Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
asynchronously loads custom evaluation tags that the teacher might have saved on firebase and update the state once loaded.
async getTeacherCustomImprovementAreas() { const teacher = await FirebaseFunctions.getTeacherByID( this.props.navigation.state.params.userID ); //if teacher has customized areas, let's load theirs. if ( teacher.evaluationImprovementTags && teacher.evaluationImprovementTags.length > 0 ) { let improvementAreas = teacher.evaluationImprovementTags; this.setState({ improvementAreas }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "loadCurrentSavedTag() {\n getValue(\"tag\")\n .then(value => {\n if (!!value)\n this.setState({ saved_tag: value })\n })\n }", "function loadTags() {\n\t\tlet tags = new wp.api.collections.Tags()\n\n\t\ttags.fetch().done( () => {\n\t\t\tconsole.log(tags);\n\t\t\t\t//clearCategories();\n\t\t\t\ttags.each( tag => loadTag( tag.attributes ) );\n\t\t});\n\t}", "async componentDidMount() {\n if (this.state.readOnly === true) {\n FirebaseFunctions.setCurrentScreen(\n \"Past Evaluation Page\",\n \"EvaluationPage\"\n );\n } else {\n FirebaseFunctions.setCurrentScreen(\n \"New Evaluation Page\",\n \"EvaluationPage\"\n );\n }\n\n const studentObject = await FirebaseFunctions.getStudentByID(\n this.state.studentID\n );\n\n const { submission } = this.state;\n\n let audioFile = -1;\n let audioSentDateTime;\n if (submission !== undefined && submission.audioFileID !== undefined) {\n //Fetches audio file for student if one is present\n audioFile = await FirebaseFunctions.downloadAudioFile(\n submission.audioFileID\n );\n\n let audioSentDate = submission.sent.toDate();\n audioSentDateTime =\n audioSentDate.toLocaleDateString(\"EN-US\") +\n \", \" +\n audioSentDate.getHours() +\n \":\" +\n audioSentDate.getMinutes();\n }\n\n //Fetches the ID for the evaluation (if there is none, it is created)\n const evaluationID = this.props.navigation.state.params.evaluationID\n ? this.props.navigation.state.params.evaluationID\n : this.state.studentID +\n (this.state.classStudent.totalAssignments + 1) +\n \"\";\n\n //what improvement area buttons to show\n //logic: if this is a read only version (of a past evaluation from history), we will show\n // the tags that teacher pressed on during evaluation (if any). Those gets passed as a navigation param\n // Otherwise, if it is a new evaluation, we'll check if the teacher has custom tags, we'll use them,\n // otherwise, we'll use the default areas\n //-----------------------------------------------------------\n let improvementAreas = this.areas;\n let evaluationCollapsed = this.state.evaluationCollapsed;\n if (this.props.navigation.state.params.readOnly === true) {\n //show areas pressed when evaluating this history item (passed from calling screen)\n improvementAreas = this.props.navigation.state.params.improvementAreas;\n let itemHasImprovementAreas =\n improvementAreas && improvementAreas.length > 0;\n let itemHasNotes =\n this.props.navigation.state.params.notes !== undefined &&\n this.props.navigation.state.params.notes.length > 0;\n\n // Expand evaluation card in history view to show evaluation notes if the evaluation item has some notes/areas.\n if (itemHasImprovementAreas || itemHasNotes) {\n evaluationCollapsed = false;\n }\n } else {\n this.getTeacherCustomImprovementAreas();\n }\n\n this.setState({\n studentObject,\n isLoading: false,\n evaluationID,\n evaluationCollapsed,\n audioFile,\n audioSentDateTime,\n improvementAreas\n });\n }", "function runWhenReady() {\n if (typeof tagpro.map !== 'undefined' && typeof tagpro.teamNames !== undefined && typeof tagpro.score !== undefined) {\n main();\n } else {\n setTimeout(function() {\n runWhenReady();\n }, 100);\n }\n}", "function loadRemoteData() {\n \ttagService.getTags().then(\n function( tags ) {\n applyRemoteData( tags );\n });\n }", "getTagPresets() {\n this.itemService.retrieveTagPresets(this.props.user._links.tagPresets.href).then(presets => {\n this.setState({ tagPresets: presets });\n }\n );\n }", "async getQuestions (config) {\n fetch(`${this.apiUrl}question/evaluate`, config)\n .then(res => res.json()).then(res => {\n const loadedArr = this.state.loaded.slice();\n loadedArr.push('questions');\n this.setState({ loaded: loadedArr, questions: res.questions, scenarioId: res.scenario_id });\n })\n .catch(err => console.log(err));\n }", "async overwriteOldEvaluation() {\n const {\n classID,\n studentID,\n evaluationID,\n notes,\n rating,\n selectedImprovementAreas,\n highlightedAyahs,\n highlightedWords\n } = this.state;\n\n this.setState({ isLoading: true });\n let evaluationDetails = {\n rating,\n notes,\n highlightedWords,\n highlightedAyahs,\n improvementAreas: selectedImprovementAreas,\n };\n \n await FirebaseFunctions.overwriteOldEvaluation(\n classID,\n studentID,\n evaluationID,\n evaluationDetails\n );\n\n const currentClass = await FirebaseFunctions.getClassByID(\n this.state.classID\n );\n this.props.navigation.push(\"TeacherStudentProfile\", {\n studentID: this.state.studentID,\n currentClass,\n userID: this.props.navigation.state.params.userID,\n classID: this.state.classID\n });\n }", "async function loadQualification() {\r\n //Error checking\r\n ///Basic set up for all API calls. In the case of an error it generates an error bar with an appropriate message\r\n ///For APi calls the message is generated by the promise result\r\n ///In the case of page changes they are reversed in the catch statement\r\n try {\r\n ///Clears the error bar, at the beginning of all try statements - empties out any error messages since a user has made a change. Standard error checking procedure \r\n clearStatusBar();\r\n\r\n //Variables\r\n ///Array containing the data pulled from the file system\r\n var qualifications = [];\r\n\r\n ///The api to be called to get the qualifications\r\n var api = apiRoot + \"/question/filter-recall\";\r\n\r\n\r\n //Updating the page\r\n ///Awaits the qualifications from the API call\r\n qualifications = await callGetAPI(api, \"qualifications\");\r\n\r\n ///Clears the qualification input box of any values - removes pre-set data \r\n $(\"#qualification\").empty();\r\n\r\n ///Adds the new data from S3 to the qualifications box\r\n qualifications.filters.qualifications.forEach(element => {\r\n $(\"#qualification\").append(newSelectItem(element.q));\r\n });\r\n\r\n ///Runs the on change event for the qualifications box\r\n newQualification();\r\n } catch (error) {\r\n generateErrorBar(error);\r\n }\r\n}", "async onLoad() {}", "readTags() {\n let self = this;\n let ref = firebase.database.ref('/tags');\n this.listeners.push(ref);\n ref.on('value', function(snapshot) {\n let tagsList = [];\n snapshot.forEach(function(child) {\n tagsList.push(child.val());\n });\n self.setState({ databaseTags: tagsList});\n })\n }", "static preloadData(dispatch) {\n return Promise.all([\n complexActionCreators.loadNotebooksWithTags()(dispatch),\n ]);\n }", "function refreshStoredTags() {\n getStoredTags();\n refreshTableTags();\n}", "loadAgencies() {\n\t\tgetAgencies()\n\t\t\t.then((ans) => {\n\t\t\t\tvar fastAccess = {};\n\t\t\t\tfor(var i = 0; i < ans.length; i++) {\n\t\t\t\t\tlet ag = ans[i];\n\t\t\t\t\tfastAccess[ag.title] = ag.tag;\n\t\t\t\t}\n\n\t\t\t\tthis.setState({\n\t\t\t\t\tagencies: ans,\n\t\t\t\t\tfastAccess: fastAccess,\n\t\t\t\t})\n\t\t\t});\n\t}", "componentDidMount() {\n const dataLayerName = this.props.dataLayerName || 'dataLayer';\n const scriptId = this.props.scriptId || 'react-google-tag-manager-gtm';\n\n if (!window[dataLayerName]) {\n const gtmScriptNode = document.getElementById(scriptId);\n\n eval(gtmScriptNode.textContent);\n }\n\n /**\n * Setup our listener for new events.\n */\n let resultsListener = this.searchkit.addResultsListener((results) => {\n this.trackResultsChange(results)\n });\n }", "function loadTags(website, tags) {\n var site = '#' + website;\n var editor = $(site).next('.CodeMirror')[0].CodeMirror;\n var tag_names = \"\";\n var colors = ['red', 'pink', 'yellow', 'purple', 'deep-purple', 'indigo', 'blue', 'light-blue', 'cyan', 'teal', 'green', 'light-green', 'lime', 'amber', 'orange', 'deep-orange', 'brown', 'blue-grey'];\n\n for (var tag in tags) {\n var ri = Math.floor(Math.random() * colors.length);\n var rs = colors.splice(ri, 1);\n var random_color = rs + ' lighten-4';\n\n var website_tag = '<div class=\"chip-wrapper\"><div class=\"chip ' + random_color + '\">' + tag + '<span class=\"tag-count\">' + tags[tag].count + '</span></div></div>';\n \n var comments = tags[tag].comments;\n var tag_comments = \"\";\n for (var c in comments) {\n tag_comments += '<div class=\"comment\"><p>\"' + comments[c].comment + '\" - ' + comments[c].name + '</p></div>';\n }\n\n var highlights = tags[tag].highlights;\n for (var h in highlights) {\n \n loadHighlight(editor, highlights[h], random_color);\n }\n tag_names += '<div class=\"tag-wrapper\">' + website_tag + tag_comments + '</div>';\n }\n $('#annotations .row').append('<div class=\"col s6\"><div class=\"card\"><div class=\"card-content\"><span class=\"card-header\">Other users have tagged this code as:</span><div class=\"card-content\">' + tag_names + '</div></div></div></div>');\n}", "async afterLoad () {\n }", "getTags() {\n this.itemService.retrieveTags().then(tags => {\n this.setState({\n tags: tags\n })\n }\n );\n }", "_loadHierarchyLearningData() {\n let {webservice} = this.props.config,\n currentUser = AppStore.getState().currentuser,\n audience = AppStore.getState().audiencemembers;\n\n getLearningForManagerHierarchy(webservice, currentUser.id, audience ,this._onLoadingProgress.bind(this)).fork(console.error, res => {\n console.log('hierarchy loaded', res);\n AppStore.dispatch(SetHierarchy(res));\n // this._loadAudience();\n this._loadAllego();\n });\n }", "function handleLoadAsync() {\n\t\t\t\t\tlogWithPhase( \"handleLoad - Async\" );\n\t\t\t\t\t$scope.$apply(\n\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\thandleLoadSync();\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t}", "async function getHashTags() {\n const data = await API.get(\"instaposthashtagsapi\", `/hashtags`);\n updateHashtags(data.hashtags.hashtags);\n setLoading(true);\n }", "function getTags(){\n\n let url ='http://bluetag.foteex.com/api/recently-tags'\n\n fetch(url)\n .then(function(response) {\n return response.json();\n })\n .then(function(values) {\n console.log(values);\n values.forEach(el =>{\n el.value = el.tag_value\n })\n // tagify.settings.whitelist = values;\n whitelist = values;\n // if(!tagify ) tagifyInit(values)\n // tagify.dropdown.show.call(tagify, value); // render the suggestions dropdown\n // renderSuggestionsList()\n });\n}", "async function prepare_front(){\n try {\n let request = await fetch('/api/classifier');\n if (!request.ok) {\n throw Error(\"Classifiers couldn't be loaded\");\n } else {\n let classifiers = await request.json();\n \n classifiers.forEach(classifier => {\n sessionStorage.setItem(classifier.name, 0);\n get_tweets(classifier.name).then(() => {\n let language_container = document.querySelector(`#pills-${classifier.name}`);\n language_container.removeChild(document.querySelector(`#${classifier.name}-load`));\n });\n \n });\n \n \n }\n } catch (error) {\n alert(Error);\n }\n}", "async function updateEval() {\n const eval = await (await fetch( './getEvaluation', { method: 'POST'} )).json();\n fillElements( eval );\n }", "applyTags(tags) {\n var qp = { tags: tags.toString() };\n return this.refreshModel(qp).then( model =>{\n this.emit(events.TAGS_SELECTED);\n return model;\n });\n }", "function loaded() {\n ut.assert(true);\n ut.async(false);\n }", "function getTags() {\n if (localStorage.getItem('tags') === null) return;\n\n tags = JSON.parse(localStorage.getItem('tags'));\n\n tags.forEach(element => {\n addTag(element)\n });\n}", "function loadQuestions() {\n disableElement(\".quiz-options .btn\");\n $(\".load-questions\").addClass(\"reduce-size\").html(\"<span class='spinner-border spinner-border-sm' role='status' aria-hidden='true'></span> Loading...\");\n $(\".answer-feedback\").addClass(\"hide-element\");\n if (Boolean(scienceQuiz.token) === false) {\n // opentdb API url address to obtain token\n let tokenUrl = \"https://opentdb.com/api_token.php?command=request\";\n getToken(tokenUrl).then(handleSuccess).catch(handleFailure);\n } else {\n getQuizData(scienceQuiz.token);\n }\n}", "function refreshTags() {\n var existingTagsCount = {};\n self.tags = [];\n _.each(NoteService.notes, function (note) {\n if (note.active === SearchService.searchParams.active.value) {\n _.each(note.tags, function (tag) {\n if (!existingTagsCount[tag]) {\n existingTagsCount[tag] = 0;\n }\n existingTagsCount[tag]++;\n });\n }\n });\n _.each(existingTagsCount, function (value, key) {\n self.tags.push(new Tag(key, value));\n });\n if (self.tags.length > 25) {\n self.tags.push(new Tag(\"Not an Easter Egg\", 0));\n }\n }", "async load () {}", "function loadQuestionData() {\n\t\t\tquestionService.getQuestions().then(function(question) {\n\t\t\t\tapplyQuestionData(question);\n\t\t\t});\n\t\t}", "function loadTagCloud () {\n $('#tag-cloud-box').children('.cloud-tags').remove()\n if (tasks.tagList.length + gitHub.tagList.length + serviceNow.snTagList.length + rally.rallyTagList.length > 0) {\n const utl = [...new Set(tasks.tagList.concat(gitHub.tagList).concat(serviceNow.snTagList).concat(rally.rallyTagList))]\n utl.sort()\n utl.forEach((tag) => {\n let color = `#${asciiToHex(tag)}`\n color = hexToHSL(color, 60)\n $('#tag-cloud-box').append(`<div class=\"cloud-tags\" style=\"background-color: ${color}\">${tag}</div>`)\n })\n }\n}", "async function fetchPhotographersTags() {\n\t\tconst request = await axios({\n\t\t\tmethod: \"get\",\n\t\t\turl: \"/api/photographers/tags\",\n\t\t\tbaseURL: \"http://34.251.153.147:5000\",\n\t\t});\n\t\tsetNavTags(request.data);\n\t}", "async componentDidMount() {\n await SearchAPIService.getAllTags().then((tags) => {\n this.setState({ tags: tags });\n });\n\n \n this.state.tags.forEach((e) => {\n this.setState((prevState) => ({\n checkedItems: prevState.checkedItems.set(e.tag, false),\n }));\n });\n }", "async function Load_State_Of_Image_IDB() {\n image_annotations = await fns_DB_IDB.Get_Record(image_files_in_dir[image_index - 1])\n console.log(`in load state of image idb image annotations: ${JSON.stringify(image_annotations)} \n and the imageName : ${image_annotations.imageName}`)\n tagging_view_annotate.Display_Image_State_Results(image_files_in_dir,image_annotations)\n}", "function preLoad() {\n // load something and continue on only when finished\n}", "function handleLoadSync() {\n\t\t\t\t\tlogWithPhase( \"handleLoad - Sync\" );\n\t\t\t\t\t$scope.$eval( attributes.bnLoad );\n\t\t\t\t}", "function initTags() {\n \n for (var j = $scope.QUERY.whattodo.length - 1; j >= 0; j--) {\n for (var i = $scope.tripTags.length - 1; i >= 0; i--) {\n if ($scope.QUERY.whattodo[j].slug == $scope.tripTags[i].slug) {\n $scope.local.tags.push($scope.tripTags[i]);\n break;\n }\n }\n }\n }", "function getUserTags()\r\n{\r\n GM_xmlhttpRequest(\r\n {\r\n method: \"GET\",\r\n url: \"https://pinboard.in/user_tag_list/\",\r\n onload: function( response )\r\n {\r\n var usertags = null;\r\n var tagsRegex = new RegExp( \"^var usertags\\\\s*=(\\[[\\\\s\\\\S]*\\];)\" );\r\n var tagsArr = tagsRegex.exec( response.responseText );\r\n if( tagsArr )\r\n {\r\n gUsertags = eval( tagsArr[1] );\r\n }\r\n \r\n // continue with script\r\n addInitializationWidget()\r\n }\r\n }\r\n );\r\n}", "load() {\n return __awaiter(this, void 0, void 0, function*() {\n const checkpointLoader = new CheckpointLoader(GOOGLE_CLOUD_STORAGE_DIR + 'yolo_mobilenet_v1_1.0_416/');\n this.variables = yield checkpointLoader.getAllVariables();\n });\n }", "componentDidMount() {\n getAsyncData('nietzsche', 'tag')\n .then(res => {\n this.props.onUpdateQuotesArr(res.data.quotes);\n this.setState({\n errorOccured: false,\n loaded: true,\n });\n })\n .catch(err =>\n this.setState({\n errorOccured: true,\n }),\n );\n }", "function loaded() {\n var customTooltipSetter = customService.get('titleTooltip');\n var customTitleSetter = customService.get('title');\n var entityName = _currentContext.action.entity.name.front;\n var params = {\n 'action-name': _currentContext.action.name.front,\n action: _currentContext.action,\n inFlow: _currentContext.isInFlow(),\n context: _currentContext,\n idContext: _currentContext.idContext\n };\n var titlePromise, titleTooltip;\n if (_currentContext.promiseData) {\n titlePromise = _currentContext.promiseData.then(function (data) {\n return customTitleSetter(entityName, 'context', data, params);\n });\n titleTooltip = _currentContext.promiseData.then(function (data) {\n return customTooltipSetter(entityName, 'context', data, params);\n });\n } else {\n titlePromise = customTitleSetter(entityName, 'context', _currentContext.getData(), params);\n titleTooltip = customTooltipSetter(entityName, 'context', _currentContext.getData(), params);\n }\n titlePromise.then(function (title) {\n var val = title.toString();\n titleService.set(val);\n if (_currentContext.title !== val) {\n // Title changed\n _currentContext.title = val; \n saveContext();\n }\n });\n titleTooltip.then(function (tooltip) {\n var val = tooltip.toString();\n if (_currentContext.titleTooltip !== val) {\n // tooltip changed\n _currentContext.titleTooltip = val;\n saveContext();\n }\n });\n }", "async function loadPredictions() {\n if(capture.loadedmetadata) {\n predictions = await blazeFaceModel.estimateFaces(capture.elt);\n }\n}", "tagAsLoadCriterion() {\n this.isLoadCriterion = true;\n return this;\n }", "function setup() {\n // finding the associated file name with the user level\n var fileToRead = \"\";\n switch(wordlistLevel) {\n case \"Beginner\":\n fileToRead = \"Beginner.txt\";\n break;\n case \"Intermediate\":\n fileToRead = \"Intermediate.txt\";\n break;\n case \"Advanced\":\n fileToRead = \"Advanced.txt\";\n break;\n }\n\n // read the file and append to word data\n // when it's appended to word data, I then\n // check to see if a question in progress is loaded otherwise,\n // generate a new one\n fetch(fileToRead)\n .then(response => response.text())\n .then((text) => {\n var lines = text.split(\"\\n\");\n for (line of lines) {\n var lineData = line.split(\",\");\n wordData[lineData[0]] = [lineData[1], lineData[2]]\n }\n var correctAnswer = localStorage.getItem('questionAnswer');\n if (correctAnswer === null) {\n generateQuestion(); \n } else {\n displayQuestion(correctAnswer);\n }\n })\n}", "componentDidMount() {\n if(this.state.compatible) {\n if(this.props.dataPath) {\n const xhr = new XMLHttpRequest();\n xhr.open('get', this.props.dataPath, true);\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4) {\n if(xhr.status === 200) {\n this.wordTranscriptions = JSON.parse(xhr.responseText);\n } else {\n console.log('error');\n }\n }\n };\n xhr.send();\n }\n\n this.setupRecognition();\n }\n }", "fetchPosts(context) {\n context.commit(\"SET_LOADING_STATUS\", \"loading\");\n }", "loadStoredState(context) {\n // last search\n const lastSearch = localStorage.getItem('lastSearch')\n if (lastSearch) {\n context.commit('setLastSearch', JSON.parse(lastSearch));\n }\n // basket\n const basket = localStorage.getItem('basket')\n if (basket) {\n context.commit('setBasket', JSON.parse(basket));\n }\n\n // questo mi va a fixare il delay causato dall' action async loadUser\n // quindi appena mi si apre l app carico subito il valore del loggedin\n // nello stored state, cosa che e immediata e non asincrona\n context.commit('setLoggedIn', isLoggedIn())\n }", "async function collectData(){\n let favs = [];\n\n await firebase.database().ref('recommenderData').child('skills')\n .once('value', x => {\n x.forEach(data => {\n favs.push(data.val());\n checkSkill(data.key, data.val().selectedAmount);\n })\n })\n}", "async loadLazy () {\n /**\n if(this.load && !this.loadComplete) {\n import('./lazy-element.js').then((LazyElement) => {\n this.loadComplete = true;\n console.log(\"LazyElement loaded\");\n }).catch((reason) => {\n console.log(\"LazyElement failed to load\", reason);\n });\n }\n */\n }", "loadContent() {\n this.setState({ currentlyLoading: true });\n // Reset the ids in case they have changed\n this.getIDsFromDB(\"author\", 'https://www.theedgesusu.co.uk/wp-json/wp/v2/users/');\n this.getIDsFromDB(\"tag\", 'https://www.theedgesusu.co.uk/wp-json/wp/v2/tags/');\n this.getIDsFromDB(\"section\", 'https://www.theedgesusu.co.uk/wp-json/wp/v2/categories/');\n this.setState({ currentlyLoading: false });\n }", "async fetchInitialData() {\n try {\n let tasks = await Helpers.fetch('/api/tasks', {\n method: 'GET'\n });\n this.setState({tasks: tasks});\n\n let tags = await Helpers.fetch('/api/tags', {\n method: 'GET'\n });\n this.setState({tags: tags, draftTags: tags, loaded: true});\n } catch (error) {\n if (error.response.status === 401) {\n this.props.history.replace('/login');\n } else if (error.response.status === 400) {\n // error in response, display could not load error message\n this.setState({error: error});\n }\n }\n }", "function load() {\n\n getAllQuestions();\n setTimeout(function () {\n if (questionsArr != null && questionsArr.length > 0) {\n\n let counter = questionsArr.length;\n onloadData = true;\n count = 1;\n\n while (count <= counter) {\n\n addQuestion();\n\n if (Object.keys(questionsArr[count - 2]).length === 6) {\n\n onloadData = false;\n addChoice();\n onloadData = true;\n\n } else if (Object.keys(questionsArr[count - 2]).length === 7) {\n onloadData = false;\n addChoice();\n addChoice();\n onloadData = true;\n }\n }\n loadQuestions(counter, questionsArr);\n\n templateStatus = false;\n }\n }, 3000);\n}", "async function loadCoreData() {\n await Promise.all([\n loadExercises(),\n loadCategories(),\n loadSessions(),\n ]);\n}", "async initializeDataLoad() {\n }", "function getClassTags() {\n for (var index = 0; index < htmlContentObjects.length; index++) {\n console.log('loading dom for: ' + htmlContentObjects[index][0]);\n var html = htmlContentObjects[index];\n loadHTML(html);\n }\n}", "function triggerPageLoad() {\n const oldTokens = Object.keys(STATE.get('TokenList')).map(k => {\n return getObj('graphic', k);\n }).filter(t => { return t !== undefined; });\n oldTokens.forEach(t => {\n const token = getObj('graphic', t.id);\n if (token)\n token.set(StatusMarker, false);\n });\n pageLoad();\n }", "async handleDraftTagCreated(tag) {\n this.setState({draftTags: [...this.state.draftTags, tag]});\n }", "function parseResponse(resp) {\n if (resp.status_code === 'OK') {\n var results = resp.results;\n console.log(results);\n tags = results[0].result.tag.classes;\n console.log(tags);\n // console.log(\"tags from upload: \" + tags);\n probabilities = results[0].result.tag.probs;\n console.log(probabilities);\n\n showUploaded();\n\n } else {\n console.log('Sorry, something is wrong.');\n }\n\n // displays the user's uploaded image in a card\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 }\n\n // Asynchronus callback to read new data in database\n productsInFirebase.on(\"value\", function(snapshot) {\n iterate(snapshot.val());\n // addHelper(snapshot.val());\n }, function (errorObject) {\n console.log(\"The read failed: \" + errorObject.code);\n });\n\n // compares the user's upload with products in the db\n function iterate(products) {\n\n var inCommon = [];\n var inCommonSorted;\n\n for (prop in products) { \n // save the like tags \n var tagsComparison = _.intersection(tags, products[prop].tags);\n\n var productsFirebase = products[prop];\n \n // save the products based on like tags (with a count of like tags) \n inCommon.push({\n numTags: tagsComparison.length, \n product: productsFirebase \n }) \n\n // sort the products based on the highest count of like tags\n inCommonSorted = _.sortBy(inCommon, 'numTags').reverse(); \n // console.log(inCommonSorted);\n \n // if there are a small number of like tags, display error state (because the quality of the output would not be high enough)\n if (inCommonSorted[0].numTags < 7 || inCommonSorted[0] === 'undefined' || inCommonSorted[0] === 'null') {\n $('.flex-container').removeClass('hidden');\n $('.uploaded-flex-item').removeClass('hidden');\n $('#product-match-card').fadeIn();\n $('#product-match-card').html(\"Yikes! We could not find a match.\");\n $('#dropdown').removeClass('hidden'); \n inCommon = [];\n inCommonSorted = [];\n }\n\n // displays the best match (product with the highest number of like tags)\n else {\n $('.flex-container').removeClass('hidden');\n $('.uploaded-flex-item').removeClass('hidden');\n $('#product-match-card').fadeIn(); \n $('#product-match-card').html('<h2>' + \"Try this: \" + '</h2>' + '<img src=\"' + inCommonSorted[0].product.itemImage + '\" alt=\"\" class=\"image-thumbnail\"/>' + inCommonSorted[0].product.itemName + \"<br>\" + '<a href=\"' + inCommonSorted[0].product.url + '\"class=\"popUpAction\" target=\"_blank\">' + \"View Details\" + '</a>'); \n }\n } \n\n\n // enables the user to choose a helper to improve the product match result\n $(document).on('change', '#dropdown', function(e) {\n \n var x = userSelectedHelperTag;\n\n // saves the users selection from the helper drop down\n var userSelectedHelperTag = this.options[e.target.selectedIndex].text;\n console.log(userSelectedHelperTag);\n\n for (prop in products) {\n\n var productsHelperFirebase = [];\n var helperInCommon = [];\n\n if (userSelectedHelperTag === products[prop].helperTag) {\n \n // add products matching the user's helper to a new array\n productsHelperFirebase.push(products[prop]);\n console.log(products[prop]);\n\n // compares the tags of the user's upload against the tags of products matching the user's selected helper\n for (var i = 0; i < productsHelperFirebase.length; i++) {\n var tagsHelperComparison = _.intersection(tags, productsHelperFirebase[i].tags);\n // console.log(tagsHelperComparison.length)\n\n helperInCommon.push({\n numTags: tagsHelperComparison.length, \n product: productsHelperFirebase[i] \n }) \n } \n\n\n // sort the products based on the highest count of like tags considering only products that match the user's selected helper\n var helperInCommonSorted = _.sortBy(helperInCommon, 'numTags').reverse();\n console.log(helperInCommonSorted) \n\n\n // if there are a small number of like tags considering only products that match the user's selected helper, display error state (because the quality of the output would not be high enough)\n if (helperInCommonSorted[0].numTags < 7 || helperInCommonSorted[0] === 'undefined' || helperInCommonSorted[0] === 'null') {\n $('.flex-container').removeClass('hidden');\n $('.uploaded-flex-item').removeClass('hidden');\n $('#product-match-card').fadeIn();\n $('#product-match-card').html(\"Yikes! We could not find a match.\");\n $('#dropdown').removeClass('hidden'); \n }\n\n // displays the best match (product with the highest number of like tags considering only products that match the user's selected helper)\n else {\n $('.flex-container').removeClass('hidden');\n $('.uploaded-flex-item').removeClass('hidden');\n $('#product-match-card').fadeIn(); \n $('#product-match-card').html('<h2>' + \"Try this: \" + '</h2>' + '<img src=\"' + helperInCommonSorted[0].product.itemImage + '\" alt=\"\" class=\"image-thumbnail\"/>' + helperInCommonSorted[0].product.itemName + \"<br>\" + '<a href=\"' + helperInCommonSorted[0].product.url + '\"class=\"popUpAction\" target=\"_blank\">' + \"View Details\" + '</a>'); \n }\n }\n } \n })\n }\n}", "async load(){\n this.getStudentData();\n this.getStudentCertificates();\n }", "async function loadAttractions(keyword = null) {\n if (nextPage !== null) {\n nextPage = await getAttractionsData(nextPage, keyword);\n showAttractions();\n readyToLoadAgain = true;\n }\n}", "fetchLectionSteps(lections, userId) {\n\n // Fetch lection steps\n lections.forEach(({ lectionId }) => {\n // Steps with type TOOLBOX\n let steps = [];\n\n lectionSteps(\n { lectionId, userId },\n (r) => {\n steps = [\n ...steps,\n ...r.filter(({ step }) => step.type === 'SELFCHECK' ).map(({ step }) => step)\n ];\n\n // Get saved config for the steps\n steps.forEach((step) => {\n getStoredData(\n { userId, key: step.id },\n (r) => {\n try {\n // Try to parse step body\n const storedConfig = JSON.parse(r.json);\n\n // Extens step with step stored config\n Object.assign(step, { storedConfig });\n\n // Update state\n this.setState({ selfAssignment: [...this.state.selfAssignment, step] });\n }\n catch (e) { }\n },\n (e) => console.error(e)\n );\n });\n },\n (e) => console.error(e)\n );\n });\n }", "__doDataSetupAfterAuthCheck() {\n\t \treturn Promise.all( [ this.loadPosts() ])\n\t \t.then( result => {\n\t \t\tthis.setState( { hasLoadedData: true } );\n\t \t} );\n\t }", "function init() {\n StoredTagsMngr.checkForTagsNotBeingUsed();\n initStorage();\n createTagsInStarsPage();\n initDOM();\n}", "async function init() {\n // Load model and metadata\n model = await loadHostedPretrainedModel(URLS.model);\n metadata = await loadHostedMetadata(URLS.metadata);\n\n // Set vars\n indexFrom = metadata['index_from'];\n maxLen = metadata['max_len'];\n wordIndex = metadata['word_index'];\n\n predictButton.disabled = false;\n loaded = true;\n}", "_initTagsAdvanced() {\n if (document.querySelector('#tagsAdvanced')) {\n var whitelist = [\n 'Anpan',\n 'Breadstick',\n 'Biscotti',\n 'Cholermüs',\n 'Dorayaki',\n 'Fougasse',\n 'Kifli',\n 'Lefse',\n 'Melonpan',\n 'Naan',\n 'Qistibi',\n 'Panbrioche',\n 'Rewena',\n 'Shirmal',\n 'Tunnbröd',\n 'Vánočka',\n 'Zopf',\n ];\n var tagifyAdvanced = new Tagify(document.querySelector('#tagsAdvanced'), {\n enforceWhitelist: true,\n dropdown: {\n enabled: 1,\n },\n whitelist: document\n .querySelector('#tagsAdvanced')\n .value.trim()\n .split(/\\s*,\\s*/), // Array of values. stackoverflow.com/a/43375571/104380\n });\n\n // \"remove all tags\" button event listener\n document.querySelector('#removeAllTags').addEventListener('click', tagifyAdvanced.removeAllTags.bind(tagifyAdvanced));\n\n // Chainable event listeners\n tagifyAdvanced\n .on('add', onAddTag)\n .on('remove', onRemoveTag)\n .on('input', onInput)\n .on('edit', onTagEdit)\n .on('invalid', onInvalidTag)\n .on('click', onTagClick)\n .on('focus', onTagifyFocusBlur)\n .on('blur', onTagifyFocusBlur)\n .on('dropdown:hide dropdown:show', (e) => console.log(e.type))\n .on('dropdown:select', onDropdownSelect);\n\n var mockAjax = (function mockAjax() {\n var timeout;\n return function (duration) {\n clearTimeout(timeout); // abort last request\n return new Promise(function (resolve, reject) {\n timeout = setTimeout(resolve, duration || 700, whitelist);\n });\n };\n })();\n\n // tag added callback\n function onAddTag(e) {\n console.log('onAddTag: ', e.detail);\n console.log('original input value: ', document.querySelector('#tagsAdvanced').value);\n tagifyAdvanced.off('add', onAddTag); // exmaple of removing a custom Tagify event\n }\n\n // tag remvoed callback\n function onRemoveTag(e) {\n console.log('onRemoveTag:', e.detail, 'tagify instance value:', tagifyAdvanced.value);\n }\n\n // on character(s) added/removed (user is typing/deleting)\n function onInput(e) {\n console.log('onInput: ', e.detail);\n tagifyAdvanced.settings.whitelist.length = 0; // reset current whitelist\n tagifyAdvanced.loading(true).dropdown.hide.call(tagifyAdvanced); // show the loader animation\n\n // get new whitelist from a delayed mocked request (Promise)\n mockAjax().then(function (result) {\n // replace tagify \"whitelist\" array values with new values\n // and add back the ones already choses as Tags\n tagifyAdvanced.settings.whitelist.push(...result, ...tagifyAdvanced.value);\n\n // render the suggestions dropdown.\n tagifyAdvanced.loading(false).dropdown.show.call(tagifyAdvanced, e.detail.value);\n });\n }\n\n function onTagEdit(e) {}\n\n function onInvalidTag(e) {}\n\n function onTagClick(e) {}\n\n function onTagifyFocusBlur(e) {}\n\n function onDropdownSelect(e) {}\n }\n }", "function getTextCompletionQuestions() {\n \n $.get(\"/api/textcompletionq\", function(data) {\n textcompletionquestions = data;\n textcompletionquestionsoriginal = data;\n \n //loop through questions to get the correct answers\n displayQuestions();\n getCorrectAnswers();\n });\n }", "liveQuestionSetter() {\n this.props.firebaseRef.once(\"value\", (snapshot)=> {\n let liveQues = snapshot.val().liveQuestion;\n this.setState({ liveQuestion: liveQues});\n this.currentQuestion();\n });\n }", "async function addTag(tag){\n if(!selectedTags.includes(tag)){\n console.log(\"adding \" + tag);\n\n setInput(\"\");\n setSelectedTags([...selectedTags, tag]);\n availableTags.current = availableTags.current.filter((tagx) => tagx !== tag);\n setTagSuggestions([]);\n }\n }", "function modelLoaded(){\n console.log('Model Loaded');\n loadingText.html('')\n // call to classifyIngredient once model is loaded\n detectIngredient();\n}", "async componentDidMount() {\n initFirebase();\n listenToFirebaseRef('votes', (votes) => {\n console.log('Votes in reference:', votes);\n this.setState({\n votes,\n loading: false,\n });\n });\n }", "function alwaysRunOnload () {\n\t\t// Placeholder/Future use.\n\t}", "async initForLoading() {\n registerCustomQuillFormats()\n await DataStore.query(TranscriptionContributor)\n }", "async function fetch() {\n const html = await getValue(\"introductionHtml\");\n setIntroHtml(html);\n }", "async doSubmitRating() {\n let {\n rating,\n notes,\n selectedImprovementAreas,\n assignmentName,\n classID,\n studentID,\n assignmentLength,\n assignmentType,\n assignmentLocation,\n evaluationID,\n highlightedWords,\n highlightedAyahs\n } = this.state;\n\n notes = notes.trim();\n const submission = this.state.submission\n ? { submission: this.state.submission }\n : {};\n let evaluationDetails = {\n ID: evaluationID,\n name: assignmentName,\n assignmentLength,\n assignmentType: assignmentType,\n location: assignmentLocation,\n completionDate: new Date().toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\"\n }),\n evaluation: {\n rating,\n notes,\n highlightedWords,\n highlightedAyahs,\n improvementAreas: selectedImprovementAreas,\n },\n ...submission\n };\n try {\n await FirebaseFunctions.completeCurrentAssignment(\n classID,\n studentID,\n evaluationDetails\n );\n const currentClass = await FirebaseFunctions.getClassByID(\n this.state.classID\n );\n this.setState({\n currentPosition: \"0:00\",\n audioFile: -1\n });\n\n this.props.navigation.push(\"TeacherStudentProfile\", {\n studentID: this.state.studentID,\n currentClass,\n userID: this.props.navigation.state.params.userID,\n classID: this.state.classID\n });\n } catch (err) {\n Alert.alert(strings.SomethingWentWrong, strings.SomethingWentWrongDesc);\n }\n }", "async onLoad(options) {\n this.setData({\n postList\n })\n wx.setStorageSync('flag', true);\n wx.getStorage({\n key: 'flag'\n }).then((val) => {\n console.log(val)\n })\n console.log(await wx.getStorage({ key: 'flag'}))\n }", "async function updatetags() {\n let json\n try {\n const res = await fetch(`https://cmgt.hr.nl:8000/api/projects/tags`);\n json = await res.json(); \n tag.innerHTML = json.tags.map(tags).join('\\n'); //Plek waar ik de opgehaalde Json data zie.\n //Join houd in dat je een nieuwe aanmaakt. Ik roep de template beneden op.\n } catch (error) {\n console.log(\"Hier bij offline?\")\n tag.innerHTML = offline(); //Voor als je geen wifi hebt. \n } \n}", "function updateExistingTagLabels() {\n removeExistingTagLabels();\n if (taggableId !== \"\") {\n sendGetTagsRequest();\n }\n}", "function pageLoad() {\n document.addEventListener('DOMContentLoaded', function(){\n // loading the questions and answer key from the API\n let APIurl = `https://opentdb.com/api.php?amount=15&difficulty=medium&type=multiple`;\n fetch(APIurl)\n .then( function(data) {\n return data.json();\n }).then(function(json) {\n var resultsArray = json.results\n resultsArray.forEach(function(result){\n questions.push(result);\n })\n updateContent();\n assignValues(); \n });\n })\n}", "function loadTags(taskJSON, taskJS) {\n if (taskJSON.tags != null && taskJSON.tags.length > 0) {\n taskJSON.tags.map(function(tag){taskJS.addTag(tag)});\n }\n}", "function loadQuiz() {\n if (arr.length > 0) {\n quiz(categoryName, arr.shift());\n } else {\n toFirebase();\n showSection(sectionResult);\n readFirebase();\n }\n console.clear();\n }", "async function test(){\n connect();\n // let user_tags = await get_user_tag('ChenDanni');\n // console.log('tags');\n // console.log(user_tags);\n cal_lan_sim('Java','C');\n}", "function loadQuestions(url) {\n let xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n // Typical action to be performed when the document is ready:\n // console.log(JSON.parse(this.responseText));\n\n //start by making it a variable\n let questions = JSON.parse(this.responseText).feed.entry;\n let stackName = JSON.parse(this.responseText).feed.title.$t;\n\n // console.log(stackName);\n // console.log(questions);\n // make the array accessible outside of this function\n storedQuestions = questions;\n nowStudying = stackName;\n // console.log(storedQuestions);\n positionDisplay();\n\n //go through the array with a for loop\n for (let i = 0; i < questions.length; i++) {\n // console.log(questions[i].gsx$definition.$t);\n // displayText.innerHTML=questions[i].gsx$definition.$t;\n // mainCard.innerHTML =\n // \"<p>\" + storedQuestions[questionCounter].gsx$term.$t + \"</p>\";\n // prevBtn.innerText=questions[i].gsx$choice2.$t;\n // flipBtn.innerText=questions[i].gsx$choice3.$t;\n // nextBtn.innerText=questions[i].gsx$choice4.$t;\n }\n }\n };\n xhttp.open(\"GET\", url, true);\n xhttp.send();\n}", "constructor() {\n //para cargar los tokens \n this.loadToken(); //estudiante\n this.loadTokenTeacher(); //docente \n }", "function loadTraining() {\n /**/console.log(\"function loadTraining\\n\");\n // Get training variables from local storage, if the exist\n try {\n var labels_str = localStorage.getItem(\"labels\");\n var keywords_str = localStorage.getItem(\"keywords\");\n var matrix_str = localStorage.getItem(\"count_matrix\");\n // Convert variables to the original structures\n labels = deserializeStrArray(labels_str);\n keywords = deserializeStrArray(keywords_str);\n count_matrix = deserializeMatrix(matrix_str);\n /**/console.log(\"# Keywords = %i\\n\\n\", keywords.length);\n } catch(e) {\n console.error(e);\n }\n}", "async function init () {\n try {\n // create an instance of tag\n if (await dbs.init()) {\n console.log('Created the databases.')\n // tagObj = await Tag.getTagObject(true)\n } else {\n console.log('Databases already created')\n // tagObj = await Tag.getTagObject(false)\n }\n } catch (e) {\n console.error('Errors:', e)\n }\n}", "loadPageDictionary() {\n const url = document.location.href;\n const dictionaryKey = `${url}.dictionary`;\n\n browser.storage.local.get(dictionaryKey).then(dictionary => {\n if (!dictionary[dictionaryKey] || dictionary[dictionaryKey].length === undefined) {\n this.log(`Dictionary not found`);\n return;\n }\n\n this.dictionary = dictionary[dictionaryKey];\n this.log(`Dictionary loaded (${this.dictionary.length} words)`);\n\n this.textManager.highlightWords(this.dictionary);\n });\n }", "lateLoad() {\n\n }", "function watchAsyncLoad() {\n if (opts.loadingAsync && !opts.isRemoved) {\n scope.$$loadingAsyncDone = false;\n\n $q.when(opts.loadingAsync)\n .then(function() {\n scope.$$loadingAsyncDone = true;\n delete opts.loadingAsync;\n }).then(function() {\n $$rAF(positionAndFocusMenu);\n });\n }\n }", "function watchAsyncLoad() {\n if (opts.loadingAsync && !opts.isRemoved) {\n scope.$$loadingAsyncDone = false;\n\n $q.when(opts.loadingAsync)\n .then(function() {\n scope.$$loadingAsyncDone = true;\n delete opts.loadingAsync;\n }).then(function() {\n $$rAF(positionAndFocusMenu);\n });\n }\n }", "function watchAsyncLoad() {\n if (opts.loadingAsync && !opts.isRemoved) {\n scope.$$loadingAsyncDone = false;\n\n $q.when(opts.loadingAsync)\n .then(function() {\n scope.$$loadingAsyncDone = true;\n delete opts.loadingAsync;\n }).then(function() {\n $$rAF(positionAndFocusMenu);\n });\n }\n }", "async updateUser() {\n // get all input names upsert the value of each to the database\n var updateList = this.state.inputNamesToBeUpdated\n // get tag input\n var tag = this.state.tag\n // make lowercase and add to state\n await this.setState({tag: tag.toLowerCase()})\n // was tag changed\n var tagChanged = (this.state.tag !== this.state.saved_tag)\n\n // check if tag was changed\n if (updateList.includes(\"tag\")) {\n // confirm tag is available, otherwise use saved tag\n const available = await this.tagIsAvailable()\n if (!available) {\n // remove from update list\n updateList.splice(updateList.indexOf(\"tag\"), 1)\n if (tagChanged)\n // show unavailable message\n this.setState({tagError: true, tagHelpText: \"Unavailable\"})\n }\n else {\n this.setState({tagError: false, tagHelpText: \"\", showTagUpdatedMessage: true, saved_tag: tag})\n }\n }\n for (const inputName of updateList) {\n console.log(\"Updating \" + inputName + \" to \" + this.state[inputName])\n await updateValue(inputName, this.state[inputName])\n }\n // reset list of input names to be updated\n this.setState({\n inputNamesToBeUpdated: [],\n showTagUpdatedMessage: true,\n })\n }", "function loadEducation()\r\n{\r\n x=0;\r\n loadQualification();\r\n \r\n}", "async handleTagCreated(tag) {\n this.setState({\n tags: [...this.state.tags, tag],\n draftTags: [...this.state.draftTags, tag]\n });\n }", "load () {\n if (!this.initialized) {\n // wire dom events to service handlers\n $('#gh-new-personal-access-token-button').click(this.onOpenNewGhPersonalAccessTokenClick)\n $('#gh-sync-enabled').change(this.onGhSyncEnabledToggle)\n $('#gh-personal-access-token').change(this.onGhPersonalAccessTokenChange)\n $('#gh-api-endpoint').change(this.onGhApiEndpointChange)\n $('#gh-repository').change(this.onGhRepositoryChange)\n\n this.initialized = true\n }\n\n const {\n ghSyncEnabled,\n ghPersonalAccessToken,\n ghApiEndpoint,\n ghRepository\n } = this.getSettings()\n\n // load state\n $('#gh-personal-access-token').val(ghPersonalAccessToken)\n $('#gh-api-endpoint').val(ghApiEndpoint)\n $('#gh-repository').val(ghRepository)\n $('#gh-sync-enabled').prop('checked', ghSyncEnabled)\n $('#gh-sync-enabled-text').text(this.getGhSyncEnabledText())\n }", "function load() {\n if (!loaded) {\n loaded = true;\n\n callback();\n }\n }", "async jsonReader(str)\n{\n var s3config = require(\"./config/AWSConfig.json\"); \n //var json=require(\"/data/com.aprrow/files/cachedlanguage/language.json\");\n let dirs = RNFetchBlob.fs.dirs;\n var path=dirs.DocumentDir + s3config.locallanguagestore + str+\".json\"\n //var path=\"/data/user/0/com.aprrow/files/cachedlanguage/\"+str+\".json\";\n var lan=await AsyncStorage.getItem(\"lan\");\n //console.log(\"read ok\");\n if(str!=lan)\n {\n await RNFetchBlob.fs.readFile(path, 'utf8')\n .then(async (data) => {\n // handle the data ..\n //console.log(data);\n try{\n var data22={str:JSON.parse(data)};\n }catch(err)\n {\n //alert(err);\n }\n // console.log(\"s3\"+JSON.stringify(data22));\n //console.log(JSON.stringify(data22));\n await Strings.setContent(data22);\n \n await Strings.setLanguage(str);\n await AsyncStorage.setItem(\"lan\",str);\n // this.replaceScreen(this,\"loading\"); \n \n\n })\n return true; \n }\n else\n return false;\n \n\n}", "function LoadTags() {\n debugger;\n var list = [];\n\n $.ajax({\n url: urlGetTags,\n type: 'GET',\n dataType: \"json\",\n data: { TagId: 0, Nombre: \"\" },\n //data: { AlbumId: AlbumIdRef, Titulo: TituloRef, PerfilId: PerfilIdRef },\n success: function (Data) {\n debugger;\n //$.each(Data.Datos.Nombre, function (ind, elem) {\n // list.push(elem)\n //});\n\n for (var key in Data.Datos) {\n list.push(Data.Datos[key].Nombre)\n //$('#cmbCiudad').append('<option value=\"' + Data.Datos[key].CiudadId + '\">' + Data.Datos[key].Nombre + '</option>');\n }\n },\n error: function (data) {\n //CrearAlerta(\"#AlertIniciaSesion\", \"¡Acción Fallida!\", \"Acción no efectuada. Intente de nuevo, si el problema persiste contacte al Administrador del sistema.\", \"alert alert-danger\");\n },\n complete: function () {\n // DesbloquearForm(\"#frmLogin\");\n }\n })\n\n $('#txtTagTag')\n .textext({\n plugins: 'tags prompt focus autocomplete',\n prompt: 'Seleccionar...'//,\n })\n .bind('getSuggestions', function (e, data) {\n\n textext = $(e.target).textext()[0],\n query = (data ? data.query : '') || ''\n ;\n\n $(this).trigger(\n 'setSuggestions',\n { result: textext.itemManager().filter(list, query) }\n );\n })\n //para evitar que se repitan bandas\n .bind('isTagAllowed', function (e, data) {\n var formData = $(e.target).textext()[0].tags()._formData,\n list = eval(formData);\n\n // duplicate checking\n if (formData.length && list.indexOf(data.tag) >= 0) {\n\n data.result = false;\n }\n });\n ;\n\n}", "function executeCodeWhenCategoriesLoads () {\n var categories = JSON.parse(event.target.responseText);\n console.log(\"categories\", categories)\n categoriesToDOM(categories);\n}", "function updateTags(){\n\tWRAP_STATE.describeTags = WRAP_STATE.tagStack.reduce(function(a, b){\n\t\treturn a.concat(b);\n\t}, []);\n\tWRAP_STATE.hasDescribeTags = (WRAP_OPTIONS.tagsAny)? \n\t\thasAnyTags(WRAP_STATE.describeTags): \n\t\thasAllTags(WRAP_STATE.describeTags);\n}" ]
[ "0.5603177", "0.55710864", "0.54379797", "0.5346783", "0.53278285", "0.52758", "0.52592653", "0.51713204", "0.5167734", "0.5154372", "0.51451504", "0.51197773", "0.5031678", "0.501171", "0.49979848", "0.49923262", "0.49743995", "0.49698848", "0.49520707", "0.49500576", "0.4885015", "0.48843518", "0.48642227", "0.48540634", "0.48527628", "0.4842968", "0.4811196", "0.48091218", "0.47973526", "0.47888112", "0.47806284", "0.4778498", "0.4778147", "0.47604704", "0.4749972", "0.47478294", "0.4745911", "0.47340256", "0.4720673", "0.4714737", "0.47108698", "0.47054347", "0.47004783", "0.46950617", "0.46859178", "0.46790245", "0.4670101", "0.46699852", "0.4669025", "0.46687868", "0.46595627", "0.46523982", "0.46428674", "0.46425337", "0.4637216", "0.46194646", "0.46044984", "0.46034408", "0.45918208", "0.45868143", "0.45811945", "0.45804456", "0.45786992", "0.4578318", "0.45773053", "0.45746008", "0.45585296", "0.45545205", "0.4552468", "0.4552108", "0.45488867", "0.4547048", "0.45333531", "0.45333004", "0.45331115", "0.4529891", "0.4524004", "0.45179716", "0.45164308", "0.45151702", "0.4512468", "0.45092535", "0.4507047", "0.45057487", "0.45028895", "0.4502804", "0.45002815", "0.44992843", "0.4498396", "0.44913116", "0.44913116", "0.4486462", "0.44846255", "0.44837546", "0.44824782", "0.4477543", "0.44769138", "0.44763362", "0.44752738", "0.44742823" ]
0.59527785
0
Updates state to reflect a change in a category rating Saves the evaluation as a new assignment
async doSubmitRating() { let { rating, notes, selectedImprovementAreas, assignmentName, classID, studentID, assignmentLength, assignmentType, assignmentLocation, evaluationID, highlightedWords, highlightedAyahs } = this.state; notes = notes.trim(); const submission = this.state.submission ? { submission: this.state.submission } : {}; let evaluationDetails = { ID: evaluationID, name: assignmentName, assignmentLength, assignmentType: assignmentType, location: assignmentLocation, completionDate: new Date().toLocaleDateString("en-US", { year: "numeric", month: "2-digit", day: "2-digit" }), evaluation: { rating, notes, highlightedWords, highlightedAyahs, improvementAreas: selectedImprovementAreas, }, ...submission }; try { await FirebaseFunctions.completeCurrentAssignment( classID, studentID, evaluationDetails ); const currentClass = await FirebaseFunctions.getClassByID( this.state.classID ); this.setState({ currentPosition: "0:00", audioFile: -1 }); this.props.navigation.push("TeacherStudentProfile", { studentID: this.state.studentID, currentClass, userID: this.props.navigation.state.params.userID, classID: this.state.classID }); } catch (err) { Alert.alert(strings.SomethingWentWrong, strings.SomethingWentWrongDesc); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "changeRating(newRating) {\n var badgeColor = colorAt(newRating);\n\n var surveyData = this.state.surveyData;\n surveyData[\"rating\"] = newRating;\n surveyData[\"color\"] = badgeColor;\n this.setState({ surveyData });\n }", "function modifyOverallRatingSubmission()\n{\n\t// Hide \"Did the candidate pass the interview?\":\n\tvar nodes = Array.from(document.getElementsByClassName('overall-recommendation')[0].childNodes);\n\tnodes.forEach(function (node) { if (/candidate pass the interview/.test(node.textContent)) { node.textContent = ''; } });\n\n\t// Change labels:\n\tdoOnSelector('.overall-recommendation [data-rating-id]', function (ratingElt) \n\t{ \n\t\tvar ratingValue = parseInt(ratingElt.getAttribute('data-rating-id'));\n\t\tratingElt.innerText = mulesoftOverallRatings[ratingValue - 1];\n\t}); \n}", "saveRating(rating) {\n if (this.obj.rating.hasOwnProperty(\"local\")) {\n // existing rating modified\n this.obj.rating.sum -= this.obj.rating.local;\n this.obj.rating.sum += rating;\n this.obj.rating.local = rating;\n } else {\n // new rating added\n this.obj.rating.sum += rating;\n this.obj.rating.local = rating;\n this.obj.rating.votes += 1;\n }\n this.saveRecipeCallback(this.obj);\n }", "function setRating(rating) {\n $('.rating-button').removeClass(ICON_CLICKED);\n $('.rating-reasons').hide();\n $('#submit-instance').show();\n $('#comment-container').show();\n\n localStorage.setItem(\"instance-rating\", rating);\n\n if (rating == BAD_QUALITY) {\n $('#bad-reasons').show();\n $('#rating-red').addClass(ICON_CLICKED);\n } else if (rating == OK_QUALITY) {\n $('#ok-reasons').show();\n $('#rating-yellow').addClass(ICON_CLICKED);\n } else if (rating == GOOD_QUALITY) {\n $('#rating-green').addClass(ICON_CLICKED);\n }\n}", "[consts.CATEGORY_SAVING_INDICATOR](state, val) {\n state.categorySaving = val;\n }", "function doUpdateRating() {\n var power = (oppRating - myRating)/400;\n var expectedScore = 1/(1 + Math.pow(10, power));\n var actualScore = 1; //win\n if (result === 'draw') actualScore = 0.5; //draw\n if (result === 'lose') actualScore = 0; //lose\n var k = 32; //k-factor\n\n var adjustedRating = myRating + k*(actualScore - expectedScore);\n console.log(\"oppRating:\", oppRating);\n console.log(\"myRating:\", myRating);\n console.log(\"my new rating:\", adjustedRating);\n console.log(\"net gain:\", adjustedRating - myRating);\n\n firebase.database().ref('leaderboard/'+gametype+'/'+userkey).update({ rating: adjustedRating});\n }", "function updateNewRating(newRating) {\n\t$('#current-rating').text(newRating)\n}", "function handleRatingChange() {\n var newReviewRating = $(this).val();\n getReviews(newReviewRating);\n }", "updateRating(rating){\n this.setState({rating: rating});\n }", "updateRating(rating){\n this.setState({rating: rating});\n }", "onRatingChange(rating) {\n this.setState({\n game_rating: rating, \n });\n }", "function updateRating(){\n climbs.$save(climb).then(function(ref){\n console.log(\"saved\");\n });\n }", "function reducer(state=defaultState, action) {\n switch (action.type) {\n case INCREMENT_ORDER:\n console.log(state[0].orderNum);\n console.log(\"action.order\" + action.order);\n const updatedStateObj = {...state[0], orderNum: action.order + 1};\n return [updatedStateObj];\n case ADD_SELECTIONS:\n console.log(action.selection);\n const newSelections = [...state[0].selections, action.selection];\n console.log(newSelections);\n const ObjWithNewSelections = {...state[0], selections: newSelections};\n console.log(ObjWithNewSelections);\n return [ObjWithNewSelections];\n case ADD_PROFIT:\n console.log(\"total money: \" + state[0].totalMoney);\n console.log(\"action.profit: \" + action.profit);\n const ObjWithUpdatedMoney = {...state[0], totalMoney: state[0].totalMoney + action.profit};\n console.log(\"total money updated: \" + ObjWithUpdatedMoney.totalMoney);\n return [ObjWithUpdatedMoney];\n case UPDATE_THIS_ROUND_RATING:\n console.log(\"thisRoundRating\" + state[0].thisRoundRating);\n console.log(\"action.changedRating\" + action.changedRating);\n if (state[0].thisRoundRating + action.changedRating <= 5.0){\n const ObjWithUpdatedRating = {...state[0], thisRoundRating: state[0].thisRoundRating + action.changedRating};\n return [ObjWithUpdatedRating];\n }else {\n const ObjWithMaxRating = {...state[0], thisRoundRating: 5.0};\n return [ObjWithMaxRating];\n }\n case RESET_ROUND_RATING:\n const ObjWithInitialRating = {...state[0], thisRoundRating: 5.0};\n return [ObjWithInitialRating];\n case ADD_RATING:\n console.log(\"ratings: \" + state[0].ratings);\n console.log(action.rating);\n const newRatings = [...state[0].ratings, action.rating];\n console.log(newRatings);\n const ObjWithNewRatings = {...state[0], ratings: newRatings};\n console.log(ObjWithNewRatings);\n return [ObjWithNewRatings];\n case RESET_RATINGS:\n const ObjWithNoRatings = {...state[0], ratings: []};\n return [ObjWithNoRatings];\n case RESET_ORDER_NUM:\n const ObjWithInitialOrderNum = {...state[0], orderNum: 0};\n return [ObjWithInitialOrderNum];\n case RESET_SELECTIONS:\n const ObjWithNoSelections = {...state[0], selections: []};\n return [ObjWithNoSelections];\n case RESET_MONEY:\n const ObjWithInitialMoney = {...state[0], totalMoney: 80};\n return [ObjWithInitialMoney];\n case RESET_TIME_REMAINED:\n const ObjWithInitialTime = {...state[0], timeRemained: 20};\n return [ObjWithInitialTime];\n // case UPDATE_TIME_REMAINED:\n // console.log(state[0].timeRemained);\n // console.log(\"action.changedRating\" + action.timeSpent);\n // const ObjWithUpdatedTime = {...state[0], timeRemained: state[0].timeRemained - action.timeSpent};\n // return [ObjWithUpdatedTime];\n default:\n console.log(state[0].orderNum);\n return state;\n }\n}", "function setRating() {\n // make sure rating doesn't go below 1 star\n if (mismatches > 7) return;\n\n // decrease rating every 3 mismatches\n if ( (mismatches % 3) === 0 ) {\n rating--;\n ratingLabel.removeChild(ratingLabel.lastElementChild);\n }\n}", "handleSelectDecisionCategoryChange(event, index, value) {\n console.log('DecisionAdd::handleSelectDecisionCategoryChange')\n let change = this.state\n change.decision.category = value\n this.setState(change)\n console.log(this.state)\n }", "function finalCategoryScore() {\r\n /* METHOD STUB */\r\n}", "onCorrect () {\n if (this.state.category < 5) {\n this.updateCheese();\n this.updateBoard();\n }\n else {\n this.updateCheese();\n this.gameEnd();\n }\n }", "function handleRatingUpdate(event, currentRating, addedRating, totalRatings){\n event.preventDefault();\n var newTotalRatings = totalRatings + 1\n var updatedRating = (currentRating * totalRatings) / newTotalRatings;\n \n\n var updatedRatingInfo = {\n rating : updatedRating,\n totalRatings : newTotalRatings\n }\n \n updateRating(updatedRatingInfo);\n \n }", "handleAdjustment(attribute, newVal){\n\t\tconsole.log(\"Changing: \", attribute);\n\t\tvar newObject = {};\n\t\tnewObject[attribute] = newVal;\n\t\tconsole.log(\"newAttribute: \", newObject)\n\t\tthis.setState(newObject);\n\t\tconsole.log(\"Changed: \", attribute);\n\t\tconsole.log(\"this.state.attribute = \", newVal);\n\t\tconsole.log(this.state.cats);\n\t\tthis.logAttribute(attribute);\n\t\tthis.updateModsAndBonuses(attribute);\n\t\tthis.logAttribute(attribute);\n\t}", "changeStarOut() {\n const { rating } = this.state;\n this.changeStar(rating);\n }", "setRating(number) {\n if (number === 1) {\n this.setState({ rating: 1, satisfaction: 'poor' });\n } else if (number === 2) {\n this.setState({ rating: 2, satisfaction: 'below average' });\n } else if (number === 3) {\n this.setState({ rating: 3, satisfaction: 'average' });\n } else if (number === 4) {\n this.setState({ rating: 4, satisfaction: 'very good' });\n } else if (number === 5) {\n this.setState({ rating: 5, satisfaction: 'excellent' });\n }\n }", "function updateRating() {\n //Rating game based on move count\n if (numMoves == (moves_to_two_stars)) {\n stars[2].classList.remove(\"fa-star\");\n stars[2].classList.add(\"fa-star-o\");\n rating = 2;\n }\n else if (numMoves == (moves_to_one_star)) {\n stars[1].classList.remove(\"fa-star\");\n stars[1].classList.add(\"fa-star-o\");\n rating = 1;\n }\n}", "function updateGrade(){\n var user_points = initPointObjectCategories();\n var max_points = initPointObjectCategories();\n\n $(ASSIGNMENT_TABLE_CSS_PATH +' > tr').each(function(){\n var assignment = getAssignmentInfo($(this));\n user_points[assignment['category']] += assignment['user_score'];\n max_points[assignment['category']] += assignment['max_score'];\n });\n\n var number_grade = generateNumberGrade(user_points, max_points);\n var letter_grade = generateLetterGrade(number_grade);\n\n $(CATEGORIES_CSS_PATH).each(function(){\n updateCategoryScore($(this), user_points, max_points);\n })\n //$(category_element).find('td:nth-child(3)').text();\n\n $(CLASS_LETTER_GRADE_CSS_PATH).text((number_grade).toFixed(2) + \"%\");\n $(CLASS_NUMBER_GRADE_CSS_PATH).text(letter_grade);\n}", "function setCatMood (newCat) {\r\ndocument.getElementById(\"moody-cats\").classList.remove(newCat.mood)\r\n\r\nif (newCat.affection >= 6) { newCat.mood = \"happy\" }\r\nif (newCat.affection <= 5) { newCat.mood = \"tolerant\" }\r\nif (newCat.affection <= 3) { newCat.mood = \"angry\" }\r\nif (newCat.affection <= 0) { newCat.mood = \"gone\" }\r\n\r\ndocument.getElementById(\"moody-cats\").classList.add(newCat.mood)\r\nsaveCats()\r\n}", "static setRatings(ratingsJSON) {\n // console.log(\"setRatings(ratingsJSON) -> ratingsJSON\", ratingsJSON);\n return store.save('CURRENT_RATINGS', ratingsJSON);\n }", "function setRating(newRating) {\n rating = newRating;\n \n //propagate widget event to main app \n /*\n instance.fireEvent('ratingChanged',{\n currentValue:rating\n });\n */\n \n textValue.text = String(rating).replace('.0','');\n for (var i = 0, l = stars.length; i < l; i++) {\n if (i >= rating) {\n stars[i].image = '/images/star_off.png';\n }\n else if (rating > i && rating < i+1) {\n stars[i].image = '/images/star_half.png';\n }\n else {\n stars[i].image = '/images/star.png';\n }\n }\n }", "userRating(type, rating) {\n // this for loop checks to see if the user submitting the rating has taken the class before\n // if they haven't they cannot submit a rating\n\n for (var i = 0; i < this.state.courseHistory.length; i++) {\n if (this.state.courseHistory[i].CourseNum == this.state.courseID) {\n break;\n } else if (i == this.state.courseHistory.length - 1) {\n return\n }\n }\n\n if (type === \"classEnjoyment\" && !this.state.classEnjoyment) {\n this.setState({ classEnjoyment: true, userRating: rating })\n } else if (type === \"classUsefulness\" && !this.state.classUsefulness) {\n this.setState({ classUsefulness: true, userRating: rating })\n } else if (type === \"examDifficulty\" && !this.state.examDifficulty) {\n this.setState({ examDifficulty: true, userRating: rating })\n } else if (type === \"attendanceAttn\" && !this.state.attendanceAttn) {\n this.setState({ attendanceAttn: true, userRating: rating })\n } else if (type === \"profRating\" && !this.state.profRating) {\n this.setState({ profRating: true, userRating: rating })\n } else if (type === \"classDifficulty\" && !this.state.classDifficulty) {\n this.setState({ classDifficulty: true, userRating: rating })\n } else if (type === \"testHeavy\" && !this.state.testHeavy) {\n this.setState({ testHeavy: true, userRating: rating })\n } else if (type === \"classType\" && !this.state.classType) {\n this.setState({ classType: true, userRating: rating })\n } else if (type === \"homeworkLoad\" && !this.state.homeworkLoad) {\n this.setState({ homeworkLoad: true, userRating: rating })\n } else if (type === \"profApproach\" && !this.state.profApproach) {\n this.setState({ profApproach: true, userRating: rating })\n } else {\n return\n }\n this.postRatings(type, rating);\n }", "function change_rating(to_rating_num, to_rating_text)\n{\n\t\n\tvar rating_element = document.getElementById('reviewer_rating');\n\trating_element.setAttribute(\"class\", \"rating \" + to_rating_text + \"star\");\n\t\n\t// set hidden field value for rating\n\tvar rating_value = document.getElementById('review_rating');\n\trating_value.value = to_rating_num;\n\t\n\tvar submit_button = document.getElementById('review_submit');\n\tsubmit_button.disabled = false;\n\t\n}", "function setMyRatings(reporteeEvaluation, managerEvaluation, evaluationScore, isReporteeEvaluationSubmitted, isManagerEvaluationSubmitted){\n\tsetManagerEvaluationLabel(managerEvaluation);\n\tsetManagerEvaluationInput(managerEvaluation);\n\tsetEvaluationScoreLabel(evaluationScore);\n\tsetManagerEvaluationScore(evaluationScore);\n\t\n\tif(isReporteeEvaluationSubmitted == true) {\n\t\tsetReporteeEvaluation(reporteeEvaluation);\n\t}else{\n\t\tsetReporteeEvaluation(NO_REPORTEE_EVALUATION_SUBMITTED)\n\t}\n\t\n\treporteeEvaluationSubmitted(isReporteeEvaluationSubmitted);\n\tmanagerEvaluationSubmitted(isManagerEvaluationSubmitted);\n\t\n\t$managerEvaluationFooter.show();\n\t\n\tif ($managerEvaluationText.text()===\"No manager evaluation has been written.\"){ \n\t\twasManagerEvaluationEmpty=true;\n\t\tlastSavedManagerEvaluationInput=\"\";\n\t}\n\telse{\n\t\twasManagerEvaluationEmpty=false;\n\t\tlastSavedManagerEvaluationInput=$managerEvaluationText.text();\n\t}\n}", "function setRating() {\n if ((moves - match) == 3) { //3 moves\n $ratingStars.eq(2).removeClass('fa-star').addClass('fa-star-o');\n rating = 2;\n questionLevel2();\n } else if ((moves - match) == 5) { //5 moves\n $ratingStars.eq(1).removeClass('fa-star').addClass('fa-star-o');\n rating = 1;\n questionLevel2();\n } else if ((moves - match) >= 7) { //7 moves\n $ratingStars.eq(0).removeClass('fa-star').addClass('fa-star-o');\n rating = 0;\n questionLevel2();\n }\n return { score: rating };\n}", "function setMyRatings(selfEvaluation, managerEvaluation, evaluationScore, isSelfEvaluationSubmitted, isManagerEvaluationSubmitted){\n\tsetSelfEvaluationLabel(selfEvaluation);\n\tsetSelfEvaluationInput(selfEvaluation);\n\tif(isManagerEvaluationSubmitted) {\n\t\tsetManagerEvaluation(managerEvaluation, evaluationScore);\n\t\t$selfEvaluationFooter.html('');\n\t}else{\n\t\tsetManagerEvaluation(MANAGER_RATING_NOT_SUBMITTED, 0);\n\t}\n\t\n\tmanagerEvaluationSubmitted(isManagerEvaluationSubmitted);\n\tselfEvaluationSubmitted(isSelfEvaluationSubmitted);\n\t\n\t$selfEvaluationFooter.show();\n\t\n\tif ($selfEvaluationText.text()===\"No self rating has been written.\"){\n\t\twasSelfEvaluationEmpty=true;\n\t\tlastSavedSelfEvaluationInput=\"\";\n\t}\n\telse{\n\t\twasSelfEvaluationEmpty=false;\n\t\tlastSavedSelfEvaluationInput=$selfEvaluationText.text();\n\t}\n}", "onStarClick(nextValue, prevValue, name) {\n this.setState({rating: nextValue});\n //request the server to save it\n this.hasRating()\n }", "function adjustRating(rating) {\n document.getElementById('rating').textContent = rating;\n}", "handleRating(rating) {\n this.setState(prevState => {\n return { form: { ...prevState.form, invalid: false, rating } }\n })\n\n // anticipate the need for a dispute per Josh\n if (rating < 3) {\n this.setState({ problemInferred: true })\n\n this.toggleModal('confirmation')\n }\n }", "function catnip(id) {\r\n let currentCat = findCatById(id)\r\n currentCat.mood = \"tolerant\"\r\n currentCat.affection = 5\r\n saveCats()\r\n}", "function calculateNewRatingScore(newRating) {\n\tlet currentRating = getCurrentRating()\n\tlet currentVotes = getCurrentVotes()\n\tlet newVotes = currentVotes+1\n\tlet calc = (currentRating*currentVotes+newRating)/newVotes\n\tcalc = calc.toFixed(2)\n\t\n\tupdateNewVotes(newVotes)\n\tupdateNewRating(calc)\n\toutputStars(calc)\n}", "changeCategory(category) {\n\t\t\t\tthis.each(function (model) {\n\t\t\t\t\tmodel.set('category', category);\n\t\t\t\t});\n\t\t\t}", "saveCourse(course){\n let categories = this.state.categories;\n let courseCategory = categories.find(c => c._id === this.state.category);\n course.category = courseCategory;\n course.modalities = this.state.addedModalityItems;\n course.methodologies = this.state.addedMethodologyItems;\n this.setState({\n course: course,\n }, () => console.log(course));\n }", "function saveRating(myReviewAnchor, insuranceId, productId, ratingValue, callback/*(err)*/){\n //preperation of anchors and data\n var aggregationElementId = \"$insurance-\"+insuranceId+\"-product-\"+productId;\n var voteElementId = myReviewAnchor;\n var aspect = 'percentage';\n\n //pass values to CH for persistence\n CrowdHound.saveVote(aggregationElementId, voteElementId, aspect, ratingValue, function(err) {\n //console.log('saveVote returned', err);\n return callback(err);\n });\n\n }", "[consts.CATEGORY_ADD_INDICATOR](state, val) {\n state.categoryAdding = val;\n }", "function updateCat(cat, csrf, type) { \n let data = cat;\n data._csrf = csrf;\n \n switch(type) {\n case \"adv\":\n data.adventurousness += 1;\n break;\n case \"agl\":\n data.agility += 1;\n break;\n case \"int\":\n data.intelligence += 1;\n break;\n case \"str\":\n data.stretch += 1;\n break;\n default:\n break;\n }\n \n console.dir(data);\n sendAjax('POST', '/updateCat', data, redirect);\n}", "function changeRating(ratingIndex, changeOfRating) {\n const allRatings = document.querySelectorAll(\".term-rating\");\n let thisRating = allRatings[ratingIndex];\n let thisRatingNumber = parseInt(thisRating.innerHTML, 10);\n thisRatingNumber += changeOfRating;\n thisRating.innerHTML = thisRatingNumber;\n}", "function changeCategory(id) {\n let radio = document.getElementsByClassName(id);\n let newCategory = null;\n for (let i = 0; i < radio.length; i++){\n if (radio[i].checked === true) {\n newCategory = radio[i].value;\n break;\n }\n }\n submitCategory(id, newCategory);\n}", "updateLearningRate() {\n /* history must have more than 2 values */\n if (this.mseHistory.length < 2) {\n return;\n }\n /* MSE went up = bad update then devide by 2*/\n if (this.mseHistory[0] > this.mseHistory[1]) {\n this.options.learningRate /= 2;\n }\n /* MSE went down : it is right direction then multiply with 5% */\n else {\n this.options.learningRate *= 1.05\n }\n }", "function setRating(rating) {\n var ir = new ItemRating(rating);\n if (rating.id == 0) {\n ir.$save()\n .then(function(data){\n rating.id = data.id;\n updateRatings(rating);\n })\n .catch(function (error) {\n rating.rate = 0;\n });\n } else {\n ir.$update({ id: rating.id })\n }\n }", "updateStarRating() {\n const { numberOfMoves, numberOfStars } = this.state;\n if(numberOfMoves < 12) {\n this.setState({\n numberOfStars: 3\n });\n } else if (numberOfMoves >= 12 && numberOfMoves < 18) {\n this.setState({\n numberOfStars: 2\n });\n } else {\n this.setState({\n numberOfStars: 1\n });\n }\n }", "changeRating(id, rating) {\n console.log('Code reached in the MusicPanel', id, rating)\n\n let newSongs = [...this.state.songs]\n\n newSongs.forEach((ele, index, arr) => {\n if (ele._id == id) {\n arr[index].rating = rating\n }\n })\n\n this.setState({ songs: newSongs })\n this.modifySong(id, rating)\n }", "function updateScore() {\n store.score++;\n}", "categ(state,data)\n {\n return state.category=data\n }", "function updateQuestion(){\n\t\tconsole.log(\"UpdateQuestion: \" + questionCount)\n\t\tquestions[questionCount].updateImages();\n\t\tcorrectCheck();\n\t\timageHover();\n\t\tclicked = false;\n\t}", "rating(event) {\n if (event.target.name === \"feedbackRating\") {\n this.feedbackRating = event.target.value;\n }\n }", "logRating(){\n\t\tthis.setState({hasSubmitted: true});\n\t\tconsole.log(\"Rating data prepared to be POSTed to some database/storage\")\n\t\tconsole.log(this.state);\n\t}", "updateScore() {\n if(Dashboard.candyMachted.length) {\n this.score += 1;\n this.levelUp();\n this.scoreUpdateView();\n Dashboard.candyMachted.pop();\n }\n }", "function updateStarRating() {\n const numCards = deckConfig.numberOfcards;\n\n if (scorePanel.moveCounter === 0) {\n scorePanel.starCounter = 3;\n $(\".star-disabled\").toggleClass(\"star-enabled star-disabled\");\n } else if (scorePanel.moveCounter === Math.trunc(numCards / 2 + numCards / 4)) {\n scorePanel.starCounter = 2;\n $($(\".stars\").children()[0]).toggleClass(\"star-enabled star-disabled\");\n } else if (scorePanel.moveCounter === (numCards)) {\n scorePanel.starCounter = 1;\n $($(\".stars\").children()[1]).toggleClass(\"star-enabled star-disabled\");\n }\n}", "function updateScore(value) {\n gState.score += value;\n document.querySelector('header > h3 > span').innerText = gState.score;\n displayVictory();\n}", "function assignmentsUpdate() {\n\tvar idx = assignmentsGetCurrentIdx();\n\t\n\tvar tmp = assignments[idx].path;\n\tassignments[idx].path = document.getElementById(\"path\").value;\n\tif (!assignmentValidatePath(idx, true)) {\n\t\tassignments[idx].path = tmp;\n\t\tdocument.getElementById(\"path\").style.backgroundColor = \"#fcc\";\n\t\tdocument.getElementById(\"path\").focus();\n\t\treturn;\n\t}\n\t\n\tvar tmp = assignments[idx].name;\n\tassignments[idx].name = document.getElementById(\"name\").value;\n\tif (!assignmentValidateName(idx, true)) {\n\t\tassignments[idx].name = tmp;\n\t\tdocument.getElementById(\"name\").style.backgroundColor = \"#fcc\";\n\t\tdocument.getElementById(\"name\").focus();\n\t\treturn;\n\t}\n\t\n\tif (document.getElementById(\"hidden\").checked) \n\t\tassignments[idx].hidden = true; \n\telse \n\t\tassignments[idx].hidden = false;\n\tif (document.getElementById(\"homework_id\").value) \n\t\tassignments[idx].homework_id = document.getElementById(\"homework_id\").value;\n\telse\n\t\tassignments[idx].homework_id = 0;\n\tassignments[idx].author = document.getElementById(\"author\").value;\n\n\tdocument.getElementById('assignmentChangeMessage').style.display = \"inline\";\n\tdocument.getElementById('assignmentChangeMessage').innerHtml = 'Assignment changed';\n\tdocument.getElementById(\"path\").style.backgroundColor = \"#fff\";\n\tdocument.getElementById(\"name\").style.backgroundColor = \"#fff\";\n\tassignmentsRender();\n\t\n\tassignmentsSendToServer();\n}", "[consts.VIS_EDIT_CATEGORY](state, obj) {\n state.visEditCategory = obj.vis;\n }", "function setIndustryScore(){\n if(!recommendationMapping){\n return\n }\n for(var index in recommendationMapping.industry_weights){\n $scope.industry_weights[index] = {score:recommendationMapping.industry_weights[index].score};\n }\n $scope.safeApply(fn => fn);\n }", "function updateState(data) {\n updateVoteFinishArea(data.state);\n}", "function set_call_rating(e)\r\n{\r\n\tif (!e) var e = window.event; //-- ie\r\n\tvar tmpEle = getEventSourceElement(e);\r\n\tif(tmpEle)\r\n\t{\r\n\t\t//-- user selected radio option\r\n\t\t//-- get row from original selected rating <p>\r\n\t\tvar aRow = get_parent_owner_by_tag(currentCratingP,\"TR\");\r\n\t\tif(aRow)\r\n\t\t{\r\n\t\t\tvarKey= aRow.getAttribute(\"keyvalue\");\r\n\t\t\tif((varKey!=\"\")&&(varKey!=null))\r\n\t\t\t{\r\n\t\t\t\r\n\t\t\t\t//-- get rating #\r\n\t\t\t\tvar intRating = get_selected_rating();\r\n\r\n\t\t\t\t//-- do http request to update rating\r\n\t\t\t\tvar strURL = app.portalroot + \"php/xmlhttp/updatecallrating.php?in_callref=\" + varKey + \"&in_crating=\" + intRating + \"&in_feedback=\" + document.getElementById('crating_text').value;\r\n\t\t\t\tvar strResult = run_php(strURL,true);\r\n\t\t\t\tif(strResult==\"TRUE\")\r\n\t\t\t\t{\r\n\t\t\t\t\tvar strClass = \"\";\r\n\t\t\t\t\tintRating--;intRating++;\r\n\t\t\t\t\tswitch(intRating)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\tstrClass = \"call-pos\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\tstrClass = \"call-neu\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 3:\r\n\t\t\t\t\t\t\tstrClass = \"call-neg\";\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcurrentCratingP.className = strClass;\r\n\r\n\t\t\t\t\tvar currentRow= get_parent_owner_by_tag(currentCratingP,\"TR\");\r\n\t\t\t\t\tvar callStatus = get_col_value(currentRow,\"status\");\r\n\r\n\t\t\t\t\tif(intRating>0)\t\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(callStatus!=6)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcurrentCratingP.innerHTML=\"<a href='#' onclick='popup_crating();'>change</a>\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tcurrentCratingP.innerHTML=\"\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t//-- failed to set rating\r\n\t\t\t\t\talert(\"An fault occured trying to set the rating for this request. Please contact youer Supportworks Administrator.\");\r\n\t\t\t\t}\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar oDiv = document.getElementById('call_rating');\r\n\tif(oDiv==null)return true;\r\n\toDiv.style['display']='none';\r\n}", "editRating() {\n axios.put(APP_URL + '/user/app/rating', {\n id_user: this.props.id_user,\n id_app: this.props.item.id_app,\n rating: this.state.rating\n }, {\n headers: {\n Authorization: 'Bearer ' + localStorage.getItem('token')\n }\n })\n .then(() => this.setState({rating: this.props.rating}))\n .catch(err => console.log(err))\n }", "calculateGrade(state, action) {\n var numOfQuestion = state.student.test.questions ? state.student.test.questions.length : 0\n var americanQuestionSum = 0\n var currentGrade = 0\n for (let i = 0; i < numOfQuestion; i++) {\n //if multy question\n if (!state.student.test.questions[i].openQuestion) {\n americanQuestionSum++;\n }\n }\n for (let c = 0; c < state.student.test.answersArray.length; c++) {\n if (state.student.test.answersArray[c].is_correct)\n currentGrade += 100;\n }\n\n //we finished to check the student answers\n //set the student grade\n state.student.test.multyQuestion_grade = americanQuestionSum == 0 ? 0 : currentGrade / americanQuestionSum;\n state.student.test.grade = numOfQuestion == 0 ? 0 : currentGrade / numOfQuestion;\n }", "function actionUpdateCategory()\n{\n\tvar name = $('.input-child-category').find('.txt_name').val();\n\tvar description = $('.input-child-category').find('.txt_description').val();\n\tvar category_id = $('#txt_category_id').val();\n\tvar parent_id = $('#cbo_parent').val();\n\t\n\t// console.log(name);\n\t// console.log(description);\n\t// console.log(category_id);\n\t// console.log(parent_id);\n\t\n\t// Update to database\n\tprocessUpdateCategory(name, description, category_id, parent_id);\n}", "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "function assignRatingValue(tag){\n for (item of tag) {\n if (item.checked) {\n request.rating = parseFloat(item.value); //assign the checked value\n }\n }\n}", "setCategoryFromStorage() {\n // check for category. if none set to all.\n let currCat = localStorage.getItem('category');\n if (!currCat) {\n // set default.\n localStorage.setItem('category', 'restaurants');\n currCat = 'restaurants';\n }\n IndexAnimationsObj.category = currCat;\n // set list-group button to active for current category\n this.$categoryButtons.children().each(function (index) {\n if ($(this).val() === currCat) {\n $(this).addClass('active');\n // set card-map-zone filter display to category name\n $('.cat-display').text($(this).text());\n }\n });\n }", "function handleChange(event) {\n const { name, value } = event.target;\n setRecommendation((previous) => {\n return {\n ...previous,\n [name]: value,\n };\n });\n }", "function calculateCategory(category) {\r\n var categoryHiddenScoreId = '#' + category + '_hidden';\r\n var score = $(categoryHiddenScoreId).val();\r\n\r\n // we round the result to the second decimal place \r\n return score;\r\n}", "function setCHealth() {\n computer.choice.health.currentHP -= player.choice.damage;\n //display updated health information\n $(\".arena .computer .data p span\").text(computer.choice.health.currentHP);\n $(\".arena .computer progress\").val(computer.choice.health.currentHP);\n}", "incrementCatsFromCatnip() {\n this.setState({\n cats: this.state.cats + (0.2 / this.state.ticksPerSeconds) * (this.state.catnip)\n });\n }", "function updateCustomAttributes(stateName) {\n createButtonsFromStoredData()\n\n loanSet = document.getElementById(\"IDLPS\");\n if (!loanSet) { loanSet = document.getElementById(\"LPS\") }\n printSet = document.getElementById(\"IDPPS\") ? document.getElementById(\"IDPPS\") : null;\n if (!printSet) { printSet = document.getElementById(\"PPS\") }\n UwSet = document.getElementById(\"IDUWS\");\n if (!UwSet) { UwSet = document.getElementById(\"UWS\") }\n jacketBtn = document.getElementById(\"IDJACKET\");\n adden = document.getElementById(\"IDADDEN\");\n checks = document.getElementById(\"IDCHECKS\");\n openReview = document.getElementById(\"IDREVIEW\");\n var lps = (stateArray) ? data[data.findIndex(data => data.state === stateName)].lps : '';\n var ups = (stateArray) ? data[data.findIndex(data => data.state === stateName)].ups : '';\n var jacket = (stateArray) ? data[data.findIndex(data => data.state === stateName)].jacket : '';\n\n var lpsbutton = (localStorage.fileNum) ? `${localStorage.fileNum} LOAN POLICY SET` : `LOAN POLICY SET`;\n var printSetbutton = (localStorage.fileNum) ? `${localStorage.fileNum} PRINT POLICY SET` : `PRINT POLICY SET`;\n var UwSetbutton = (localStorage.fileNum) ? `${localStorage.fileNum} UW SET` : `UW SET`;\n if (loanSet) {\n loanSet.setAttribute(\"data-val\", lpsbutton);\n loanSet.setAttribute(\"title\", lps);\n }\n if (UwSet) {\n UwSet.setAttribute(\"data-val\", UwSetbutton);\n UwSet.setAttribute(\"title\", ups);\n }\n\n if (printSet) {\n printSet.setAttribute(\"data-val\", printSetbutton)\n printSet.setAttribute(\"title\", `${ups}, ${lps}`);\n }\n if (jacketBtn) {\n jacketBtn.setAttribute(\"title\", jacket)\n }\n if (adden) {\n if (adden) {\n adden.setAttribute(\"data-val\", \"adden\")\n }\n }\n\n}", "function updateState(stateName) {\n localStorage.setItem('stateName', stateName);\n stateArray = find(data, index => index.state === stateName);\n split = (stateArray) ? stateArray.split / 100 : 0;\n makeList(stateArray);\n\n //DISPLAYS SPLIT, CPL AND RIDER INFO TO MAIN SCREEN\n $('#split').text(`UW:${stateArray ? stateArray.UW : ''} split:${stateArray ? stateArray.split : ''} CPL:${stateArray ? stateArray.cpl : ''} Rider:${stateArray ? stateArray.pud : ''}`\n );\n display = (stateArray) ? stateArray.end : false;\n updateCustomAttributes(stateName)\n\n toggleEndorsementCalc(display);\n displayRiskRateDiv()\n checkCalc();\n\n\n}", "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "onCategoryChange(categorySelected) {\n this.setState({\n categorySelected\n });\n if (categorySelected === null) {\n this.state.props.categoryChangeListener(-1);\n } else {\n this.state.props.categoryChangeListener(categorySelected.value)\n }\n }", "updateScore() {\n\t\tthis.score++;\n\t\tthis.drawScore();\n\t\tif (this.score >= this.highestScore) {\n\t\t\tthis.highestScore = this.score;\n\t\t\tlocalStorage.setItem(STORAGE_KEY, this.highestScore);\n\t\t}\n\t}", "changeCategoryValue(stringInput){\n this.setState({categoryValue:stringInput});\n }", "async function addCommentToAttraction(attractionId, commentId, rating) {\n if (!attractionId) { throw 'You need to provide id of this attraction when add a comment to attraction' };\n if (!commentId) { throw 'You need to provide id of this comment when add a comment to attraction' };\n if (!rating) { throw 'You need to provide rating in your comment when add a comment to attraction' };\n const attractionCollection = await attractions();\n const targetAttraction = await attractionCollection.findOne({ _id: ObjectId(attractionId) });\n let newRating = await caculateRating(Number(targetAttraction.description.Rating), Number(rating), targetAttraction.numOfComments);\n newRating = Math.floor(newRating * 100) / 100;\n let newDescription = {\n Name: targetAttraction.description.Name,\n Category: targetAttraction.description.Category,\n Rating: newRating.toString(),\n Img: targetAttraction.description.Img,\n Price: targetAttraction.description.Price,\n Content: targetAttraction.description.Content,\n Address: targetAttraction.description.Address\n }\n let updateInfo = await attractionCollection.updateOne({ _id: ObjectId(attractionId) }, { $set: { numOfComments: targetAttraction.numOfComments + 1, description: newDescription } });\n if (!updateInfo.matchedCount && !updatedInfo.modifiedCount) {\n // throw 'Error: update failed';\n return;\n }\n updateInfo = await attractionCollection.updateOne({ _id: ObjectId(attractionId) }, { $addToSet: { relatedCommentsId: { id: commentId.toString() } } });\n if (!updateInfo.matchedCount && !updatedInfo.modifiedCount) {\n // throw 'Error: update failed';\n return;\n }\n return await this.getAttraction(attractionId);\n}", "attributeChangedCallback( name, oldValue, newValue ) {\n switch( name ) {\n case 'classification':\n this.classification = newValue;\n break;\n }\n }", "function saveRecommendationScore(){\n let currentInsuraceType = $stateParams.insurancetype;\n let data = {industry_weights: $scope.industry_weights};\n metaService.saveIndustryRecommendationScore(currentInsuraceType,data,()=>{\n console.log(\"successfully saved Industry weight\")\n }, error => {\n console.error(error);\n $rootScope.genService.showDefaultErrorMsg(error.message);\n backofficeService.logpost(error,$rootScope.user.email,'insurance_type','error',()=>{},()=>{})\n });\n }", "function getCurrentRating(){\n\tvar success = function(data){\n\t\tloaded();\n\t\tsetMyRatings(data.selfEvaluation, data.managerEvaluation, data.score, data.selfEvaluationSubmitted, data.managerEvaluationSubmitted);\n\t}\n\tvar error = function(){ loaded(); }\n\t\n\tgetCurrentRatingAction(ADLoginID, success, error);\n}", "function changePopcornImage(num, classTarget) {\n switch (eval(num)) {\n case 1:\n document.querySelector(classTarget + \"[value='1']\").setAttribute(\"src\", popcornImage);\n rating = 1;\n break;\n case 2:\n document.querySelector(classTarget + \"[value='1']\").setAttribute(\"src\", popcornImage);\n document.querySelector(classTarget + \"[value='2']\").setAttribute(\"src\", popcornImage);\n rating = 2;\n break;\n case 3:\n document.querySelector(classTarget + \"[value='1']\").setAttribute(\"src\", popcornImage);\n document.querySelector(classTarget + \"[value='2']\").setAttribute(\"src\", popcornImage);\n document.querySelector(classTarget + \"[value='3']\").setAttribute(\"src\", popcornImage);\n rating = 3;\n break;\n case 4:\n document.querySelector(classTarget + \"[value='1']\").setAttribute(\"src\", popcornImage);\n document.querySelector(classTarget + \"[value='2']\").setAttribute(\"src\", popcornImage);\n document.querySelector(classTarget + \"[value='3']\").setAttribute(\"src\", popcornImage);\n document.querySelector(classTarget + \"[value='4']\").setAttribute(\"src\", popcornImage);\n rating = 4;\n break;\n case 5:\n document.querySelector(classTarget + \"[value='1']\").setAttribute(\"src\", popcornImage);\n document.querySelector(classTarget + \"[value='2']\").setAttribute(\"src\", popcornImage);\n document.querySelector(classTarget + \"[value='3']\").setAttribute(\"src\", popcornImage);\n document.querySelector(classTarget + \"[value='4']\").setAttribute(\"src\", popcornImage);\n document.querySelector(classTarget + \"[value='5']\").setAttribute(\"src\", popcornImage);\n rating = 5;\n break;\n }\n}", "addNewCategory(newCategory){\n\t\tvar newCategoryArr = [];\n\n\t\tthis.state.maintenance.map((categories) => {\n\t\t\tnewCategoryArr.push({\n\t\t\t\tcategory: categories.category,\n\t\t\t\ttasks: categories.tasks \n\t\t\t});\n\t\t});\n\n\t\tnewCategoryArr.push({\n\t\t\tcategory: newCategory,\n\t\t\ttasks: []\n\t\t});\n\n\t\t// run helpers function to update the database\n\t\t// with the new maintenance array\n\t\tvar updateK = \"maintenance\";\n\t\tvar updateVal = newCategoryArr;\n\n\t\thelpers.updateCarMaintenanceArray(this.props.params.vin, updateK, updateVal).then((data) => {\n\n\t\t\thelpers.getCarMaintenanceInfo(this.props.params.vin).then((data) => {\n\t\t\n\t\t\t\t// set new state of maintenance array\n\t\t\t\tthis.setState({maintenance:data});\n\n\t\t\t});\n\t\t\t\n\t\t});\n\t}", "function setScore(foodname, compdata) {\n var selector = '[name=\"' + foodname + '\"]';\n var item = $.grep(compdata.carm.food_arr, function(e) {\n return e.name == foodname;\n });\n if (item.length === 0) {\n item = $.grep(compdata.dewick.food_arr, function(e) {\n return e.name == foodname;\n });\n }\n item = item[0];\n $(selector).each(function() {\n var oldScore = $(this).find('.food-score').html();\n var newScore = item.up;\n if (newScore > oldScore) {\n $(this).find('.downvote').attr('class', 'btn btn-danger downvote');\n $(this).find('.upvote').attr('class', 'btn btn-secondary upvote');\n } else if (newScore < oldScore) {\n $(this).find('.downvote').attr('class', 'btn btn-secondary downvote');\n $(this).find('.upvote').attr('class', 'btn btn-success upvote');\n }\n $(this).find('.food-score').html(newScore);\n });\n}", "function editManagerEvaluation(){\n\t$managerEvaluationLabels.hide();\n\t$managerEvaluationOptions.show();\n\teditingRating = true;\n}", "toggleRatingFilter(rating) {\n let newState;\n if (rating === 'reset') {\n newState = DEFAULT_STATE.reviewFilters;\n } else {\n newState = updateFilters(this.state.reviewFilters, rating);\n }\n this.setState({\n reviewFilters: newState,\n });\n }", "handleRatingClick(nextValue) {\n this.props.voteCat({ image_id: this.props.cat.id, score: nextValue });\n\n // Show the favorite modal\n this.setState({ showModal: true, rating: nextValue });\n }", "function UpdateRating(id, rating){\n fetch('https://dev-api.gotdadjoke.com/rating/update', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(\n {\n \"id\": id,\n \"rating\": rating\n }),\n })\n .then(function (data) {\n return data.json();\n }).then(ratingBody => {\n let currentRating = document.getElementById('currentRating');\n let totalRatings = document.getElementById('totalRatings');\n currentRating.innerHTML = ratingBody.rating;\n totalRatings.innerHTML = \"ratings: \" + ratingBody.num_rated;\n })\n}", "function changeCat() {\r\n cat = this;\r\n\r\n if (cat === list[0]) {\r\n currentCat(cats[0]);\r\n }\r\n\r\n if (cat === list[1]) {\r\n currentCat(cats[1]);\r\n }\r\n\r\n if (cat === list[2]) {\r\n currentCat(cats[2]);\r\n }\r\n\r\n if (cat === list[3]) {\r\n currentCat(cats[3]);\r\n }\r\n\r\n if (cat === list[4]) {\r\n currentCat(cats[4]);\r\n }\r\n}", "function changeCategory(cat) {\n if (cat === 1) {\n setDuration(timeSettings.time_pom * 60);\n setSeconds(timeSettings.time_pom * 60);\n } else if (cat === 2) {\n setDuration(timeSettings.time_short * 60);\n setSeconds(timeSettings.time_short * 60);\n } else if (cat === 3) {\n setDuration(timeSettings.time_long * 60);\n setSeconds(timeSettings.time_long * 60);\n }\n\n setCategory(cat);\n setRunning(false);\n }", "[consts.CATEGORY_MOVING_INDICATOR](state, val) {\n state.categoryMoving = val;\n }", "[consts.CATEGORY_REMOVING_INDICATOR](state, val) {\n state.categoryOneRemoving = val;\n }", "function Prank(props) {\n const [clicked, setClick] = useState(null);\n const [h2h, setH2h] = useState([0,1])\n const [b2b, setB2b] = useState([2,3])\n const [display, setDisplay] = useState([\"show\", \"noshow\"])\n // updating the rating after the vote\n function giveRating(event,prankArr, h2h, setIndex){\n console.log(clicked);\n setClick(\"active\");\n setDisplay(display.reverse());\n //first we need to identify the index that won and the index of gif that lost\n console.log(event);\n let winIndex = event.target.attributes['prankindex'].value\n let loseIndex;\n h2h.forEach((item) => {\n if(item != winIndex){\n loseIndex = item;\n }\n }\n )\n //get the new ratings in the form [winner score, loser score]\n let newRatings = ELOrank(props.prankArr, [winIndex, loseIndex])\n\n //Obtaining the id's of the pranks for which the rating needs to be \n //updated\n //update the oldRatings with the new ones\n let winId = props.prankArr[winIndex].id;\n let loseId = props.prankArr[loseIndex].id;\n\n // console.log(winId, loseId)\n let winningPrank = db.collection(\"pranks\").doc(`${winId}`);\n let losingPrank = db.collection(\"pranks\").doc(`${loseId}`);\n // Set the \"rating\" field to the \"newratings\"\n winningPrank.update({\n rating: newRatings[0]\n })\n losingPrank.update({\n rating: newRatings[1]\n })\n .then(() => {\n let minIndex = Math.min(h2h[0], h2h[1])\n if(minIndex + 3 < prankArr.length){\n setIndex([minIndex + 2, minIndex + 3]);\n }\n else{\n \n db.collection(\"pranks\").get().then((querySnapshot) => {\n let updatedArr = querySnapshot.docs.map((doc) => {\n // doc.data() is never undefined for query doc snapshots\n return doc.data();\n });\n props.updateArr(shuffle(updatedArr));\n props.setIndex([0,1]);\n // console.log('This is the shuffled array:' , props.prankArr);\n });\n \n }\n setClick(null)\n })\n\n //now we have to load the next two indices into the arena\n //if we have exhausted the list we need to start at h2h = [0,1]\n // again after shuffling the array\n\n \n\n }\n return (\n <div className= {`image-container ${clicked}`}>\n <div className = {`prank-image ${display[0]}`}>\n <img className = \"prank-gif\"\n src = {props.prankArr[h2h[props.side]].link} \n alt =\"\"\n prankindex = {props.prankArr[h2h[props.side]].index} \n height = \"200\" \n width = \"250\"\n onClick = {(event)=>(giveRating(event, props.prankArr, b2b, setB2b))}\n />\n </div>\n <div className = {`prank-image ${display[1]}`}>\n <img className = \"prank-gif\"\n src = {props.prankArr[b2b[props.side]].link} \n alt =\"\"\n prankindex = {props.prankArr[b2b[props.side]].index} \n height = \"200\" \n width = \"250\"\n onClick = {(event)=>(giveRating(event, props.prankArr, h2h, setH2h))}\n />\n </div> \n {/* <div className= \"icon-Container\">\n <img className = \"like-icon\" src = \"https://svgshare.com/i/Y5h.svg\" alt = \"joker\"/>\n </div> */}\n </div>\n )\n}", "function adjustedRating(card) {\n \n // apply some variance to card evaluation\n let rating = normalRandom(card.rating, bot.variance);\n\n // bias to preferred color in early picks\n if (bot.color_preference) {\n if (pick_number <= bot.color_preference.picks &&\n card.colors.indexOf(bot.color_preference.color) !== -1) {\n rating += 1.0;\n }\n }\n\n // return adjusted rating\n return rating;\n }", "function setClassification() {\n var classification = document.getElementById('classification');\n var product = document.getElementById('product');\n var selected_product = product.value; \n var select_classification = all_classifications[selected_product];\n classification.value = select_classification;\n bz_fireEvent(classification, 'change');\n}", "increaseScore(){\n let oldScore = this.state.score\n let newScore = oldScore + 1\n this.setState({score : newScore})\n ScoreManager.saveAppScore(newScore.toString())\n }", "function Recommendation($state) {\n\t\t\t/*jshint validthis: true */\n\t\t\tvar vm = this;\n\n\t\t\tvm.saveRecommendation = function(recommendation){\n\t\t\t\tconsole.log(\"inside save Recommendation method\");\n\t\t\t\t$state.go(\"home.quoteCreation\");\n\t\t\t};\n\n\t\t}", "function pickedRating() {\n $(\".rec-description *\").unbind(\"mouseenter mouseleave\");\n $(\".disable-submit\").removeClass(\"disable-submit\");\n let changedImgs = $(this).prevAll().addBack();\n for (let i = 0; i < changedImgs.length; i++) {\n changedImgs[i].src = \"../static/img/star-full.png\";\n if (i === changedImgs.length - 1) {\n $(\"#form-rating input\").val(i + 1);\n }\n }\n let sameImgs = $(this).nextAll();\n for (let j = 0; j < sameImgs.length; j++) {\n sameImgs[j].src = \"../static/img/star-empty.png\";\n }\n }", "update (selection) {\n _.values(this._instances).forEach(action => {\n action.evaluate(selection)\n })\n }", "function setAggressiveRating(updateRelated) {\n updateRelated = typeof updateRelated === 'undefined' ? true : updateRelated;\n\n var value = 0; // Default value?\n\n if (self.ElementField.IndexEnabled && self.ElementField.referenceRatingMultiplied() > 0) {\n switch (self.ElementField.IndexSortType) {\n case 1: { // HighestToLowest (High rating is better)\n value = (1 - self.numericValueMultipliedPercentage()) / self.ElementField.referenceRatingMultiplied();\n break;\n }\n case 2: { // LowestToHighest (Low rating is better)\n value = self.numericValueMultiplied() / self.ElementField.referenceRatingMultiplied();\n break;\n }\n }\n\n if (!self.ElementField.referenceRatingAllEqualFlag()) {\n value = 1 - value;\n }\n }\n\n if (self.backingFields._aggressiveRating !== value) {\n self.backingFields._aggressiveRating = value;\n\n // Update related values\n if (updateRelated) {\n // TODO ?\n }\n }\n }" ]
[ "0.6210639", "0.6076197", "0.6028207", "0.5942839", "0.57916754", "0.57270336", "0.5700214", "0.56769586", "0.5638897", "0.5638897", "0.55733585", "0.54768836", "0.5470916", "0.5450127", "0.5423766", "0.54129136", "0.5392594", "0.53596616", "0.5278805", "0.5273262", "0.5264079", "0.5237171", "0.5229852", "0.5212723", "0.521059", "0.5193887", "0.51827973", "0.5156851", "0.51537293", "0.51531976", "0.51520854", "0.5127907", "0.5125934", "0.51193494", "0.511201", "0.5099152", "0.50733864", "0.5066763", "0.5057748", "0.5050707", "0.5048088", "0.50460845", "0.5041815", "0.50343764", "0.5033525", "0.49983585", "0.49969298", "0.4988528", "0.49850392", "0.49747673", "0.49745628", "0.4960667", "0.4954605", "0.4953008", "0.49405327", "0.494024", "0.49343583", "0.49337777", "0.49073792", "0.49055162", "0.48780534", "0.4857975", "0.48503655", "0.48410138", "0.48410138", "0.48410138", "0.4829974", "0.48284012", "0.48281384", "0.4807494", "0.48071405", "0.48057234", "0.48045272", "0.4804433", "0.4803473", "0.48030218", "0.48015392", "0.4801166", "0.48007122", "0.4800516", "0.47999975", "0.47981346", "0.47843394", "0.4779768", "0.47784522", "0.47742054", "0.47735897", "0.47685215", "0.47629625", "0.47603944", "0.47596008", "0.4755191", "0.4743578", "0.47397476", "0.47352403", "0.4732754", "0.47311813", "0.47238466", "0.47167864", "0.4716257", "0.47162405" ]
0.0
-1
Overwrites a previously saved assignment with the new data
async overwriteOldEvaluation() { const { classID, studentID, evaluationID, notes, rating, selectedImprovementAreas, highlightedAyahs, highlightedWords } = this.state; this.setState({ isLoading: true }); let evaluationDetails = { rating, notes, highlightedWords, highlightedAyahs, improvementAreas: selectedImprovementAreas, }; await FirebaseFunctions.overwriteOldEvaluation( classID, studentID, evaluationID, evaluationDetails ); const currentClass = await FirebaseFunctions.getClassByID( this.state.classID ); this.props.navigation.push("TeacherStudentProfile", { studentID: this.state.studentID, currentClass, userID: this.props.navigation.state.params.userID, classID: this.state.classID }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveOldData() {\n oldData = newData;\n newData = null\n} // saveOldData", "async save_assign(assign) {\n //const {location_id, table_id, date_from, first_name, last_name, phone, email} = assign;\n try {\n /* NOTE: assign contains all key-value pairs to pass it as values-object */\n const result = await mAssign.create(assign, {raw: true});\n return eAssign.from_object(result.dataValues);\n //return new eAssign(a.location_id, a.table_id, a.date_from, a.first_name, a.last_name, a.phone, a.email);\n } catch (err) {\n throw err;\n }\n }", "copy(other) {\n this.data.set(other.data);\n }", "function updateSaveData() {\n if (currentMode == \"event\") {\n let saveData = missionData.Completed.Remaining.map(m => m.Id).join(',');\n setLocal(\"event\", \"Completed\", saveData);\n setLocal(\"event\", \"Id\", EVENT_ID);\n setLocal(\"event\", \"Version\", EVENT_VERSION);\n } else {\n \n // Motherland\n let curRankCompletedIds = missionData.Completed.Remaining.map(m => m.Id);\n let saveData = [...curRankCompletedIds, ...missionData.OtherRankMissionIds].join(',');\n setLocal(\"main\", \"Completed\", saveData);\n }\n \n setLocal(currentMode, \"CompletionTimes\", JSON.stringify(missionCompletionTimes));\n}", "function saveValues() {\n\tstorage.hiscore2 = hiscore;\n\tstorage.longest2 = longest;\n\tstorage.speed2 = speed;\n}", "function assignData(node, data) {\n node.__data__ = data;\n}", "save(data) {\n this.data = Object.assign({}, this.data, data);\n return this.store.set(data);\n }", "assign(name, value) {\n this.add(name, {\n value,\n assigned: true\n }, true);\n return this.hasAssignments = true;\n }", "function overrideInMemoryData(_newData) {\n var confirmation = confirm(\"Pressing OK will override in-memory data\");\n if (confirmation) {\n console.log(\"Overriding data ...\");\n newDataset.resetData();\n var json = JSON.parse(document.getElementById(\"override_data_input\").value);\n newDataset.overrideData(json);\n document.getElementById(\"override_data_output\").innerHTML = JSON.stringify(newDataset.getDataset(), 2, 2);\n }\n\n}", "function saveData(data)\n{\n\tobjectData = data;\n}", "assign(assignment) {\n let pixi = this.pixi;\n\n if (this.assignment && this.assignment.assigned === this)\n this.assignment.dismiss();\n this.assignment = assignment;\n\n if (assignment) {\n assignment.assign(this);\n\n if (pixi)\n pixi.position = assignment.getCenter().clone();\n }\n\n return this;\n }", "function Assign(toCopy : MeshData)\n\t{\n\t\tterrainPath = toCopy.terrainPath;\n\t\tmaterial = toCopy.material;\n\t\twidth = toCopy.width;\n\t\theight = toCopy.height; \n\t\tdist = toCopy.dist;\n\t\t\n\t\troundStep = toCopy.roundStep;\n\t\tantialiasingLevel = toCopy.antialiasingLevel;\n\t\tsteepness = toCopy.steepness;\n\t lavaElevation = toCopy.lavaElevation;\n\t\tautoDist = toCopy.autoDist;\t\n\t\tisConfigured = toCopy.isConfigured;\n\t}", "SaveAndReimport() {}", "resetSavedData () {\n this.objects = {}\n\n this.electData = {\n ComponentParts: [],\n ComponentToParts: [],\n PartToPart: [],\n PartToPartNames: [],\n need: {},\n pass: {}\n }\n\n this.gridSize = 100\n this.data.routing_data = []\n this.nets = []\n this.data.assets = []\n this.data.compSize = [20,20]\n }", "saveOriginalState() {\n\n\t\tconst binding = this.binding;\n\n\t\tconst buffer = this.buffer,\n\t\t\tstride = this.valueSize,\n\n\t\t\toriginalValueOffset = stride * this._origIndex;\n\n\t\tbinding.getValue( buffer, originalValueOffset );\n\n\t\t// accu[0..1] := orig -- initially detect changes against the original\n\t\tfor ( let i = stride, e = originalValueOffset; i !== e; ++ i ) {\n\n\t\t\tbuffer[ i ] = buffer[ originalValueOffset + ( i % stride ) ];\n\n\t\t}\n\n\t\t// Add to identity for additive\n\t\tthis._setIdentity();\n\n\t\tthis.cumulativeWeight = 0;\n\t\tthis.cumulativeWeightAdditive = 0;\n\n\t}", "setData(data) {\n // Handle situation where this is clearing existing data, by ensuring the change event is\n // emitted.\n const forceEmit = (Object.keys(this._cachedData).length > 0);\n this._cachedData = {};\n this.add(data, forceEmit);\n }", "async save() {\n // Check if anything has changed or stop here.\n const originData = await loadDataObject(this.dataKey)\n\n if (this.data === originData) {\n console.log('Nothing changed here for ' + this.dataKey)\n return\n }\n\n // Convert the modified data for the backend.\n const convertedData = await convertNewData(\n this.dataKey,\n JSON.parse(JSON.stringify(this.data))\n )\n\n // Update the data on the backend.\n try {\n await ApiConnector.update(this.dataKey, convertedData)\n } catch (err) {\n // TODO: Show the error to the user.\n console.log('Message: ' + err.message)\n }\n }", "function assign(newStats) {\n\n // Flip iAmRed.\n newStats.iAmRed = !newStats.iAmRed;\n\n // Swap names.\n var temp = newStats.myName;\n newStats.myName = newStats.theirName;\n newStats.theirName = temp;\n\n // Swap readinesses.\n temp = newStats.iAmReady;\n newStats.iAmReady = newStats.theyAreReady;\n newStats.theyAreReady = temp;\n\n // Swap desires to rematch.\n temp = newStats.iWantMore;\n newStats.iWantMore = newStats.theyWantMore;\n newStats.theyWantMore = temp;\n\n // Update our stats.\n Object.assign(stats, newStats);\n }", "assign(A, a) {\n this.assignment[A] = a;\n }", "setData(data){\n this.hasSavedValues = false,\n this.publicoAlvoSim= data.publicoAlvoSim,\n this.publicoAlvoNao= data.publicoAlvoNao,\n this.publicoAlvoALVA= data.publicoAlvoNao,\n this.XER= data.XER,\n this.COP= data.COP,\n this.listaPrefixos= data.listaPrefixos,\n this.operacaoNaoVinculada= data.operacaoNaoVinculada,\n this.operacaoVinculada= data.operacaoVinculada,\n this.operacaoVinculadaEmOutroNPJ= data.operacaoVinculadaEmOutroNPJ,\n this.acordoRegPortalSim= data.acordoRegPortalSim,\n this.acordoRegPortalNao= data.acordoRegPortalNao,\n //this.acordoRegPortalDuplicados= data.acordoRegPortalDuplicados,\n this.totaisEstoque = data.totaisEstoque,\n this.totaisFluxo = data.totaisFluxo,\n this.estoqueNumber= data.estoqueNumber,\n this.fluxoNumber= data.fluxoNumber,\n this.duplicadoSimNao = data.duplicadoSimNao,\n this.analisadoSimNao = data.analisadoSimNao\n }", "function changeData() {\n elem.name = userData.name;\n elem.star = userData.star;\n elem.time = userData.time;\n elem.moves = userData.moves;\n}", "savePosition() {\n this.savedX = this.x;\n this.savedY = this.y;\n }", "assign(name, value) {\r\n\t\t\t\tthis.add(name, {\r\n\t\t\t\t\tvalue,\r\n\t\t\t\t\tassigned: true\r\n\t\t\t\t}, true);\r\n\t\t\t\treturn this.hasAssignments = true;\r\n\t\t\t}", "safeReplaceDataset(oldDataset, newDataset) {\n oldDataset.data = newDataset.data\n oldDataset.labels = newDataset.labels\n }", "function reset() {\n save(null);\n }", "updateExchange(exchangeId, data) {\n this.findExchangeById(exchangeId)\n .then((exchange) => {\n /* diff the data with current exchange data */\n exchange.strategy = data.strategy;\n exchange.markets = Object.assign({}, data.markets);\n })\n .catch((err) => console.log(err))\n }", "function AssignmentOperator(){\nequalAssOP();\naddAssigOp();\nsubAssigOp();\n}", "updateWithoutSave(newValues) {\n // let newLanguageData = Object.assign({}, this.state.languageData, newValues)\n this.setState({\n // languageData: newLanguageData\n experiences: newValues\n })\n }", "_save() {\n\t\tconst version = this._editor.model.document.version;\n\n\t\t// Operation may not result in a model change, so the document's version can be the same.\n\t\tif ( version === this._lastDocumentVersion ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis._data = this._getData();\n\t\t\tthis._lastDocumentVersion = version;\n\t\t} catch ( err ) {\n\t\t\tconsole.error(\n\t\t\t\terr,\n\t\t\t\t'An error happened during restoring editor data. ' +\n\t\t\t\t'Editor will be restored from the previously saved data.'\n\t\t\t);\n\t\t}\n\t}", "save() {\n this.tf.push(lastElement(this.tf).clone());\n this.context.save();\n }", "AppendAssignment(assignmentID) {\n this.assignments.push(assignmentID);\n }", "resetData() {\n // Start out with no souls\n this.souls = 0;\n // Start at stage 0\n this.stage = 0;\n // Starting upgrade levels\n this.levels = {\n sword: 0,\n thunder: 0,\n fire: 0\n }\n // Save the reset values\n this.saveData();\n }", "set(value) {\n let self = this\n\n // go through every item attempting to be saved and compare it to our currently\n // populated model. Only replace those items that need replacing rather than\n // the entire object\n function recurse(initial, update) {\n for (var prop in initial) {\n if ({}.hasOwnProperty.call(initial, prop) &&\n (update !== null && {}.hasOwnProperty.call(update, prop))\n ) {\n if (typeof initial[prop] === 'object' &&\n (\n initial[prop] !== null &&\n initial[prop].constructor !== Array\n ) &&\n (\n typeof update[prop] === 'object' &&\n update[prop] !== null\n )\n ) {\n recurse(initial[prop], update[prop])\n } else if (update[prop] === null) {\n initial[prop] = self.baseModel[prop]\n } else {\n initial[prop] = update[prop]\n }\n }\n }\n\n return initial\n }\n\n this.model = recurse(this.model, value)\n\n // save to local storage\n this.saveStorage()\n }", "function saveData() {\n\tstate.save();\n}", "function justSave() {\n interpolateAndSave(false);\n }", "function saveCopyCurrentOutcomeMeasure(currentOutcomeMeasure) {\n vm.copyOM = {};\n angular.copy(currentOutcomeMeasure, vm.copyOM);\n }", "function updateAssignmentTimeCardData(id, data) {\n getAssignmentMapForID(id).setKeyProp('timeCardData', getTimeModelObj().date, data);\n }", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "save () { if (this.name) saveValue(this.name, this.items); }", "function genAssignmentCode(value,assignment){var res=parseModel(value);if(res.key===null){return value+\"=\"+assignment;}else{return\"$set(\"+res.exp+\", \"+res.key+\", \"+assignment+\")\";}}", "function genAssignmentCode(value,assignment){var res=parseModel(value);if(res.key===null){return value+\"=\"+assignment;}else{return\"$set(\"+res.exp+\", \"+res.key+\", \"+assignment+\")\";}}", "[DATA_TABLE_SET_MUTATION] (state, data) {\n state.data = data;\n }", "function updateAssignment(req, res) {\n Assignment.findByIdAndUpdate(req.body._id, req.body, { new: true }, (err, assignment) => {\n if (err) {\n console.log(err);\n res.send(err)\n } else {\n res.json({ message: 'updated' })\n }\n\n // console.log('updated ', assignment)\n });\n\n}", "function setData(loc, val) {\n if (storage) {\n storage.setItem(loc, JSON.stringify(val));\n }\n }", "function ParseJsonToAssignment() {\n if (courseAssignmentData != undefined) {\n courseAssignmentData.forEach((item) => {\n Assignments[item.id] = new Assignment(\n item.id,\n item.name,\n item.description,\n item.points_possible,\n item.html_url\n );\n });\n }\n}", "storeForEval(toBeEvaluated) {\n this.internalContext.assign(Const_1.UPDATE_ELEMS).value.push(toBeEvaluated);\n }", "update (data) {\n for (let key in data) {\n if (this.hasOwnProperty(key)) { // Can only update already defined properties\n this[key] = data[key];\n }\n }\n }", "updateRecord(record) {\n const {\n values\n } = this; // Clean resourceId / resources out of values when using assignment store, it will handle the assignment\n\n if (this.scheduler.assignmentStore) {\n delete values.resource;\n }\n\n record.set(values);\n }", "updateAssignmentResourceIds() {\n this.assigned.forEach(assignment => {\n assignment.resourceId = this.id;\n });\n }", "function save_vals(d)\n{\n this._current = d;\n}", "save(){\n let coords = this.coords.slice(0).map(row => row.slice(0)); // shadow cloning array of arrays.\n super.save({\n coords,\n x:this.x,\n y:this.y\n });\n }", "function resetPomoData() {\n currentPomoID = INVALID_POMOID;\n pomoData = [];\n updateTable();\n savePomoData();\n}", "equalScore(){\n let permaAbility = JSON.stringify(this.abilityScore)\n let tempAbility = JSON.parse(permaAbility)\n let permaModifier = JSON.stringify(this.abilityModifier)\n let tempModifier = JSON.parse(permaModifier)\n this.temporaryScore = tempAbility\n this.temporaryModifier = tempModifier\n }", "function populatePointStorageObj(graph) {\n for (const node of graph.nodes) {\n if (!(node.assessment in oldGraphPoints)) {\n oldGraphPoints[node.assessment] = {}\n }\n oldGraphPoints[node.assessment][node.name] =\n {\n \"y0\": node.y0,\n \"y1\": node.y1,\n \"rectHeight\": node.rectHeight,\n \"value\": node.value\n }\n }\n}", "function updata() {\n\t\t\tlastData.update(point);\n\t\t}", "function setDirtyData(dirty) { \n\tdirtyData = dirty;\n}", "_resetData () {\n this.data = {}\n }", "function updateDataset(element, oldDataset, newDataset) {\r\n for (var name_3 in oldDataset) {\r\n if (!(name_3 in newDataset)) {\r\n element.removeAttribute(\"data-\" + name_3);\r\n }\r\n }\r\n for (var name_4 in newDataset) {\r\n if (oldDataset[name_4] !== newDataset[name_4]) {\r\n element.setAttribute(\"data-\" + name_4, newDataset[name_4]);\r\n }\r\n }\r\n }", "function save (data) {\n data.save('brushed', brushed)\n}", "async save(){\n let temp = this.state;\n delete temp.planetoids;\n delete temp.nodes;\n //temp.inhabitants;\n fs.writeFileSync(`../maps/${this.state.parent_ID.substring(0,this.state.parent_ID.indexOf(':'))}/${this.state.id}.json`, JSON.stringify(temp), (err) =>{if(err) throw err;});\n }", "saveCopy(){\n\t\tthis.savableCopy = FileManager.jsonWriter(this.state.toShowText);\n\t}", "on_assign_data() {\n }", "_mergeWithCurrentState(change) {\n return assign(this.props.data, change);\n }", "updateStore() {\n const dataToStore = {\n formulas: this.formulas,\n lastObjectId: this.lastObjectId,\n };\n localStorage.setItem(LS_FORMULAS_KEY, JSON.stringify(dataToStore));\n }", "assign(){\n index = this.index; \n PlayerIndex = this.playerIndex;\n block = this.block;\n turn = this.turn;\n }", "function updateAssignmentGroups() {\n let names = document.querySelectorAll('div[data-fields=assignmentGroups] input[data-for=name]')\n let sys = document.querySelectorAll('div[data-fields=assignmentGroups] input[data-for=sys]')\n let groups = {}\n for (let assignmentGroup in names) {\n if (names[assignmentGroup].value) {\n groups[names[assignmentGroup].value] = sys[assignmentGroup].value\n } else {\n continue;\n }\n\n }\n chrome.storage.local.set({'assignmentGroups': groups})\n}", "function getEditAssignmentData() {\r\n //Assignment Data\r\n ///Object to store the assignment data\r\n var assignmentData = {};\r\n\r\n assignmentData.ID = getSelectedID();\r\n\r\n ///The name of the assignment\r\n assignmentData.name = $(\"#edit-assignment-name\").val();\r\n\r\n ///The description of the assignment - not called description in variables as it might be a key word\r\n assignmentData.info = $(\"#edit-assignment-description\").val();\r\n\r\n ///The deadline of the assignment\r\n assignmentData.deadline = getEditDeadline();\r\n\r\n return assignmentData;\r\n}", "set(data) {\n this.internalData = data;\n }", "function updatingData1() {\n let wafersPrice = store2['inventory prices']['Mint Wafers'];\n wafersPrice = 1.99;\n return false;\n\n /* The price in the store2 data does not change because store2 is an object type.\n Objects are passed by reference. This means that reassigning the original \n wafersPrice to a new price only only changes the reference pointer to a new price without \n altering the original data.\n */\n}", "function saveGeneral()\r\n{\r\n\tupdateEntp(arrEntp[gArrayIndex]); \r\n}", "function setIdToLocalStorage(id) {\r\n localStorage.setItem(\"assignmentToUpdate\", id);\r\n const assignmentArray = JSON.parse(localStorage.getItem('assignmentArray'));\r\n const ourDesiredAssignment = assignmentArray.filter(item => item.id === Number(id));\r\n if (ourDesiredAssignment) {\r\n document.getElementById('updateName').value = ourDesiredAssignment[0].name;\r\n document.getElementById('updateModule').value = ourDesiredAssignment[0].module;\r\n document.getElementById('updateDueDate').value = ourDesiredAssignment[0].duedate;\r\n document.getElementById('updateNotes').value = ourDesiredAssignment[0].notes;\r\n document.getElementById('updateResearch').value = ourDesiredAssignment[0].research;\r\n document.getElementById('updateDev').value = ourDesiredAssignment[0].development;\r\n document.getElementById('updateReport').value = ourDesiredAssignment[0].report;\r\n localStorage.setItem('id', id);\r\n };\r\n}", "save() {}", "function setData(profile){\n \tgameData.data.player.profile.name = profile.name;\n \tgameData.data.player.profile.surname = profile.surname;\n \tgameData.data.player.profile.age = profile.age;\n \tgameData.data.player.profile.sex = profile.sex; \t\n \tgameData.data.player.profile.mobile = profile.mobile;\n \tgameData.saveLocal();\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setData\");\n \tsetDataFromLocalStorage(); \t\n }", "function updatingData1() {\n let mintWaferPrice = store2['inventory prices']['Mint Wafers'];\n mintWaferPrice = 2.09;\n return false;\n //No, the price in the data for store2 doesn't change because we created a new variable \"mintWaferPrice\" and initially set it equal to the price of Mint Wafers. When we assign a new value to that variable, it doesn't effect the original price of Mint Wafers stored in the data for store2.\n}", "setData (callback) {\n\t\tthis.newCommitHash = this.repoFactory.randomCommitHash();\t// a new commit hash for the adjusted locations\n\t\tthis.data = {\n\t\t\tteamId: this.team.id,\n\t\t\tstreamId: this.repoStreams[0].id,\n\t\t\tcommitHash: this.newCommitHash,\n\t\t\tlocations: this.adjustedMarkerLocations\n\t\t};\n\t\tcallback();\n\t}", "assign(target, data, omitFields = [] ) {\n let changes = this._copyFields(target, data, omitFields);\n\n if (data.elements !== undefined) {\n if (target.elements !== undefined) {\n changes['elements'] = [...target.elements]\n }\n target.elements = [];\n for (let index = 0; index < data.elements.length; index++) {\n target.elements.push(typeof data.elements[index] !== 'object' ? {id: data.elements[index]} : data.elements[index])\n }\n }\n if (!target.title && Object.keys(changes).length) {\n target.title = '(no title)';\n changes.title = ''\n }\n\n if (Object.keys(changes).length) {\n if (target['creationData'] === undefined) {\n target['creationDate'] = Date.now()\n }\n target['modifiedDate'] = Date.now();\n }\n return target;\n }", "function deepObjectAssign() {\n var merged = deepObjectAssignNonentry.apply(void 0, arguments);\n stripDelete(merged);\n return merged;\n}", "assign(data = this.array.data) {\n mapList(assignMap, data, this.array.data);\n\n return this;\n }", "updateRecord(record) {\n const { values } = this;\n\n // Clean resourceId / resources out of values when using assignment store, it will handle the assignment\n if (this.scheduler.assignmentStore) {\n delete values.resource;\n }\n\n record.set(values);\n }", "set assignmentStore(store) {\n throwIfNotTheSameStore(this.assignmentStore, store);\n }", "save() {\n this._mutateModel();\n\n this._super(...arguments);\n }", "function rewriteHighscores() {\n var n = [\"Computer 1\",\"Computer 2\",\"Computer 3\",\"Computer 4\",\"Computer 5\"];\n var s = [22.7, 22.8, 22.9, 23.0, 23.1];\n var old_n = JSON.parse(localStorage.getItem(\"names\"));\n var old_s = JSON.parse(localStorage.getItem(\"scores\"));\n old_n = n;\n old_s = s;\n localStorage.setItem(\"names\", JSON.stringify(old_n));\n localStorage.setItem(\"scores\", JSON.stringify(old_s));\n }", "function saveAfterLoad () {\n\t\tif (moduleData) {\n\t\t\tmodule.set(moduleData);\n\t\t\tmoduleData = null;\n\n\t\t\tmodule._remains_ = module.dependencies.length;\n\t\t\tmodule.status = LOADED;\n\t\t\tmodule.emit('loaded', this);\n\t\t\tmodule.loadDependencies();\n\t\t} \n\t}", "function setAssignNumber(num) {\n assignNumber = num;\n}", "$assign( dest, value ) {\n if( arguments.length === 1 ) {\n value = dest;\n dest = this.$data;\n }\n\n for( const key of Object.keys( value ) ) {\n this.$set( dest, key, value[ key ] );\n }\n }", "reset()\n {\n Object.assign(this,this.__.originalData);\n this.errors.clear();\n }", "save() {\n this._requireSave = true;\n }", "parseAssignStatement () {\n return this.callNow(this.parseAssign, this.recordAssignStatement)\n }", "function UnassignedAssignment() {\n this.param = new canon.Parameter({\n name: '__unassigned',\n type: 'string'\n });\n this.paramIndex = -1;\n this.onAssignmentChange = util.createEvent('UnassignedAssignment.onAssignmentChange');\n\n this.setBlank();\n}", "function updateAssignment(req, res) {\n req.body.dateUpdate = new Date();\n Assignment.findByIdAndUpdate(\n req.body._id,\n req.body,\n { new: true },\n (err, assignment) => {\n if (err) {\n console.log(err);\n res.send(err);\n } else {\n console.log(req.body._id, \"updated\");\n res.json({ message: \"updated\" });\n }\n\n // console.log('updated ', assignment)\n }\n );\n}", "processRecord(eventRecord, isDataset = false) {\n super.processRecord(eventRecord, isDataset);\n const resourceId = eventRecord.get('resourceId');\n\n if (resourceId != null) {\n const me = this,\n {\n assignmentStore\n } = me,\n existingRecord = me.getById(eventRecord.id),\n isReplacing = existingRecord && existingRecord !== eventRecord && !isDataset; // Replacing an existing event, repoint the resource of its assignment\n // (already repointed to the new event by engine in EventStoreMixin)\n\n if (isReplacing) {\n // Have to look assignment up on store, removed by engine in super call above\n const assignment = assignmentStore.find(e => e.eventId === eventRecord.id);\n\n if (assignment) {\n assignment.resource = resourceId;\n me.reassignedFromReplace = true;\n }\n } // AssignmentStore found, add an assignment to it if this is no a dataset operation\n else if (assignmentStore && !isDataset && !me.assignmentsAutoAddSuspended) {\n // Cannot use `event.assign(resourceId)` since event is not part of store yet\n // Using a bit shorter generated id to not look so ugly in DOM\n assignmentStore.add({\n id: assignmentStore.modelClass.generateId(''),\n resourceId,\n eventId: eventRecord.id\n });\n } // No AssignmentStore assigned yet, need to process when that happens. Or if it is a dataset operation,\n // processing will happen at the end of it to not add individual assignment (bad for performance)\n else {\n me.$processResourceIds = true;\n } // Flag that we have been loaded using resourceId, checked by CrudManager to exclude the internal\n // AssignmentStore from sync\n\n me.usesSingleAssignment = true;\n }\n\n return eventRecord;\n }", "assignment_statement(lhsToken) {\n const startToken = this.currentToken;\n\n try {\n let lhs = new AST.VarNode(lhsToken);\n let opToken = this.currentToken;\n this.eat(Lexer.TokenTypes.ASSIGN); // Assume that caller checks next token is ASSIGN\n let rhs = this.expr();\n return new AST.AssignmentNode(lhs, opToken, rhs);\n } catch (e) {\n throw new ParserException('Error processing ASSIGNMENT_STATMENT', startToken, e);\n }\n }", "_updateGameOnly(data, newValues) {\n if (newValues) {\n data = objectAssign({}, data, newValues)\n }\n const percent = (data.actual)? Math.round(calculatePercent(data.promise, data.actual)) : 0\n if (percent != data.percent) {\n const generation = (data._gen || 0) + 1\n const points = getPoints(data.key, percent)\n return objectAssign({}, data, {percent, points, _gen: generation})\n } else {\n return data\n }\n }", "function handleAssignmentExp(pred) {\n var _convertedValue = convertValueToInputVars(pred.value, true, false);\n var _result = parseInt(convertValueToInputVars(pred.value, true, true));\n\n if (isInput(pred.name)) {\n pred.value = _result;\n symbolize.push(pred);\n }\n\n if (isInputArray(pred.name)) {\n setInputArrayValue(pred.name, _result);\n symbolize.push(pred);\n } else {\n _convertedValue = removeZeros(_convertedValue);\n var_table[pred.name] = { value: _convertedValue, result: _result };\n }\n}", "parseAssignStatement() {\n return this.callNow(this.parseAssign, this.recordAssignStatement);\n }", "function alterObject (y) {\n // This works because we are changing the data value that the pointer refers to\n y.newField = \"I have been set in function\"\n y.existingField = \"I have been set in function\"\n\n // This won't work because we're overwriting the pointer\n y = {somethingWayDifferent: \"New completely\"}\n}", "set data(newValue) {\n privateDataMap.get(this).update(this.path, newValue);\n }", "@action changeCategoryData(data) {\n this.editingCategoryData = {\n ...this.editingCategoryData,\n ...data,\n };\n }", "_revertToOriginal() {\n this._storage = {}\n this._length = 0\n this._head = 0\n }", "saveData() {\n if (this.s.unavailable()) {\n return;\n }\n\n for (const val of this.dispField.items) {\n this.s.set(val, this.dispField.checked(val));\n }\n\n this.s.set(\"unit\", this.unitField.get());\n this.s.set(\"format\", this.formatField.get());\n this.s.set(\"sort\", this.sortableField.toArray());\n }", "function updateData() {\n\t\txyData = pruneData(xyData);\n\t\tllmseFit = xyHelper.llmse(xyData, xPowers);\n\t\tupdate();\n\t}" ]
[ "0.6717452", "0.5806337", "0.56792283", "0.56267625", "0.55997545", "0.5585929", "0.5539014", "0.552649", "0.5477935", "0.54568726", "0.54324114", "0.5413249", "0.5409316", "0.5384512", "0.5361604", "0.5323818", "0.53165394", "0.53124917", "0.5311528", "0.5283935", "0.5279235", "0.52778524", "0.52669096", "0.5263803", "0.5263347", "0.5259885", "0.52519864", "0.5239791", "0.52165866", "0.5214375", "0.5207366", "0.5198613", "0.5197099", "0.5196667", "0.51880413", "0.5182593", "0.5176831", "0.5170648", "0.51622903", "0.51590025", "0.51590025", "0.5148465", "0.5144309", "0.51391244", "0.5136019", "0.5088447", "0.50880635", "0.50861704", "0.5083285", "0.5082089", "0.5081501", "0.50767803", "0.50711405", "0.50366974", "0.50310165", "0.5021753", "0.50207454", "0.50177276", "0.50121653", "0.5010515", "0.5005808", "0.5002085", "0.50020105", "0.50013936", "0.4995229", "0.49933288", "0.49893743", "0.4979657", "0.4976268", "0.49758005", "0.4969148", "0.49679852", "0.49637008", "0.49622694", "0.49543408", "0.49494737", "0.49463686", "0.49451116", "0.49433532", "0.49421176", "0.4941873", "0.49401146", "0.49337533", "0.4927438", "0.49213386", "0.49156848", "0.491417", "0.490503", "0.49034226", "0.48999634", "0.4899069", "0.4899034", "0.4892098", "0.48867023", "0.4886602", "0.48712084", "0.4870477", "0.4870238", "0.48647994", "0.48644975", "0.48642093" ]
0.0
-1
Ensures a rating is inputted before submitting it
submitRating() { if (this.state.rating === 0) { Alert.alert("No Rating", strings.AreYouSureYouWantToProceed, [ { text: "Yes", style: "cancel", onPress: () => { if (this.props.navigation.state.params.newAssignment === true) { this.setState({ isLoading: true }); this.doSubmitRating(); } else { this.overwriteOldEvaluation(); } } }, { text: "No", style: "cancel" } ]); } else { this.setState({ isLoading: true }); if (this.props.navigation.state.params.newAssignment === true) { this.doSubmitRating(); } else { this.overwriteOldEvaluation(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleRating(rating) {\n this.setState(prevState => {\n return { form: { ...prevState.form, invalid: false, rating } }\n })\n\n // anticipate the need for a dispute per Josh\n if (rating < 3) {\n this.setState({ problemInferred: true })\n\n this.toggleModal('confirmation')\n }\n }", "function validateRating(){\n try {\n let rating = parseInt(ratingInput.value);\n if(typeof rating !== 'number' || rating < 1 || rating > 10){\n return false;\n }\n return true;\n } catch(e) {\n console.log(e);\n return false;\n }\n} // end of validateRating()", "function checkRating() {\n if (!rating) {\n feedback.innerHTML = \"Please rate your experience\"\n $(feedback).css({\n color: \"red\"\n });\n $(feedback).show(0);\n $(feedback).fadeOut(2500);\n noRating = true;\n console.log(\"Review not submitted - no rating.\");\n } else {\n noRating = false;\n }\n}", "function ratingsValidate(ratingsForm){\n\nvar validationVerified=true;\nvar errorMessage=\"\";\n\nif (ratingsForm.name.value==\"\")\n{\nerrorMessage+=\"rate level not filled!\\n\";\nvalidationVerified=false;\n}\nif (ratingsForm.rating.selectedIndex==0)\n{\nerrorMessage+=\"rate level not selected!\\n\";\nvalidationVerified=false;\n}\nif(!validationVerified)\n{\nalert(errorMessage);\n}\nreturn validationVerified;\n}", "function validateRating(rating){\n return rating >= 1 && rating <= 100;\n}", "function setRating(rating) {\n $('.rating-button').removeClass(ICON_CLICKED);\n $('.rating-reasons').hide();\n $('#submit-instance').show();\n $('#comment-container').show();\n\n localStorage.setItem(\"instance-rating\", rating);\n\n if (rating == BAD_QUALITY) {\n $('#bad-reasons').show();\n $('#rating-red').addClass(ICON_CLICKED);\n } else if (rating == OK_QUALITY) {\n $('#ok-reasons').show();\n $('#rating-yellow').addClass(ICON_CLICKED);\n } else if (rating == GOOD_QUALITY) {\n $('#rating-green').addClass(ICON_CLICKED);\n }\n}", "function ratingsValidate(ratingsForm){\n\nvar validationVerified=true;\nvar errorMessage=\"\";\n\nif (ratingsForm.name.value==\"\")\n{\nerrorMessage+=\"Bạn chưa điền mức độ đánh giá!\\n\";\nvalidationVerified=false;\n}\nif (ratingsForm.rating.selectedIndex==0)\n{\nerrorMessage+=\"Bạn chưa chọn mức độ đánh giá!\\n\";\nvalidationVerified=false;\n}\nif(!validationVerified)\n{\nalert(errorMessage);\n}\nreturn validationVerified;\n}", "function commentSubmit(form)\r\n{\r\n var ratingValue = document.getElementById('commentBoxRating');\r\n var rating = document.getElementsByClassName('rating')[0];\r\n\tvar comment = document.getElementById('commentArea');\r\n\r\n\tif (ratingValue.value == null || comment.value == \"\") {\r\n\t\talert('Rating or comment cannot be empty');\r\n\t\treturn false;\r\n\t}\r\n \r\n rating.value = ratingValue.value;\r\n \r\n // Remove these elements from form so that the data from them won't be sent\r\n form.removeChild(ratingValue);\r\n \r\n return true;\r\n}", "function postAttraction() {\n if (document.getElementById(\"attractionsLimit\").value === \"\") {\n document.getElementById(\"attractionsLimit\").value = \"5\"\n }\n if (document.getElementById(\"attractionsRating\").value === \"\") {\n document.getElementById(\"attractionsRating\").value = \"3.0\"\n }\n document.getElementById(\"adultAttrNum\").value = attrFormAdults;\n document.getElementById(\"optionBestHotel\").value = bestHotel;\n document.getElementById(\"staySearching\").value = attractionsWithStaySearch;\n}", "function handleReviewerFormSubmit(event) {\n event.preventDefault();\n // Don't do anything if the name fields hasn't been filled out\n if (\n !nameInput \n .val()\n .trim()\n .trim()\n ) {\n return;\n }\n // Calling the upsertReviewer function and passing in the value of the name input\n upsertReviewer({\n name: nameInput.val().trim()\n });\n }", "function sendRate(sel){\n\titem_rating = sel.id[sel.id.length - 1];\n\titem = sel.id.substr(0, sel.id.length - 2);\n\t\n\t$(\"#rating_\" + item).val(item_rating);\n\t// alert(\"hey\");\n\t// $(\"#submit_review\").css('display', 'block');\n\t$(\"#rating_form_\" + item).submit();\n\t// alert(\"#solution_rating_form_\" + sol);\n\t// alert(\"Your rating was: \"+sel.title);\n}", "set addRating (rating) {\n if (typeof rating === 'number' && rating >= 1 && rating <= 10) {\n this.ratings.push(rating)\n } else {console.log(\"please enter a valid number\")}\n }", "addRating(input) {\n // to make sure input is a number between 1 and 5 including\n if (typeof (input) == 'number' && input > 0 && input < 6) {\n this.ratings.push(input);\n } else {\n console.log('Error! Pick a number from 1 to 5.')\n }\n }", "function handleReviewFormSubmit(event) {\n event.preventDefault();\n \n // Don't do anything if the name fields hasn't been filled out\n if (!movieSelect.val().trim().trim()) {\n return;\n }\n\n processReviewForm();\n\n }", "function handleRatingChange() {\n var newReviewRating = $(this).val();\n getReviews(newReviewRating);\n }", "function checkForm() {\n var d = document.getElementById('mainForm'); // just a shortcut\n var errors = false;\n var errorMsg = \"\";\n// basic check required fields\n if (d.name.value == \"\") {\n errorMsg += \"Please enter your name.\\n\";\n errors = true;\n }\n // check if one of the radio buttons for site rating is selected\n var checkedSiteRating = false;\n for (var i = 0; i < 3; i++) {\n if (d.siterating[i].checked)\n checkedSiteRating = true;\n }\n if (!checkedSiteRating) {\n errorMsg += \"Please select a site rating.\\n\";\n errors = true;\n }\n// if errors exist, popup error message \n if (errors)\n alert(errorMsg);\n// return true (submit form) or false (don't submit form) depending on errors\n return !errors;\n}", "rating(event) {\n if (event.target.name === \"feedbackRating\") {\n this.feedbackRating = event.target.value;\n }\n }", "function change_rating(to_rating_num, to_rating_text)\n{\n\t\n\tvar rating_element = document.getElementById('reviewer_rating');\n\trating_element.setAttribute(\"class\", \"rating \" + to_rating_text + \"star\");\n\t\n\t// set hidden field value for rating\n\tvar rating_value = document.getElementById('review_rating');\n\trating_value.value = to_rating_num;\n\t\n\tvar submit_button = document.getElementById('review_submit');\n\tsubmit_button.disabled = false;\n\t\n}", "function attachHandlerSubmitReview() {\n $(\".post_submit\").on(\"click\", function(e) {\n var attractionIdReview = $($(this)).data('attraction');\n var rating = $(\".rating[data-val='\" + attractionIdReview + \"']\").val();\n if (rating <= 5 && localStorage.userId) {\n var review = {\n comments: $(\".comments[data-val='\" + attractionIdReview + \"']\").val(),\n rating: $(\".rating[data-val='\" + attractionIdReview + \"']\").val(),\n tourist_attraction_id: attractionIdReview,\n user_id: localStorage.userId\n };\n //make an ajax request to submit the review\n $.ajax({\n type: 'POST',\n url: \"https://salty-fortress-4270.herokuapp.com/reviews/\" + attractionIdReview,\n header: localStorage.token,\n data: {\n review: review\n }\n }).done(function() {\n alert(\"success!\");\n }).fail(function() {\n alert(\"please login\");\n });\n } else {\n if (rating <= 5) {\n alert(\"Please log in\");\n } else {\n alert(\"Enter a valid rating between 1 to 5\"); \n }\n };\n });\n }", "function submit() {\n if (currentChoice == undefined) {\n feedback.innerText = 'Please select one of the bags!';\n return;\n }\n if (nReveals < maxReveals) {\n revealBadChoice();\n } else {\n checkAnswer();\n }\n}", "function handleMoodFormSubmit(event) {\n event.preventDefault();\n // Don't do anything if the name fields hasn't been filled out\n if (!red || !pink || !orange || !yellow || !green || !blue || !purple || !brown || !white || !grey) {\n return;\n }\n // Calling the upsertAuthor function and passing in the value of the name input\n upsertMood({\n name: red;\n name: pink;\n name: orange;\n name: yellow;\n name: green;\n name: blue;\n name: purple;\n name: brown;\n name: white;\n name: grey\n }", "function setInputValue(star, value, ev) {\n if (isClickEvent(ev)) {\n ratingName = star.parent().parent().parent().attr('class');\n console.log(ratingName + \" : \" + value);\n $('#new_review #review_' + ratingName + '_rating').val(value);\n }\n } // setInputValue", "setrating() \n {\n this.rating = prompt(\"What is your rating from 0-10?\"); // whatever is passed into the parameter CHANGES the default parameter we set in the beginning\n }", "function validateForm(e) {\n e.preventDefault();\n let rateValue = ratingSelected;\n let satValue = document.forms[\"surveyForm\"][\"satisfaction\"].value;\n if (rateValue == \"\" || rateValue == null) {\n alert(\"Provide rating for the survey\");\n return false;\n } else if (satValue == \"\") {\n alert(\n \"Tell us how satisfied you are with this survey, select option accordingly\"\n );\n return false;\n } else if (!isValidDescription()) {\n alert(\"Select at least one description for our product\");\n return false;\n } else {\n //Hide the container and show success alert div\n let containerDiv = document.getElementById(\"container\");\n setTimeout(function() {}, 500);\n containerDiv.style.display = \"none\";\n let sucessDiv = document.getElementById(\"success\");\n sucessDiv.classList.remove(\"success-hide\");\n sucessDiv.classList.add(\"success-alert\");\n return true;\n }\n}", "function setTrackRating() {\n\t\t// check that a track is selected\n\t\tif (!$(\"#trackName\").is(\":empty\")) {\n\t\t\t// grab user rating and send ajax request to update in DB\n\t\t\tvar rating = $(\"#trackRating\").val();\n\t\t\tvar trackURI = $(\"#trackName\").text();\n\t\t\t\n\t\t\t// create request\n\t\t\tvar request = {};\n\t\t\trequest[\"TrackURI\"] = trackURI;\n\t\t\trequest[\"rating\"] = rating;\n\t\t\t\n\t\t\tvar requestBuilder = new SpotifyRequestBuilder();\n\t\t\trequestBuilder.postRequest(common.setTrackRatingURL, onSetTrackRating, JSON.stringify(request));\n\t\t}\n\t}", "function setRating(rating) {\n var ir = new ItemRating(rating);\n if (rating.id == 0) {\n ir.$save()\n .then(function(data){\n rating.id = data.id;\n updateRatings(rating);\n })\n .catch(function (error) {\n rating.rate = 0;\n });\n } else {\n ir.$update({ id: rating.id })\n }\n }", "function postRating(obj,id,rating) { \n $.post('/codeCollection/books/phpFiles/submitRating.php',\n {\n id: id,\n rating: rating\n }, function(data){\n var ratingData = $.parseJSON(data);\n\n var newRating = ratingData.Rating;\n var newCount = ratingData.RatingCount;\n var avgRating = newRating/newCount;\n\n $(obj).parent().parent().next().children().text(newCount + \" ratings\");\n $(obj).parent().parent().parent().children().eq(5).text(newRating);\n $(obj).parent().parent().parent().children().eq(6).text(newCount);\n $(obj).parent().parent().children(\".avgRating\").text(avgRating.toFixed(1));\n\n });\n }", "function rating_form(id) {\n var rate_button = document.getElementById('rating_' + id);\n rate_button.style.display = \"none\";\n var current_form = document.getElementById('rating_form_' + id);\n current_form.style.display = \"inline\";\n submit_form(current_form.children[0]);\n}", "function handleSubmitForm(e) {\n e.preventDefault();\n let title = $('#title').val()\n let rating = $('#rating').val()\n if (title !== '') {\n addMovie(title, rating)\n $('#title').val('')\n $('#rating').val(0)\n addToLocStorage(title,rating)\n getMovies()\n }\n }", "function rateIt(me){\n\tif(!rated){\n\t\tdocument.getElementById(\"rateStatus\").innerHTML = document.getElementById(\"ratingSaved\").innerHTML + \" :: \"+me.title;\n\t\tpreSet = me;\n\t\trated=1;\n\t\tsendRate(me);\n\t\trating(me);\n\t}\n}", "function handleFormSubmit() {\n API.saveReviews(formObject)\n .then((data) => {\n console.log(data);\n console.log(\"I hit the route\");\n })\n .catch((err) => console.log(err));\n }", "function setRating() {\n // make sure rating doesn't go below 1 star\n if (mismatches > 7) return;\n\n // decrease rating every 3 mismatches\n if ( (mismatches % 3) === 0 ) {\n rating--;\n ratingLabel.removeChild(ratingLabel.lastElementChild);\n }\n}", "submitRating(){\r\n if(this.rating == -1){\r\n return;\r\n }\r\n let date = new Date();\r\n let day = date.getDate();\r\n let month = date.getMonth();\r\n if(day < 10){\r\n day = \"0\"+day;\r\n }\r\n if(month < 10){\r\n month = \"0\"+month;\r\n }\r\n let rated = {\r\n sign: this.sign,\r\n horoscope: this.horoscope,\r\n rating: this.rating,\r\n date: month+ \"-\" + day + \"-\" + date.getFullYear()\r\n }\r\n let ref = this.database.ref('ratings/' +this.sign);\r\n ref.push(rated);\r\n \r\n //reseting the rating slider\r\n this.rating = -1;\r\n //calling function to display the next horoscope\r\n this.nextHoroscope();\r\n }", "function handlerSubmit(e) {\n e.preventDefault();\n if (!comment || !rating) {\n dispatch(\n showMessageWithTimeout(\"danger\", true, \"Please fill out all the fields\")\n );\n } else if (token === null) {\n dispatch(\n showMessageWithTimeout(\n \"danger\",\n true,\n \"You need to log in to leave a comment\"\n )\n );\n } else if (user.isCandidate) {\n dispatch(\n showMessageWithTimeout(\n \"danger\",\n true,\n \"You can leave a review only if you are register as owner\"\n )\n );\n } else {\n dispatch(addReview(rating, comment, profile.id));\n }\n setRating(0);\n setComment(\"\");\n }", "function ajaxRating()\n{\n\tshow_ajax();\n\t$.post(\n\t\t$('#ratingF').attr('action'),\n\t\t{ rating: $('#rating').val() },\n\t\tfunction (new_contents) {\n\t\t\t$('#ratingF').parent().html(new_contents);\n\t\t\t$('#rating').sb();\n\t\t\thide_ajax();\n\t\t}\n\t);\n}", "saveRating(rating) {\n if (this.obj.rating.hasOwnProperty(\"local\")) {\n // existing rating modified\n this.obj.rating.sum -= this.obj.rating.local;\n this.obj.rating.sum += rating;\n this.obj.rating.local = rating;\n } else {\n // new rating added\n this.obj.rating.sum += rating;\n this.obj.rating.local = rating;\n this.obj.rating.votes += 1;\n }\n this.saveRecipeCallback(this.obj);\n }", "function submitIni(e) {\n e.preventDefault();\n\n var initial = userInitialEl.value.trim();\n //If the user does not input their name, return nothing\n if (initial === \"\") {\n return;\n }\n\n //Push the user's entered initials and score into scoreStorage array, then sets them back to empty and 0\n scoreStorage.push(scoreStorage.length + 1 + \". \" + initial + \" - \" + score + \" points\")\n userInitialEl.value = \"\";\n score = 0;\n\n storeScores();\n renderScoreStorage();\n viewHighScore();\n}", "function handleRatingUpdate(event, currentRating, addedRating, totalRatings){\n event.preventDefault();\n var newTotalRatings = totalRatings + 1\n var updatedRating = (currentRating * totalRatings) / newTotalRatings;\n \n\n var updatedRatingInfo = {\n rating : updatedRating,\n totalRatings : newTotalRatings\n }\n \n updateRating(updatedRatingInfo);\n \n }", "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "function adjustRating(rating) {\n document.getElementById(\"ratingvalue\").innerHTML = rating;\n}", "function valSubmitted() {\n myName = document.querySelector('.input--user__name').value;\n if(myName) {\n updateLocalStorage();\n removeRegistrationOption();\n enableBtn();\n }\n }", "function pickedRating() {\n $(\".rec-description *\").unbind(\"mouseenter mouseleave\");\n $(\".disable-submit\").removeClass(\"disable-submit\");\n let changedImgs = $(this).prevAll().addBack();\n for (let i = 0; i < changedImgs.length; i++) {\n changedImgs[i].src = \"../static/img/star-full.png\";\n if (i === changedImgs.length - 1) {\n $(\"#form-rating input\").val(i + 1);\n }\n }\n let sameImgs = $(this).nextAll();\n for (let j = 0; j < sameImgs.length; j++) {\n sameImgs[j].src = \"../static/img/star-empty.png\";\n }\n }", "function setAverageRating(ev) {\n var $averageRating = $('.rating-form #average');\n\n if (allFieldsRated()) {\n var average = getAverageStarRating(),\n $star = $averageRating.find('.stars .star').eq(Math.round(average) - 1),\n starIndex = $averageRating.find('.stars .star').index($star);\n\n $averageRating.removeClass('d-none');\n turnOffStars($star, starIndex, ev);\n turnOnStars($star, starIndex, ev);\n setInputValue($star, (Math.round(average) - 1), ev);\n }\n } // setOverallRating", "function validateAndSubmit() {\r\n var isValid = false;\r\n isValid = validateForm();\r\n if (isValid == true) {\r\n disableButtons() // make sure you can only press the submit button once\r\n document.getElementById('evaluationForm').submit();\r\n }\r\n }", "function searchSubmit(form)\r\n{\r\n var ratingSelector = document.getElementsByClassName(name_ratingSelector)[0];\r\n var suburbSelector = document.getElementsByClassName(name_suburbSelector)[0];\r\n var searchBar = document.getElementsByClassName(name_searchBar)[0];\r\n var type = document.getElementsByClassName(name_typeSelector)[0].value;\r\n\r\n if (type == 'suburb') {\r\n searchBar.value = suburbSelector.value;\r\n \r\n } else if (type == 'rating') {\r\n searchBar.value = ratingSelector.value;\r\n }\r\n\r\n\tif (searchBar.value == null || searchBar.value == \"\") {\r\n\t\talert('The value entered is invalid');\r\n\t\treturn false;\r\n\t}\r\n \r\n // Remove these elements from form so that the data from them won't be sent\r\n form.removeChild(ratingSelector);\r\n form.removeChild(suburbSelector);\r\n \r\n return true;\r\n}", "function askUser(){\n setRatingVars();\n checkEvents();\n if(outChooseVal == 1){\n console.log(chalk.cyan(\"\\nYour task has been completed. Select the a validator to continue...\\n\"));\n }\n if(canRate == true){\n giveRating();\n }\n else{\n if(prov == 0)\n inquirer.prompt([questions]).then(answers => {choiceMade(answers.whatToDo)});\n else\n inquirer.prompt([questions1]).then(answers => {choiceMade(answers.whatToDo1)});\n }\n}", "function clickedScore() {\n if (playerInitals.includes(nameSubmit.value)) {\n alert(\"That inital already exist\");\n } else if (\n nameSubmit.value === \"\" ||\n nameSubmit.value === null ||\n nameSubmit.value === undefined\n ) {\n alert(\"Please enter valid initals\");\n } else {\n playerInitals.push(nameSubmit.value);\n playerScores.push(score);\n setLS();\n matchHS();\n viewHS();\n }\n}", "function submitHighScore(event){\n event.preventDefault();\n var userText = userInput.value.trim();\n if (userText === \"\" || scoreEl.innerHTML == \"\") {\n return;\n }\n //prevents submission during the quiz as well as if the quiz has not been completed\n if( userScore != 0 && quizStarted == false){\n promptTextEl.textContent= \"Thanks for playing! Click the start button if you want to try again.\"\n userInitials = userText\n highScore.innerHTML = \"Current High Score: \" + userInitials + \" \" + userScore;\n }\n else{\n promptTextEl.textContent= \"You must finish the quiz to submit your score! Click the Start button if you have not already!\"\n }\n}", "function watchSubmit() {\n $(\"form\").submit(function (event) {\n event.preventDefault();\n let num = $(this).find(\"#inputISBN\").val();\n if (INVENTORY[num]) {\n alert(\"This book has already been added.\");\n } else {\n addBook({\n Title: $(this).find(\"#inputTitle\").val().trim(),\n Year: parseInt($(this).find(\"#inputYear\").val(), 10),\n AuthorLastName: $(this).find(\"#inputAuthorLast\").val().trim(),\n AuthorFirstName: $(this).find(\"#inputAuthorFirst\").val().trim(),\n ISBN: $(this).find(\"#inputISBN\").val().trim()\n }, $(this).find(\"#inputQty\").val().trim());\n $(\".inputBook form input\").val(\"\").blur();\n }\n });\n}", "function setStar(x)\t{\r\n\ty=x*1+1\r\n\tswitch(x)\t{\r\n\t\tcase \"1\": zRating=\"1\" \r\n\t\tflash(zRating);\r\n\t\tbreak;\r\n\t\tcase \"2\": zRating=\"2\" \r\n\t\tflash(zRating);\r\n\t\tbreak;\r\n\t\tcase \"3\": zRating=\"3\" \r\n\t\tflash(zRating);\r\n\t\tbreak;\r\n\t\tcase \"4\":zRating=\"4\" \r\n\t\tflash(zRating);\r\n\t\tbreak;\r\n\t\tcase \"5\":zRating=\"5\" \r\n\t\tflash(zRating);\r\n\t\tbreak;\r\n\t\t}\r\n//\talert(zRating);\r\n\tdocument.getElementById('RATING').value = zRating;\r\n\t//\tdocument.getElementById('vote').innerHTML=\"Thank you for your vote!\"\r\n\t}", "function checkInputsValue() {\n if (inputBookTitleEl.value === \"\" && inputBookAuthorEl.value === \"\")\n alert(\"Please fill the 2 fields before submiting!\");\n else {\n setItemInLocalStorage();\n }\n}", "function handleSubmitButton() {\n $('#container').on('submit', 'form', function(event) {\n event.preventDefault()\n//instead do the below\n//userAnswer is a variable that listens for which input is selected within the span sibilings\n const userAnswer = $('input:checked').siblings('label');\n console.log(userAnswer.length);\n if (userAnswer.length == 0) {\n\talert(\"Please select an answer\");\n}\nelse {\n// create a variable that listens for a function that checks the user's answer\n const userIsCorrect = checkUserAnswer(userAnswer);\n//if the user is correct assign +1 to their score\n if(userIsCorrect) {\n \t// console.log(\"correct\")\n $('#container').html(generateCorrectFeedback());\n iterateCorrectAnswers();\n//if the user is incorrect assign nothing to their overall score\n } else {\n // generateIncorrectFeedback();\n //render this function into the html\n $('#container').html(generateIncorrectFeedback());\n }}\n });\n}", "async doSubmitRating() {\n let {\n rating,\n notes,\n selectedImprovementAreas,\n assignmentName,\n classID,\n studentID,\n assignmentLength,\n assignmentType,\n assignmentLocation,\n evaluationID,\n highlightedWords,\n highlightedAyahs\n } = this.state;\n\n notes = notes.trim();\n const submission = this.state.submission\n ? { submission: this.state.submission }\n : {};\n let evaluationDetails = {\n ID: evaluationID,\n name: assignmentName,\n assignmentLength,\n assignmentType: assignmentType,\n location: assignmentLocation,\n completionDate: new Date().toLocaleDateString(\"en-US\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\"\n }),\n evaluation: {\n rating,\n notes,\n highlightedWords,\n highlightedAyahs,\n improvementAreas: selectedImprovementAreas,\n },\n ...submission\n };\n try {\n await FirebaseFunctions.completeCurrentAssignment(\n classID,\n studentID,\n evaluationDetails\n );\n const currentClass = await FirebaseFunctions.getClassByID(\n this.state.classID\n );\n this.setState({\n currentPosition: \"0:00\",\n audioFile: -1\n });\n\n this.props.navigation.push(\"TeacherStudentProfile\", {\n studentID: this.state.studentID,\n currentClass,\n userID: this.props.navigation.state.params.userID,\n classID: this.state.classID\n });\n } catch (err) {\n Alert.alert(strings.SomethingWentWrong, strings.SomethingWentWrongDesc);\n }\n }", "preventSubmitUnlessValid() {\n }", "function CheckAuditReviewLocalFields() { \n\tif ($(\"#reportDate\").val() == \"\") { \n\t\t\talert(\"Report Date is Require\");\n\t\t\t$('#reportDate').focus();\n\t\t\treturn false;\n\t} else { \n\t\tif ($(\"#rating\").val() == \"\") {\n\t\t\talert(\"Rating is Require\");\n\t\t\t$('#rating').focus();\n\t\t\treturn false;\n\t\t} else {\n\t\t\tif(!$.isNumeric($(\"#numRecommendationsTotal\").val())) {\n\t\t\t\talert(\"Total Recomemendation must be numeric type.\");\n\t\t\t\t$('#numRecommendationsTotal').focus();\n\t\t\t\treturn false;\n\t\t\t} else {\n\t\t\t\tif(!$.isNumeric($(\"#numRecommendationsOpen\").val())) {\n\t\t\t\t\talert(\"Open Recomemendation must be numeric type.\");\n\t\t\t\t\t$('#numRecommendationsOpen').focus();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}\n\treturn true;\n}", "function isValidRating(value){\n\n if (isNaN(value)){\n return false; \n }\n else{\n if (parseInt(value) < 0 || parseInt(value) > 5){\n return false\n }\n else{\n return true\n }\n }\n}", "function saveReview() {\n// Get the data from the form into JavaScript variables\n\n// Get a reference to each element in the form that contains data we want\nconst name = document.getElementById('name'); // Get the value out of the element id='name'\nconst title = document.getElementById('title'); // Get the value out of the element id='title'\nconst rating = document.getElementById('rating'); // Get the value out of the element id='rating'\nconst reviewText = document.getElementById('review'); // Get the value out of the element id='review'\n\n// Create a new object to hole the data so we can add the object to the array\nconst newReview = {\n reviewer: name.value, // Define the reviewer property with the data in the name field on the form\n title : title.value, // Define the title property with the data in the title field on the form\n review : reviewText.value, // Define the review property with the data in the review field on the form\n rating : rating.value // Define the rating property with the data in the rating field on the form\n }\n\n// Add the new object to the array\nreviews.push(newReview);\ndisplayReview(newReview); // display all of the product reviews in the array on our page\nshowHideForm(); // Hide the form\n}", "function validateFertRate(obj){\n\t\tif(obj.value == \"\") return;\n\t\tif(parseFloat(obj.value) < 155 || parseFloat(obj.value) > 189){\n\t\t\talert(\"Fertilizer Application Rate must be > 155 lb/ha and < 189 lb/ha.\");\n\t\t\tobj.value = \"\";\n\t\t\tobj.focus();\n\t\t}\n\t}", "function bindReviewSubmitEvents() {\n\n\t\t\t// SUBMIT A REVIEW 일 경우 Omniture 적용\n\t\t\t$('.ratings-button').on('click', function() {\n\t\t\t\tsendClickCode('content_click', 'submit a review');\n\t\t\t});\n\n\t\t\tvar $reviewSubmitPopup = $('#ratings-popover-container');\n\n\t\t\t$reviewSubmitPopup.on('focus', '[id^=y_radio]', function() {\n\t\t\t var $this = $( this );\n\t\t\t var id = $this.attr( \"id\" );\n\t\t\t var $label = $this.siblings( \"label[ for=\"+id+\"]\");\n\t\t\t $label.addClass( \"focused\" );\n\t\t\t});\n\t\t\t$reviewSubmitPopup.on('blur','[id^=y_radio]', function() {\n\t\t\t var $this = $( this );\n\t\t\t var id = $this.attr( \"id\" );\n\t\t\t var $label = $this.siblings( \"label[ for=\"+id+\"]\");\n\t\t\t $label.removeClass( \"focused\" );\n\t\t\t});\n\n\t\t\t/**\n\t\t\t * Write Form 이벤트\n\t\t\t */\n\t\t\t// 별점체크\n\t\t\t$reviewSubmitPopup.on('click', '.ratings-write-content .icoStarBox span', function(event) {\n\t\t\t\tvar $this = $(this);\n\t\t\t\tvar rating = $this.attr('rating');\n\t\t\t\tvar $starDiv = $this.parent().parent();\n\t\t\t\tvar $ratingDiv = $this.parent();\n\t\t\t\tvar $ratingText = $this.parent().parent().find('.fl');\n\t\t\t\t$ratingDiv.find('span').each(function() {\n\t\t\t\t\t(rating >= $(this).attr('rating') ? $(this).addClass('on').removeClass('off') : $(this).addClass('off').removeClass('on'));\n\t\t\t\t});\n\t\t\t\t$this.parent().attr('rating', rating);\n\n\t\t\t\t$ratingDiv =$ratingDiv.detach();\n\t\t\t\t$starDiv.find('p:eq(1)').before($ratingDiv);\n\n\t\t\t\tswitch (rating) {\n\t\t\t\tcase '1':\n\t\t\t\t\t$ratingText.text(pdpMsg.poor);\n\t\t\t\t\t$ratingDiv.find('span:eq(0)').focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '2':\n\t\t\t\t\t$ratingText.text(pdpMsg.fair);\n\t\t\t\t\t$ratingDiv.find('span:eq(1)').focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '3':\n\t\t\t\t\t$ratingText.text(pdpMsg.average);\n\t\t\t\t\t$ratingDiv.find('span:eq(2)').focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '4':\n\t\t\t\t\t$ratingText.text(pdpMsg.good);\n\t\t\t\t\t$ratingDiv.find('span:eq(3)').focus();\n\t\t\t\t\tbreak;\n\t\t\t\tcase '5':\n\t\t\t\t\t$ratingText.text(pdpMsg.excellent);\n\t\t\t\t\t$ratingDiv.find('span:eq(4)').focus();\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$ratingText.text('');\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\t// 별점체크\n\t\t\t$reviewSubmitPopup.on('keydown', '.ratings-write-content .icoStarBox span', function(event) {\n\t\t\t\tif (event.keyCode === 13){\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tvar $this = $(this);\n\t\t\t\t\tvar rating = $this.attr('rating');\n\t\t\t\t\tvar $starDiv = $this.parent().parent();\n\t\t\t\t\tvar $ratingDiv = $this.parent();\n\t\t\t\t\tvar $ratingText = $this.parent().parent().find('.fl');\n\t\t\t\t\t$ratingDiv.find('span').each(function() {\n\t\t\t\t\t\t(rating >= $(this).attr('rating') ? $(this).addClass('on').removeClass('off') : $(this).addClass('off').removeClass('on'));\n\t\t\t\t\t});\n\t\t\t\t\t$this.parent().attr('rating', rating);\n\n\t\t\t\t\t$ratingDiv =$ratingDiv.detach();\n\t\t\t\t\t$starDiv.find('p:eq(1)').before($ratingDiv);\n\n\t\t\t\t\tswitch (rating) {\n\t\t\t\t\tcase '1':\n\t\t\t\t\t\t$ratingText.text(pdpMsg.poor);\n\t\t\t\t\t\t$ratingDiv.find('span:eq(0)').focus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '2':\n\t\t\t\t\t\t$ratingText.text(pdpMsg.fair);\n\t\t\t\t\t\t$ratingDiv.find('span:eq(1)').focus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '3':\n\t\t\t\t\t\t$ratingText.text(pdpMsg.average);\n\t\t\t\t\t\t$ratingDiv.find('span:eq(2)').focus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '4':\n\t\t\t\t\t\t$ratingText.text(pdpMsg.good);\n\t\t\t\t\t\t$ratingDiv.find('span:eq(3)').focus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase '5':\n\t\t\t\t\t\t$ratingText.text(pdpMsg.excellent);\n\t\t\t\t\t\t$ratingDiv.find('span:eq(4)').focus();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t$ratingText.text('');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t});\n\n\n\t\t\t// PREVIEW 버튼 클릭\n\t\t\t$reviewSubmitPopup.on('click', '.ratings-write-content .y_btnBox01 .ratings-submit-button', function() {\n\t\t\t\t// Validate\n\t\t\t\tif (!validateWriteForm())\n\t\t\t\t\treturn;\n\t\t\t\tif (reviewTermsCheckSite && (!$('#checkYes').is(':checked')))\n\t\t\t\t\treturn;\n\t\t\t\t// submit form show\n\t\t\t\t$('.terms-content').hide();\n\t\t\t\t$('.review-content').hide();\n\t\t\t\t$('.ratings-submit-content').show();\n\t\t\t\t$('.ratings-submit-content').nextAll().hide();\n\t\t\t\tbarSize(); // bar size 재계산\n\t\t\t\t$(this).parents('.popover-content').animate({scrollTop: 0}, 500);\n\t\t\t\t// submit Setting\n\t\t\t\tsubmitFormSetting();\n\t\t\t\t// Omniture 적용\n\t\t\t\tsendClickCode('reviews', 'consumer review:wirte');\n\t\t\t});\n\n\t\t\t// terms&conditions 버튼 클릭\n\t\t\t$reviewSubmitPopup.on('click', '.ratings-write-content .y_btnBox02 .terms-button', function() {\n\t\t\t\tsendClickCode('reviews', 'review:terms conditions');\n\t\t\t\twindow.open('http://reviews.'+SITE_CD+'.samsung.com/content/' + reviewSubmitPopup.message.bvDisplayCd + '/termsandconditions.htm', 'termsConditionWindow', 'scrollbars=1,width=500px,height=550px');\n\t\t\t});\n\n\t\t\t// reivew guidelines 버튼 클릭\n\t\t\t$reviewSubmitPopup.on('click', '.ratings-write-content .y_btnBox02 .review-button', function() {\n\t\t\t\tsendClickCode('reviews', 'review:review guidelines');\n\t\t\t\twindow.open('http://reviews.'+SITE_CD+'.samsung.com/content/' + reviewSubmitPopup.message.bvDisplayCd + '/guidelines.htm', 'guideLinesWindow', 'scrollbars=1,width=500px,height=550px');\n\t\t\t});\n\n\t\t\t// 내부 팝업 close 버튼 클릭\n\t\t\t$reviewSubmitPopup.on('click', '.ratings-write-content .icon-close-x.hide-parent', function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t$(this).parent().hide();\n\t\t\t});\n\t\t\t\n\t\t\t// 체크박스 클릭\n\t\t\t$reviewSubmitPopup.on('click','.ratings-write-content #checkYes', function() {\n\t\t\t\tif (!$(this).is(':checked')) {\n\t\t\t\t\t$('.ratings-submit-button').css('cursor','default').css('background','#e2e2e2');\n\t\t\t\t}else {\n\t\t\t\t\t$('.ratings-submit-button').css('cursor','Pointer').css('background','#1428a0');\n\t\t\t\t}\n\t\t\t});\n\n\n\t\t\t/**\n\t\t\t * Submit Form 이벤트\n\t\t\t */\n\t\t\t// terms&conditions 버튼 클릭\n\t\t\t$reviewSubmitPopup.on('click', '.ratings-submit-content .terms-button', function() {\n\t\t\t\twindow.open('http://reviews.'+SITE_CD+'.samsung.com/content/' + reviewSubmitPopup.message.bvDisplayCd + '/termsandconditions.htm', 'termsConditionWindow', 'scrollbars=1,width=500px,height=550px');\n\t\t\t});\n\t\t\t// 내부 팝업 close 버튼 클릭\n\t\t\t$reviewSubmitPopup.on('click', '.ratings-submit-content .icon-close-x.hide-parent', function(event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\t$(this).parent().hide();\n\t\t\t});\n\t\t\t// edit 버튼 클릭\n\t\t\t$reviewSubmitPopup.on('click', '.ratings-submit-content .edit-button', function(event) {\n\t\t\t\t// submit form hide\n\t\t\t\t$('.terms-content').hide();\n\t\t\t\t$('.ratings-submit-content').hide();\n\t\t\t\t$('.ratings-submit-content').nextAll().show();\n\t\t\t\t$(this).parents('.popover-content').animate({scrollTop: 0}, 500);\n\t\t\t});\n\t\t\t// submit 버튼 클릭\n\t\t\t$reviewSubmitPopup.on('click', '.ratings-submit-content .submit-button', function(event) {\n\t\t\t\tif (confirm(reviewSubmitPopup.message.validateSubmit)) {\n\t\t\t\t\treviewSubmit();\n\t\t\t\t}\n\t\t\t});\n\n\n\t\t\t/**\n\t\t\t * Private Function\n\t\t\t */\n\t\t\t// Validate & submit Setting\n\t\t\tvar validateWriteForm = function() {\n\t\t\t\tvar $wform = $reviewSubmitPopup.find('.ratings-write-content');\n\n\t\t\t\tvar title = $wform.find('[name=title]').val2();\n\t\t\t\tvar reviewText = $wform.find('[name=reviewText]').val2();\n\t\t\t\tvar userNickname = $wform.find('[name=userNickname]').val2();\n\t\t\t\tvar userEmail = $wform.find('[name=userEmail]').val2();\n\n\t\t\t\t// validation\n\t\t\t\tif ('' === title || '' === reviewText || '' === userNickname || '' === userEmail) {\n\t\t\t\t\talert(reviewSubmitPopup.message.validateBlank);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (reviewText.length < 50) {\n\t\t\t\t\talert(reviewSubmitPopup.message.validateDetail);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif (userNickname.length < 4) {\n\t\t\t\t\talert(reviewSubmitPopup.message.validateNickname);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tvar reg = new RegExp(\"^[\\\\w\\\\-]+(\\\\.[\\\\w\\\\-_]+)*@[\\\\w\\\\-]+(\\\\.[\\\\w\\\\-]+)*(\\\\.[a-zA-Z]{2,3})$\", \"gi\");\n\t\t\t\tif (!reg.test(userEmail)) {\n\t\t\t\t\talert(reviewSubmitPopup.message.validateEmail);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t};\n\n\t\t\t// Review Submit Form 초기화\n\t\t\tvar submitFormSetting = function() {\n\t\t\t\tvar $wform = $reviewSubmitPopup.find('.ratings-write-content');\n\t\t\t\tvar $sform = $reviewSubmitPopup.find('.ratings-submit-content');\n\n\t\t\t\tvar title = $wform.find('[name=title]').val2();\n\t\t\t\tvar reviewText = $wform.find('[name=reviewText]').val2();\n\t\t\t\tvar userNickname = $wform.find('[name=userNickname]').val2();\n\t\t\t\tvar userEmail = $wform.find('[name=userEmail]').val2();\n\n\t\t\t\t// submit setting\n\t\t\t\t$sform.find('[form-name=userNickname]').text(userNickname);\n\t\t\t\t$sform.find('[form-name=title]').text(title);\n\t\t\t\t// HTML Escape\n\t\t\t\treviewText = reviewText.replace(/<script[^>]*>(.|[\\t\\n\\r])*<\\/script>/gi, '');\n\t\t\t\treviewText = reviewText.replace(/>/gi, '&gt;');\n\t\t\t\treviewText = reviewText.replace(/</gi, '&lt;');\n\t\t\t\treviewText = reviewText.replace(/%3C/gi, '&lt;');\n\t\t\t\treviewText = reviewText.replace(/%3E/gi, '&gt;');\n\t\t\t\treviewText = reviewText.replace(/\\n/gi, '<br/>');\n\t\t\t\t$sform.find('[form-name=reviewText]').html(reviewText);\n\t\t\t\t$sform.find('[form-name=userEmail]').attr('href', 'mailto:' + userEmail).text(userEmail);\n\t\t\t\t$wform.find('[ratingType]').each(function() {\n\t\t\t\t\tvar ratingType = $(this).attr('ratingType');\n\t\t\t\t\tvar rating = $(this).attr('rating');\n\t\t\t\t\tif ('rating' === ratingType) {\n\t\t\t\t\t\tvar ortLabel = reviewSubmitPopup.message.overallRatingTypeLabel;\n\t\t\t\t\t\t$sform.find('[ratingType=rating]').attr('aria-label', ortLabel.replace('#rating#', rating));\n\t\t\t\t\t\t$sform.find('span[group=rating]').each(function() {\n\t\t\t\t\t\t\t(rating >= $(this).attr('rating') ? $(this).addClass('on').removeClass('off') : $(this).addClass('off').removeClass('on'));\n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar rtLabel = reviewSubmitPopup.message.ratingTypeLabel;\n\t\t\t\t\t\t$sform.find('[ratingType=' + ratingType + '] h4').attr('aria-label', rtLabel.replace('#ratingtype#', ratingType).replace('#rating#', rating));\n\t\t\t\t\t\t$sform.find('[ratingType=' + ratingType + '] .rating-value').text(rating + '/5');\n\t\t\t\t\t\tvar $barFull = $sform.find('[ratingType=' + ratingType + '] .barfull').eq(0);\n\t\t\t\t\t\tvar barSize = $barFull.css('background-size').split('px')[0] / 5;\n\t\t\t\t\t\t$sform.find('[ratingType=' + ratingType + '] .barfull').css('width', rating * barSize);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\n\t\t\t// 리뷰 등록\n\t\t\tvar reviewSubmit = function() {\n\t\t\t\t// parameter setting\n\t\t\t\tvar $wform = $reviewSubmitPopup.find('.ratings-write-content');\n\t\t\t\tvar param = {\n\t\t\t\t\t'title': $wform.find('[name=title]').val2(),\n\t\t\t\t\t'reviewtext': $wform.find('[name=reviewText]').val2(),\n\t\t\t\t\t'usernickname': $wform.find('[name=userNickname]').val2(),\n\t\t\t\t\t'useremail': $wform.find('[name=userEmail]').val2(),\n\t\t\t\t\t'isrecommended': $wform.find('[name=recommend]:checked').val(),\n\t\t\t\t};\n\t\t\t\tif(reviewTermsCheckSite){\n\t\t\t\t\tparam['agreedtotermsandconditions'] = true; \n\t\t\t\t}\n\t\t\t\t$wform.find('[ratingType]').each(function() {\n\t\t\t\t\t($(this).attr('rating') > 0 ? param[$(this).attr('ratingType')] = $(this).attr('rating') : param[$(this).attr('ratingType')] = '');\n\t\t\t\t});\n\t\t\t\t//var url = '/' + SITE_CD + '/data-consumer/review-submit/' + $('#modelCode').val();\n\t\t\t\t//var url = '//' + DOMAIN + '/' + SITE_CD + '/data-consumer/review-submit/' + $('#modelCode').val();\n\t\t\t\tvar url = 'http://api.bazaarvoice.com/data/submitreview.json?ApiVersion=5.4&PassKey=' + reviewSubmitPopup.message.passKey + '&ProductId=' + $('#modelCode').val().replace(\"/\", \"_\") + '&Action=submit';\n\t\t\t\tconsole.log(\"review ajax url : \"+url);\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype: 'POST',\n\t\t\t\t\turl: url,\n\t\t\t\t\tdataType: 'json',\n\t\t\t\t\tdata: param,\n\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t// Omniture 적용\n\n\t\t\t\t\t\tsendClickCode('reviews', 'consumer review:review submit');\n\t\t\t\t\t\t// 팝업 클로즈\n\t\t\t\t\t\t$.Popover.activePopover.hide();\n\t\t\t\t\t\t$('.lightbox-skrim').remove();\n\t\t\t\t\t},\n\t\t\t\t\terror: function(data) {\n\t\t\t\t\t\t// 팝업 클로즈\n\n\t\t\t\t\t\t$.Popover.activePopover.hide();\n\t\t\t\t\t\t$('.lightbox-skrim').remove();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t};\n\t\t}", "function handleSubmitClick(){\r\n\t\tvar grocery = {};\r\n\t\tgrocery.title = txtGroceryName.value;\r\n\t\tgrocery.desc = txtGroceryDesc.value;\r\n\t\tgrocery.price = txtGroceryPrice.value;\r\n\r\n\t\tif(concernedLi === null){\r\n\t\t\tif(isValid(grocery)){\r\n\t\t\t\taddGrocery(grocery);\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\tif(isValid(grocery)){\r\n\t\t\t\tupdateGrocery(grocery);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\twindow.event.preventDefault();\r\n\t}", "function onlySubmit(){\r\n disableButtons() // make sure you can only press the save button once\r\n document.getElementById('evaluationForm').submit();\r\n }", "function rate(rating) {\n if (song.rating < 0) return;//negative ratings cannot be changed\n if (settings.linkRatings) {\n if (rating >= settings.linkRatingsMin && !isRatingReset(song.rating, rating)) loveTrack();\n else if (settings.linkRatingsReset) unloveTrack();//unlove on reset or lower rating\n }\n executeInGoogleMusic(\"rate\", { rating: rating });\n }", "function submitReview() {\n let xhr = new XMLHttpRequest();\n xhr.open('POST', '/diner/profile/add_review', true);\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n closeReviewPage();\n if (!this.response) {\n } else {\n alert('failed to submit review');\n }\n }\n }\n xhr.send(JSON.stringify({token:token, voucher_id:voucher_id, comment:comment, rating:rating}));\n}", "function fillStarsTill(starNo){\n\tclearAllStars();\n\t\n\tif(starNo == 1){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"1\";\n\t}\n\t\n\tif(starNo == 2){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"2\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"2\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"2\";\n\t}\n\t\n\tif(starNo == 3){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"2\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"2\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"3\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"3\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"3\";\n\t}\n\t\n\tif(starNo == 4){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"2\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"2\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"3\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"3\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"4\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"4\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"4\";\n\t}\n\t\n\tif(starNo == 5){\n\t\tdocument.getElementById(\"1\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"1\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"2\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"2\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"3\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"3\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"4\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"4\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"5\").className = \"glyphicon glyphicon-star\";\n\t\tdocument.getElementById(\"5\").style.color = \"yellow\";\n\t\t\n\t\tdocument.getElementById(\"starRating\").value = \"5\";\n\t}\n}", "function resetFormValues() {\n const form = document.querySelector('form');\n const inputs = form.querySelectorAll('input');\n inputs.forEach((input) => {\n input.value = '';\n });\n document.getElementById('rating').value = 1;\n document.getElementById('review').value = '';\n}", "function submitAnswer() {\n $('form').on('submit', function (event) {\n event.preventDefault();\n let selected = $('input:checked');\n let answer = selected.val();\n let rightAnswer = `${STORE[questionNum].correctAnswer}`;\n\n if (answer === rightAnswer) {\n selectCorrectAnswer();\n scoreUpdater();\n } else {\n selectWrongAnswer();\n }\n })\n}", "function adjustRating(rating) {\n document.getElementById('rating').textContent = rating;\n}", "function handleSubmitBtn() {\n try {\n const result = game.playersGuessSubmission( input.value );\n if (result === 'You Win!' || result === 'You Lose.') {\n pauseScreen(result);\n } else {\n updateScreen(result);\n }\n } catch (error) {\n updateScreen(error);\n }\n \n input.value = '';\n}", "submitBudgetForm(){\n // console.log('Test Out!');\n const value = this.budgetInput.value;\n if (value === '' || value <0){ \n this.budgetFeedback.classList.add(\"showItem\");\n this.budgetFeedback.innerHTML = `<p> Value cannot be empty or negative!</p>`\n }\n }", "function changeRatingGo(ratingId) {\n var newRating = document.getElementById(\"newRating\").value;\n if (!checkRatingVal(newRating)) {\n $(\"#changeRating\").modal(\"hide\");\n return;\n }\n document.getElementById(\"newRating\").value = \"\";\n var pid = ratingId.split(\"-\")[0];\n var songName = ratingId.split(\"-\")[1];\n console.log(\"ratingId: \" + ratingId);\n var req = {\n rating: newRating,\n song_name: songName,\n pid: pid\n };\n $(\"#changeRating\").modal(\"hide\");\n ajaxRequest(\"POST\", \"/rating/update\", \"update_rating\", req, ratingId, newRating);\n}", "function saveReview() {\n /*\n * Get references to all the form controls (name, title, review, rating)\n * Create a new Javascript object for the Review, and set those 4 properties\n * Add the review to the collection of reviews. \n * Call displayReviews, passing in the new review\n * Hide the form (call showHideForm)\n */\n let nameInput = document.getElementById('name');\n let titleInput = document.getElementById('title');\n let ratingSelect = document.getElementById('rating');\n let reviewTextArea = document.getElementById('review');\n\n // Create the new review object\n let newReview = {\n reviewer: nameInput.value,\n title: titleInput.value,\n rating: ratingSelect.value,\n review: reviewTextArea.value\n };\n\n // Add it to the array of reviews\n reviews.unshift(newReview);\n\n // Now display it in the html\n displayReviews();\n\n // Hide the form\n showHideForm();\n\n}", "function submitVote(event) {\n\t\tvar eventId = $(event.target).attr('name');\n\t\tvar vote = $(event.target).val();\n\t\tuser.vote(eventId, vote);\n\t\tdisableVoteButtons();\n\t}", "function addItem() {\n var starValue; // this variable will be used to store the value of the selected stars.\n const addUserNameTextbox = document.getElementById('add-username'); // will get the value from the html element and store it.\n var ele = document.getElementsByName('rate'); // will get the value from the html element and store it in ele.\n\n // This for loop will iterate through the radio elements and find which one is checked.\n for (var i = 0; i < ele.length; i++)\n {\n if (ele[i].checked)\n {\n starValue = ele[i].value\n }\n }\n const addMessageTextbox = document.getElementById('add-message'); // will get the value from the html element message and store it.\n const addFilePathTextbox = document.getElementById('add-imagepath'); // will get the value from the image path html element and store it.\n\n // this is the json object of ReviewRating and send the data through to the controller.\n const item =\n {\n username: addUserNameTextbox.value.trim(),\n starRating: parseInt(starValue),\n message: addMessageTextbox.value.trim(),\n filePath: addFilePathTextbox.value\n };\n\n // Will fetch this URI with the POST method.\n fetch('https://localhost:44317/ReviewRating', {\n method: 'POST',\n mode: 'cors',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(item) // will convert the const item into a json object.\n })\n .then(response => response.json())\n .then(() => {\n getItems(); // will call get items to get items once the add item is made.\n })\n .catch(error => console.error('Unable to add item.', error)); // logs error if it is caught.\n}", "function check_rate(obj){\n if (isNaN(obj.value)){\n alert('Please enter only number');\n obj.value=''\n obj.focus();\n return;\n }\n var rate = obj.value;\n var frate = parseFloat(rate);\n if ((rate.indexOf('.') != -1) && ((rate.length - rate.indexOf('.') -1) > 2)){\n frate = frate.toFixed(2);\n jQuery('#'+obj.id).val(frate);\n }\n if (frate > 9999.99 || frate < 0.01){\n obj.value=''\n obj.focus();\n alert(\"Rate should be between 0.01 and 9999.99\");\n }\n}", "function displayStarRating() {\n const userRating = document.querySelector(\".total-rating\").textContent;\n if (userRating < 10) {\n addProfileStars(1)\n }\n else if (userRating >= 10 && userRating <= 100) {\n addProfileStars(2);\n }\n else if (userRating > 100 && userRating <= 200) {\n addProfileStars(3);\n }\n else if (userRating > 200 && userRating <= 500) {\n addProfileStars(4);\n }\n else {\n addProfileStars(5);\n }\n}", "function validate_form_goal()\n{\n\t// season (only need to check if season2 is not empty)\n\tbseason = document.createitem.season2.value != \"\";\n\tif (!bseason)\n\t{\n\t\tdocument.createitem.season.value = 0;\n\t}\n\telse\n\t{\n\t\tdocument.createitem.season.value = document.createitem.season1.value + \"/\" + document.createitem.season2.value\n\t}\n\t\t\n\t\t\n\t// At this point, if bok equals true, then the details have been filled correctly\n\t////////////////////////////////////////////////////////////////////////\n\t\n\t// submit form if it has been correctly populated\n\tshow_topscorers(\"div_topscorer\",\"get_topscorer.php\")\n}", "logRating(){\n\t\tthis.setState({hasSubmitted: true});\n\t\tconsole.log(\"Rating data prepared to be POSTed to some database/storage\")\n\t\tconsole.log(this.state);\n\t}", "function userRating(){\n var element = document.getElementById(\"ratingstars\");\n var rating = prompt(\"How would you rate us? Type in an integer up to 5!\");\n\n while (rating != '1' && rating!= '2' && rating!= '3' && rating != '4' && rating != '5'){\n rating = prompt(\"Must be number between 1 and 5\");\n }\n\n for (i = 0; i < rating; i++){\n element.innerHTML = element.innerHTML + \"<img src=images/star.png height = 50 width = 50>\"+(i+1);\n }\n\n}", "function checkSiteRating() {\n document.mainForm.rateTick.src = 'tick.png';\n document.mainForm.rateTick.alt = 'tick';\n}", "function saveMovieUserRating() {\n var payload = {\n movie_id: $routeParams.movieId,\n rating: $scope.userRating\n };\n\n requestService.saveMovieUserRating(payload).then(\n\n // success function\n function(data) {\n $log.debug('movieCommentsController -> saveMovieUserRating success', data);\n getMovieRatings();\n },\n\n // error function\n function() {\n $log.debug('movieCommentsController -> saveMovieUserRating error');\n }\n );\n }", "function handleSubmit(event) {\n event.preventDefault();\n\n // check if input matches that of a random question\n // if yes, increment the number of random questions asked\n if (randomQuestions.includes(inputValue)) {\n setRandomQuestionsAsked(randomQuestionsAsked + 1);\n }\n\n // sends message via socket\n sendMessage(inputValue);\n\n setInputValue('');\n }", "function submitTurk() {\n $(\"#scoreField\").val(score);\n $(\"#secondsField\").val(seconds);\n $(\"#timeoutField\").val(averageTimeout);\n $(\"#movementsField\").val(movements);\n $(\"#mturk_form\").submit();\n }", "function checkBookingData() {\n // trim values in case there are any whitespaces at the end and front of the value\n const bookingDateValue = $('bookingDate').value.trim();\n const bookingTitleValue = $('bookingTitle').value.trim();\n const bookingDescValue = $('bookingDesc').value.trim();\n\n // if empty display error\n if (bookingDateValue == \"\" || bookingTitleValue == \"\" || bookingDescValue == \"\") {\n $(\"bookingTag\").style.display = \"inline\";\n $(\"bookingTag\").innerText = \"Please fill in all the fields.\"; // display error message\n }\n else {\n allowSubmit = true; // if not empty, allowSubmit is then set to true then let the form be sent to the PHP file\n }\n}", "function viewRating(ratings, url) {\n changeState(\"search\");\n\n document.getElementById(\"professor\").value = ratings[\"name\"];\n\n var numberRatings = document.getElementById('numRatings');\n numberRatings.innerHTML = ratings[\"number-of-ratings\"];\n\n var overallRating = document.getElementById('overallRating');\n overallRating.innerHTML = ratings[\"overall-quality\"];\n\n var gradeRating = document.getElementById('gradeRating');\n gradeRating.innerHTML = ratings[\"average-grade\"];\n\n var helpRating = document.getElementById('helpRating');\n helpRating.innerHTML = ratings[\"helpfulness\"];\n\n var clarityRating = document.getElementById('clarityRating');\n clarityRating.innerHTML = ratings[\"clarity\"];\n\n var easyRating = document.getElementById('easyRating');\n easyRating.innerHTML = ratings[\"easiness\"];\n\n var commentsBox = document.getElementById('comments');\n commentsHTML = \"\";\n comments = ratings[\"comments\"];\n for(var i = 0; i < comments.length; i++) {\n commentsHTML += \"<div class=\\\"comment\\\"><div class=\\\"comment_rating\\\">\";\n commentsHTML += \"<span class=\\\"com_rating\\\">Date: \" + ratings[\"comments\"][i][\"date\"] + \"</span>\";\n commentsHTML += \"<span class=\\\"com_rating\\\">Class: \" + ratings[\"comments\"][i][\"class\"] + \"</span>\";\n commentsHTML += \"<span class=\\\"com_rating\\\">Helpfulness: \" + ratings[\"comments\"][i][\"helpfulness\"] + \"</span>\";\n commentsHTML += \"<span class=\\\"com_rating\\\">Easiness: \" + ratings[\"comments\"][i][\"easiness\"] + \"</span>\";\n commentsHTML += \"<span class=\\\"com_rating\\\">Clarity: \" + ratings[\"comments\"][i][\"clarity\"] + \"</span></div>\";\n commentsHTML += \"<div class=\\\"comment_text\\\">\" + ratings[\"comments\"][i][\"comment\"];\n commentsHTML += \"</div></div>\";\n }\n commentsBox.innerHTML = commentsHTML;\n\n var webLink = document.getElementById(\"webLink\");\n webLink.innerHTML = \"<a href=\" + url + \">View full review on RateMyProfessors.com</a>\";\n}", "function rateMovie(id){\n\n var ration = prompt(\"Zahl zwischen 0 und 5\");\n\n //Check if input is alright\n if(ration >= 0 & ration <= 5){\n var imagesource = \"img/\" + ration + \"stars.png\";\n var generatedHtml = \"<img src='\" + imagesource + \"' alt='\" + ration + \" Sterne'/>\";\n //Ration as number\n ration = parseInt(ration);\n\n updateRationOnParse(id, generatedHtml, ration);\n\n var imageId = id.replace(/rowId_/g, \"imageId_\");\n updateRation(generatedHtml, imageId);\n }else{\n alert(\"Üngültige Eingabe, sie müssen eine Zahl zwischen 0 und 5 eingeben!\");\n }\n}", "function submitData() {\n // getting the submitted data\n today_rating = 0;\n week_rating = 0;\n month_rating = 0;\n for (var i = 0; i < 5; i++) {\n if (rating_numbers[i].style.backgroundColor == \"rgb(128, 128, 128)\") {\n today_rating = parseInt(rating_numbers[i].innerHTML);\n }\n }\n for (var i = 5; i < 10; i++) {\n if (rating_numbers[i].style.backgroundColor == \"rgb(128, 128, 128)\") {\n week_rating = parseInt(rating_numbers[i].innerHTML);\n }\n }\n for (var i = 10; i < 15; i++) {\n if (rating_numbers[i].style.backgroundColor == \"rgb(128, 128, 128)\") {\n month_rating = parseInt(rating_numbers[i].innerHTML);\n }\n }\n\n // uploading data\n if (today_rating | week_rating | month_rating != 0) {\n console.log(\"Submitting data...\")\n if (document.URL == \"http://localhost:5000/\") {\n upload_data(\"qa_data\");\n } else if (document.URL == \"https://hows-business.firebaseapp.com/\"){\n upload_data(\"prod_data\");\n }\n }\n }", "function validateInput() {\n\t\tif (!name) {\n\t\t\talert('Please input a name');\n\t\t\treturn false;\n\t\t}\n\t\tif (!description) {\n\t\t\talert('Please give a small description');\n\t\t\treturn false;\n\t\t}\n\t\tif (!value) {\n\t\t\talert('Please describe the sentimental value');\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function onClickSubmit() {\n // Grab comment\n console.log(document.getElementById(\"comment_box\").value);\n var feedback = document.getElementById(\"feedback\");\n checkSelection();\n if (!noStoreSelected) {\n checkRating();\n }\n // Add or modify a review if selections are valid\n if (!noStoreSelected && !noRating) {\n addReview(store);\n // Display success message and direct users back to the main page\n document.getElementById(\"feedback\").innerHTML = \"Thanks for your feedback!\";\n $(feedback).css({\n color: \"green\"\n });\n $(feedback).show(0);\n $(feedback).fadeOut(2500);\n setTimeout(function () {\n location.href = \"/web/member/main.html\"\n }, 2300);\n }\n}", "function rateSong(user, songId, score) {\n // \"if\" statement differentiates between who is rating\n if (user === \"pilot\") {\n const ratingData = {\n id: songId,\n pilot_rating: score,\n };\n $.ajax({\n method: \"PUT\",\n url: \"/api/songs\",\n data: ratingData,\n }).then(function() {\n window.location.reload();\n getAverage();\n });\n } else if (user === \"coPilot\") {\n const ratingData = {\n id: songId,\n copilot_rating: score,\n };\n $.ajax({\n method: \"PUT\",\n url: \"/api/songs\",\n data: ratingData,\n }).then(function() {\n window.location.reload();\n getAverage();\n });\n }\n }", "function validateReq(){\r\n\t\t//Variables\r\n\t\tvar name = document.survey_form.name;\r\n\t\tvar age = document.survey_form.age;\r\n\t\tvar t = document.survey_form.knittime;\r\n\t\tvar time = document.survey_form.time;\r\n\t\tvar experience = document.survey_form.experience;\r\n\t\tvar informative = document.survey_form.informative;\r\n\t\tvar informPage = document.survey_form.informativePage;\r\n\t\tvar objects = document.survey_form.objects;\r\n\t\tvar selfish = document.survey_form.selfish;\r\n\t\tvar ravelry = document.survey_form.Ravelry;\r\n\t\tvar updates = document.survey_form.updates;\r\n\t\tvar othercrafts = document.survey_form.othercrafts;\r\n\t\tvar suggestions = document.survey_form.suggestions;\r\n\t\t//Makes the Name a required input\r\n\t\tif (name.value ==\"\")\r\n\t\t{window.alert(\"Please enter your name\")\r\n\t\tname.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the age range a required input\r\n\t\tif (age.value ==\"\")\r\n\t\t{window.alert(\"Please enter your age range\")\r\n\t\tage.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the experience level a required input\r\n\t\tif (experience.value ==\"\")\r\n\t\t{window.alert(\"Please share your experience level.\")\r\n\t\texperience.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the time a required input\r\n\t\tif (t.value ==\"\")\r\n\t\t{window.alert(\"Please enter the amount of time\")\r\n\t\ttimeknitting.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t\t//Makes the time radio a required input\r\n\t\tif (time.value == \"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\ttime.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the rating a required input\r\n\t\tif (informative.value ==\"\")\r\n\t\t{window.alert(\"Please enter a value\")\r\n\t\tinformative.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the dropdown selection a required input\r\n\t\tif (informPage.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\tinformPage.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the object radio a required input\r\n\t\tif (objects.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\tobjects.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the who do you knit for question a required input\r\n\t\tif (selfish.value ==\"\")\r\n\t\t{window.alert(\"Please share your thoughts\")\r\n\t\tselfish.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the ralvery radio a required input\r\n\t\tif (ravelry.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\travelry.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the email radio a required input\r\n\t\tif (updates.value ==\"\")\r\n\t\t{window.alert(\"Please select an option\")\r\n\t\tupdates.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the ralvery username a required input if the 'yes' radio us check\r\n\t\tif (document.survey_form.yesRav.checked) {\r\n\t\t\tif (username.value ==\"\")\r\n\t\t\t{window.alert(\"Please enter your username\")\r\n\t\t\tusername.focus()\r\n\t\t\treturn false;}\r\n\t\t}\r\n\t\t//Makes the email a required input if the 'yes' radio us checked\r\n\t\tif (document.survey_form.yesEmail.checked) {\r\n\t\t\tif (email.value ==\"\")\r\n\t\t\t{window.alert(\"Please enter your e-mail\")\r\n\t\t\temail.focus()\r\n\t\t\treturn false;}\r\n\t\t}\r\n\t\t//Makes the other crafts reply a required input\r\n\t\tif (othercrafts.value ==\"\")\r\n\t\t{window.alert(\"Please share your thoughts\")\r\n\t\tothercrafts.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\t\t//Makes the general suggestion reply a required input\r\n\t\tif (suggestions.value ==\"\")\r\n\t\t{window.alert(\"Please share your thoughts\")\r\n\t\tsuggestions.focus()\r\n\t\treturn false;\r\n\t\t}\r\n\treturn true;\r\n\t}", "function modifyOverallRatingSubmission()\n{\n\t// Hide \"Did the candidate pass the interview?\":\n\tvar nodes = Array.from(document.getElementsByClassName('overall-recommendation')[0].childNodes);\n\tnodes.forEach(function (node) { if (/candidate pass the interview/.test(node.textContent)) { node.textContent = ''; } });\n\n\t// Change labels:\n\tdoOnSelector('.overall-recommendation [data-rating-id]', function (ratingElt) \n\t{ \n\t\tvar ratingValue = parseInt(ratingElt.getAttribute('data-rating-id'));\n\t\tratingElt.innerText = mulesoftOverallRatings[ratingValue - 1];\n\t}); \n}", "async function postReview(req, res) {\n //if recevied order change it cause problem\n let {\n ratings,\n review,\n rider_id\n } = req.body;\n if (ratings && review && rider_id) {\n ratings = parseInt(ratings);\n let old_review = await Review.findOne({\n \"user_id\": req.user._id,\n \"rider_id\": rider_id\n });\n //if he already not post the review\n if (!old_review) {\n\n let new_review = new Review({\n \"user_id\": req.user._id,\n \"rider_id\": rider_id,\n \"rating\": ratings,\n \"review\": review\n });\n\n let rider = await Rider.findOne({\n _id: rider_id\n });\n\n let current_rating = rider.rating * rider.total_rating;\n ratings = (current_rating + ratings) / (rider.total_rating + 1)\n ratings = ratings.toFixed(1);\n total_rating = rider.total_rating + 1;\n\n rider = await Rider.findOneAndUpdate({\n _id: rider_id\n }, {\n total_rating: total_rating,\n rating: ratings\n })\n\n new_review = await new_review.save().catch((err) => {\n let msg = dbErrorHandler(err);\n res.json({\n status: \"Failure\",\n msg: msg\n });\n });\n res.json({\n status: \"success\",\n msg: \"successfully Added\"\n })\n } else {\n res.json({\n status: \"Failure\",\n msg: \"Already Reviewed\"\n })\n\n }\n\n }\n}", "function libraryFormSubmit(event) {\n\n let title = document.getElementById('title').value;\n let author = document.getElementById('author').value;\n let getGenres = document.getElementsByName('genre');\n let genre\n Array.from(getGenres).forEach(element => {\n if (element.checked) {\n genre = element.value;\n }\n });\n let newBook = new Book(title, author, genre);\n\n if (newBook.validate()) {\n newBook.addBook();\n Display.show('success', 'Book added successfully');\n } else {\n Display.show('danger', 'Sorry enter a valid book');\n }\n Display.clear();\n event.preventDefault();\n}", "onSubmitReview(event, index) {\n console.log(\"do you see me?\")\n // change boolean of state is_review_submitted to T\n this.setState({\n // change to true, not ! because only 1 submission needed\n is_rating_submitted: true,\n })\n }", "async function handleSubmit() {\n // if no quantity is entered user is alerted to do so\n if (!formData.itemName || !formData.quantity) {\n alert(\"Please the missing feilds in form\");\n } else {\n // Axios POST call using Token to add a wishlist item to the user's (receiver) list by using specific user id in params\n const res = await axios.post(\n `/api/wishlist/${params.id}/add`,\n {\n ...formData,\n },\n {\n headers: {\n Authorization: \"Bearer \" + localStorage.getItem(\"token\"),\n },\n }\n );\n props.addNewWishlist(res.data);\n handleClose();\n }\n }", "onPressSubmitButton(){\n if(this.state.game_rating){\n RateGame(this.props.game_id, this.state.game_rating)\n .then(response => {\n if (response.status == 200) {\n this.props.fetchProductData()\n this.props.AverageRating()\n }\n })\n .catch(error => {\n console.log(\"@Error [GameInfo] GameRateModal\", error.message);\n });\n this.props.renderRateModal()\n }\n }", "function rate(id,rating,type)\r\n{\r\n var page = '/ajax.php';\r\n $.post(page,\r\n {\r\n mode : 'rating',\r\n id:id,\r\n rating:rating,\r\n type:type\r\n },\r\n function(data)\r\n {\r\n if(!data)\r\n alert(\"No data\");\r\n else\r\n $(\"#rating_container\").html(data);\r\n },'text');\r\n}", "function modifyUserObject() {\n let starRate = document.querySelectorAll(\".full\").length;\n userObject.starRate = starRate;\n userObject.review = document.querySelector(\".reviews_add-input\").value;\n putReviews(userObject);\n}", "async rate (rating, user_id, admin_id) {\n let from = `${new Date().getFullYear()}-${new Date().getMonth()+1}-${new Date().getDate()}`;\n let ratingDoc = await this.models.ratings.findOne({user_id, admin_id, created_at: {$gte: from}});\n\n if (ratingDoc || rating <= 0 || rating > 10) {\n throw new Error('cant rate');\n }\n\n let newRating = new this.models.ratings({user_id, admin_id, rating});\n return newRating.save();\n }" ]
[ "0.6870484", "0.6824826", "0.66302794", "0.639286", "0.6386344", "0.63446975", "0.6289959", "0.62447697", "0.62378657", "0.62015134", "0.61152303", "0.61014295", "0.6062152", "0.60508615", "0.6050153", "0.6008189", "0.5990314", "0.59827167", "0.59203637", "0.5888692", "0.5880445", "0.5871869", "0.5802951", "0.57821184", "0.5774043", "0.57577324", "0.5717275", "0.5715172", "0.57035047", "0.5702804", "0.56915736", "0.5674038", "0.5668015", "0.564426", "0.56325996", "0.5628112", "0.5625999", "0.5622941", "0.5621959", "0.5621959", "0.5621959", "0.56206876", "0.5613379", "0.56127876", "0.56123495", "0.560914", "0.5607882", "0.5602219", "0.56020266", "0.5585792", "0.5576165", "0.55558336", "0.5555186", "0.5538611", "0.5535105", "0.5532089", "0.55093575", "0.5476972", "0.5472464", "0.5461043", "0.54463315", "0.54352957", "0.5421225", "0.5418114", "0.541735", "0.5411701", "0.5409075", "0.5407931", "0.5405547", "0.54054177", "0.54052114", "0.53952634", "0.5393008", "0.53841287", "0.5381143", "0.53694916", "0.53686774", "0.53680634", "0.5358073", "0.53365517", "0.53201723", "0.531981", "0.531915", "0.5310629", "0.5310343", "0.5308295", "0.5303477", "0.53034663", "0.5298858", "0.5296124", "0.52950144", "0.5294887", "0.52927905", "0.52817565", "0.52801317", "0.5279758", "0.5273522", "0.52701926", "0.52695227", "0.52607334" ]
0.6334964
6
remove the highlight and its corresponding evaluation notes from the given word.
unhighlightWord(word, ayah) { if (word.char_type === "word") { let highlightedWords = this.state.highlightedWords; delete highlightedWords[word.id]; this.setState({ highlightedWords }); } else if (word.char_type === "end") { //if user presses on an end of ayah, we highlight that entire ayah let highlightedAyahs = this.state.highlightedAyahs; let ayahKey = toNumberString(ayah); delete highlightedAyahs[ayahKey]; this.setState({ highlightedAyahs }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleBrokenWordUnselect() {\n $(self.util.svgRoot).find('.wordpart').removeClass('wordpart');\n }", "function unhighlight(){\n insertWords();\n //added to reset value variable -- alec;\n //value=\"\";\n //userWord=\"\";\n}", "function removeContextHighlights () {\n $('.moderation-note-contextual-highlight').each(function () {\n if ($(this).data('moderation-note-highlight-id')) {\n $(this).removeClass('moderation-note-contextual-highlight existing');\n }\n else {\n $(this).contents().unwrap();\n }\n });\n }", "removeHighlightedVariable() {\n this.highlightedVariable = '';\n }", "function removeHighlight(square) {\n if (square !== undefined) {\n square.actions.removeHighlight(); // bound to directive!\n scope.activeSquare = undefined; // prevent repeat deHighlight if no new highlight been made!\n }\n }", "function delWord() {\n\t\t var str = commText.innerHTML; \n\t\t var res = str.replace(\"Comments\", \"\");\n\t\t var res = res.replace(\"Comment\", \"\");\n\t\t commText.innerHTML = res;\n\t\t}", "function _removeHighlights() {\n\t\t$(\".find-highlight\").contents().unwrap();\n\t}", "function dehighlight() {\n\n\t// Get tweet text div\n\tvar tweetTextDiv = d3.select(\"#tweetTextDiv\");\n\n\t// Get tweet text\n\tvar tweetText = tweetTextDiv.text();\n\n\t// Remove highlighted text (the old tweet text with 3 <span>s)\n\ttweetTextDiv.selectAll(\"span\").remove();\n\n\t// Add non highlighted text\n\ttweetTextDiv.append(\"span\").text(tweetText);\n\n\t// Add actual tweet\n\n}", "function unHighlight() {\r\n var sel = window.getSelection && window.getSelection();\r\n if (sel && sel.rangeCount == 0 && savedRange != null) {\r\n sel.addRange(savedRange);\r\n }\r\n if (sel && sel.rangeCount > 0) {\r\n // Get location and text info\r\n let range = sel.getRangeAt(0);\r\n console.log(range)\r\n let node = document.createElement('p')\r\n node.setAttribute('class', 'unhighlight')\r\n let selText = range.cloneContents();\r\n node.appendChild(selText);\r\n let markedList = node.getElementsByTagName('mark');\r\n for (let i = 0; i < markedList.length; i++) {\r\n markedList[i].outerHTML = markedList[i].innerHTML;\r\n }\r\n\r\n range.deleteContents();\r\n range.insertNode(node);\r\n // Remove the tags from inserted node\r\n var unHiteLiteList = document.getElementsByClassName('unhighlight');\r\n\r\n for (let i = 0 ; i < unHiteLiteList.length; i ++) {\r\n var parent = unHiteLiteList[i].parentNode;\r\n while (unHiteLiteList[i].firstChild) {\r\n parent.insertBefore(unHiteLiteList[i].firstChild, unHiteLiteList[i]);\r\n }\r\n parent.removeChild(unHiteLiteList[i]);\r\n }\r\n // range.selectNodeContents(selText); \r\n saveCurrentState();\r\n }\r\n }", "function eraseWord(e, prevWord, id){\n isAnimating = true;\n num = prevWord.length;\n\n loopThroughLetters(e.target, 'subtract', prevWord, 0, id);\n }", "function removeWord() {\n document.getElementById(\"word-display\").innerHTML = \"\";\n }", "function undoHighlightContext() {\n highlightDOM.style.display = \"none\";\n document.body.removeChild(highlightDOM);\n}", "function keyCommandDeleteWord(editorState){var afterRemoval=removeTextWithStrategy(editorState,function(strategyState){var selection=strategyState.getSelection();var offset=selection.getStartOffset();var key=selection.getStartKey();var content=strategyState.getCurrentContent();var text=content.getBlockForKey(key).getText().slice(offset);var toRemove=DraftRemovableWord.getForward(text);// If there are no words in front of the cursor, remove the newline.\r\n\treturn moveSelectionForward(strategyState,toRemove.length||1);},'forward');if(afterRemoval===editorState.getCurrentContent()){return editorState;}return EditorState.push(editorState,afterRemoval,'remove-range');}", "function removehighlight(language){\n $(\"div#\" + language).removeClass(\"highlightrow\");\n $(\"div#\" + language).removeClass(\"highlightrow1\");\n $(\"div#\" + language).removeClass(\"highlightrow2\");\n }", "ClearGraphicHighlight() {\n this.highlight.remove();\n this.highlight = null;\n }", "function removeWord(e) {\n let $currentWords = $('.blacklist__word'),\n args = (arguments.length === 0 || e.type === 'click') ? $(this).closest('.blacklist__word').index() : e;\n [].concat(args)\n .map(elem => {\n let index = typeof elem === 'number' ? elem : blacklistWords.indexOf(elem.toLowerCase());\n if (index !== -1) {\n return index;\n }\n })\n .sort((a, b) => b - a)\n .forEach(index => {\n blacklistWords.splice(index, 1);\n $currentWords.eq(index).addClass('zoomOut');\n console.log(blacklistWords);\n });\n checkAllReviews();\n }", "function unHighlight() {\n if (window.getSelection) {\n var selection = window.getSelection();\n if (selection.rangeCount) {\n\n var highlightNode = document.createElement(\"span\");\n highlightNode.setAttribute(\"id\", \"highlighted\");\n highlightNode.setAttribute(\"style\", \"background-color:#FFFF00\");\n\n var range = selection.getRangeAt(0).cloneRange();\n var node = $(range.commonAncestorContainer);\n\n var previousRange = document.createRange();\n previousRange.setStart(range.startContainer, 0);\n previousRange.setEnd(range.startContainer, range.startOffset);\n\n var nextRange = document.createRange();\n nextRange.setStart(range.endContainer, range.endOffset);\n nextRange.setEnd(range.endContainer, 0);\n\n node.unwrap();\n previousRange.surroundContents(highlightNode);\n nextRange.surroundContents(highlightNode);\n\n selection.removeAllRanges();\n selection.addRange(previousRange);\n selection.addRange(nextRange);\n }\n }\n}", "clearHighlight() {\n\n //TODO - your code goes here -\n }", "function deselect() {\n\tcanedit = false\n\tdocument.getElementById(\"mobilePreview\").classList.add(\"invisable\")\n\tdocument.getElementById(\"previewBox\").innerHTML = \"\"\n\tfor (let i = 1; i < (numsquares + 1); i++) {\n\t\tdocument.getElementById(\"crossword-square-\"+i).classList.remove(\"focus\")\n\t\tdocument.getElementById(\"crossword-square-\"+i).classList.remove(\"highlight\")\n\t}\n\tfor (let i = 1; i < (numwordsacross + 1); i++) {\n\t\tdocument.querySelector(\"#crossword-clues-across :nth-child(\" + i + \")\").classList.remove(\"highlight\")\n\t}\n\tfor (let i = 1; i < (numwordsdown + 1); i++) {\n\t\tdocument.querySelector(\"#crossword-clues-down :nth-child(\" + i + \")\").classList.remove(\"highlight\")\n\t}\n}", "function unhighlight(p){\n\t$(p).css('background', '#fff');\n}", "function MyApp_RemoveAllHighlights() {\nMyApp_RemoveAllHighlightsForElement(document.body);\n}", "function clearHighlights() {\n // select element to unwrap\n var el = document.querySelector('#highlighted');\n\n // get the element's parent node\n if (el !== null) {\n var parent = el.parentNode;\n\n // move all children out of the element\n while (el.firstChild)\n parent.insertBefore(el.firstChild, el);\n\n // remove the empty element\n parent.removeChild(el);\n }\n}", "unhighlightAll() {\n if (!this.tf.highlightKeywords) {\n return;\n }\n\n this.unhighlight(null, this.highlightCssClass);\n }", "function removeHighlight(highlight) {\n\t// Move its children (normally just one text node) into its parent.\n\twhile (highlight.firstChild) {\n\t\thighlight.parentNode.insertBefore(highlight.firstChild, highlight);\n\t}\n\t// Remove the now empty node\n\thighlight.remove();\n}", "function removeFromDictionary(word) {\r\n var element = checkWord(word);\r\n var index = dictionary.indexOf(element);\r\n dictionary.splice(index, 1);\r\n remoteDictionaryTransaction(word, \"delete\")\r\n //console.log(\"Remove from dictionary index: \" + index);\r\n //checkDictionary(iCurrentSubs, false);\r\n\tcheckDictionary(subtitlesHistory.getCuesNL(), false);\r\n setStorageDictionary(dictionary);\r\n}", "function removeHeatMapWord(){\n\tvar words = $(this).parent().text();\n\t$(this).closest(\"li\").remove();\n\tvar query = $(\"#heat-map\").val();\n\tquery = query.replace(\"+\"+words+\" \", \"\");\n\t$('#heat-map').val(query);\n\t$(\"#heat-map-query > a\").attr(\"href\", heatMapURL+escape(query)+\";\")\n}", "function keyCommandDeleteWord(editorState) {\n\t var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n\t var selection = strategyState.getSelection();\n\t var offset = selection.getStartOffset();\n\t var key = selection.getStartKey();\n\t var content = strategyState.getCurrentContent();\n\t var text = content.getBlockForKey(key).getText().slice(offset);\n\t var toRemove = DraftRemovableWord.getForward(text);\n\n\t // If there are no words in front of the cursor, remove the newline.\n\t return moveSelectionForward(strategyState, toRemove.length || 1);\n\t }, 'forward');\n\n\t if (afterRemoval === editorState.getCurrentContent()) {\n\t return editorState;\n\t }\n\n\t return EditorState.push(editorState, afterRemoval, 'remove-range');\n\t}", "function clearHighlight() {\n $('.opBtn').removeClass('selectedOperator');\n}", "function handleBrokenWordDelete( elem ) {\n elem = $(elem).closest('g');\n if ( elem.length > 0 && elem.hasClass('Word') && elem.attr('id').match(/_part[12]$/) ) {\n var\n deltext = self.cfg.textFormatter(elem.find('> .TextEquiv').html()).replace(/\\u00AD/g,''),\n wpart = elem.attr('id').replace(/.*(_w[^_]+_part[12])$/,'$1');\n if ( wpart.match(/1$/) )\n wpart = wpart.replace(/1$/,'2');\n else\n wpart = wpart.replace(/2$/,'1');\n elem = elem.closest('g.TextRegion').find('g[id$=\"'+wpart+'\"].wordpart');\n var\n keeptext = self.cfg.textFormatter(elem.find('> .TextEquiv').html()).replace(/\\u00AD/g,''),\n newtext = wpart.match(/1$/) ? keeptext+deltext : deltext+keeptext,\n newid = elem.attr('id').replace(/_part[12]$/,'');\n alert('WARNING: Due to part of broken word deletion, the other part will be updated.\\nid: '+elem.attr('id')+' => '+newid+'\\ntext: \"'+keeptext+'\" => \"'+newtext+'\"');\n elem.attr( 'id', newid );\n elem.find('> .TextEquiv').html( self.cfg.textParser(newtext) );\n }\n }", "function removeWord() {\n // Generate random number between the length of the title and 1\n var rand;\n do {\n rand = Math.round(Math.random() * 10);\n } while (rand > titlelength || rand === 0);\n wordPosition = rand - 1; // Array start at 0\n answer = titlewords[wordPosition];\n answer = answer.replace(/[#?!,:]/g, \"\");\n // Use answer length to generate string to replace missing word with\n\n var replacement = [];\n\n // If answer is just one letter - replace it with an underline\n // If answer is greater than one - replace the remaining letters with underline\n\n if (answer.length === 1) {\n for (i = 0; i < answer.length; i++) {\n replacement[i] = [\"_\"];\n }\n } else {\n for (i = 0; i < answer.length - 1; i++) {\n replacement[i] = [\"_\"];\n }\n }\n\n // If the answer is only one letter - we don't give them a clue - if not, we give them the first letter\n if (answer.length === 1) {\n var string = replacement.join();\n } else {\n var string = answer[0] + replacement.join();\n string.replace(/,/g, \"\");\n }\n\n if (\n titlewords[wordPosition].toString().toLowerCase() !=\n topic.toString().toLowerCase()\n ) {\n lengthOfWord = titlewords[wordPosition].length;\n titlewords[wordPosition] = `${string}`;\n }\n // Problem might arise if the movie only has one word and it is the key word (end in infinite loop)\n // Check if the title is only one word and that word is the topic word\n else if (\n titlewords.length === 1 &&\n titlewords[wordPosition].toString().toLowerCase() ===\n topic.toString().toLowerCase()\n ) {\n lengthOfWord = titlewords[wordPosition].length;\n titlewords[wordPosition] = `${string}`;\n } else {\n removeWord(); // Call the function again if it choose the topic word\n }\n }", "function removeHighlightingFromDoc(docId) {\n var doc = DocumentApp.openById(docId);\n var content = doc.getBody();\n var documentProperties = PropertiesService.getDocumentProperties();\n var data = documentProperties.getProperties();\n \n for (var key in data) {\n var propertyValue = JSON.parse(data[key]);\n var namedRange = doc.getNamedRangeById(key);\n // if not found - skip iteration\n if(!namedRange) {\n continue;\n }\n var elements = namedRange.getRange().getRangeElements();\n \n for (var i = 0; i < elements.length; i++) {\n var element = elements[i];\n \n // Only modify elements that can be edited as text; skip images and other non-text elements.\n if (element.getElement().editAsText) {\n // remove styles for a part of element in case if \n // element is partial\n if (element.isPartial()) {\n text.setAttributes(element.getStartOffset(), element.getEndOffsetInclusive(), getStyles('none'));\n } else {\n text.setAttributes(getStyles('none'));\n }\n }\n } \n }\n doc.saveAndClose();\n}", "function deleteWord(x, y) {\n\tvar idElement = \"#s\"+x+\"-\"+y;\n\tif (document.querySelector(idElement) !== null) {\n\t\tdocument.querySelector(idElement).className = \"mouille\";\n\t\tif (intervId[x] == null)\n\t\t\tintervId[x] = new Array();\n\t\tintervId[x][y] = window.setInterval(function () {\n\t\t\tif (document.querySelector(idElement).style.opacity > 0.4) {\n\t\t\t\tdocument.querySelector(idElement).style.opacity -= 0.05;\n\t\t\t} else {\n\t\t\t\tclearInterval(intervId[x][y]);\n\t\t\t}\n\t\t}, 250);\n\t}\n}", "function MyApp_RemoveAllHighlightsForElement(element) {\nif (element) {\n\tif (element.nodeType == 1) {\n\t\tif (element.getAttribute(\"class\") == \"highlight\") {\n\t\t\tvar text = element.removeChild(element.firstChild);\n\t\t\telement.parentNode.insertBefore(text, element);\n\t\t\telement.parentNode.removeChild(element);\n\t\t\treturn true;\n\t\t} else {\n\t\t\tvar normalize = false;\n\t\t\tfor (var i = element.childNodes.length - 1; i >= 0; i--) {\n\t\t\t\tif (MyApp_RemoveAllHighlightsForElement(\n\t\t\t\t\t\telement.childNodes[i])) {\n\t\t\t\t\tnormalize = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (normalize) {\n\t\t\t\telement.normalize();\n\t\t\t}\n\t\t}\n\t}\n}\nreturn false;\n}", "function rem(){\n $(\"#b1\").removeClass(\"Highlight\") ;\n $(\"#b2\").removeClass(\"Highlight\") ;\n $(\"#b3\").removeClass(\"Highlight\") ;\n $(\"#b4\").removeClass(\"Highlight\") ;\n }", "wordRemove(idBook, idWord) {\n const book = this.bookFilter(idBook)\n const words = book.words\n const word = words.findIndex((i_word) => i_word.id === idWord)\n book.words.splice(word, 1)\n }", "function SearchDoc_RemoveAllHighlightsForElement(element) {\n if (element) {\n if (element.nodeType == 1) {\n if (element.getAttribute(\"class\") == \"MyAppHighlight\") {\n var text = element.removeChild(element.firstChild);\n element.parentNode.insertBefore(text,element);\n element.parentNode.removeChild(element);\n return true;\n } else {\n var normalize = false;\n for (var i=element.childNodes.length-1; i>=0; i--) {\n if (SearchDoc_RemoveAllHighlightsForElement(element.childNodes[i])) {\n normalize = true;\n }\n }\n if (normalize) {\n element.normalize();\n }\n }\n }\n }\n return false;\n}", "function clearHighlights() {\n $(getContainer()).find('.' + className).each(function() {\n var $wrapped = $(this);\n $wrapped.replaceWith($wrapped.text());\n });\n }", "removeWordLeft() {\n if (this.selection.isEmpty())\n this.selection.selectWordLeft();\n\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n }", "function removeParaHighlights() {\nconst paras = document.querySelectorAll('p.highlight'); for(let p of paras) {\n p.classList.remove('highlight');\n }\n}", "resetHighlighted() {\n this.highlights.forEach((h) => h.remove());\n this.highlights.length = 0; // Clear\n }", "function clearHighlight() {\n document.getElementById(\"flyLynchburg\").style.border = unhighlight;\n document.getElementById(\"flyAlexandria\").style.border = unhighlight;\n document.getElementById(\"flyHenrico\").style.border = unhighlight;\n \n }", "removeWordRight() {\n if (this.selection.isEmpty())\n this.selection.selectWordRight();\n\n this.session.remove(this.getSelectionRange());\n this.clearSelection();\n }", "eraseHotWord(aWord) {\n const status = binding.EraseHotWord(this._impl, aWord);\n if (status !== 0) {\n throw `eraseHotWord failed: ${binding.ErrorCodeToErrorMessage(status)} (0x${status.toString(16)})`;\n }\n }", "function js_unHighlight()\n{\n for (var i=0; i<bold_Tags.length; i++) \n {\n bold_Tags[i].style.color = \"black\";\n }\n}", "function keyCommandDeleteWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(offset);\n var toRemove = DraftRemovableWord.getForward(text);\n\n // If there are no words in front of the cursor, remove the newline.\n return moveSelectionForward(strategyState, toRemove.length || 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "function keyCommandDeleteWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(offset);\n var toRemove = DraftRemovableWord.getForward(text);\n\n // If there are no words in front of the cursor, remove the newline.\n return moveSelectionForward(strategyState, toRemove.length || 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "function keyCommandDeleteWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(offset);\n var toRemove = DraftRemovableWord.getForward(text);\n\n // If there are no words in front of the cursor, remove the newline.\n return moveSelectionForward(strategyState, toRemove.length || 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "function keyCommandDeleteWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(offset);\n var toRemove = DraftRemovableWord.getForward(text);\n\n // If there are no words in front of the cursor, remove the newline.\n return moveSelectionForward(strategyState, toRemove.length || 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "function keyCommandDeleteWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(offset);\n var toRemove = DraftRemovableWord.getForward(text);\n\n // If there are no words in front of the cursor, remove the newline.\n return moveSelectionForward(strategyState, toRemove.length || 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "function keyCommandDeleteWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(offset);\n var toRemove = DraftRemovableWord.getForward(text);\n\n // If there are no words in front of the cursor, remove the newline.\n return moveSelectionForward(strategyState, toRemove.length || 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "function keyCommandDeleteWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(offset);\n var toRemove = DraftRemovableWord.getForward(text);\n\n // If there are no words in front of the cursor, remove the newline.\n return moveSelectionForward(strategyState, toRemove.length || 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "function keyCommandDeleteWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(offset);\n var toRemove = DraftRemovableWord.getForward(text);\n\n // If there are no words in front of the cursor, remove the newline.\n return moveSelectionForward(strategyState, toRemove.length || 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "function keyCommandDeleteWord(editorState) {\n var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n var selection = strategyState.getSelection();\n var offset = selection.getStartOffset();\n var key = selection.getStartKey();\n var content = strategyState.getCurrentContent();\n var text = content.getBlockForKey(key).getText().slice(offset);\n var toRemove = DraftRemovableWord.getForward(text);\n\n // If there are no words in front of the cursor, remove the newline.\n return moveSelectionForward(strategyState, toRemove.length || 1);\n }, 'forward');\n\n if (afterRemoval === editorState.getCurrentContent()) {\n return editorState;\n }\n\n return EditorState.push(editorState, afterRemoval, 'remove-range');\n}", "function cleanWord(html){\n\thtml = html.replace(/<o:p>\\s*<\\/o:p>/g, \"\");\n\thtml = html.replace(/<o:p>(.|\\n)*?<\\/o:p>/g, \"&nbsp;\");\n\t\n\t// Remove mso-xxx styles.\n\thtml = html.replace(/\\s*mso-[^:]+:[^;\"]+;?/gi, \"\");\n\n\t// Remove margin styles.\n\thtml = html.replace(/\\s*MARGIN: 0cm 0cm 0pt\\s*;/gi, \"\");\n\thtml = html.replace(/\\s*MARGIN: 0cm 0cm 0pt\\s*\"/gi, \"\\\"\");\n\thtml = html.replace(/\\s*TEXT-INDENT: 0cm\\s*;/gi, \"\");\n\thtml = html.replace(/\\s*TEXT-INDENT: 0cm\\s*\"/gi, \"\\\"\");\n\thtml = html.replace(/\\s*TEXT-ALIGN: [^\\s;]+;?\"/gi, \"\\\"\");\n\thtml = html.replace(/\\s*PAGE-BREAK-BEFORE: [^\\s;]+;?\"/gi, \"\\\"\");\n\thtml = html.replace(/\\s*FONT-VARIANT: [^\\s;]+;?\"/gi, \"\\\"\");\n\thtml = html.replace(/\\s*tab-stops:[^;\"]*;?/gi, \"\");\n\thtml = html.replace(/\\s*tab-stops:[^\"]*/gi, \"\");\n\n\t// Remove FONT face attributes.\n\thtml = html.replace(/\\s*face=\"[^\"]*\"/gi, \"\");\n\thtml = html.replace(/\\s*face=[^ >]*/gi, \"\");\n\thtml = html.replace(/\\s*FONT-FAMILY:[^;\"]*;?/gi, \"\");\n\t\n\t// Remove Class attributes\n\thtml = html.replace(/<(\\w[^>]*) class=([^ |>]*)([^>]*)/gi, \"<$1$3\");\n\n\t// Remove styles.\n\thtml = html.replace(/<(\\w[^>]*) style=\"([^\\\"]*)\"([^>]*)/gi, \"<$1$3\");\n\n\t// Remove empty styles.\n\thtml = html.replace(/\\s*style=\"\\s*\"/gi, '');\n\t\n\thtml = html.replace(/<SPAN\\s*[^>]*>\\s*&nbsp;\\s*<\\/SPAN>/gi, '&nbsp;');\n\thtml = html.replace(/<SPAN\\s*[^>]*><\\/SPAN>/gi, '');\n\t\n\t// Remove Lang attributes\n\thtml = html.replace(/<(\\w[^>]*) lang=([^ |>]*)([^>]*)/gi, \"<$1$3\");\n\t\n\thtml = html.replace(/<SPAN\\s*>((.|\\n)*?)<\\/SPAN>/gi, '$1');\n\t\n\thtml = html.replace(/<FONT\\s*>((.|\\n)*?)<\\/FONT>/gi, '$1');\n\n\t// Remove XML elements and declarations\n\thtml = html.replace(/<\\\\?\\?xml[^>]*>/gi, \"\");\n\t\n\t// Remove Tags with XML namespace declarations: <o:p><\\/o:p>\n\thtml = html.replace(/<\\/?\\w+:[^>]*>/gi, \"\");\n\thtml = html.replace(/<H\\d>\\s*<\\/H\\d>/gi, '');\n\thtml = html.replace(/<H1([^>]*)>/gi, '<div$1><b><font size=\"6\">');\n\thtml = html.replace(/<H2([^>]*)>/gi, '<div$1><b><font size=\"5\">');\n\thtml = html.replace(/<H3([^>]*)>/gi, '<div$1><b><font size=\"4\">');\n\thtml = html.replace(/<H4([^>]*)>/gi, '<div$1><b><font size=\"3\">');\n\thtml = html.replace(/<H5([^>]*)>/gi, '<div$1><b><font size=\"2\">');\n\thtml = html.replace(/<H6([^>]*)>/gi, '<div$1><b><font size=\"1\">');\n\thtml = html.replace(/<\\/H\\d>/gi, '<\\/font><\\/b><\\/div>');\n\thtml = html.replace(/<(U|I|STRIKE)>&nbsp;<\\/\\1>/g, '&nbsp;');\n\n\t// Remove empty tags\n\thtml = html.replace(/<([^\\s>]+)[^>]*>\\s*<\\/\\1>/g, '');\n\n\t// Transform <P> to <DIV>\n\tvar re = new RegExp(\"(<P)([^>]*>(.|\\\\n)*?)(<\\\\/P>)\",\"gi\");\t\n\thtml = html.replace(re, \"<div$2<\\/div>\");\n\treturn html ;\n}", "function dehighlight(props){\n\t\tlet selected = d3.selectAll(\".\" + props.name)\n\t\t\t.style(\"stroke\", function(){\n\t\t\t\treturn getStyle(this, \"stroke\")\n\t\t\t})\n\t\t\t.style(\"stroke-width\", function(){\n\t\t\t\treturn getStyle(this, \"stroke-width\")\n\t\t\t});\n\t\tfunction getStyle(element, styleName){\n\t\t\tlet styleText = d3.select(element)\n\t\t\t\t.select(\"desc\")\n\t\t\t\t.text();\n\n\t\t\tlet styleObject = JSON.parse(styleText);\n\n\t\t\treturn styleObject[styleName];\n\t\t};\n\n\t\td3.select(\".infoLabel\")\n\t\t\t.remove();\n\t}", "function keywordBlur(){\n\tclearContent();\n}", "function removeOperatorHighlight(){\n\t\tvar $operators = $(\".operator\");\n\t\t$operators.each(function(){\n\t\t\t$(this).css({\"border\": \"1px solid grey\"});\n\t\t});\n\t}", "onUnhighlight() {\n const { onChangeHighlight } = this.props;\n if (onChangeHighlight) {\n onChangeHighlight(null);\n }\n }", "function stripTrigger(text, trigger) {\n return text.replace(new RegExp(`${trigger} *`), \"\");\n}", "function dehighlight(props){\n var selected = d3.selectAll(\".\" + props.adm1_code)\n .style(\"stroke\", function(){\n return getStyle(this, \"stroke\")\n })\n .style(\"stroke-width\", function(){\n return getStyle(this, \"stroke-width\")\n });\n\n function getStyle(element, styleName){\n var styleText = d3.select(element)\n .select(\"desc\")\n .text();\n\n var styleObject = JSON.parse(styleText);\n\n return styleObject[styleName];\n };\n d3.select(\".infolabel\")\n .remove();\n }", "function removeSpan() {\n $(\"#hang-word\").empty();\n $(\"#hint-img\").attr(\"src\", \"#\").hide();\n}", "function removeUnderlineSelection() {\n\n var sel = window.getSelection();\n var range = sel.getRangeAt(0);\n\n var nodes = getRangeTextNodes(range);\n\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n// unhighlight(node);\n var parent = node.parentNode;\n// window.TextSelection.jsLog(\"====\\n!@@@@@@@@@@! span= \" + parent.getElementsByTagName(\"span\").length);\n if (parent.nodeName != \"SPAN\") {\n unhighlight(node);\n// window.TextSelection.jsLog(\"1111\");\n } else {\n// window.TextSelection.jsLog(\"2222\");\n unhighlight(parent);\n }\n\n// window.TextSelection.jsError(\"!@@@@@@@@@@! = \" + parent.nodeType);\n// window.TextSelection.jsError(\"!@@@@@@@@@@! = \" + parent.textContent);\n// window.TextSelection.jsError(\"!@@@@@@@@@@! = \" + parent.nodeName);\n// continue;\n//\n// var r = document.createRange();\n// r.setStart(node, 0);\n// r.setEnd(node, node.textContent.length);\n// setRangeTextDecoration(r, \"none\");\n//\n//\n//// r.setStart(node, )\n// if (node.style) {\n// node.style.textDecoration = \"none\";\n// }\n }\n}", "function dehighlight(props){\n var selected = d3.selectAll(\".\" + props.name)\n .style(\"stroke\", function(){\n return getStyle(this, \"stroke\")\n })\n .style(\"stroke-width\", function(){\n return getStyle(this, \"stroke-width\")\n });\n \n function getStyle(element, styleName){\n var styleText = d3.select(element)\n .select(\"desc\")\n .text();\n \n var styleObject = JSON.parse(styleText);\n \n return styleObject[styleName];\n };\n \n d3.select(\".infoLabel\")\n .remove()\n }", "function clearHighlightsOnPage()\n{\n unhighlight(document.getElementsByTagName('body')[0], \"ffff00\");\n highlightedPage = false;\n lastText = \"\";\n}", "function destroyHighlightAnnotation(){\n editor.getSession().removeMarker(currentHighlight);\n}", "function undoHighlightLine(code_mirror_box, css) {\n var identifier = \"_\" + css\n if (identifier in code_mirror_box) {\n var lineHandle = code_mirror_box[identifier]\n code_mirror_box.removeLineClass(lineHandle, \"background\", css);\n }\n}", "function removeHighlights() {\n $(\".edit-box, .edit-box > p\").css({\n \"border\": \"\"\n });\n}", "function keyCommandBackspaceWord(editorState){var afterRemoval=removeTextWithStrategy(editorState,function(strategyState){var selection=strategyState.getSelection();var offset=selection.getStartOffset();// If there are no words before the cursor, remove the preceding newline.\r\n\tif(offset===0){return moveSelectionBackward(strategyState,1);}var key=selection.getStartKey();var content=strategyState.getCurrentContent();var text=content.getBlockForKey(key).getText().slice(0,offset);var toRemove=DraftRemovableWord.getBackward(text);return moveSelectionBackward(strategyState,toRemove.length||1);},'backward');if(afterRemoval===editorState.getCurrentContent()){return editorState;}return EditorState.push(editorState,afterRemoval,'remove-range');}", "function SearchDoc_RemoveAllHighlights() {\n SearchDoc_SearchResultCount = 0;\n SearchDoc_RemoveAllHighlightsForElement(document.body);\n}", "function wordHighlighter(node, word, options, onVisitHighlightedWord) {\n if (!word || !Array.isArray(word)) return;\n const {wordNumbers = [], wordCounter} = options;\n const textContent = toString(node);\n\n word.forEach((word, index) => {\n if (word && textContent?.includes(word)) {\n options.wordCounter = wordCounter + 1;\n if (\n wordNumbers.length === 0 ||\n wordNumbers[index]?.includes(options.wordCounter) ||\n wordNumbers[index]?.length === 0\n ) {\n let textContent = toString(node);\n let startIndex = 0;\n\n while (textContent.includes(word)) {\n const nodesToWrap = getNodesToHighlight(node, word, startIndex);\n\n // maybe throw / notify due to failure here\n if (nodesToWrap.length === 0) break;\n\n wrapHighlightedWords(node, nodesToWrap, onVisitHighlightedWord);\n // re-start from the 'last' node (the word or part of it may exist multiple times in the same node)\n // account for possible extra nodes added from split with - 2\n startIndex = Math.max(\n nodesToWrap[nodesToWrap.length - 1].index - 2,\n 0\n );\n textContent = node.children\n ?.map((childNode) => {\n if (\n !childNode.properties.hasOwnProperty(\n 'rehype-pretty-code-visited'\n ) &&\n !childNode.properties.hasOwnProperty(\n 'data-rehype-pretty-code-wrapper'\n )\n ) {\n return toString(childNode);\n }\n })\n .join('');\n }\n\n node.children?.forEach((childNode) => {\n if (\n childNode.properties.hasOwnProperty('rehype-pretty-code-visited')\n ) {\n delete childNode.properties['rehype-pretty-code-visited'];\n }\n });\n }\n }\n });\n}", "function undoHighlightCurrentCode() {\n // Change the css property by applying no highlighted background color\n $(\"#code_\" + registers[\"rip\"]).css(\"background-color\", \"\");\n}", "function dehighlight(){\n for(var i = 1; i <= fiveWords.length; i++){\n //just took this substring from compare function\n var stringValue = fiveWords[i-1].substring(0, userWord.length).toUpperCase();\n //it reinserts words that are not valid, and keeps the word that is good.\n if(userWord != stringValue){\n document.getElementById(\"myAnimation\" + i).innerHTML = fiveWords[i - 1];\n }\n }\n}", "delete_from_trie(word){\n if (this.is_word(word) === false) {\n return false \n }\n this.deleteRecursive(this.root, word);\n }", "function removingUsedWord() {\r\n\tlet tempWords = randomWords;\r\n\tfor (let r = 0; r < tempWords.length; r++) {\r\n\t\tif (tempWords[r] == lowerCaseRandomWord) {\r\n\t\t\ttempWords.splice(r, 1);\r\n\t\t\tbreak;\r\n\t\t} else {\r\n\t\t\t//randomWords = tempWords[r];\r\n\t\t}\r\n\t}\r\n}", "function Del(Word) {\na = Word.indexOf(\"<\");\nb = Word.indexOf(\">\");\nlen = Word.length;\nc = Word.substring(0, a);\nif(b == -1)\nb = a;\nd = Word.substring((b + 1), len);\nWord = c + d;\ntagCheck = Word.indexOf(\"<\");\nif(tagCheck != -1)\nWord = Del(Word);\nreturn Word;\n}", "function unwrapWords(rootNode) {\n whileApplyingSelectionChanges(rootNode, (selectionSnapshot) => {\n const spellingNodes = rootNode.querySelectorAll('spelling');\n for (let ii = 0; ii < spellingNodes.length; ii++) {\n const node = spellingNodes[ii];\n if (selectionSnapshot.anchorNode === node) {\n selectionSnapshot.anchorNode = node.firstChild;\n }\n if (selectionSnapshot.focusNode === node) {\n selectionSnapshot.focusNode = node.firstChild;\n }\n selectionSnapshot.modified = true;\n while (node.firstChild) {\n node.parentNode.insertBefore(node.firstChild, node);\n }\n recycleSpellingNode(node);\n node.parentNode.removeChild(node);\n }\n });\n rootNode.normalize();\n}", "clearHighlight() {\n\n //TODO - Your code goes here - \n let icon = d3.select('.icon-holder').selectAll('text');\n icon.remove();\n let values = d3.select('.value-holder').selectAll('text');\n values.remove();\n let name = d3.select('.name-holder').selectAll('text');\n name.remove();\n\n }", "function handleWordAnimaton(e) {\n let $word = $(this);\n if ($word.hasClass('zoomIn')) {\n $word.removeClass('zoomIn');\n } else {\n $word.remove();\n }\n }", "function removeModerationNotes () {\n $('.moderation-note-highlight').each(function () {\n $(this).contents().unwrap();\n });\n }", "function dehighlight(props){\n var selected = d3.selectAll(\".\" + props.name.replace(/ /g, \"_\"))\n .style(\"stroke\", function(){\n return getStyle(this, \"stroke\")\n })\n .style(\"stroke-width\", function(){\n return getStyle(this, \"stroke-width\")\n });\n\n function getStyle(element, styleName){\n var styleText = d3.select(element)\n .select(\"desc\")\n .text();\n\n var styleObject = JSON.parse(styleText);\n\n d3.select(\".infolabel\")\n .remove();\n\n return styleObject[styleName];\n };\n}", "function highlightWord(node, word, doc){\n if (word.length < 3) \n return;\n //word = urldecode(word);\n \n doc = typeof(doc) != 'undefined' ? doc : document;\n // Iterate into this nodes childNodes\n \n /* tp integration */\n if (node.className == 'tp-info-box')\n return;\n /* tp integration */\n\n if (node.hasChildNodes) {\n var hi_cn;\n for (hi_cn = 0; hi_cn < node.childNodes.length; hi_cn++) {\n highlightWord(node.childNodes[hi_cn], word, doc);\n }\n }\n \n // And do this node itself\n if (node.nodeType == 3) { // text node\n tempNodeVal = stripVowelAccent(node.nodeValue.toLowerCase());\n tempWordVal = stripVowelAccent(word.toLowerCase());\n if (tempNodeVal.indexOf(tempWordVal) != -1) {\n \n pn = node.parentNode;\n if (pn.className != \"searchword\") {\n // word has not already been highlighted!\n nv = node.nodeValue;\n ni = tempNodeVal.indexOf(tempWordVal);\n // Create a load of replacement nodes\n before = doc.createTextNode(nv.substr(0, ni));\n docWordVal = nv.substr(ni, word.length);\n after = doc.createTextNode(nv.substr(ni + word.length));\n hiwordtext = doc.createTextNode(docWordVal);\n hiword = doc.createElement(\"span\");\t\t\t\n hiword.className = \"searchword\";\n hiword.appendChild(hiwordtext);\n pn.insertBefore(before, node);\n pn.insertBefore(hiword, node);\n pn.insertBefore(after, node);\n pn.removeChild(node);\n\t\t\t\ttry {\n\t\t\t\t\tif ((\"\"+hiword.parentNode.href) == 'undefined' &&\n\t\t\t\t\t\t(\"\"+hiword.parentNode.parentNode.href) == 'undefined' && \n\t\t\t\t\t\t(\"\"+hiword.parentNode.parentNode.parentNode.href) == 'undefined') {\n\t\t\t\t\t\thiword.onclick = reportClick;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} catch(e) {};\n }\n }\n }\n}", "function dehighlight(props){\n d3.select(\".infolabel\").remove();\n var selected = d3.selectAll(\".\" + props.geoid)\n .style(\"stroke\", function(){\n return getStyle(this, \"stroke\")\n })\n .style(\"stroke-width\", function(){\n return getStyle(this, \"stroke-width\")\n });\n\n function getStyle(element, styleName){\n var styleText = d3.select(element)\n .select(\"desc\")\n .text();\n\n var styleObject = JSON.parse(styleText);\n\n return styleObject[styleName];\n };\n }", "function resetSelection(){\n\t$(\".document-list, #scrapPaperDiv, .scrap-keyword\").find(\"span\").each(function( index ){\n\t\tif($(this).hasClass('ent_highlighted')){\n\t\t\t$(this).removeClass('ent_highlighted');\n\t\t}\n\t\t\n\t\tif($(this).hasClass('highlighted')){\n\t\t\t$(this).parent().unhighlight({className:$(this).text().split(\" \")[0]});\t\t\n\t\t}\n\t});\n\tqueue = [];\n}", "function unhighlightEasyFeature(e) {\n info.update();\n if (e.target.feature.properties.Difficulty === selectedText || selectedText === \"All\") {\n easyLayer.resetStyle(e.target);\n }\n }", "function unhighlight(event) {\n preventDefaults(event);\n dropArea.classList.remove('highlight');\n }", "function cleanHighlights() {\n\t\t\t// document.querySelectorAll returns a NodeList, it looks like an array, almost behaves like an array\n\t\t\t// but is not an array and therefore doesn't have the .forEach method available.\n\t\t\t// That's why I make an Array.from this list to have an array instead.\n\t\t\tArray.from(document.querySelectorAll('.playing')).forEach(function (element) {\n\t\t\t\telement.classList.remove('playing');\n\t\t\t})\n\t\t}", "function handleSpace() {\n userType = document.querySelector(\".type-area\").value; // data typed by user\n var deleteData = userType.replace(minusString, \"\"); // getting currently typed word\n let startword = modifiedpara.substr(0, modifiedpara.indexOf(\" \") + 1); // Getting the starting word from the paragraph\n\n if (startword == deleteData) {\n // If the starting word is equal to the word currently typed by the user\n modifiedpara = modifiedpara.replace(deleteData, \"\"); // delete the word from the paragraph\n document.querySelector(\".para-type\").innerHTML = modifiedpara; //show it in the para section\n minusString = userType; // Setting the string typed by user to minusString variable for future\n } else if (startword != deleteData && userType != deleteData) {\n document.querySelector(\".error-bundle\").innerHTML =\n document.querySelector(\".error-bundle\").innerHTML +\n `<span class=\"error-word\">${deleteData}</span>`;\n document.querySelector(\".type-area\").value = minusString;\n mistakeCount += 1;\n modifiedpara.replace(['<span class=\"highlight\">', \"</span>\"], \"\");\n document.querySelector(\".para-type\").innerHTML = modifiedpara;\n } else {\n document.querySelector(\".type-area\").value = minusString;\n }\n}", "function cleanupHighlights() {\n\t\t// Remember range details to restore it later.\n\t\tvar startContainer = rangeObject.startContainer;\n\t\tvar startOffset = rangeObject.startOffset;\n\t\tvar endContainer = rangeObject.endContainer;\n\t\tvar endOffset = rangeObject.endOffset;\n\n\t\t// Remove each of the created highlights.\n\t\tfor (var highlightIdx in highlights) {\n\t\t\tremoveHighlight(highlights[highlightIdx]);\n\t\t}\n\n\t\t// Be kind and restore the rangeObject again.\n\t\trangeObject.setStart(startContainer, startOffset);\n\t\trangeObject.setEnd(endContainer, endOffset);\n\t}", "function removeHighlighter(object){\n\n\ttry{\n\t // reset the material\n\t\tobject.material.transparent = true;\n\t\tobject.material.opacity = 0.5;\n\n\t}catch(error){\n\n\t\t//update display\n status = 'Fehler bei Markierung';\n\n\t}\n}", "removeHighlight() {\n if (this._highlight) {\n this._highlight.setStyle({\n fillOpacity: 0,\n });\n }\n }", "function removeTargetHighlight(target) {\n $(target).removeClass(\"highlight\");\n}", "clearHighlights() {\n\t\tvar t = this;\n\t\tvar len = t.getLength();\n\t\tfor (var x = 0; x < len; x++) {\n\t\t\tt.getRow(x).classList.remove(\"highlight\");\n\t\t}\n\t}", "function cleanWord (word) {\n if (!word) return ''\n var cleanWord = word.replace(/[()!,;:.\"]+/, '')\n return cleanWord\n}", "function keepSingleWords(words) {\n\n}", "function dehighlight(props){\r\n var selected = d3.selectAll(\".\" + props.CODE)\r\n .style(\"stroke\", function(){\r\n return getStyle(this, \"stroke\")\r\n })\r\n .style(\"stroke-width\", function(){\r\n return getStyle(this, \"stroke-width\")\r\n });\r\n\r\n function getStyle(element, styleName){\r\n var styleText = d3.select(element)\r\n .select(\"desc\")\r\n .text();\r\n \r\n var styleObject = JSON.parse(styleText);\r\n\r\n return styleObject[styleName];\r\n };\r\n \r\n d3.select(\".infolabel\")\r\n .remove();\r\n}", "function BreakerClick([color, word]){\n\twordClick=document.getElementById(word);\n\twordClick.bgColor=color;\n\twordClick.innerText=\"\";\n\twordClick.setAttribute(\"name\", \"usedWord\");\n}", "function selectWord(word) {\n\tselectedWord = cssUnescapeString(word);\n\t// select correct words\n\t$(\".selectedWord\").addClass(\"unselectedWord\").removeClass(\"selectedWord\");\n\t$(\".unselectedWord[word='\" + word + \"']\").addClass(\"selectedWord\")\n\t\t\t\t\t\t\t\t\t\t.removeClass(\"unselectedWord\");\n\t\n\tloadOfficialTable();\n\tmoveContext(0);\n}", "function removeSelectionHighlight() {\r\n hideSelectionRect();\r\n hideRotIndicator();\r\n }", "function processWord(word) {\n var optimalRecognitionposition = Math.floor(word.length / 3),\n letters = word.split('')\n return letters.map(function(letter, idx) {\n if (idx === optimalRecognitionposition)\n return '<span class=\"highlight\">' + letter + '</span>'\n return letter;\n }).join('')\n }", "function dehighlight(props){\n var selected = d3.selectAll(\".\" + props.TRACT)\n .style(\"stroke\", function(){\n return getStyle(this, \"stroke\")\n })\n .style(\"stroke-width\", function(){\n return getStyle(this, \"stroke-width\")\n });\n\n function getStyle(element, styleName){\n var styleText = d3.select(element)\n .select(\"desc\")\n .text();\n\n var styleObject = JSON.parse(styleText);\n\n return styleObject[styleName];\n };\n //below Example 2.4 line 21...remove info label\n d3.select(\".infolabel\")\n .remove();\n}" ]
[ "0.6502792", "0.62419283", "0.61501455", "0.6088625", "0.60879046", "0.6055429", "0.6054556", "0.5972656", "0.5962439", "0.5947594", "0.5904569", "0.5898729", "0.5796435", "0.5780125", "0.57516414", "0.5705371", "0.5691678", "0.566514", "0.56323665", "0.56138027", "0.56009203", "0.5567463", "0.55531687", "0.5542288", "0.55337834", "0.55126673", "0.5489776", "0.5446286", "0.5445881", "0.5441577", "0.54379463", "0.54321927", "0.5425446", "0.53968835", "0.53827405", "0.5363281", "0.5357749", "0.5348851", "0.5337416", "0.53360873", "0.53342515", "0.533317", "0.5328493", "0.5328148", "0.53250384", "0.53250384", "0.53250384", "0.53250384", "0.53250384", "0.53250384", "0.53250384", "0.53250384", "0.53250384", "0.5322551", "0.53159815", "0.5299342", "0.52896214", "0.5284693", "0.527729", "0.5273729", "0.52735025", "0.52721953", "0.52600896", "0.52581406", "0.52527696", "0.5249491", "0.5243368", "0.52377665", "0.52340907", "0.5232631", "0.5220898", "0.52070475", "0.5205447", "0.5194293", "0.51866364", "0.51699245", "0.51505214", "0.51355547", "0.51263475", "0.5125564", "0.51247185", "0.51185817", "0.5114301", "0.51062554", "0.5095488", "0.5085079", "0.5082658", "0.5080497", "0.5080296", "0.50731224", "0.5061455", "0.50544447", "0.50503826", "0.50477046", "0.5041045", "0.50402874", "0.5037086", "0.5034199", "0.50312024", "0.5027729" ]
0.6616735
0
this function is called when users
onSelectAyah(selectedAyah, selectedWord, evalNotes) { if (this.state.readOnly) { // don't change highlighted words/ayahs on read-only mode. return; } //if users press on a word, we highlight that word if (selectedWord.char_type === "word") { let highlightedWords = this.state.highlightedWords; let wordEval = _.get(highlightedWords, selectedWord.id, {}); //merge the new notes with the old notes.. Object.assign(wordEval, evalNotes); highlightedWords = { ...highlightedWords, [selectedWord.id]: wordEval }; this.setState({ highlightedWords }); } else if (selectedWord.char_type === "end") { //if user presses on an end of ayah, we highlight that entire ayah let highlightedAyahs = this.state.highlightedAyahs; let ayahKey = toNumberString(selectedAyah); let ayahEval = _.get(highlightedAyahs, ayahKey, {}); highlightedAyahs = { ...highlightedAyahs, [ayahKey]: { ...ayahEval, ...evalNotes } }; this.setState({ highlightedAyahs }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function user()\n {\n\n }", "function onRendered() {\n identifyUser();\n}", "function userinfo_requester_routines() {\n\n}", "function userinfo_dispatcher_routines() {\n\n\n}", "function HttpUserEvent() { }", "function HttpUserEvent() { }", "function HttpUserEvent() { }", "init() {\n _listenToCurrentUser();\n }", "function onUserChange(newname) {\n var id;\n\n username = newname;\n\n items.username = username;\n\n var fn = !!username? loggedin: loggedout;\n for (i=0, len=fn.length; i<len; i++) {\n fn[i](newname);\n }\n }", "function user(){\r\n uProfile(req, res);\r\n }", "_onUserUpdated() {\n UserActions.setIsUpdating(false);\n UserActions.setIsRequesting(false);\n }", "function userInfo(){\n\n}", "set_user(on) { store.dispatch(hpUser(on)); }", "function HttpUserEvent() {}", "function HttpUserEvent() {}", "function functionsToExecuteIfUserIsLoggedIn(username) {\n setCurrentUser(username);\n showLoggedInUserInformation(username);\n unlockSubscriptionButtons();\n}", "function newUser(){\r\r\n}", "function useDummy() {\n //put dummy user to be loaded in here.\n }", "function setUserData() {\n //TODO: for non-social logins - userService is handling this - not a current issue b/c there is no data for these right after reg, but needs to be consistent!\n authService.setUserCUGDetails();\n authService.setUserLocation();\n authService.setUserPreferences();\n authService.setUserBio();\n authService.setUserBookings();\n authService.setUserFavorites();\n authService.setUserReviews();\n authService.setSentryUserContext();\n authService.setSessionStackUserContext();\n\n //was a noop copied from register controller: vm.syncProfile();\n }", "_notifyListenersIfCurrent(user) {\r\n if (user === this.currentUser) {\r\n this.notifyAuthListeners();\r\n }\r\n }", "_notifyListenersIfCurrent(user) {\r\n if (user === this.currentUser) {\r\n this.notifyAuthListeners();\r\n }\r\n }", "function addUser() {\n }", "function initialize_shit(){\n\tif(!user_exists('default')){\n\t\tadd_user('default', '', patients_default);\n\t}\n}", "function activate() {\n dataService.get('/api/whoami/')\n .then(function(response) {\n $rootScope.username = response.data.username;\n $location.path(`/users/${$rootScope.username}/recipes`);\n }, function(error) {\n $rootScope.username = null;\n dataService.clearCredentials();\n recipeService.clearAllCache();\n $location.path('/public');\n });\n }", "function listenForAuthChanges() {\r\n auth.onAuthStateChanged(user => {\r\n if (user) {\r\n user.getIdTokenResult().then(idTokenResult => {\r\n user.admin = idTokenResult.claims.admin;\r\n Client.setupUI(user, db);\r\n })\r\n showMovieList();\r\n } else {\r\n Client.setupUI();\r\n hideMovieList();\r\n }\r\n })\r\n}", "function proceed() {\n\t\t/*\n\t\t\tIf the user has been loaded determine where we should\n\t\t\tsend the user.\n\t\t*/\n if (store.getters.getUserLoadStatus == 2) {\n next();\n } else if (store.getters.getUserLoadStatus == 3) {\n //user is not logged in\n console.log('you are not logged in');\n }\n }", "function CheckStatus(){\n \n fire.auth().onAuthStateChanged(\n (user)=>{\n if (user) {\n setUserInfo(user.email)\n }\n }\n )\n }", "function init() {\n \n newUser()\n\n}", "doSpoofUser() {\n this.spoofUser(this.get('user.id'));\n }", "function connected() {\n\t\t// when a user is identificated\n\t\t// fetch relevant data from OG\n\t\tfetchLikes();\n\t\tfetchFavorites();\n//\t\tfetchRecordings();\n\t\t// let know eveyone\n\t\tEvent.emit(u.LOGGED_IN);\n\n\t}", "users(parent, args, ctx, info) {\n return USERS_DATA;\n }", "function getallusers() {\n\n\t}", "function authStateObserver(user) {\n if (user) { // User is signed in!\n // Get the signed-in user's profile pic and name.\n firebase.firestore().collection('gamelist').doc(sessionStorage.gameID).get().then(function(doc){\n if (doc.data().status==\"ready\"){\n alert(\"아직 게임이 시작되지 않아 사용할 수 없습니다.\");\n location.href=\"../index.html\";\n }\n if (doc.data().status==\"on\")\n updateGameInfo();\n else\n finalGameInfo();\n var url = getProfilePicUrl();\n\n document.getElementById(\"userpic\").setAttribute(\"src\", url);\n document.getElementById(\"userID\").innerHTML = getUserName();\n document.getElementById(\"userID2\").innerHTML = getUserName();\n });\n //because it is not reveal day, removed user name and pic in guess columns.\n } else { // User is signed out!\n location.href=\"../index.html\";\n }\n}", "function registerUser() {\n addUser()\n }", "function authUser() {\n FB.Event.subscribe('auth.statusChange', handleStatusChange);\n}", "function authStateObserver(user) {\n if (user) { // User is signed in!\n // show the game list\n document.getElementById(\"userID\").innerHTML=getUserName()+\" 님, 안녕하세요.\";\n toggleScreen();\n } else{\n toggleScreen();\n }\n}", "function _notify() {\n $rootScope.$emit('usersFactoryUserChanged');\n }", "function handleUserChangeSuccess() {\n var user = userState.user();\n $scope.userNickname = user ? user.nickname : undefined;\n updateCanShowRootOperations();\n }", "function observador(){\n firebase.auth().onAuthStateChanged(function(user) {\n if (user) {\n contenidoWeb(user)\n // User is signed in.\n var displayName = user.displayName;\n var email = user.email;\n var emailVerified = user.emailVerified;\n var photoURL = user.photoURL;\n var isAnonymous = user.isAnonymous;\n var uid = user.uid;\n var providerData = user.providerData;\n // ...\n } else {\n // User is signed out.\n // ...\n console.log('No ha podido acceder')\n }\n });\n}", "function activate() {\n getUser($routeParams.username);\n }", "function userLoggedInListener (roomName, occupants, isPrimary) {\n //update the global occupants list for this user.\n all_occupants_list = occupants;\n\n //as this callback method is also called on any user disconnection...\n //remove any 'zombie' easyrtc id from 'all_occupants_details' variable\n removeZombieClientsFromOccupantsDetails(occupants);\n\n //update the online/offline status as per the new list.\n //this update is important for someone leaves the connection.\n updateOnlineStatusOfClients(all_occupants_details);\n\n //spawn telepointers for the logged in users.\n spawnTelepointers(occupants);\n\n //inform my email, name along with easyrtc id, which is later used for different tracking\n informMyDetailsToAllOtherClients(occupants);\n\n //notifyAll('disconnected', \"Hello\");\n}", "runAuthChangeHandler() {\n for (var i = 0; i < this.authObservers_.length; i++) {\n this.authObservers_[i](this['currentUser']);\n }\n }", "function userSetMode(){\n // remove the sensitive list and add the user list to websiteMap\n removePreloadListFromBlacklist();\n preloadUserSet();\n saveMode(\"userset\")\n}", "function proceed() {\r\n $scope.status = ''\r\n $scope.logo.class = 'animated zoomOutDown'\r\n AppService.getMutualMatches() // load in the background\r\n // disable the back button\r\n $ionicHistory.nextViewOptions({\r\n historyRoot: true,\r\n disableBack: true\r\n })\r\n\r\n // the timeout is to give the drop CSS animation time\r\n $timeout(() => AppService.goToNextLoginState(), 1000)\r\n\r\n var profile = AppService.getProfile();\r\n var user = {\r\n userId: profile.uid,\r\n name: profile.name,\r\n custom_attributes: {\r\n Name: profile.name,\r\n user_id: profile.uid\r\n }\r\n };\r\n\r\n intercom.updateUser(user, function() {\r\n intercom.displayMessenger();\r\n });\r\n }", "function _notify() {\n $rootScope.$emit('userFactoryUserChanged');\n }", "function setPermissions() {\n postPermission(\n success = function () {\n sweetAlert(\"User created\", \"User '\" + email + \"' has been created\", \"success\");\n viewController('users');\n },\n error = null,\n email = email,\n admin = isAdmin,\n editor = isEditor,\n dataVisPublisher = isDataVisPublisher\n );\n }", "function loadUserData() {\n firebaseFunctions.setCurrentUserData( ( user ) => {\n currentUser.innerText = user.name;\n currentUser.dataset.uid = user.id;\n currentUser.dataset.pubKey = user.chavePublica;\n } );\n}", "function refreshListOfAddedUsers(l) { User.downloadListOfAddedUsers(l); }", "function proceed () {\n\t\t\t/*\n\t\t\t\tIf the user has been loaded determine where we should\n\t\t\t\tsend the user.\n\t\t\t*/\n\t\t\tif (store.getters.getBearerToken) {\n\t\t\t\tnext();\n\t\t\t} else {\n\t\t\t\t//user is not logged in\n\t\t\t\tconsole.log('you are not logged in');\n\t\t\t}\n\t\t}", "function messageAllUsers() {\n vm.filteredusers.forEach(function (obj) {\n AddContacts(obj.email);\n });\n }", "function setUser() {\n\tuser = firebase.auth().currentUser;\n\tisSignedIn = true;\n\tcheckIfIt();\n\tcheckIt();\n\tconnectUser();\n\tdisplayScreen();\n}", "function useNewButton() {\r\n createUser();\r\n startPage()\r\n}", "function updateAllUsersLS() {\n\tif(DEBUG) console.info(\"Updating Last Seen info of everybody.\");\n\t\n\tfor (var i in usersOnThisPage) {\n\t\tgetUserOptions(i);\n\t}\n}", "function refreshListOfUsersWhoHaveAddedYou(l) { User.downloadListOfUsersWhoHaveAddedYou(l); }", "function GetUser() {\n showUsers(dataUsers[currentPage]);\n}", "function HijackUserList() {\n\t\t\t\t\t\t// Find the element for this user and change it to have an editiable user name\n\t\t\t\t\t\tvar $userNameSpan = $('div.goinstant-userlist li.goinstant-user[data-goinstant-id=\"' + user.id + '\"] > div.goinstant-name > span');\n\t\t\t\t\t\t// Rebind Click Handler\n\t\t\t\t\t\t$userNameSpan.off('click').click(function() {\n\t\t\t\t\t\t\tvar $input = $('<input type=\"text\" value=\"' + $userNameSpan.text() + '\" />');\n\t\t\t\t\t\t\t// On blur we commit the name and switch back\n\t\t\t\t\t\t\t$input.blur(function() {\n\t\t\t\t\t\t\t\tvar displayName = $input.val();\n\t\t\t\t\t\t\t\t// Set the name\n\t\t\t\t\t\t\t\tuserKey.key('displayName').set(displayName);\n\t\t\t\t\t\t\t\t$userNameSpan.text(displayName);\n\t\t\t\t\t\t\t\t// Switch back the elements\n\t\t\t\t\t\t\t\t$input.replaceWith($userNameSpan);\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t// Replace the span with the name insert\n\t\t\t\t\t\t\t$userNameSpan.replaceWith($input);\n\t\t\t\t\t\t\t// Give it focues\n\t\t\t\t\t\t\t$input.focus();\n\t\t\t\t\t\t});\n\t\t\t\t\t}", "function attachNewUserToIncident() {\n attachNewUser = true;\n $(\"#user_add_username\").val($(\"#user_name\").val());\n openAddUser();\n }", "function main() {\n tbody = $('tbody');\n template = $('.template');\n userService = new UserServiceClient();\n currentUserID = 0;\n $('.wbdv-create').click(createUser);\n $('.wbdv-update').click(updateUser);\n\n findAllUsers();\n\n }", "function detectLogin()\n {\n $.when(api.whoami()).done(function(user)\n {\n // update the UI to reflect the currently logged in user.\n topnav.update(user.firstName + ' ' + user.lastName);\n }).fail(function()\n {\n topnav.clear();\n });\n }", "async bringUser(req,res){\n //función controladora con la lógica que muestra los usuarios\n }", "function userRegistered(user) {\n console.log(\"user has been registered\");\n}", "onAuthenticated(user) {\n if (isFunction(onAuthenticated)) {\n onAuthenticated(user);\n }\n }", "function onAuthStateChange(user) {\n if (user) {\n\n // in caz ca este logat\n\n var email = user.email;\n var userId = user.uid;\n user_uid = userId;\n\n // vom face apel la baza de date pentru a prelua datele despre acesta\n\n firebase.database().ref('/users/' + userId).once('value').then(function (snapshot) {\n document.getElementById('username').innerText = snapshot.val().first_name + ' ' + snapshot.val().last_name;\n renderDbValuesToHtml(snapshot.val());\n user_stats = snapshot.val().stats;\n\n });\n }\n else\n {\n // in cazul in care iese din aplicatie, va fi redirectionat la pagina de start\n\n window.location = '../Start.html';\n }\n}", "function updateUserNames(){ \n io.emit('get users', users); // users is the array with all user names\n\n }", "function setUser(u) {\n user = u\n}", "function handleGetUser(event) {\n if (DEBUG) {\n console.log (\"Triggered handleGetUser\");\n }\n\n event.preventDefault();\n $(\"#user_list li\").removeClass(\"active\");\n\n // Make the user element 'active' visually\n $(this).parent().addClass(\"active\");\n\n prepareUserDataVisualization();\n\n var url = $(this).attr(\"href\");\n get_user(url);\n\n return;\n}", "function main() {\r\n // user.userLogin(\"[email protected]\", \"sporks\");\r\n}", "function updateDisplay() {\n UserService.getUserInfo().then(function(response) {\n displayLogs();\n })\n }", "function init() {\n UserService.get(vm.user.username)\n .then(res => {\n vm.user = res.user;\n if (vm.user.notifications.length !== 0 && vm.user.lastReadNotificationId != vm.user.notifications.reverse()[0]) {\n vm.hasNewNotifications = true;\n }\n });\n }", "onlog() {}", "function onHotmailLogin() {\r\n\t\tvar session = WL.getSession();\r\n\t\tif (session) {\r\n\t\t\tgetHotmailUser(session);\r\n\t\t}\r\n\t}", "function proceed () {\n\t\t/*\n\t\t\tIf the user has been loaded determine where we should\n\t\t\tsend the user.\n\t\t*/\n if ( store.getters.getUserLoadStatus() == 2 ) {\n\t\t\t/*\n\t\t\t\tIf the user is not empty, that means there's a user\n\t\t\t\tauthenticated we allow them to continue. Otherwise, we\n\t\t\t\tsend the user back to the home page.\n\t\t\t*/\n\t\t\tif( store.getters.getUser != '' ){\n \tnext();\n\t\t\t}else{\n\t\t\t\tnext('/cafes');\n\t\t\t}\n }\n\t}", "function userget(){\n document.getElementById('current-user').innerHTML = current_user;\n }", "function updateUsernames(){\r\n\t\tconsole.log(\"#Update User\");\r\n\t\tpicsy = [];\r\n\t\tfor(i = 0; i< profilpics.size;i++){\r\n\t\t\tpicsy[i]=profilpics.get(Object.keys(users)[i]);\r\n\t\t\tconsole.log('##'+i+\"##\"+picsy[i]);\r\n\t\t}\r\n\t\tio.sockets.emit('get users', Object.keys(users), picsy);\r\n\t\tdatabaseGetUserNames();\r\n\t}", "function updateUsers() {\n\tupdateUsersFunc(function() {\n\t});\n}", "async setupUsers() {\n const findUser = async username => {\n const user = await this.getUser(username);\n\n if (_.isEmpty(user)) {\n throw new Error(`User ${username} not found.`);\n }\n return user;\n };\n\n this.user = await findUser(this.settings.name);\n this.authorised_user = await findUser(\n this.settings.authorised_username\n );\n }", "function storeUserCallback (err) {\n if (err) {console.log(\"account already in database, moving on\");}\n else {console.log(\"inserted user into db\");}\n //I set googleid as primary key so uniqueness is forced.\n }", "function addStateToUserObject () {\n\t\tme.subscribe(\"ready\", \"User self-subscription\", function(){\n\t\t\tuser.signedin = signedin;\n\t\t}).runAsap(function(){\n\t\t\tuser.signedin = signedin;\n\t\t});\n\t}", "async _bootstrapAsync() {\n const unsub = firebase.auth().onAuthStateChanged(async user => {\n unsub();\n if (user) {\n const userId = user.uid;\n const result = await firebase.firestore().collection('users').doc(userId).get();\n const role = result.get('role');\n\n await AsyncStorage.setItem('userId', userId);\n\n if (role === 'caregiver') {\n this.props.navigation.navigate('Caregiver');\n } else {\n this.props.navigation.navigate('Patient');\n }\n } else {\n this.props.navigation.navigate('Auth');\n }\n });\n }", "onUpdated() {\n this.setState({editDialogOpen: false});\n\n this.fetchUser();\n }", "function handleUpdate() {\n var palList = AvatarList.getPalData().data;\n\n // Add users to userStore\n for (var a = 0; a < palList.length; a++) {\n var currentUUID = palList[a].sessionUUID;\n\n var hasUUID = palList[a].sessionUUID;\n var isInUserStore = userStore[currentUUID] !== undefined;\n\n if (hasUUID && !isInUserStore) {\n // UUID exists and is NOT in userStore\n addUser(currentUUID);\n } else if (hasUUID) {\n // UUID exists and IS in userStore already\n userStore[currentUUID].audioLoudness = palList[a].audioLoudness;\n userStore[currentUUID].currentPosition = palList[a].position;\n updateAudioForAvatar(currentUUID);\n if (settings.ui.isExpandingAudioEnabled && userStore[currentUUID].overlayID) {\n updateOverlaySize(currentUUID);\n }\n }\n }\n\n // Remove users from userStore\n for (var uuid in userStore) {\n // if user crashes, leaving domain signal will not be called\n // handle this case\n var hasUUID = uuid;\n var isInNewList = palList.map(function (item) {\n return item.sessionUUID;\n }).indexOf(uuid) !== -1;\n\n if (hasUUID && !isInNewList) {\n removeUser(uuid);\n }\n }\n doUIUpdate();\n }", "function userLoggedInListener (roomName, occupants, isPrimary) {\n //update the global occupants list for this user.\n all_occupants_list = occupants;\n\n //as this callback method is also called on any user disconnection...\n //remove any 'zombie' easyrtc id from 'all_occupants_details' variable\n removeZombieClientsFromOccupantsDetails(occupants);\n\n //update the online/offline status as per the new list.\n //this update is important for someone leaves the connection.\n updateOnlineStatusOfClients(all_occupants_details);\n\n //spawn telepointers for the logged in users.\n spawnTelepointers(occupants);\n\n //inform my email, name along with easyrtc id, which is later used for different tracking\n informMyDetailsToAllOtherClients(occupants);\n\n //notifyAll('disconnected', \"Hello\");\n\n\n //FOR VIDEO STRM\n clearConnectList();\n var otherClientDiv = document.getElementById(\"otherClients\");\n for(var easyrtcid in occupants) {\n var button = document.createElement(\"button\");\n button.onclick = function(easyrtcid) {\n return function() {\n performCall(easyrtcid);\n };\n }(easyrtcid);\n var label = document.createTextNode(\"Call \" + getNameForAnEasyRTCid( easyrtc.idToName(easyrtcid) ) );\n button.appendChild(label);\n otherClientDiv.appendChild(button);\n }\n\n\n\n\n\n}", "function startup(snap) {\n me = snap.val(); // user profile\n if (me === null) { // new user\n var t = $.trim(prompt('ID \"'+id+'\" doesn\\'t exist. '+\n 'Retype to create it or switch to different name.'));\n if (t.length === 0) {\n window.location.href = 'http://jrslims.com';\n return;\n }\n if (t !== id) {\n id = t;\n $('#user').text(id);\n myuserdb = usersdb.child(id); // my profile\n myuserdb.once('value', startup);\n return;\n }\n me = { // default values for new user\n lastseen: null,\n avatar: 'avatars/newuser.png',\n modifierkey: modifierkey, // shift key\n enterkey: enterkey // return key\n };\n myuserdb.set(me); // inititalize\n $('#user, #logo').click();\n }\n if (me.lastseen !== undefined) { lastseen = me.lastseen; }\n if (me.email !== undefined) { email = me.email; }\n if (me.avatar !== undefined) { avatar = me.avatar; }\n if (me.modifierkey !== undefined) { modifierkey = +me.modifierkey; }\n if (me.enterkey !== undefined) { enterkey = +me.enterkey; }\n\n if (paramOverride) { getParams(window.location.href); }\n\n myonoffdb = onoffdb.child(id);\n mystatusdb = myonoffdb.child('status');\n\n connectdb.on('value', presencechange);\n\n var now = new Date();\n $('#usertime').html('<time>'+now.toLocaleTimeString()+'</time>').attr('title', now.toLocaleDateString()).click(uptime);\n\n timeout = now.valueOf() + 5000;\n setTimeout( function() { // delay until after logo appears\n msgdb.on('child_added', addmessages); // start getting messages\n msgdb.on('child_removed', dropmessages); // remove from messages list\n }, 10);\n } // end startup (get user profile)", "function start(){\r\n helloUser();\r\n }", "model(param) {\n let college_role = this.get('session.data.authenticated.token_data.college_role');\n\n // Set the god switch -- is this user an admin.\n let godMode = college_role === \"god\";\n let superGodMode = false;\n\n let context = this;\n let routeUsername = param.Username.toLowerCase();\n let IDNumber = this.get(\"session.data.authenticated.token_data.id\");\n let loggedInUsername = this.get(\"session.data.authenticated.token_data.user_name\").toLowerCase();\n let requestsSent = [];\n let memberships = [];\n let activities = [];\n let activityAdmins = [];\n let admins = [];\n let links = [];\n let userInfo;\n let userLoggedIn = false;\n let loggedInUserInfo;\n let showBothImages;\n\n let isLoggedInUser = function() {\n if(routeUsername === loggedInUsername){\n userLoggedIn = true;\n }\n return userLoggedIn;\n };\n\n let verifyAdmin = function() {\n if (godMode) {\n return getAsync(\"/admins/\" + IDNumber, context)\n .then(function(result) {\n if (result.SUPER_ADMIN) {\n superGodMode = true;\n }\n });\n }\n };\n\n let getAdmins = function() {\n if (superGodMode) {\n return getAsync(\"/admins\", context)\n .then(function(result) {\n for (var i = 0; i < result.length; i++) {\n admins.push({\n \"ID\": result[i].ADMIN_ID,\n \"Name\": result[i].USER_NAME.replace(\".\", \" \"),\n \"Email\": result[i].EMAIL,\n \"superAdmin\": result[i].SUPER_ADMIN\n });\n }\n });\n }\n };\n\n // Get the account from email (Not used)\n let getAccount = function(email) {\n return getAsync(\"/accounts/email/\" + email + \"/\", context);\n };\n\n // Get leader positions of user (not used)\n let getLeaderPositions = function() {\n let positions = [];\n return getAsync(\"/memberships/student/\" + IDNumber, context)\n .then(function(result) {\n for (var i = 0; i < result.length; i++) {\n if (isLeader(result[i].Participation)) {\n if (positions.indexOf(result[i].ActivityCode.trim()) === -1) {\n positions.push(result[i].ActivityCode.trim());\n }\n }\n }\n return positions;\n });\n };\n\n // Get advisor positions of user (not used)\n let getadvisorPositions = function(positions) {\n return getAsync(\"/memberships/student/\" + IDNumber, context)\n .then(function(result) {\n for (var i = 0; i < result.length; i++) {\n if (!isLeader(result[i].Participation)) {\n if (positions.indexOf(result[i].ActivityCode.trim()) === -1) {\n positions.push(result[i].ActivityCode.trim());\n }\n }\n }\n return positions;\n })\n };\n\n // Get requests sent by user\n let getSentRequests = function() {\n return getAsync(\"/requests/student/\" + IDNumber, context);\n };\n\n // Add sent requests to list and calculate age\n let addSentRequests = function(result) {\n for (var i = 0; i < result.length; i++) {\n let diffDays = getDiffDays(result[i].DateSent);\n result[i].DiffDays = diffDays.diffString;\n result[i].DiffDaysInt = diffDays.diffInt;\n requestsSent.push(result[i]);\n }\n };\n\n // Get the difference in days bewteen today and specified date\n // Returns integer and printable string\n let getDiffDays = function(date) {\n let currentDate = new Date();\n let requestDate = new Date(date);\n let timeDiff = Math.abs(currentDate.getTime() - requestDate.getTime());\n let diffDays = Math.floor(timeDiff / (1000 * 3600 * 24));\n let diffString;\n if (diffDays === 0) {\n diffString = \"Today\";\n }\n else if (diffDays === 1) {\n diffString = \"Yesterday\";\n }\n else {\n diffString = diffDays.toString() + \" days ago\";\n }\n return {\n \"diffInt\": diffDays,\n \"diffString\": diffString\n };\n };\n\n // Gets user info from server\n let getLoggedInUserInfo = function() {\n return getAsync(\"/profiles/\", context);\n };\n\n let getPublicUserInfo = function() {\n return getAsync(\"/profiles/\" + routeUsername + \"/\", context);\n };\n\n let checkIfUserExists = function(data) {\n if(data === \"Not Found\"){\n return Promise.reject({name: \"Not found\", message: \"user was not found\"});\n }else {\n\n data.found = true;\n return data;\n }\n };\n\n let catchNotFound = function(error) {\n if(error.status === 404){\n console.log(\"not found\");\n userInfo = {\n \"found\": false\n };\n } else {\n throw error;\n }\n }\n\n\n // Changes class from the number value set in the table to the corresponding string\n let setClass = function(data) {\n if(data.IsStudent){\n switch(data.Class) {\n case \"1\":\n data.Class = \"Freshman\";\n break;\n case \"2\":\n data.Class = \"Sophmore\";\n break;\n case \"3\":\n data.Class = \"Junior\";\n break;\n case \"4\":\n data.Class = \"Senior\";\n break;\n case \"5\":\n data.Class = \"Graduate Student\";\n break;\n case \"6\":\n data.Class = \"Undergraduate Conferred\";\n break;\n case \"7\":\n data.Class = \"Graduate Conferred\";\n break;\n default:\n data.Class = \"Student\";\n }\n }\n\n return data;\n }\n\n let setMajorObject = function(data) {\n data.Majors = [];\n if(data.Major1Description){\n data.Majors.push(data.Major1Description)\n }\n if(data.Major2Description){\n data.Majors.push(data.Major2Description);\n }\n if(data.Major3Description){\n data.Majors.push(data.Major3Description);\n }\n return data;\n }\n\n let setMinorObject = function(data) {\n data.Minors = [];\n if(data.Minor1Description){\n data.Minors.push(data.Minor1Description)\n }\n if(data.Minor2Description){\n data.Minors.push(data.Minor2Description);\n }\n if(data.Minor3Description){\n data.Minors.push(data.Minor3Description);\n }\n return data;\n }\n\n let setOnOffCampus = function(data){\n switch(data.OnOffCampus){\n case \"O\":\n data.OnOffCampus = \"Off Campus\";\n break;\n case \"A\":\n data.OnOffCampus = \"Away\";\n break;\n case \"D\": \"Deferred\";\n data.OnOffCampus = \"\"\n default:\n data.OnOffCampus = \"On Campus\";\n }\n return data;\n };\n\n let setNickName = function(data) {\n if(data.FirstName === data.NickName){\n data.NickName = \"\";\n }\n return data;\n };\n\n let setClassYear = function(data) {\n if(data.PreferredClassYear){\n data.ClassYear = data.PreferredClassYear;\n }\n return data;\n }\n\n // Adds data to model to determine the type of user\n let setUserType = function(data) {\n data.IsFaculty = (data.PersonType.includes(\"fac\"));\n data.IsAlumni = (data.PersonType.includes(\"alu\"));\n data.IsStudent = (data.PersonType.includes(\"stu\"));\n data.IsStudentOrAlumni = (data.IsStudent || data.isAlumni) ? true:false;\n return data\n }\n\n let setOfficeHours = function(data) {\n let officeHours = [];\n if(data.office_hours){\n while(data.office_hours.indexOf(\",\") > 0){\n officeHours.push(data.office_hours.slice(0, data.office_hours.indexOf(\",\")));\n data.office_hours = data.office_hours.slice(data.office_hours.indexOf(\",\")+2);\n }\n if(data.office_hours.indexOf(\",\") > 0){\n officeHours.push(data.office_hours.slice(0, data.office_hours.indexOf(\",\")));\n } else {\n officeHours.push(data.office_hours.slice(0, data.office_hours.length));\n }\n\n }\n data.office_hours = officeHours;\n return data;\n };\n\n let formatCountry = function(data){\n if(data.Country){\n data.Country = data.Country.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n if(data.Country.includes(\",\")){\n data.Country = data.Country.slice(data.Country.indexOf(\",\") + 2,) + \" \" + data.Country.slice(0, data.Country.indexOf(\",\"));\n }\n }\n return data;\n };\n\n let setuserInfo = function(data) {\n var user = Ember.Object.extend({\n init: function() {\n this._super();\n }\n });\n userInfo = user.create(data);\n // userInfo = data;\n return userInfo;\n }\n\n // Sets userInfo to be the edited data about the person\n let setLoggedInUserInfo = function(data) {\n loggedInUserInfo = data;\n }\n\n // Gets the logged in user's profile picture, It is a base64 string\n let getLoggedInUserProfilePicture = function() {\n return getAsync(\"/profiles/image/\", context);\n }\n\n // Gets the public profile picture of the person being looked up\n let getPublicUserProfilePicture = function() {\n return getAsync(\"/profiles/image/\" + routeUsername + \"/\", context);\n }\n\n // Converts the base64 to a blobl and stores it in a URL to be used by the handlebars file.\n let setUserProfilePicture = function(content) {\n // console.log(content);\n if(content.def){\n var blob = base64ToBlob(content.def , {type: 'image/jpeg'});\n URL = window.URL || window.webkitURL;\n var blobUrl = URL.createObjectURL(blob);\n userInfo.defaultImageURL = blobUrl;\n }\n if(content.pref) {\n var blob = base64ToBlob(content.pref , {type: 'image/jpeg'});\n URL = window.URL || window.webkitURL;\n var blobUrl = URL.createObjectURL(blob);\n userInfo.preferredImageURL = blobUrl;\n }\n }\n\n let base64ToBlob = function(base64) {\n var binary = atob(base64);\n var len = binary.length;\n var buffer = new ArrayBuffer(len);\n var view = new Uint8Array(buffer);\n for (var i = 0; i < len; i++) {\n view[i] = binary.charCodeAt(i);\n }\n return new Blob([view], {type: 'image/jpeg'});\n };\n\n let dataURItoBlob = function (dataURI) {\n // convert base64/URLEncoded data component to raw binary data held in a string\n var byteString;\n if (dataURI.split(',')[0].indexOf('base64') >= 0)\n byteString = atob(dataURI.split(',')[1]);\n else\n byteString = unescape(dataURI.split(',')[1]);\n\n // separate out the mime component\n var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];\n\n // write the bytes of the string to a typed array\n var ia = new Uint8Array(byteString.length);\n for (var i = 0; i < byteString.length; i++) {\n ia[i] = byteString.charCodeAt(i);\n }\n\n return new Blob([ia], {type:mimeString});\n }\n\n let showImages = function() {\n if(userInfo.defaultImageURL && userInfo.preferredImageURL){\n showBothImages = true;\n } else {\n showBothImages = false;\n }\n }\n\n // Gets all the activities a user is a member of\n let getLoggedInUserMemberships = function() {\n return getAsync(\"/memberships/student/\" + IDNumber + \"/\", context);\n }\n\n let getPublicUserMemberships = function() {\n return getAsync(\"/memberships/student/username/\" + routeUsername + \"/\", context);\n }\n\n let setUserMemberships = function(data) {\n memberships = data;\n return data;\n }\n\n // Gets more information about the activites that a user is a member of\n let getActivitiesInfo = function(data) {\n for(var i = 0; i < data.length; i++) {\n activities.push(getAsync(\"/activities/\" + data[i].ActivityCode.trim(), context));\n }\n return activities;\n\n }\n\n //Allows mulitple promises to be executed\n let prepareInfo = function(data) {\n return Promise.all(data);\n }\n\n // Sets memberships to be the information about all of a users activities\n let addActivitiesInfo = function(data) {\n for(var i = 0; i < data.length; i++) {\n if (data[i].Privacy) {\n memberships[i].Privacy = true;\n }\n memberships[i].clubInfo = data[i];\n }\n return memberships;\n }\n\n //Gets the contact information for every club a student is a part of\n let getActivityAdmins = function(data) {\n for(var i = 0; i < data.length; i++) {\n activityAdmins.push(getAsync(\"/emails/activity/\" + data[i].ActivityCode.trim() + \"/group-admin/session/\" + data[i].SessionCode.trim(), context));\n }\n return activityAdmins;\n };\n\n // Adds the admins contact information to each of the users memberships\n let addActivityAdmins = function(data) {\n for(var i = 0; i < data.length; i++) {\n for(var j = 0; j < data[i].length; j++){\n data[i][j].username = data[i][j].Email.slice(0, data[i][j].Email.indexOf('@')).toLowerCase();\n if(data[i][j].username === loggedInUsername){\n memberships[i].isAdmin = true;\n }\n }\n memberships[i].groupAdminsEmail = data[i];\n }\n return memberships;\n }\n\n //Turn Memberships into ember objects so that they have listeners\n let loadMemberships = function(data) {\n var membership = Ember.Object.extend({\n init: function() {\n this._super();\n }\n });\n for(var i = 0; i < data.length; i++){\n //Create session variable that is the session without \"Academic Year\" if that is part of the session description\n if(data[i].SessionDescription.indexOf(\"Academic\") > 0){\n data[i].session = data[i].SessionDescription.slice(0, data[i].SessionDescription.indexOf(\" Academic\"));\n }\n memberships[i] = membership.create(data[i]);\n }\n }\n\n // sets social media links to seperate array of ember objects that defines the type of the link along with the link\n let loadLinks = function() {\n var Link = Ember.Object.extend({\n linkPrefixes: [\"https://www.facebook.com/\", \"https://twitter.com/\",\"https://www.linkedin.com/in/\",\"https://www.instagram.com/\"],\n init: function() {\n this._super();\n }\n });\n links = [\n Link.create({\n \"type\": \"Facebook\",\n \"link\": userInfo.Facebook,\n \"prefixNum\": 0\n }),\n Link.create({\n \"type\": \"Twitter\",\n \"link\": userInfo.Twitter,\n \"prefixNum\": 1\n }),\n Link.create({\n \"type\": \"LinkedIn\",\n \"link\": userInfo.LinkedIn,\n \"prefixNum\": 2\n }),\n Link.create({\n \"type\": \"Instagram\",\n \"link\": userInfo.Instagram,\n \"prefixNum\": 3\n })\n ];\n // userInfo.LinkedIn = decodeURIComponent(userInfo.LinkedIn);\n }\n\n // Convert US phone numbers to a readable format\n let formatPhoneNumbers = function() {\n var mobilePhone = userInfo.MobilePhone;\n var homePhone = userInfo.HomePhone;\n if(mobilePhone && mobilePhone.length === 10){\n userInfo.formattedMobilePhone = \"(\" + mobilePhone.slice(0, 3) + \") \" + mobilePhone.slice(3, 6) + \"-\" + mobilePhone.slice(6);\n }\n if(homePhone && homePhone.length ===10) {\n userInfo.formattedHomePhone = \"(\" + homePhone.slice(0,3) + \") \" + homePhone.slice(3, 6) + \"-\" + homePhone.slice(6);\n }\n }\n\n\n let loadModel = function() {\n // console.log(userInfo);\n // console.log(links);\n // console.log(memberships);\n return {\n \"requestsSent\": requestsSent,\n \"godMode\": godMode,\n \"superGodMode\": superGodMode,\n \"admins\": admins,\n \"userInfo\": userInfo,\n \"memberships\": memberships,\n \"links\" : links,\n \"userLoggedIn\": userLoggedIn,\n \"loggedInUserInfo\": loggedInUserInfo,\n \"showBothImages\": showBothImages\n };\n };\n\n\n if(isLoggedInUser()){\n console.log(\"Private Page\");\n return getSentRequests()\n .then(addSentRequests)\n .then(verifyAdmin)\n .then(getAdmins)\n .then(getLoggedInUserInfo)\n .then(checkIfUserExists)\n .then(setUserType)\n .then(setOnOffCampus)\n .then(setClassYear)\n .then(setNickName)\n .then(setClass)\n .then(setMajorObject)\n .then(setMinorObject)\n .then(setOfficeHours)\n .then(formatCountry)\n .then(setuserInfo)\n .then(setLoggedInUserInfo)\n .then(getLoggedInUserProfilePicture)\n .then(setUserProfilePicture)\n .then(getLoggedInUserMemberships)\n .then(setUserMemberships)\n .then(getActivitiesInfo)\n .then(prepareInfo)\n .then(addActivitiesInfo)\n .then(getActivityAdmins)\n .then(prepareInfo)\n .then(addActivityAdmins)\n .then(loadMemberships)\n .then(loadLinks)\n .then(formatPhoneNumbers)\n .then(loadModel);\n } else {\n console.log(\"Public Page\");\n return getPublicUserInfo()\n .then(checkIfUserExists)\n .then(setUserType)\n .then(setOnOffCampus)\n .then(setNickName)\n .then(setClassYear)\n .then(setClass)\n .then(setMajorObject)\n .then(setMinorObject)\n .then(setOfficeHours)\n .then(formatCountry)\n .then(setuserInfo)\n .then(getLoggedInUserInfo)\n .then(checkIfUserExists)\n .then(setUserType)\n .then(setLoggedInUserInfo)\n .then(getPublicUserProfilePicture)\n .then(setUserProfilePicture)\n .then(showImages)\n .then(getPublicUserMemberships)\n .then(setUserMemberships)\n .then(getActivitiesInfo)\n .then(prepareInfo)\n .then(addActivitiesInfo)\n .then(getActivityAdmins)\n .then(prepareInfo)\n .then(addActivityAdmins)\n .then(loadMemberships)\n .then(loadLinks)\n .then(formatPhoneNumbers)\n .catch(catchNotFound)\n .then(loadModel);\n }\n\n }", "function init() {\n\t\t\tUser.all().success(function(data) {\n\t\t\t\t$rootScope.processing = false;\n\t\t\t\t$scope.users = data;\n\t\t\t});\n\t\t}", "function isLoggedIn(){\n firebase.auth().onAuthStateChanged(function(user){\n if(user){\n var uid = user.uid;\n console.log(uid);\n var userRef = firestore.doc(\"users/\"+uid);\n userRef.get().then(function(userdetails){\n username.innerHTML = userdetails.data().name.split(' ')[0];\n });\n loggedIn();\n }\n });\n}", "function show_manage_user(){\n var manage_user = fill_template('user-management',{});\n $('#dd-log-in-menu').remove();\n $('.navbar-nav').append(manage_user);\n $('#dd-manage-alerts').click( function(e) {\n show_manage_alerts();\n });\n $('#dd-log-out').click( function(e) {\n set_cookie('dd-email','', -100);\n show_log_in();\n });\n }", "_newUsersPageGifting() {\n return __awaiter(this, void 0, void 0, function* () {\n console.log('Coming soon');\n });\n }", "__defineHandlers__() {\n self = this;\n this.auth.onAuthStateChanged(\n function (user) {\n if (user == null) {\n //console.log(\"state: logged out\");\n // show logged out view\n this.login_state = 0;\n } else {\n //console.log(\"state: logged in\");\n // show logged in view\n this.unsafe_user = user;\n this.primary = new User(user);\n this.login_state = 1;\n }\n this.refresh_view(user);\n }.bind(self)\n );\n }", "function setupCrittercism() {\n Ti.App.removeEventListener('login', setupCrittercism);\n var username = Alloy.Globals.userInfo.realName;\n crittercism.setUsername(username);\n\n var tags = Alloy.Globals.userInfo;\n crittercism.setMetaData(tags);\n }", "function loadUser() {\n checkAdmin(username);\n hideElement(\"#btn-invite-form\");\n if (isAdmin) {\n // showElement(\"#btn-block-user\");\n showElement(\"#btn-delete-user\");\n showElement(\"#btn-ban-user\");\n showElement(\"#btn-set-admin\");\n hideElement(\"#btn-report-user\");\n showElement(\".incoming-message .btn-group\");\n if (chatroomType === \"Private\")\n showElement(\"#btn-invite-form\");\n } else {\n // hideElement(\"#btn-block-user\");\n hideElement(\"#btn-delete-user\");\n hideElement(\"#btn-ban-user\");\n hideElement(\"#btn-set-admin\");\n showElement(\"#btn-report-user\");\n hideElement(\".incoming-message .btn-group\");\n }\n}", "function onLogin() {}", "function broadCastUsers() {\n io.local.emit('users', {'count': userCount()});\n}", "function setAppboyUser() {\n // get email and create user ids and such\n var emailAddress = document.getElementById('email-address').value\n var hashedAddress = emailAddress.hashCode()\n var abUser = appboy.getUser().getUserId()\n\n appboy.changeUser(hashedAddress)\n appboy.getUser().setEmail(emailAddress)\n\n // set user attributes in profile\n var firstName = document.getElementById('first-name').value\n var lastName = document.getElementById('last-name').value\n var phoneNumber = document.getElementById('phone-number').value\n\n if (firstName) appboy.getUser().setFirstName(firstName);\n if (lastName) appboy.getUser().setLastName(lastName);\n if (phoneNumber) appboy.getUser().setPhoneNumber(phoneNumber);\n\n // change id button to Identified!\n document.getElementById('login-button').value = \"Identified!\"\n}", "function showUserInformation(user){\n setSideBar(user)\n setLists(user)\n}", "function changeUserView(url, guid, session){\n var data = {};\n if(url === '/dial'){\n data.content = fs.readFileSync(dialContent,\"utf8\").toString();\n data.scripts = dialScripts;\n data.title = \"Dial testing \";\n }\n else if(url === '/wheel'){\n data.content = fs.readFileSync(wheelContent,\"utf8\").toString();\n data.scripts = wheelScripts;\n data.title = \"Emotion wheel \";\n }\n else if(url === '/questions'){\n data.content = fs.readFileSync(questionContent,\"utf8\").toString();\n data.scripts = questionScripts;\n data.title = \"Questionnaire \";\n }\n else if(url === '/fob'){\n data.content = fs.readFileSync(fobContent,\"utf8\").toString();\n data.scripts = fobScripts;\n data.title = \"Fob \";\n }\n if(guid === 'all'){\n // socket.to(session).broadcast.emit('static', data);\n log(\"setting all users in \"+ session + \" to view \" + url, session);\n io.to(session).emit('static', data);\n }\n else{\n log(\"setting user \" + guid + \" to view \" + url, session);\n io.to(guid).emit('static', data);\n // socket.emit('static', data);\n }\n\n }", "function startInterview(){\n // timer start \n // database upate user data\n // user id will be the object id? is that going to be safe? simply i will bcrypt the roomid and make it userid \n }", "function checkUserStatus() {\n if (firebase.auth().currentUser === null) { loadLoginPage(); }\n else { loadHomePage(); }\n }", "function setLoggedUserName() {\n\t\t// Get hold of link of inbox\n\t\tvar bannerDiv = getElementByClass(getElementsByName(document,'div'),'banner');\n\t\tvar navGroup = getElementByClass(getElementsByName(bannerDiv,'ul'),'nav');\n\t\tvar navList = getElementsByName(navGroup,'li');\n\t\tfor(var linkIndx=0; linkIndx < navList.length; ++linkIndx) {\n\t\t\tvar anchor = getElementsByName(navList[linkIndx],'a')[0];\n\t\t\tif(anchor.href.indexOf(\"/inbox\") != -1) {\n\t\t\t\tvar anchorHrefSplit = anchor.href.split('/');\n\t\t\t\tloggedUserName = anchorHrefSplit[anchorHrefSplit.length-1];\n\t\t\t\treturn;\n\t\t\t}\n\t\t} \t\t\n\t}", "function LodLiveProfile() {\n\n }" ]
[ "0.6996582", "0.67647934", "0.6661413", "0.65854686", "0.63520765", "0.63520765", "0.63520765", "0.61020464", "0.61006784", "0.6053417", "0.6039701", "0.59929734", "0.5990063", "0.59647006", "0.59647006", "0.5961672", "0.5948359", "0.5934144", "0.59000444", "0.58736306", "0.58736306", "0.58596206", "0.58523005", "0.584265", "0.58338636", "0.58251166", "0.58139163", "0.5808784", "0.5793994", "0.5789104", "0.57736474", "0.5773281", "0.57728183", "0.5761513", "0.5759526", "0.5758136", "0.5737802", "0.57348746", "0.5732265", "0.5706246", "0.57022893", "0.56989455", "0.56975377", "0.56969744", "0.5695183", "0.5689422", "0.56886816", "0.56854093", "0.5680156", "0.5676598", "0.56722015", "0.5669672", "0.56651884", "0.5661933", "0.56602937", "0.565915", "0.56520003", "0.56516564", "0.5645198", "0.564284", "0.56319845", "0.56240886", "0.5605643", "0.5597636", "0.5594508", "0.5594362", "0.55920595", "0.5591851", "0.5590666", "0.5588904", "0.5586128", "0.5586053", "0.55834806", "0.5582881", "0.55770606", "0.5576315", "0.55755025", "0.55743515", "0.55733705", "0.557299", "0.5568066", "0.5558587", "0.55560845", "0.55503863", "0.5544147", "0.5544076", "0.5541969", "0.5539685", "0.5538747", "0.5535173", "0.55280966", "0.55254006", "0.5523725", "0.55224526", "0.5520844", "0.55199546", "0.55153126", "0.5508849", "0.55059445", "0.5503054", "0.550246" ]
0.0
-1
handles when teacher enters a note durig tasmee3 evaluation
onSaveNotes(notes, word, ayah) { if (word === undefined) { this.setState({ notes }); } else { this.onSelectAyah(ayah, word, { notes }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 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 checknotes(){\r\n\r\n}", "function topic_answered() {\n\t//do stuff like check validity and sending answer to db\n\tif (document.getElementById(\"answer-input\").value.replace(/^\\s+|\\s+$/g,\"\") === \"\"){\n\t\talert(\"Missing some text here\");\n\t}else{\n\t\tcheck_correctness();\n\t\tchange_topic();\n\t}\n}", "enterQuestionText(ctx) {\n\t}", "playNote(e) {\n e.stopPropagation();\n\n // Return if tutorial is active and not targeting this element,\n // bot playback hasn't played the last note, or animation is ongoing\n if ((this.tutorial.active && !this.tutorial.isElementTarget(e)) || (this.playback && !this.lastBotNote) || this.blockAction) {\n return;\n }\n const element = e.currentTarget;\n const noteIndex = parseInt(element.getAttribute('data-note'));\n\n // Dispatch an event that for the tutorial module.\n e.currentTarget.dispatchEvent(new Event('tutorial-tap'));\n\n // If it's the last note, turn off the playback to avoid the source\n // being disconnected later\n if (this.lastBotNote) {\n this.playback = false;\n this.lastBotNote = false;\n }\n\n // Stop showing red on the notebars\n this.wrongNoteFeedback = false\n\n // Animate the active element \n element.classList.add('hit');\n setTimeout(() => {\n element.classList.remove('hit');\n }, 250);\n\n this.playUserSound(noteIndex);\n\n // User has heard at least two notes, so if they are playing sounds, display the full melody\n // to allow evaluation\n if (this.userStoppedPlaybackAfterHearingMultipleNotes) {\n this.playbackIndex = this.botSequence.length - 1;\n }\n\n // Evalutate the played note if a bot melody is present,\n // flow not suspended, not in tutorial and\n // melody has played through (playback index is not -1)\n if (this.botSequence.length > 0\n && !this.tutorial.active\n && !this.evaluationSuspended\n && this.playbackIndex !== -1) {\n this.evaluatePlayedNote(noteIndex);\n\n // Reset this flag as user guesses are evaluated now\n this.userStoppedPlaybackAfterHearingMultipleNotes = false;\n }\n \n }", "function checkKeyWithNote(keyCode){\n\tif(pattern == null) {\n\t\treturn;\n\t}\n\n\tvar pressedKey = getPressedKey(keyCode);\n\tvar keyArr = eval(\"key\" + numOfKey);\n\tvar index = keyArr.indexOf(pressedKey);\n\tvar _score = getScoreByPosition(firstNote[index]);\n\tif(_score == 'bad'){\n\t\tprintScore('Miss');\n\t\treturn;\n\t}\n\telse if(_score == 'normal'){//normal\n\t\tprintScore(\"Good!\");\n\t\tscore+=50;\n\t}\n\telse if(_score == 'perfect'){//perfect\n\t\tprintScore(\"Perfect!!\");\n\t\tscore+=100;\n\t}\n\tdeleteNote(index); //normal or pefect deletes note\n\tupdateScore();\n}", "function ask(question) {\n console.log(this.teacher, question);\n}", "function validateNote (note) {\n if (!note.title || typeof note.title !== 'string') {\n return false; \n }\n if (!note.text || typeof note.text !== \"string\") {\n return false;\n }\n return true; \n}", "function myWork(){\n\n let job = prompt(' Please read the second paragraph, I think this will help you, so my last job was \"teacher , chashier\" ?');\n if (job === 'cashier') {\n alert('Unfortenatly yes :P !');\n score++;\n } else if (job === 'teacher') {\n alert('No no !!');\n prompt('So what do you think now ?');\n }\n \n}", "function doneTyping() {\n var notesContents = document.getElementById(\"notesTextArea\").value\n $scope.postNotesTable(notesContents);\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 C001_BeforeClass_Sidney_PantiesRemark() {\n\tif (C001_BeforeClass_Sidney_PantiesRemark_Done == false) {\n\t\tC001_BeforeClass_Sidney_PantiesRemark_Done = true;\n\t\tActorChangeAttitude(0, 1);\n\t\tOverridenIntroText = GetText(\"Panties\");\n\t}\n}", "function editNotes()\r\n{\r\n\tvar note = GM_getValue(steam_id, \"Enter notes here\");\r\n\tvar newNote = window.prompt(\"User notes\", note);\r\n\tif (newNote != note && newNote != \"\" && newNote != null)\r\n\t\tGM_setValue(steam_id, newNote);\r\n}", "function textKeyPress(e) {\n if (e.keyCode == ENTER_KEY) {\n postRemark();\n }\n}", "function validateNote(note) {\n if(!note.title || typeof note.title !== 'string') {\n return false;\n }\n if (!note.text || typeof note.text !== 'string') {\n return false\n }\n return true;\n }", "function validateNote(note){\n if(!note.title || typeof note.title !== 'string' ){\n return false;\n }\n if(!note.text || typeof note.text !== 'string' ){\n return false;\n }\n return true;\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}", "function takeInput() {\n\n // Asking the user if he's patient or User.\n r.question(\"Are you a\\n1. Patient or\\n2. User\\n\", function(ans1) {\n\n if (ans1.trim() == 1) {\n\n // If user enters 1, register the patient.\n registerPatient();\n } else {\n\n // If user enters 2, ask his purpose.\n purposeUser();\n }\n });\n}", "function handlenoteEdit() {\n var currentnote = $(this).parents(\".note-panel\").data(\"id\");\n editnote(currentnote);\n }", "handler(argv){\n notes.readNotes(argv.title);\n }", "function tutorial() {\n\tif (event == 'tutorial1') {\n\t\tcurrentStage = levels.chapter1.tutorial.lv1;\n\t\tstageChanged = true;\n\t\tplayer.weapon = weapons.lunarshot.Hytex;\n\t\tevent = 'tutorial2';\n\t} else if (event == 'tutorial2') {\n\t\tif (variables.chapter1.tutorial.text1 == false) {\n\t\t\ttextBox = messages.chapter1.tutorial.msg1;\n\t\t\tvariables.chapter1.tutorial.text1 = true;\n\t\t}\n\n\t\tif (textBox == undefined) {\n\t\t\tif (variables.chapter1.tutorial.text1 == true && variables.chapter1.tutorial.text2 == false) {\n\t\t\t\ttextBox = messages.chapter1.tutorial.msg2;\n\t\t\t\tvariables.chapter1.tutorial.text2 = true;\n\n\t\t\t} else if (variables.chapter1.tutorial.text1 == true && variables.chapter1.tutorial.text2 == true && variables.chapter1.tutorial.text3 == false) {\n\t\t\t\ttextBox = messages.chapter1.tutorial.msg3;\n\t\t\t\tvariables.chapter1.tutorial.text3 = true;\n\n\t\t\t} else if (variables.chapter1.tutorial.text1 == true && variables.chapter1.tutorial.text2 == true && variables.chapter1.tutorial.text3 == true && variables.chapter1.tutorial.text4 == false) {\n\t\t\t\ttextBox = messages.chapter1.tutorial.msg4;\n\t\t\t\tvariables.chapter1.tutorial.text4 = true;\n\n\t\t\t} else if (defeated == true && variables.chapter1.tutorial.text5 == true) {\n\t\t\t\tevent = 'tutorial3';\n\t\t\t\tdefeated = false;\n\t\t\t}\n\t\t}\n\n\t\tlevels.chapter1.tutorial.lv1.walls.forEach(function(ele) {\n\t\t\tif (ele.id == 'NPC0') {\n\t\t\t\tif (ele.HP <= 0) {\n\t\t\t\t\tdefeated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (defeated == true) {\n\t\t\ttextBox = messages.chapter1.tutorial.msg5;\n\t\t\tvariables.chapter1.tutorial.text5 = true;\n\t\t}\n\n\t} else if (event == 'tutorial3') {\n\t\tcurrentStage = levels.chapter1.tutorial.lv2;\n\t\tstageChanged = true;\n\t\tevent = 'tutorial4';\n\t\tdefeated = false;\n\t} else if (event == 'tutorial4') {\n\t\tif (variables.chapter1.tutorial.text6 == false) {\n\t\t\ttextBox = messages.chapter1.tutorial.msg6;\n\t\t\tvariables.chapter1.tutorial.text6 = true;\n\t\t}\n\n\t\tlevels.chapter1.tutorial.lv2.walls.forEach(function(ele) {\n\t\t\tif (ele.id == 'enemy0') {\n\t\t\t\tif (ele.HP <= 0) {\n\t\t\t\t\tdefeated = true;\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tif (defeated == true) {\n\t\t\tevent = 'tutorial5';\n\t\t}\n\n\t} else if (event == 'tutorial5') {\n\t\tif (variables.chapter1.tutorial.text7 == false) {\n\t\t\ttextBox = messages.chapter1.tutorial.msg7;\n\t\t\tvariables.chapter1.tutorial.text7 = true;\n\t\t}\n\n\t\tif (textBox == undefined) {\n\t\t\tif (variables.chapter1.tutorial.text7 == true && variables.chapter1.tutorial.text8 == false) {\n\t\t\t\ttextBox = messages.chapter1.tutorial.msg8;\n\t\t\t\tvariables.chapter1.tutorial.text8 = true;\n\n\t\t\t} else if (variables.chapter1.tutorial.text8) {\n\t\t\t\tevent = 'chapter1';\n\t\t\t\tmenu = 'levelS';\n\t\t\t}\n\t\t}\n\t}\n}", "'change .js-editNote' (event) {\n // Get value from editNote element\n const text = event.currentTarget.value;\n note.set(text);\n }", "function validateNote(note) {\n if (!note.title || typeof note.title !== \"string\") {\n return false;\n }\n if (!note.text || typeof note.text !== \"string\") {\n return false;\n }\n return true;\n}", "handler(argv) {\n notes.addNote(argv.title,argv.body)\n }", "handler () {\n notes.addNote(title, body);\n }", "function editNote(note) {\n const edit = note.querySelector(\"p\");\n edit.contentEditable = true;\n edit.addEventListener(\"keydown\", function (event) {\n if (event.key === \"Enter\") {\n edit.contentEditable = false;\n }\n });\n}", "function checkInput(subject, type) {\n var correct = true;\n var selected;\n var input;\n var citedData = {};\n \n if (subject == \"document\") {\n\n if ($('#selectedTextArea').attr('class') == 'hide') {\n // nessuna selezione di testo\n input = $('#docInput').val();\n selected = false;\n\n if (input == \"\") {\n Materialize.toast(\"insert something\", 2000);\n return false;\n }\n } else {\n // testo selezionato\n input = $('#selectedText').html();\n selected = true;\n }\n\n switch (type) {\n case \"hasAuthor\":\n correct = checkAuthor(input)\n break\n case \"hasPublicationYear\":\n correct = checkYear(input);\n break;\n case \"hasTitle\":\n correct = true;\n break;\n case \"hasURL\":\n correct = checkURL(input);\n break;\n case \"hasDOI\":\n correct = checkDOI(input);\n break;\n\n }\n } else if (subject == \"fragment\") {\n if ($('#selectedTextArea').attr('class') == 'hide')\n return false;\n else\n selected = true;\n\n switch (type) {\n case \"hasComment\": {\n input = $('#inputComment').val();\n correct = checkComment(input);\n break;\n }\n case \"denotesRhetoric\": {\n input = $('input[name=\"rhetoricalChoice\"]:checked').val()\n correct = checkRhetorical(input);\n break;\n }\n case \"cites\": {\n citedData.author = parseInput($(\"#inputCitedAuthor\").val());\n citedData.year = $(\"#inputCitedYear\").val();\n citedData.title = parseInput($(\"#inputCitedTitle\").val()); \n citedData.DOI = $(\"#inputCitedDOI\").val();\n \n input = citedData.URL = parseInput($(\"#inputCitedURL\").val());\n\n \n correct = checkCitation(citedData);\n\n break;\n }\n }\n }\n if (correct == true)\n saveAnnotation(subject, type, selected, parseInput(input), citedData);\n}", "function questionThreePt1() {\r\n alert(\"Question 3 pt. 1\");\r\n}", "function submitEditNotes(ele){\n\t\t\tvar popup = document.getElementsByClassName(\"edit-notes-form\")[0],\n\t\t\t\tupdatedNotes = ele.parentNode.getElementsByTagName(\"textarea\")[0].value;\n\n\t\t\tif(!updatedNotes) updatedNotes = \"There are no notes for this event.\"\n\n\t\t\t// Update notes\n\t\t\tcurrentStepNode.setAttribute(\"data-notes\", updatedNotes);\n\n\t\t\t// Save notes to database\n\t\t\tsaveAction.enqueue( makeJsonFromNode(currentStepNode));\n\n\t\t\t// Remove popup\n\t\t\tremoveEditNotes(popup);\n\t\t}", "function purposeUser() {\n\n // Displaying the patients.\n var p = displayPatients();\n\n // Asking the user to select the patient to change the appointment.\n r.question(\"Hello User! Choose a patient ID to set/change his/her appointment! \", (ans1) => {\n if (!isNaN(ans1.trim()) && ans1.trim() < p) {\n\n // Calling chooseDoctor() function to choose the doctor for appointment.\n chooseDoctor(Number(ans1.trim()));\n } else {\n\n // If the ID is invalid, trying again.\n console.log(\"INVALID! Choose a patient by ID only! Try again.\");\n purposeUser();\n }\n });\n}", "function evaluateInput()\n {\n var inputText = my.html.input.value\n var inputLength = inputText.length\n\n // If the tutor is in READY state, and input has been entered,\n // then set it to RUNNING STATE.\n if (my.current.state == my.STATE.READY && inputLength > 0) {\n\n my.current.startTime = new Date().getTime()\n my.current.state = my.STATE.RUNNING\n updatePracticePaneState()\n\n log('state', my.current.state.toUpperCase(),\n 'unit', my.current.unitNo + '.' + my.current.subunitNo,\n 'type', my.settings.unit)\n }\n\n // Number of characters correctly typed by the user\n var goodChars = Util.common(my.current.subunitText, inputText)\n my.current.correctInputLength = goodChars\n\n // Validate the input\n if (goodChars == inputLength) {\n\n // Clear error if any\n if (my.current.state == my.STATE.ERROR) {\n\n my.current.state = my.STATE.RUNNING\n updatePracticePaneState()\n }\n } else {\n\n // Set and display error\n if (my.current.state == my.STATE.RUNNING) {\n my.current.state = my.STATE.ERROR\n my.current.errors++\n updatePracticePaneState()\n } else if (my.current.state == my.STATE.ERROR) {\n processInputCommand()\n }\n }\n\n // Update error rate\n if (goodChars == 0) {\n if (my.current.errors == 0) {\n my.current.errorRate = 0\n } else {\n my.current.errorRate = Number.POSITIVE_INFINITY\n }\n } else {\n my.current.errorRate = 100 * my.current.errors / goodChars\n }\n\n // Check if the complete target text has been typed successfully\n if (goodChars == my.current.subunitText.length) {\n my.current.state = my.STATE.COMPLETED\n updatePracticePaneState()\n }\n }", "function esBasics(){ askAboutInsert(insertableText.esBasics.text); }", "function questionThreePt2() {\r\n alert(\"Question 3 pt. 2\");\r\n}", "function updatePreviewWithNote(sender, paeNote) {\r\n // console.log(\"key pressed is \" + paeNote)\r\n plaineEasieCodes.push(paeNote)\r\n updateNotesSVG()\r\n}", "function classroom(teacher) {\n return function study() {\n console.log(\n `${teacher} says to study ${this.topic}`\n );\n };\n }", "isValidNote(note) {\n return note.title !== '';\n }", "function validateNote(note){\n if(!note.title || typeof note.title !== 'string'){\n return false; \n }\n if(!note.text || typeof note.text !== 'string'){\n return false; \n }\n if(!note.id || typeof note.id !== 'string'){\n return false; \n }\n}", "function submitNote(e) {\r\n e.preventDefault();\r\n NoteService.postNote(Note).then(data => {\r\n const { message } = data;\r\n\r\n resetForm();\r\n if (!message.msgError) {\r\n NoteService.getNotes().then(getData => {\r\n setAddedNote(getData?.notes);\r\n\r\n });}\r\n else if(message.msgError){\r\n alert(message.msgBody)\r\n \r\n }\r\n \r\n })\r\n\r\n setIsClicked(false);\r\n\r\n }", "function answer() {\n let parentSection = this.parentElement.parentElement;\n if (this.textContent === \"Go back to Menu\") {\n backToMenu();\n } else if (this.textContent === \"Play Again\") {\n playAgain(parentSection);\n } else {\n let correct = false;\n let noteTag = gen(\"p\");\n for (let i = 0; i < CORRECT_ANSWER.length; i++) {\n if (CORRECT_ANSWER[i] === this.textContent) {\n noteTag.textContent = \"Correct !\";\n noteTag.classList.add(\"correct\");\n parentSection.appendChild(noteTag);\n correct = true;\n }\n }\n if (!correct) {\n noteTag.textContent = \"Wrong !\";\n noteTag.classList.add(\"wrong\");\n parentSection.appendChild(noteTag);\n }\n setTimeout(() => nextQuestion(parentSection), WAITING_TIME);\n }\n }", "function interviewQuestion(job) {\n return (name) => {\n if (job === 'designer') {\n console.log(name + ', can you please explain what UX design is?');\n } else if (job === 'teacher') {\n console.log('What subject do you teach, ' + name + '?');\n } else {\n console.log('Hello ' + name + ', what do you do?');\n }\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}", "function getText(event) {\n event.preventDefault();\n // Get user textarea input:\n var text = document.getElementById(\"textArea\").value;\n // remove all punctuation\n text = text.replace(/[\\.,-\\/#!$%\\^&\\*;:{}=\\-_`~()@\\+\\?><\\[\\]\\+]/gm, \"\");\n\n // Get user line input:\n let lineInput = document.querySelector('input[name=\"lines\"]:checked').value;\n\n var lines = Number(lineInput);\n\n // Get user word input\n var words = Number(document.getElementById(\"wordInput\").value);\n\n //get user vowel input\n var vowels = Number(document.getElementById(\"vowelInput\").value);\n\n //Determine if textarea input has line breaks:\n let test = checkLineBreaks(text); // call check line breaks function\n if (test === true) {\n textArr = splitText(text);\n } else {\n // add line breaks based on whitespace\n textArr = stringLines(text); // call function to format text lines\n }\n\n // identify the which lines will be parsed.\n activeLines(textArr, lines, words, vowels);\n}", "function input_note_onfocus(e) {\n var note = e.getAttribute(\"data-note\");\n if (!note) {\n note = e.value;\n e.setAttribute(\"data-note\", note);\n }\n e.value = e.value == note? '' : e.value;\n e.className = '';\n}", "function storyOne() {\n console.log(\"story there\");\n $('#instructions').text('story time');\n// varible to make a random story\n var story = {\n \"start\": \"Once upon a time, #name# the #animal# #action# #moment# #place#\",\n// the different variable that the player chose\n \"name\": [chosenName],\n \"animal\": [chosenAnimal],\n \"action\": [chosenAction],\n \"moment\": [chosenMoment],\n \"place\": [chosenPlace]\n }\n\n// variable to use tracery\n var grammar = tracery.createGrammar(story);\n var result = grammar.flatten(\"#start#\");\n console.log(result);\n $('#story').show();\n $('#story').text(result);\n responsiveVoice.speak(result, 'UK English Female',{pitch:1},{rate:1});\n// set a timeout before showing the next step of the story\n setTimeout(narrator,5000);\n}", "validate(){\n\t\t//on met dans t la valeur du titre\n\t\tlet t = document.querySelector('#form_add_note_title').value;\n\t\t//on met dans c la valeur du contenu\n\t\tlet c = document.querySelector('#form_add_note_text').value;\n\n\t\tif (noteFormView.isEdit){\n\t\t\tlet note = noteList.list.filter(e => e.id == noteListView.note.id);\n\t\t\tnote[0].titre = t;\n\t\t\tnote[0].contenu = c;\n\t\t\t//update date\n\t\t\tnote[0].date_creation = new Date();\n\t\t\tnoteFormView.isEdit = false;\n\t\t} else {\n\t\t\tlet n = new Note(t,c);\n\t\t\t//ajoute la note au tableau\n\t\t\tnoteList.add(n);\n\t\t}\n\n\n\t\t//save to localstorage\n\t\tnoteList.save();\n\t\t//vide la section et load le tableau avec les infos à jour\n\t\tnoteList.load();\n\t\t//hide le formulaire\n\t\tnoteFormView.hide();\n\t}", "function initialQuote() {\n //user was asked a yes/no question, get response\n getUseInput(function(data) {\n if (/^n$/i.test(data) || /^no$/i.test(data)) {\n deleteAllLines();\n displayString(\"In that case, I'll wait patiently until you need me.\", false);\n setTimeout(function() {\n deleteAllLines();\n displayString('Standing by...', 'main');\n }, 1500);\n } else if (/^y$/i.test(data) || /^yes$/i.test(data)) {\n deleteAllLines();\n getQuote(function() {\n //since this is first quote retrieved, inform user of tweeting ability\n displayString([\"If you would like to tweet this, please type tweet. Otherwise,\",\n \"as I mentioned earlier, feel free to type help to see what else I can do for you.\"].join(' '));\n });\n\n } else { //user has entered something other than yes/no\n deleteAllLines();\n displayString(\"You didn't answer my question. Nevermind. What is it you want?\", 'main');\n }\n });\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 BOT_onTell() {\r\n\tvar thebotobject = eval(BOT_theBotId);\r\n\tvar thebottopicid = thebotobject.topicId;\r\n\tif(BOT_theReqTopic == thebottopicid) { BOT_reqSay(false,\"ANGRY\",\"NOFACTSABOUTBOT\"); return }\r\n\tif( !BOT_theReqEqual || !BOT_theReqAttribute || !BOT_theReqValue) { BOT_reqSay(false,\"WARNING\",\"BADFACTFORMAT\"); return }\r\n\t// topic.attribute <- value\r\n\tif (!BOT_reqExistAttribute(BOT_theReqAttribute)) return;\r\n\tBOT_set(BOT_theReqTopic,BOT_theReqAttribute,\"VAL\",BOT_theReqValue);\r\n\tBOT_reqSay(true,\"HAPPY\",\"FACTSTORED\",BOT_theReqAttribute,BOT_theReqTopic,BOT_theReqValue);\r\n}", "function evaluator (userAnswer) {\n currentTour;\n correctAnswer;\n if (userAnswer === correctAnswer) {\n currentTour = currentTour + 1;\n console.log(\"User wrigt\");\n console.log(\"Tour\",currentTour)\n answerCorrect();\n quizExecutor(currentTour);\n } else {\n currentTour = currentTour + 1;\n console.log(\"User wrong\");\n console.log(\"Tour\",currentTour);\n answerWrong();\n quizExecutor(currentTour);\n };\n }", "setTeacher() {\n let name = prompt(\"Enter teacher full name: \", \"Steve Martin\");\n let email = prompt(\"Enter teacher email: \", \"[email protected]\");\n let honorific = prompt(\"Enter honorific: \", \"Prof.\");\n let newTeacher = new Teacher(name, email, honorific);\n this.teacher = newTeacher;\n updateRoster(this);\n }", "function getTextTTS() {\n if(PLAYING_SOMETHING){\n // do nothing\n }\n else {\n var ttsInput = document.getElementById(\"textArea\").value;\n //titleElement = document.getElementById(\"resultTitle\");\n //resultElement = document.getElementById(\"resultP\");\n // Calls speakText function with the user inputted text.\n speakText(ttsInput);\n }\n}", "function addNote(lectureID, slideID, note) {\n var objectStore = database.transaction([\"notes\"], \"readwrite\").objectStore(\"notes\");\n objectStore.add({\n slideID: slideID,\n lectureID: lectureID,\n note: note\n }).onsuccess = function(e) {\n // Add a radio button for the note.\n addNoteButton(\n \"Note \" + e.target.result\n + \": Lecture \" + lectureID\n + \" - Slide \"+ slideID,\n e.target.result, note\n );\n };\n}", "function editNote(index){\n if(addTxt.value ===\"\" && addHeading.value ===\"\"){\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesArr = [];\n }\n else {\n notesArr = JSON.parse(notes);\n }\n // console.log(notesArr[index].heading); \n addHeading.value=notesArr[index].heading;\n addTxt.value=notesArr[index].text;\n deleteNote(index);\n\n }else{\n return alert(\"Please clear the field before Edit.\");\n }\n}", "function answer(guess) {\r\n\r\n // If ear trainer has started, else simply play the note\r\n if (started) {\r\n if (guessed) { return; } // If already guessed, do nothing (to prevent spam)\r\n guessed = true;\r\n\r\n if (guess == ans) {\r\n document.getElementById(\"ind\").style.color = \"green\";\r\n document.getElementById(\"ind\").innerHTML = \"Correct!\"\r\n correct++;\r\n play(guess);\r\n } else {\r\n document.getElementById(\"ind\").style.color = \"red\"\r\n document.getElementById(\"ind\").innerHTML = \"Incorrect. That was \" + ans;\r\n wrong++;\r\n stopAllAudio();\r\n wrongsound.play();\r\n }\r\n document.getElementById(\"ind\").style.visibility = \"visible\";\r\n updateScore();\r\n\r\n // Wait 1.75 sec then stop audio\r\n changeTrainerTitle(\"Okay.\");\r\n sleep(1750).then(() => {\r\n stopAllAudio();\r\n changeTrainerTitle(\"Get Ready!\");\r\n });\r\n\r\n // Wait 2.5 sec then get next chord\r\n sleep(2500).then(() => {\r\n getNewChord();\r\n });\r\n } else {\r\n document.getElementById(\"ind\").style.visibility = \"hidden\";\r\n play(guess);\r\n }\r\n}", "function saveTeacher(){\n teacher = true;\n }", "function showNote(note, button) {\n shownNote = note;\n shownNoteButton = button;\n $(\"#noteTime\", slide.contentDocument).text(new Date(note.time).toLocaleString());\n $(\"#noteBody\", slide.contentDocument)[0].value = note.body;\n $(\"#noteBody\", slide.contentDocument)[0].focus();\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 mNote() {\n return function(state) {\n note(state);\n return {answer: undefined, state: state}\n }\n}", "function handleQuestionAnswer(topic, data) {\n data = JSON.parse(data);\n\n updateContestantScore(data.contestant, data.value, true);\n\n if (!data.correct) {\n buzzer.activate(jeopardy.getStatusIndicatorElement());\n }\n }", "enterMultiLineAnswer(ctx) {\n\t}", "function evaluateNote(note) {\n var toneVal = note.tone;\n var msNoteDur = note.duration.stop - note.duration.start;\n var msPerBeat = void 0;\n if (bpm > 140) {\n msPerBeat = 60000 / (bpm / 2);\n msNoteDur = msNoteDur / 2;\n } else if (bpm < 60) {\n msPerBeat = 60000 / (bpm * 2);\n msNoteDur = msNoteDur * 2;\n } else {\n msPerBeat = 60000 / bpm;\n }\n\n var beatVals = [{ beats: '4', notation: ':w', msDur: msPerBeat * 4 }, { beats: '3', notation: ':hd', msDur: msPerBeat * 2 + msPerBeat }, { beats: '2', notation: ':h', msDur: msPerBeat * 2 }, { beats: '1.5', notation: ':hq', msDur: msPerBeat + msPerBeat / 2 }, { beats: '1', notation: ':q', msDur: msPerBeat }, { beats: '.75', notation: ':8d', msDur: msPerBeat / 2 + msPerBeat / 4 }, { beats: '.5', notation: ':8', msDur: msPerBeat / 2 }, { beats: '.25', notation: ':16', msDur: msPerBeat / 4 }];\n minBeat = beatVals[beatVals.length - 1].msDur;\n if (timeSig === '3/4') {\n beatVals.splice(0, 1);\n }\n\n // find the closest value in beatVals to msNoteDur\n var noteLength = getClosestBeatValue(beatVals, msNoteDur);\n // account for exceeding beats in a measure\n validateMeasureLength();\n\n addToNotesArr(note, msNoteDur, noteLength);\n\n noteIndex++;\n }", "function handleNote({note, time}) {\n samplePlayer.play(note);\n store.dispatch(addPlayedNote({note, time}));\n}", "handler(argv){\n notes.addNote(argv.title, argv.body)\n }", "function seeEvaluate()\n{\n if(event.which==13 || event.keyCode==13)\n {\n evaluateMe();\n }\n}", "function Transcribe(note , duration) {\n\tif (canTranscribe) {\n\t// inserire pezzo come contenitore per l'output\n\t\t\n\t\tmelodyArray.push(transcription_map[note] + duration);\n\t\ttimingArray.push(duration);\n\t\tnoteNameArray.push(transcription_map[note]);\n\t\t\n\t\tvar tune = transcription_map[note];\n\t\t// console.log(\"Sto Trascrivendo una nota:\", tune);\n\t\t\n\t}\n}", "function C101_KinbakuClub_RopeGroup_TieCharlotte() {\n\tif (ActorSpecificGetValue(\"Charlotte\", ActorSubmission) >= 4) OverridenIntroText = GetText(\"YouTry\");\n}", "function AddTicketNote(e, tid){\n if(e.keyCode==13 || e==13){\n $text = $(\".ticket\" + tid).find(\"#addnotetext\").val();\n\t $box = $(\".ticket\" + tid).find(\"#notebox\");\n\t if(!$text == \"\"){\n\t $(\".ticket\" + tid).find(\"#addnotetext\").val(\"\");\n\t $.ajax({\n\t\t url: \"ajax/notes/ticketnote.php?ticket=\" + tid + \"&note=\" + $text,\n\t\t\t cache: false\n\t\t }).done(function(html){\n\t\t $box.html(html);\n\t\t });\n\t } else {\n\t $(\".ticket\" + tid).find(\"#addnotetext\").focus();\n\t }\n\t}\n}", "function handleNTS1Proceed() {\n console.log(\"in proceed\");\n let isValid = true;\n $('#noteNameError').hide();\n $('#noteDescriptionError').hide();\n $('#noteNoOfParticipantsError').hide();\n $('#noteLanguageError').hide();\n $('#noteTypeError').hide();\n const noteName = $('#noteName')[0].value;\n const noteDescription = $('#noteDescription')[0].value;\n const noteLanguage = $('#noteLanguage')[0].value;\n const noteType = $('#noteType .selected')[0].dataset.noteType;\n if (!noteName) {\n $('#noteNameError').text('Please Provide note Name');\n $('#noteNameError').show()\n isValid = false;\n }\n console.log(isValid);\n if (!noteDescription) {\n $('#noteDescriptionError').text('Please Provide note Description');\n $('#noteDescriptionError').show()\n isValid = false;\n }\n console.log(isValid);\n if (noteLanguage === 'none') {\n $('#noteLanguageError').text('Please Select note Language');\n $('#noteLanguageError').show()\n isValid = false;\n }\n console.log(isValid);\n if (!noteType) {\n $('#noteTypeError').text('Please Select note Type');\n $('#noteTypeError').show()\n isValid = false;\n }\n console.log(isValid);\n if (isValid) {\n console.log(\"proceed eng\");\n $(\"#step1\").submit();\n console.log($('#subscriptionType')[0].value)\n console.log(\"proceed complete\");\n }\n}", "evaluatePlayedNote(noteIndex) {\n const currentNoteIndex = this.userProgress + 1;\n\n // Right guess\n if (this.botSequence[currentNoteIndex].noteIndex === noteIndex) {\n this.userProgress = this.userProgress + 1;\n if (this.userProgress === this.botSequence.length - 1) {\n this.progressAfterCorrectGuess();\n }\n // Wrong guess\n } else {\n // Cancel previous red feedback timeout\n if (this.feedbackTimeout) {\n clearTimeout(this.feedbackTimeout);\n this.feedbackTimeout = null;\n this.wrongNoteFeedback = false;\n\n // Show red again\n setTimeout(() => {\n this.wrongNoteFeedback = true;\n }, 50);\n } else {\n // Show red immediately\n this.wrongNoteFeedback = true;\n }\n this.wrongGuessStreak = this.wrongGuessStreak ? this.wrongGuessStreak + 1 : 1;\n\n // If there are too many wrong guesses without listening to the melody,\n // suspend the evaluation of the notes and allow free play.\n if (this.wrongGuessStreak === 4) {\n this.evaluationSuspended = true;\n this.playbackIndex = -1;\n }\n \n this.feedbackTimeout = setTimeout(() => {\n this.wrongNoteFeedback = false;\n this.feedbackTimeout = null;\n }, 1200); \n this.userProgress = -1;\n this.score = this.score - 10;\n\n if (this.gameMode) {\n this.lifeCount -= 1;\n\n // Game over\n if (this.lifeCount === 0) {\n this.wrongGuessStreak = 0;\n this.blockAction= true;\n\n // This is set to false to avoid hiding note bars\n this.evaluationSuspended = false;\n\n // Don't allow playback or exit game momentarily\n this.$['play-button'].style['pointer-events'] = 'none';\n this.$['exit-game-trigger'].style['pointer-events'] = 'none';\n\n setTimeout(() => {\n this.blockAction = false;\n this.$['play-button'].style['pointer-events'] = 'auto';\n this.$['exit-game-trigger'].style['pointer-events'] = 'auto';\n this.$['game-over-dialog'].open();\n }, 300);\n }\n }\n }\n }", "function Quiz() {\n\n var name = document.registration.username;\n var add = document.registration.Subject;\n var cla = document.registration.Class;\n var name = document.registration.username;\n\n if (allLetter(name)) {\n\n }\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 getText() {\n if(PLAYING_SOMETHING){\n\n }\n else{\n var textInput = document.getElementById(\"textArea\").value;\n //console.log(textInput);\n //var textblock = textInput;\n // titleElement = document.getElementById(\"resultTitle\");\n // //titleElement.innerHTML = \"Your input:\";\n //\n // resultElement = document.getElementById(\"resultP\");\n //resultElement.innerHTML = textInput;\n\n readText(textInput);\n }\n}", "function introQ(evt){\nlet event = evt;\n if (evt == 'yes'){\n addScore('Compliant', 5)\n first.style.display = \"none\";\n ypage.style.display = \"inline-block\"; \n } else if (evt == \"y1\"){\n addScore('Compliant', 3)\n beginQuiz('y')\n }else if (evt == \"y2\"){\n addScore('Compliant', 2)\n beginQuiz('y')\n }else if (evt == \"y3\"){\n addScore('Compliant', 1)\n beginQuiz('y')\n }else if (evt == \"y4\"){\n addScore('Fool', 5)\n beginQuiz('y')\n } else if (evt == 'no'){\n addScore('Resistant', 5)\n addScore('Troll', 5)\n first.style.display = \"none\";\n npage.style.display = \"inline-block\";\n } else if (evt == \"n1\"){\n addScore('Resistant', 3)\n beginQuiz('n')\n } else if (evt == \"n2\"){\n addScore('Resistant', 2)\n beginQuiz('n')\n } else if (evt == \"n3\"){\n addScore('Resistant', 1)\n beginQuiz('n')\n } else if (evt == \"n4\"){\n addScore('Fool', 5)\n beginQuiz('n')\n } \n}", "function Analyze() {\n\n // get the value of title input field and textarea field\n let inputField = document.getElementById(\"title-input\").value;\n let textareaField = document.getElementById(\"note-textarea\").value;\n\n // alert paragraph element\n let alert = document.querySelector(\".alert\");\n\n // if both fields are empty\n if (inputField == \"\" || textareaField == \"\") {\n alert.innerText = \"Both Fields are Required!\";\n alert.style.display = \"block\";\n }\n // if length of inputField is greater than 40 char\n else if (inputField.length > 40) {\n alert.innerText = \"Title Field must be less than 40 characters!\";\n alert.style.display = \"block\";\n }\n // if upper both conditions are false then store data and add note\n else {\n alert.innerText = \"\";\n alert.style.display = \"none\";\n CheckAndStoreData(inputField, textareaField);\n }\n\n}", "function qnasection(){\n\tWait(1000);\n\tR(\"My story ends here.\");\n\tR(\"Is there any questions?\");\n\tp(\"Do you ever regret it?\");\n\n\tR(\"I wonder what you’re asking exactly...\");\n\tp(\"Didn’t you make that words..?\");\n\tR(\"What?\");\n\tR(\"identifying myself as transgender, starting hormonal therapy, and getting surgeries?\");\n\tR(\"Coming out to my mom?\");\n\tR(\"Briefly speaking, I don’t regret neither of them.\");\n\tR(\"As I said before,\");\n\tp(\"You will not change your decision?\");\n\tR(\"I will not change--\");\n\tR(\"Yeah, that.\");\n\tR(\"I am still faced with difficulties,\");\n\tR(\"but at least I can say confidently that it’s better than before.\");\n\tR(\"Of course, It’s not that I am not terribly happy right now...\");\n\tR(\"It was just too hard before all this...\");\n\n\tR(\"Anyways, thanks for running along with me all the way here!\");\n\tR(\"I wish you all the best.\");\n\tWait(1000);\n\tShow(\"nurse\",\"nurse\");\n\tf(\"D-D, let my replace your IV.\");\n\tWait(1500);\n\tfinale_tw();\n}", "function quiz (question, answer) {\nindex = read_input.keyInSelect(answer, question);\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 addNote(){\n var noteText = document.getElementById(\"note_text\").value;\n noteList.addNote(noteText);\n displayNotes();\n }", "function setNote() {\n var row = oNotesTable.row('.selected').data();\n var oNote = oData.jsFormula.getNote(row[0]);\n oSelectedNote = oNote;\n\n document.getElementById('note_area').value = oNote.sNote;\n document.getElementById('btnEditNote').disabled = false;\n document.getElementById('btnDelNote').disabled = false;\n document.getElementById('note_area').readOnly = true;\n}", "function createNewNote()\n{\n randomNote = int(random(notes.length - 1));\n goalNote = notes[randomNote].note\n goalFrequency = -notes[randomNote].frequency\n\n // play voice over when the new note is created\n playVoiceOver();\n}", "function allowQuestion() { }", "handleUserInput(e){\n this.setState({\n newNoteContent: e.target.value, // the value of the text input\n })\n }", "handleUserInput(e){\n this.setState({\n newNoteContent: e.target.value, // the value of the text input\n })\n }", "function saveNote() {\n var sText = document.getElementById('note_area').value;\n\n if (oSelectedNote == null) {\n note = new Note();\n note.sNote = sText;\n\n oData.jsFormula.addNote(note);\n\n oNotesTable.row.add([\n note.nuNote,\n note.iIdNote,\n note.sNote\n ]).draw( false );\n }\n else {\n oData.jsFormula.getNote(oSelectedNote.nuNote).sNote = sText;\n $('#notes_table').dataTable().fnUpdate(sText , oSelectedNote.nuNote, 2);\n }\n\n initNote();\n}", "function talkToTia() {\n\n // check that final text box has been changed or not from recording\n synthesisObject.finalTextInBox = $('#textInput').val();\n\n //no change from audio\n if ( synthesisObject.finalTextInBox === synthesisObject[ 'transcript' + synthesisObject.transcriptCur ] ) {\n\n synthesisObject.originalVoice = true;\n\n } else {\n\n synthesisObject.originalVoice = false;\n synthesisObject.pitch = 0;\n synthesisObject.speaking_rate = 0.85;\n synthesisObject.text = synthesisObject.finalTextInBox;\n sendTTS( synthesisObject.finalTextInBox, false, \"talk\" ); \n\n }\n\n\n // fadeOut all prev sentences - this is to stop learners reading prev sents while should be looking at tia\n $('#prevSents').fadeTo( 500, 0.1 );\n $('#textInputContainer').hide();\n $('.record-btn').prop(\"disabled\", true);\n $('#recordBtnsContainer').fadeOut( 500 );\n \n setTimeout( function(){\n \n initCameraMove('tia', tiaTimings.cameraMoveUpDuration);\n \n setTimeout( function() {\n \n //whenAllMovFinished( tiaLeanToListen )\n tiaLeanToListen();\n \n }, tiaTimings.cameraMoveUpDuration * 700 );//2/3 of camera move up duration\n\n \n }, tiaTimings.delayAfterClickPlayUntilCameraMovesUp );\n \n}", "function handleChange(event) {\n setNote(event.target.value);\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 updateNote(worker, note) {\n if (note != null) {\n note = datastore.updateNote(note);\n worker.port.emit(\"NoteUpdated\", note);\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}", "onAnswer (e, category, currentQuestion) {\n return (\n e.target.innerText === trivia[category].questions[currentQuestion].answer ? this.onCorrect() : this.onWrong()\n )\n }", "function syncReview(e){\n let sync = () =>{\n let inputs = headlineNote.innerText.split(\"\\n\\n\");\n inputs.forEach((input, index) => { \n index < placeholders.length ?\n placeholders[index].textContent = input.trim() :\n ''; \n });\n }\n setTimeout(sync, 0.1);\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 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 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 addNote()\n{\n\tcreatePop(\"Add Note\", submitNote,{})\n}", "function C012_AfterClass_Jennifer_ChangeToTrain() {\n\tif (ActorGetValue(ActorCloth) != \"Tennis\") {\n\t\tCurrentTime = CurrentTime + 50000;\n\t\tActorSetCloth(\"Tennis\");\n\t\tOverridenIntroText = GetText(\"TennisToTrain\");\n\t}\n}", "function nextQuestion() {\n if(\"Manager\"){\n managerInfo\n \n ifelse(\"Engineer\")\n engineerInfo\n \n ifelse(\"Intern\")\n internInfo\n \n ifelse(undefined)\n throw(err)\n }\n}", "function q3() {\n\n var answerToThirdQ = prompt('Am I currently an effective front end web developer?').toUpperCase();\n\n if (answerToThirdQ === 'N' || answerToThirdQ === 'NO') {\n alert('Correct! You\\'re a savant!');\n }else if (answerToThirdQ === 'Y' || answerToThirdQ === 'YES') {\n alert('Um, ya dun goofed!');\n }else{alert('Please type accurately! Answer YES or NO!')};\n\n}", "enterQnaQuestion(ctx) {\n\t}" ]
[ "0.62702304", "0.60719585", "0.5800763", "0.578722", "0.5752094", "0.5613822", "0.5610951", "0.5563169", "0.55351526", "0.55065984", "0.55020505", "0.5483793", "0.54834193", "0.54390305", "0.5419827", "0.54090244", "0.5386201", "0.53801924", "0.5379006", "0.53762174", "0.53339493", "0.53272194", "0.5319854", "0.53132826", "0.5304051", "0.52890784", "0.52669907", "0.5253504", "0.5246019", "0.5229512", "0.5228618", "0.5226136", "0.5225704", "0.52211547", "0.5220749", "0.5212865", "0.52124566", "0.52097344", "0.520713", "0.5191415", "0.51872176", "0.51859957", "0.51850283", "0.5182727", "0.5171397", "0.5171337", "0.51573324", "0.5153832", "0.5130932", "0.512119", "0.51207435", "0.51199377", "0.5114476", "0.5107847", "0.5107513", "0.5105728", "0.51032734", "0.51007247", "0.5092758", "0.5090048", "0.50878733", "0.5083016", "0.5077433", "0.5075007", "0.5074698", "0.5074394", "0.5073871", "0.5068252", "0.5067622", "0.5064155", "0.50572485", "0.5051294", "0.5038758", "0.5038212", "0.50304115", "0.50264573", "0.5025996", "0.5024205", "0.5020351", "0.50173193", "0.50165516", "0.50084573", "0.50064963", "0.50064963", "0.50038797", "0.49841824", "0.49824646", "0.4968992", "0.49628866", "0.49571437", "0.49499172", "0.4946111", "0.49428084", "0.49419773", "0.49397784", "0.49386322", "0.49379972", "0.4937391", "0.49337652", "0.49277127" ]
0.523041
29
Renders Evaluation scree UI
render() { const { improvementAreas, readOnly, rating, classStudent, assignmentName, isLoading, studentObject, studentID, classID, assignmentType, showMushaf, highlightedAyahs, highlightedWords } = this.state; if (isLoading === true) { return ( <View style={{ flex: 1, justifyContent: "center", alignItems: "center" }} > <LoadingSpinner isVisible={true} /> </View> ); } const { profileImageID } = studentObject; const headerTitle = readOnly ? strings.Completed + ": " + this.props.navigation.state.params.completionDate : strings.HowWas + classStudent.name + strings.sTasmee3; return ( //----- outer view, gray background ------------------------ //Makes it so keyboard is dismissed when clicked somewhere else <View style={{ flex: 1 }} > {this.props.navigation.state.params.newAssignment === true ? ( <Header title={assignmentType} subtitle={assignmentName} avatarName={classStudent.name} avatarImage={studentImages.images[profileImageID]} onClose={this.closeScreen.bind(this)} /> ) : readOnly === true && !this.props.navigation.state.params.isStudentSide ? ( <TopBanner LeftIconName="angle-left" LeftOnPress={this.closeScreen.bind(this)} Title={strings.Evaluation} RightIconName="edit" RightOnPress={() => { this.setState({ readOnly: false, selectedImprovementAreas: this.state.improvementAreas }); this.getTeacherCustomImprovementAreas(); }} /> ) : ( <Header title={assignmentType} avatarName={classStudent.name} subtitle={assignmentName} avatarImage={studentImages.images[profileImageID]} onClose={this.closeScreen.bind(this)} /> )} <KeyboardAvoidingView behavior={isAndroid ? undefined : "padding"} style={ showMushaf ? styles.evaluationContainer : { justifyContent: "center", alignItems: "center" } } > <ScrollView> {showMushaf && ( <View style={{ bottom: 5, left: screenWidth * 0.9, zIndex: 1, position: "absolute" // add if dont work with above }} > <TouchableOpacity onPress={() => this.setState({ evaluationCollapsed: !this.state.evaluationCollapsed }) } > <Icon name={ this.state.evaluationCollapsed ? "angle-double-down" : "angle-double-up" } type="font-awesome" color={colors.primaryDark} /> </TouchableOpacity> </View> )} {this.state.audioFile !== -1 ? ( <View style={{ justifyContent: "center", alignItems: "center", margin: 10 }} > <View style={styles.playAudio}> <AudioPlayer visible={true} compensateForVerticalMove={false} image={studentImages.images[profileImageID]} reciter={classStudent.name} audioFilePath={this.state.audioFile} hideCancel={true} sent={ this.state.audioSentDateTime ? this.state.audioSentDateTime : "" } /> </View> </View> ) : ( <View /> )} <View style={styles.section}> <Text style={fontStyles.mainTextStyleDarkGrey}> {headerTitle} </Text> <View style={{ paddingVertical: 15 }}> <AirbnbRating defaultRating={rating} size={30} showRating={false} onFinishRating={value => this.setState({ rating: value }) } isDisabled={readOnly} /> </View> {this.state.evaluationCollapsed === false && ( <EvaluationNotes improvementAreas={improvementAreas} readOnly={readOnly} onImprovementAreasSelectionChanged={this.onImprovementAreasSelectionChanged.bind( this )} onImprovementsCustomized={this.onImprovementsCustomized.bind( this )} saveNotes={evalNotes => this.onSaveNotes(evalNotes)} notes={this.state.notes} selectedImprovementAreas={this.state.selectedImprovementAreas} userID={this.props.navigation.state.params.userID} /> )} </View> </ScrollView> </KeyboardAvoidingView> <View style={{ flex: 1 }}> {showMushaf && ( <View style={{ height: screenHeight - headerHeight }} > <KeepAwake /> <MushafScreen assignToID={studentID} hideHeader={true} readOnly={readOnly} showSelectedLinesOnly={false} classID={classID} showTooltipOnPress={readOnly ? "whenHighlighted" : "true"} profileImage={studentImages.images[profileImageID]} showLoadingOnHighlightedAyah={ this.state.isAudioLoading === true && (this.state.highlightedAyahs !== undefined || _.isEqual(this.state.highlightedAyahs, {})) } selection={this.state.selection} highlightedWords={_.cloneDeep(highlightedWords)} highlightedAyahs={_.cloneDeep(highlightedAyahs)} highlightedColor={colors.darkRed} assignmentName={assignmentName} assignmentType={assignmentType} topRightIconName="close" onClose={this.closeScreen.bind(this)} currentClass={classStudent} onSelectAyah={this.onSelectAyah.bind(this)} disableChangingUser={true} removeHighlight={this.unhighlightWord.bind(this)} evalNotesComponent={(word, ayah) => { let wordOrAyahImprovements = []; let wordOrAyahNotes = ""; let wordHasFeedback = false; try { //if user taps on a word, and teacher has put feedback specific to that word, show it if (word.char_type !== "end") { wordOrAyahImprovements = _.get( highlightedWords[word.id], "improvementAreas", [] ); wordOrAyahNotes = _.get( highlightedWords[word.id], "notes", [] ); if ( wordOrAyahImprovements.length > 0 || wordOrAyahNotes.length > 0 ) { wordHasFeedback = true; } } //show ayah feedback if: // 1: user taps on an ayah number of an ayah that has feedback associated with it // 2: user taps on a word that belongs to an ayah with feedback items AND there is no other // feedback specific to tha word if (word.char_type === "end" || wordHasFeedback === false) { let ayahNumber = toNumberString(ayah); wordOrAyahImprovements = _.get( highlightedAyahs[ayahNumber], "improvementAreas", [] ); wordOrAyahNotes = _.get( highlightedAyahs[ayahNumber], "notes", [] ); } } catch (error) { console.trace(); console.log( "ERROR_GET_WRD_AYAH_IMPROVEMENTS" + JSON.stringify(error) ); FirebaseFunctions.logEvent( "ERROR_GET_WRD_AYAH_IMPROVEMENTS", { error } ); } return ( <EvaluationNotes //TODO: This logic needs cleaning // for now: if the teacher is evaluating, then we pass the full set of improvement ares for her to choose from // if this is readonly (ie: student or teacher are seeing a past assignment), // then we show only imp. areas entered for ths word. improvementAreas={ readOnly ? wordOrAyahImprovements : improvementAreas } notes={wordOrAyahNotes} selectedImprovementAreas={wordOrAyahImprovements} readOnly={readOnly} userID={this.props.navigation.state.params.userID} onImprovementAreasSelectionChanged={selectedImprovementAreas => this.onImprovementAreasSelectionChanged( selectedImprovementAreas, word, ayah ) } onImprovementsCustomized={newAreas => { this.setState({ improvementAreas: newAreas }); FirebaseFunctions.saveTeacherCustomImprovementTags( this.props.navigation.state.params.userID, newAreas ); }} saveNotes={wordNotes => this.onSaveNotes(wordNotes, word, ayah) } /> ); }} /> </View> )} {!readOnly && ( <ActionButton buttonColor={colors.darkGreen} onPress={() => { this.submitRating(); }} renderIcon={() => ( <Icon name="check-bold" color="#fff" type="material-community" style={styles.actionButtonIcon} /> )} /> )} </View> </View> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function render() {\n let html = '';\n\n if (STORE.quizStarted === false) {\n $('main').html(displayStartScreen());\n return;\n }\n else if (STORE.questionNumber >= 0 && STORE.questionNumber < STORE.questions.length) {\n html = displayQuestNumAndScore();\n html += displayQuestion();\n $('main').html(html);\n }\n else {\n $('main').html(displayResults());\n }\n }", "function render() {\n if (store.quizStarted === false) {\n $('main').html(generateWelcome());\n return;\n }\n else if (store.questionNumber < store.questions.length) {\n let html = '';\n html = generateQuestion();\n html += generateQuestionNumberAndScore();\n $('main').html(html);\n }\n else {\n $('main').html(generateResultsScreen());\n }\n}", "function render() {\n let html = '';\n\n if (questionnaire.quizStarted === false) {\n $('main').html(generateStartButton());\n \n return;\n } else if (\n questionnaire.currentQuestion >= 0 &&\n questionnaire.currentQuestion < questionnaire.questions.length\n ) {\n $(\"header\").css({ \"margin-top\": \"50px\" });\n \n html = printQuiz();\n html += printQuestion();\n $('main').html(html);\n } \n \n \n else {\n \n \n $('main').html(generateResultsScreen());\n \n \n }\n}", "evaluationOutput () {\n\n const result = store.state.results[store.state.score.scoreLevel]\n\n return `<h2>${result.title}</h2>\n <h3>${result.message}</h3>`\n }", "function editSelfEvaluation(){\n\t$selfEvaluationLabels.hide();\n\t$selfEvaluationOptions.show();\n}", "function render() {\n if (STORE.view === 'start') {\n renderStartQuiz();\n $('.intro').show();\n $('.quiz').hide();\n $('.result').hide();\n $('.quizStatus').hide();\n } else if (STORE.view === 'quiz') {\n renderQuestionText();\n renderQuizStatusBar();\n $('.intro').hide();\n $('.quiz').show();\n $('.result').hide();\n $('.quizStatus').show();\n } else if (STORE.view === 'questionResult') {\n renderQuestionResult();\n renderQuizStatusBar();\n $('.intro').hide();\n $('.quiz').hide();\n $('.result').show();\n $('.quizStatus').show();\n } else if (STORE.view === 'finalResult') {\n renderFinalResult();\n $('.intro').hide();\n $('.quiz').hide();\n $('.result').show();\n $('.quizStatus').hide();\n }\n }", "function render() {\r\n let content = '';\r\n if (STORE.view === 'home') {\r\n $('main').html(welcomePage());\r\n }\r\n else if (STORE.view === 'question') {\r\n content = questionAsked();\r\n content += generateAnswers();\r\n content += questionAndScoreStanding();\r\n $('main').html(`<form>${content}</form>`);\r\n } else if (STORE.view === 'feedback') {\r\n answerFeedback();\r\n } else if (STORE.view === 'score') {\r\n finalScore();\r\n }\r\n}", "function render() {\r\n if (store.quizStarted === false){\r\n $('main').html(startScreen());\r\n }\r\n else if (store.quizStarted === true){\r\n // $('main').html(showAnswers())\r\n $('main').html(showQuestion());\r\n }\r\n\r\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 }", "function render(){ \n console.log('`render function` ran');\n const createdHtml = generateHtml(STORE); \n $('main').html(createdHtml);\n}", "function renderQuiz(){\n let html = generateQuiz();\n $('main').html(html);\n}", "function render(){\n //console.log(store.quizstarted)\n if(store.quizstarted){\n console.log('`startscreen` ran');\n const start = startScreen();\n $(\".main\").html(start);\n }\n else if(store.questionNumber > -1 && store.questionNumber<store.questions.length){\n console.log('`questionscreen` ran');\n const questionscreen = questionScreen(store.questionNumber);\n $(\".main\").html(questionscreen);\n $(handleQuestion);//to see all options again in new dom\n }\n else{\n console.log('`endscreen` ran')\n const end = endScreen();\n $(\".main\").html(end);\n $(handleEnd);//to see all options again in new dom\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 resultsPage() {\r\n return `\r\n <div class=\"results\">\r\n <fieldset>\r\n <legend>Final Score: ${store.score} out of ${store.questions.length}</legend>\r\n <button type=\"button\" id=\"redo\"> Try Quiz Again </button>\r\n </fieldset>\r\n <img class= \"finished\" src = \"images/end/gretzky.jpg\" alt= \"Michael Scott infront of a white board with a quote\" />\r\n\r\n </div>\r\n `\r\n}", "function render() {\n\n\t\t\t}", "function behavioural_evaluation_temp(){\n\t\t\n\t\t$(\"#eval_content\").html(\"<div align=\\\"center\\\" width=\\\"100%\\\"><img align=\\\"center\\\" src=\\\"images/loader.gif\\\"/></div>\");\n\t\t$.ajax({\n\t\t\ttype : \"POST\",\n\t\t\turl : \"behaviouralevaluation_evaluationtemp.action\",\t\t\t\t\n\t\t\tdata : \"\",\n\t\t\tsuccess : function(response) { \n\t\t\t\tdocument.getElementById(\"beh\").innerHTML = \"<img alt=\\\"click\\\" src=\\\"images/next.gif\\\" width=\\\"8px\\\">&nbsp;Behavioral Evaluation\";\n\t\t\t\tdocument.getElementById(\"hol\").innerHTML = \"<img alt=\\\"click\\\" src=\\\"images/next_dim.gif\\\" width=\\\"8px\\\">&nbsp;Holistic Behavioral Evaluation\";\n\t\t\t\t$('#eval_content').html(response);\n\t\t\t},\n\t\t\terror : function(e) {\n\t\t\t\talert('Error: ' + e);\n\t\t\t}\n\t\t});\n\t}", "function refreshStudentEvalResultView(){\n\t\t\n\t\tdocument.getElementById(\"student_side_list_pergrade\").innerHTML = \"\";\n\t}", "function renderPage() {\n if (STORE.questionNumber === 0) {\n startPage();\n return;\n }\n\n else if (STORE.questionNumber > STORE.numQuestions) {\n finalScore();\n return;\n }\n\n //generateCurrentScore();\n else {\n generateAllQuestions();\n }\n\n}", "function dataSubmittedPage() {\r\n app.getView().render('subscription/emarsys_datasubmitted');\r\n}", "function resultsPage(){\n let finalScore = STORE.score;\n return `\n <body>\n <h2>The results are in...</h2>\n <div class = 'score-container'>\n <span id = 'current-score'>Your final score was ${finalScore} out of 5.</span>\n </div>\n \n <button id = 'restart-button'>Restart quiz?</button> \n \n</body>\n `;\n}", "function render() {\n\t\t\t}", "function render() {\n\n const renderedString = createRenderString(store);\n\n // insert html into DOM\n $('main').html(renderedString);\n}", "function renderFinalPage() {\r\n let finalPage = `<div class=\"content\">\r\n <h2>Fin</h2> <img src=\"images/end-quiz.gif\" alt=\"Cars driving, split off at fork\" /><p>Your final score is ${store.score}/5... hope you are proud of yourself</p>\r\n <button id=\"restart\">Restart</button> </div>`\r\n return finalPage;\r\n}", "function editManagerEvaluation(){\n\t$managerEvaluationLabels.hide();\n\t$managerEvaluationOptions.show();\n\teditingRating = true;\n}", "function display() {\n // Update the display of the target rate text boxes, if needed.\n for (var i = 0; i < build_targets.length; i++) {\n build_targets[i].getRate()\n }\n var totals = globalTotals\n\n window.location.hash = \"#\" + formatSettings()\n\n if (currentTab == \"graph_tab\") {\n renderGraph(totals, spec.ignore)\n }\n recipeTable.displaySolution(totals)\n if (showDebug) {\n renderDebug()\n }\n\n timesDisplayed = timesDisplayed.add(one)\n var dc = document.getElementById(\"display_count\")\n dc.textContent = timesDisplayed.toDecimal()\n}", "function drawResult(){\n $(\".calcDisplay\").text(expression);\n}", "function renderUiForState(currentState) {\n console.log('renderUiForState mode: ' +currentState.mode);\n console.log(currentState);\n console.log(fleetData);\n \n //hide all elements that vary by MODE\n \n if(currentState.mode == MODE.FLEET) {\n populateScoreTiles('FLEET', currentState.selectedPeriodOffset, fleetData);\n plotAggrDistScatterChart(currentState.groups, currentState.selectedPeriodOffset);\n \n } else if(currentState.mode == MODE.GROUP) {\n populateScoreTiles(currentState.selectedGroup.label, currentState.selectedPeriodOffset, currentState.selectedGroup);\n plotAggrDistScatterChart(currentState.selectedGroup.individuals, currentState.selectedPeriodOffset);\n } else if(currentState.mode == MODE.INDIVIDUAL) {\n populateScoreTiles(currentState.selectedIndividual.label, currentState.selectedPeriodOffset, currentState.selectedIndividual);\n }\n \n \n }", "function renderCorrectAnswerPage() {\r\n let correctAnswerPage = `<div class=\"content\">\r\n <h2>Correct!!</h2> \r\n <p>Your score: ${store.score}/5</p>\r\n <form> <button id=\"next-question\">Next Question</button> </form> </div>`\r\n return correctAnswerPage;\r\n}", "function renderExamResult() {\n console.log('renderExamResult() has been used.');\n \n hideElements(['challenge', 'progress', 'timer']);\n \n showElement('.result');\n\n\n var summary = validateExamAnswers();\n var score = summary.score;\n var title;\n var subtitle;\n var image;\n\n var html = '';\n\n subtitle = getMessage('result_score', 'Your score is ${score}.', ['<strong>'+score+'%</strong>']) + ' ';\n\n if (score == 100) {\n title = getMessage('result_perfect', 'Perfect');\n subtitle += getMessage('result_perfect_details', 'Will you repeat this?');\n image = 'passed';\n }\n if (score >= 80 && score < 100) {\n title = getMessage('result_great', 'Great');\n subtitle += getMessage('result_great_details', 'You would pass exam.');\n image = 'passed';\n }\n if (score >= 50 && score < 80) {\n title = getMessage('result_not_good', 'Not good');\n subtitle += getMessage('result_not_good_details', 'You can do it better.');\n image = 'failed';\n }\n if (score < 50) {\n title = getMessage('result_poor', 'Poor');\n subtitle += getMessage('result_poor_details', 'You have to do it better.');\n image = 'failed';\n }\n if (score == 0) {\n title = getMessage('result_terrible', 'Terrible');\n subtitle += getMessage('result_terrible_details', 'Start to learn wise.');\n image = 'epic-fail';\n }\n\n html += '<div class=\"row\">';\n html += '<div class=\"col mb-3\">';\n html += '<div class=\"card text-center result-box\">';\n // html += '<div class=\"card text-center col-sm-6 col-md-6 col-lg-8 col-xl-12\">';\n html += ' <div class=\"card-header\">';\n // html += allExams[exam].exam.toUpperCase() + ' exam result';\n html += getMessage('exam_result_header', '${name} exam result', [allExams[exam].description]);\n // html += ' Service Mapping exam result';\n html += ' </div>';\n html += ' <a href=\"#\" onclick=\"javascript:renderExamResultDetails();\">';\n html += ' <div class=\"card-body\">';\n html += ' <div class=\"col-sm-6 result-image '+image+'\"></div>';\n html += ' <h1 class=\"card-title\">'+title+'</h1>';\n html += ' <p class=\"card-text\">'+subtitle.replace('%d%', '<strong>'+score+'%</strong>')+'</p>';\n // html += '<a href=\"#\" class=\"btn btn-primary\">Go somewhere</a>';\n html += ' </div>';\n html += ' </a>';\n html += '</div>';\n html += '</div>';\n html += '</div>';\n\n html += '<div class=\"row row-cols-1 row-cols-md-2\">';\n html += ' <div class=\"col mb-3 col-sm-6 col-md-6\">';\n html += ' <div class=\"card h-100 text-center text-success border-success result-box\">';\n html += ' <a href=\"#\" onclick=\"javascript:renderExamResultDetails(\\'correct\\');\">';\n html += ' <div class=\"card-body\">';\n html += ' <h1 class=\"card-title\">'+summary.correct.length+'</h1>';\n html += ' <p class=\"card-text\">' + getMessage('exam_result_correct', 'Questions answered correctly.') + '</p>';\n html += ' </div>';\n html += ' </a>';\n html += ' </div>';\n html += ' </div>';\n html += ' <div class=\"col mb-3 col-sm-6 col-md-6\">';\n html += ' <div class=\"card h-100 text-center text-danger border-danger result-box\">';\n html += ' <a href=\"#\" onclick=\"javascript:renderExamResultDetails(\\'wrong\\');\">';\n html += ' <div class=\"card-body\">';\n html += ' <h1 class=\"card-title\">'+summary.wrong.length+'</h1>';\n html += ' <p class=\"card-text\">' + getMessage('exam_result_incorrect', 'Questions with incorrect or missing answer.') + '</p>';\n html += ' </div>';\n html += ' </a>';\n html += ' </div>';\n html += ' </div>';\n html += '</div>';\n\n // html += '<div class=\"row\">';\n // html += ' <div class=\"col text-center mt-3 mb-3\">';\n // html += '<button id=\"repeat-exam\" onclick=\"javascript:repeatExam();\" class=\"btn btn-secondary\">Repeat same questions</button>';\n // html += '<button id=\"retry-exam\" onclick=\"javascript:retryExam();\" class=\"btn btn-primary\">Retry new questions</button>';\n // html += ' </div>';\n // html += '</div>';\n\n html += '<div class=\"row row-cols-1 row-cols-md-2\">';\n html += ' <div class=\"col text-center mb-3 col-sm-6 col-md-6\">';\n html += ' <button id=\"retry-exam\" onclick=\"javascript:retryExam();\" class=\"btn btn-primary\">' + getMessage('retry_exam', 'Retry new questions') + '</button>';\n html += ' </div>';\n html += ' <div class=\"col text-center mb-3 col-sm-6 col-md-6\">';\n html += ' <button id=\"repeat-exam\" onclick=\"javascript:repeatExam();\" class=\"btn btn-secondary\">' + getMessage('repeat_exam', 'Repeat same questions') + '</button>';\n html += ' </div>';\n html += '</div>';\n \n\n // renderElement('.result', result + '<p class=\"advice\">' + advice + '</p>' + html);\n renderElement('.result', html);\n\n state = 'exam_result_rendered';\n}", "function update_display(){\n // canvas\n draw();\n // DOM displaying results\n display_questions_list();\n}", "function scoreRender() {\r\n scoreDiv.style.display = \"block\";\r\n quiz.style.display = \"none\";\r\n\r\n // calculate the final score\r\n var finalScore = score;\r\n\r\n scoreDiv.innerHTML += \"<p>\" + finalScore + \"</p>\";\r\n}", "function renderGrades(){\n // Get subject from standardID.\n standardSubjectID = _.find(_.find(standards, function(standard){\n return standard.id === OC.editor.lwOptions['standardID'];\n }).subjects, function(subject) { return subject.title === OC.editor.lwOptions['subject']; }).id;\n\n // Find the subject title in the standards list.\n $.get('/resources/api/get-child-categories/' + standardSubjectID + '/',\n function(response){\n if (response.status == 'true'){\n var list = response.categories,\n i,\n gradeList = $('.lesson-wizard-grade-level-list');\n for (i = 0; i < list.length; i++){\n gradeList.append($('<li/>', {\n 'class': 'lesson-wizard-grade-level-list-item',\n 'id': list[i].id,\n 'text': list[i].title,\n }));\n }\n // Handle clicks for grade & topic.\n $('.lesson-wizard-grade-level-list-item').click(\n gradeTopicClickHandler);\n }\n else {\n OC.popup(response.message, response.title);\n }\n\n },\n 'json');\n }", "render() {\r\n this.updateFontSize();\r\n this.actValDiv.innerHTML = this.actValText;\r\n this.buttonElem.innerHTML = this.desValText;\r\n }", "function scoreRender(){ \n scoreDiv.html(\"You got \" + score + \"/10 correct!\");\n}", "function renderRanking() {\n var context = { artists: rankingData };\n var tpt = window[\"JST\"][\"templates/ranking.hbs\"];\n var html = tpt(context);\n $(\"#ranking\").html(html);\n }", "function renderQuestionResult() {\n //console.log('Result is being rendered');\n $('.result').html(generateQuestionResult());\n}", "function render() {\n\tvar subtotal = 0;\n\t$(\".product\").each(function() {\n\t\tvar productId = $(this).find(\"[name='productId']\").val();\n\t\tvar totalPrice = products[productId].price * products[productId].qty;\n\t\tsubtotal += totalPrice;\n\t\t$(this).find(\".price.total\").html(formatPrice(totalPrice));\n\t});\n\n\tvar vat = Math.ceil(subtotal * VAT);\n\tvar totalValue = subtotal + vat;\n\n\t// Update total values\n\t$(\".summary .subtotal .value\").html(formatPrice(subtotal));\n\t$(\".summary .vat .value\").html(formatPrice(vat));\n\t$(\".summary .total .value\").html(formatPrice(totalValue));\n\n\tif (totalValue > 0) {\n\t\t$(\"button[type='submit']\").removeAttr('disabled');\n\t} else {\n\t\t$(\"button[type='submit']\").attr('disabled','disabled');\n\t}\n}", "function renderQuiz() {\n startPage();\n handleAnswerSubmitButton();\n handleNextQuestionButton();\n restartQuiz();\n}", "function renderQuiz () {\n if(store.quizStarted === false) {\n if(store.questionNumber === store.questions.length){\n const quizResultsString = generateQuizResultsString();\n $('main').html(quizResultsString); \n } else {\n const quizWelcomeInterfaceString = generateWelcomeString();\n $('main').html(quizWelcomeInterfaceString);\n }\n } else if (store.quizStarted === true) {\n if(store.submittingAnswer === false) {\n const quizInterfaceString = generateQuizForm(currentQuestion());\n $('main').html(quizInterfaceString);\n } else if (store.submittingAnswer === true) {\n const quizAnswerResponseString = generateAnswerResults();\n $('main').html(quizAnswerResponseString);\n }\n } \n}", "function render() {\n var ISML = require('dw/template/ISML');\n\n // Get Basket Info\n var BasketMgr = require('dw/order/BasketMgr');\n var basket = BasketMgr.getCurrentBasket();\n\n // Get Preferences\n var Site = require('dw/system/Site');\n var currentSite = Site.getCurrent();\n var preferences = Site.getCurrent().getPreferences();\n\n // GeoLocation Data\n var location = request.getGeolocation() || {};\n\n ISML.renderTemplate('rvw/devtools', {\n Debugger: {\n basket: serialize(basket),\n geolocation: serialize(location),\n messages: Debugger,\n preferences: serialize(preferences),\n session: serialize(session),\n site: serialize(currentSite)\n }\n });\n}", "function render() {\n\t\t\n\t}", "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 render() {\n let $div = document.querySelector('#result');\n $div.innerHTML = store;\n}", "function renderQuizBox(){\n renderQuestionCount();\n renderQuestion();\n renderScore();\n}", "function renderQuiz() {\n // *** Loop through the Length of the quizRes array\n for (let i = 0; i < quizRes.length; i++) {\n // ** Variables\n const resPath = quizRes[i];\n const domPath = $(\".question\")[i].children;\n // *** Update Question\n domPath[1].children[1].children[0].value = decode(resPath.question);\n // *** Update Correct Answer\n domPath[2].children[1].children[0].value = decode(resPath.correct_answer);\n // *** Update Incorrect Answer\n domPath[3].children[1].children[0].value = decode(\n resPath.incorrect_answers[0]\n );\n domPath[3].children[1].children[1].value = decode(\n resPath.incorrect_answers[1]\n );\n domPath[3].children[1].children[2].value = decode(\n resPath.incorrect_answers[2]\n );\n }\n // *** Display Quiz Container, New Q Container Button, and Submit Button\n $(\"#quiz-cont\").removeClass(\"hide\");\n $(\"#btns\").removeClass(\"hide\");\n }", "function renderFinalPage() {\n $('main').html(`\n <section role=\"main\" class=\"final-page\">\n <h2>You scored ${userScore} points out of ten.</h2>\n <button class=\"restart-quiz-button submit-button\">\n Start the Quiz Again!\n </button\n </section>\n `)\n}", "function renderFinalView () {\n $('.instructions, .questions, .feedback, .final-view, .js-start-button, .js-submit-button, .js-next-button').addClass('js-hide');\n $('.score-question, .final-view, .js-replay-button').removeClass(\"js-hide\");\n generateFinalRank();\n}", "returnRenderText() {\n /*-- add heading part of seating chart --*/\n let layout = /*html*/`\n <div class=\"seating-container\">\n <div class=\"buffer\"></div>\n <div class=\"movie-details-row\">\n <em>${bookingTempStore.showingDetails.film}: ${bookingTempStore.showingDetails.date} (${bookingTempStore.showingDetails.time})</em>\n </div>\n <div class=\"screen-row\">\n <div></div>\n <h1>BIODUK</h1>\n <div></div>\n </div>\n <div class=\"seating-rows-container\">\n `\n /*-- add seating/checkboxes part of seating chart --*/\n layout += this.seatingChart();\n /*-- closing tags and footer part of seating chart --*/\n layout += /*html*/`\n </div>\n <div class=\"text-row\">\n <em>Välj din plats</em>\n </div>\n <div class=\"age-btn-row\">\n `\n layout += this.ageButtons();\n layout += /*html*/`\n </div>\n <div class=\"button-row\">\n ${BookingUtilityFunctions.bookingPriceButton()}\n </div>\n <div class=\"buffer\"></div>\n </div>\n `\n return layout;\n }", "render() {\n\n\t}", "render() {\n\n\t}", "startEvalPrompt() {\n return (\n <div>\n <p>\n This evaluation consists of some quick administrative questions, a personality\n evaluation, and a pattern recognition test.\n </p>\n <p>Employers cannot see your answers to any of these questions.</p>\n <p>There will be a progress bar so you can see how much you have completed.</p>\n <p>\n Before every section there will be an introduction with instructions. Read them\n carefully.\n </p>\n <p>Click the button to start once you are ready.</p>\n {this.state.loading ? (\n <CircularProgress color=\"primary\" />\n ) : (\n <Button onClick={this.startEval}>Start</Button>\n )}\n </div>\n );\n }", "function render() {\n\t}", "function renderQuizScreen() {\n // render what we've generated to the screen\n // if our quiz started flag is false // generate our title screen else\n // if our question number > questions.length // generate end screen\n // else // generate our quiz question\n\n let generateString = '';\n // title screen // question screen // correct screen // incorrect screen\n if (!store.quizStarted) {\n generateString = generateTitleScreen();\n } else if (store.questionNumber >= store.questions.length) {\n generateString = generateEndScreen();\n } else {\n if (store.answer) {\n generateString = generateQuizFeedback();\n } else {\n generateString = generateQuizQuestion();\n }\n }\n $('main').html(generateString);\n}", "function _display(){\n\t\t\t$(levelID).html(level);\n\t\t\t$(pointsID).html(points);\n\t\t\t$(linesID).html(lines);\n\t\t}", "display() {\n\t\tsuper.display();\n\n\t\t/* Display the boxes on the right panel. */\n\t\tthis.scoreBox.display();\n\t\tthis.levelLinesBox.display();\n\t\tthis.nextPieceBox.display();\n\t\tthis.statBox.display();\n\n\t\t/* Display the falling piece. */\n\t\tif (this.piece != undefined) {\n\t\t\tthis.piece.display(this.grid.initialx, this.grid.initialy, this.grid.squareSize);\n\t\t}\n\n\t\t/* Display the grid. */\n\t\tthis.grid.display();\n\n\t\tif (this.state == STATE_SELECT_LEVEL) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.levelSelectorBox.display();\n\t\t}\n\t\telse if (this.state == STATE_WAIT_ADVERSARY_SELECTION) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.waitAdversarySelectionBox.display();\n\t\t}\n\t\telse if (this.state == STATE_GAME_OVER) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.gameOverSelectorBox.display();\n\t\t}\n\t\telse if (this.state == STATE_SUBMIT) {\n\t\t\tthis.blurBackground();\n\t\t\tthis.submitBox.display();\n\t\t}\n\t}", "displayScene() {\n\n //Process all component nodes\n this.processNode(this.idRoot, null, null, 1, 1);\n }", "render () {\n\t\tthis.renderBoard();\n\t\tthis.renderPieces();\n\t\t$writeInnerHTML( this.view.$maxVal, this.model.maxTimes );\n\t\t$writeInnerHTML( this.view.$minVal, this.model.minTimes );\n\t\tthis.view.alocatePieces( this.model.finalPositionsArr, this.model.baseNumber, this.model.getPieceSize(), this.model.gutterSize );\n\t\tthis.toggleBoardLock();\n\t}", "function evaluate() {\n if (firstNum !== null && secondNum !== null) {\n switch (equation) {\n case \"add\":\n firstNum += secondNum;\n\n break;\n case \"subtract\":\n firstNum -= secondNum;\n\n break;\n case \"divide\":\n firstNum /= secondNum;\n\n break;\n case \"multiply\":\n firstNum *= secondNum;\n\n if (displayNum > 10000000) {\n setDisplayNum(\"8======D\");\n }\n break;\n default:\n break;\n }\n setDisplayNum(firstNum);\n }\n }", "showResult(ctx) {\n\t\tctx.drawImage(ASSET_MANAGER.getAsset(\"./sprites/end game GUI.png\"), 150, 150);\n\t\tctx.font = \"30px Arial\";\n\t\tctx.fillText((\"Score: \" + this.score), 200, 225);\n\t\tctx.fillText((\"Highest combo: \" + this.highestCombo), 200, 275);\n\t\tctx.stroke();\n }", "function render(){\n renderScores();\n adjustTurn();\n getWinner();\n clearSelection();\n}", "function render(){\n $('main').html(choiceTemplate());\n}", "function showResult(event) {\n event.preventDefault();\n const fullName = getFullName();\n const email = getEmail();\n const house = getHouse();\n const family = getFamily();\n const content = getContent();\n const rate = getRate();\n const comment = getComment();\n deleteFormContent();\n const form = document.getElementById('evaluation-form');\n form.innerHTML = `${fullName}${email}${house}${family}${content}${rate}${comment}`;\n}", "function setupEvaluationButton() {\n let evaluationButton = document.getElementById(\"id-evaluate\");\n evaluationButton.addEventListener('click', evaluateText, false);\n}", "function generateFinalPage() {\n return `\n <section class='container'>\n <p>You finished the quiz! Here is your final score: </p>\n <p> Score: ${store.score}/5</p>\n <button type='submit' id='js-restart-btn'>Restart Quiz</button>\n </section>\n `\n}", "function scoreRender() {\n quiz.style.display = \"none\";\n initials.style.display = \"block\";\n var scorePercent = Math.round(100 * score/questions.length);\n document.getElementById(\"yourscore\").innerHTML = \"Your final score is \" + scorePercent + \"%.\";\n localStorage.setItem(\"scorestring\", JSON.stringify(scorePercent));\n}", "function renderStartQuiz() {\n //console.log('Generating start of quiz');\n $('.intro').html(generateStartPage());\n}", "render() {}", "render() {}", "render() {}", "function renderQuestions () {\n console.log(`Next Question, #${questionNumber + 1} Render question screen.`);\n updateQuestionNumber();\n //generate the string we need to Display\n const questionString = getQuestionString();\n $('main').html(questionString);\n\n}", "function displayExperiment(data){\n\n\t$('#msform').addClass('hidden');\n\t//checks to see if experiment is complete\n\tif (data.status === ' Complete') {\n\t\t$('#edit').addClass('hidden');\n\t\t$('#dme').addClass('hidden');\n\t};\n\n\n\t$('.title').text(data.title);\n\t$('.author').text(data.author);\n\t$('.created').text(data.created);\n\t$('.background').text(data.background);\n\t$('.purpose').text(data.purpose);\n\t$('.procedure').text(data.procedure);\n\t$('.mce').html(data.results.text);\n\n\tif(data.results.drawing.length >= 0){\n\t\t$(\"<img>\", {\n\t \t\"src\":data.results.drawing,\n\t \t// added `width` , `height` properties to `img` attributes\n\t \t\"width\": \"250px\", \"height\": \"250px\"})\n\t\t.appendTo(\".drawing\");\n\n\t} else {\n\t\t$('.drawing').text('No images Drawn');\n\t};\n\n\t$('.molecule').text(data.results.molecule);\n\t$('.conclusion').html(data.conclusion);\n\t$('.id').text(data.id);\n}", "function renderQuizStart() {\n const quizStartView = generateQuizStart();\n $(\".js-quiz-container\").html(quizStartView);\n}", "function evaluationGradeList(bt_id){\n\t\t\n\t\t$(\"#evalGrgList\").html(\"<img align=\\\"center\\\" src=\\\"images/30.GIF\\\"/>\");\n\t\t$.ajax({\n\t\t\ttype : \"POST\",\n\t\t\turl : \"behaviouralevaluation_evalgradelist.action\",\t\t\t\t\n\t\t\tdata : \"bt_id=\" + bt_id,\n\t\t\tsuccess : function(response) {\n\t\t\t\t\n\t\t\t\t$('#evalGrgList').html(response);\n\t\t\t\t\n\t\t\t},\n\t\t\terror : function(e) {\n\t\t\t\talert('Error: ' + e);\n\t\t\t}\n\t\t});\n\t}", "function Render() {\n ClearScreen();\n RenderEnergeticDroplets();\n ResetRenderingConditions();\n}", "function renderScore() {\n scoreDiv.style.display = \"block\";\n initialsDiv.style.display = \"block\";\n quiz.style.display = \"none\";\n scoreDiv.textContent = \"Your score is \" + score;\n}", "function renderScore(){\r\n\tscore.innerHTML = \"<p>Score: \" + qscore + \"</p>\";\r\n}", "function renderQuestionView () {\n $('.variable-content-container, .instructions, .feedback, .final-view, .js-start-button, .js-next-button, .js-replay-button').addClass('js-hide');\n $('.score-question, .questions, .js-submit-button').removeClass(\"js-hide\");\n $('.questions').empty();\n updateQuestionNum();\n generateQuestion();\n}", "function render() { \t\n\t// renderMenu(); // dropdown menu to let user switch between years manually\n\trenderDatatext();\n\tif (state.world && state.countries.length > 0) renderMap();\n\trenderKey(); // map legend\n\trenderMapyear();\n\trenderLinechart(\".chart-1\", config.countryGroups.heighincome, \"normal\"); // where to place, what data to use\n\trenderLinechart(\".chart-2\", config.countryGroups.brics, \"normal\");\n\trenderLinechart(\".chart-3\", config.countryGroups.arab, \"large\");\n\trenderLinechart(\".chart-4\", config.countryGroups.mostrising, \"normal\");\n\trenderLinechart(\".chart-5\", config.countryGroups.northamerica, \"normal\");\n\trenderLinechart(\".chart-6\", config.countryGroups.warridden, \"normal\");\n\trenderLinechart(\".chart-7\", config.countryGroups.soviet, \"normal\");\n\trenderLinechart(\".chart-8\", config.countryGroups.mensworld,\"normal\");\n\trenderLinechart(\".chart-9\", state.userselected,\"normal\");\n\trenderUserinput();\n}", "createPreTestContent() {\n if (this.state.alreadyInProgress) {\n return (\n <div className=\"marginTop20px\">\n <p>You{\"'\"}ve already started this evaluation.</p>\n <p>Ready to get back into it?</p>\n {this.state.loading ? (\n <CircularProgress className=\"marginTop20px\" color=\"primary\" />\n ) : (\n <Button onClick={this.getEvalState}>Let{\"'\"}s Go!</Button>\n )}\n </div>\n );\n }\n\n // TODO: if the user is in the middle of a different eval already\n else if (this.state.evalInProgress) {\n return <div>Want to switch to your other eval?</div>;\n }\n // TODO: if the user is ready to start the eval, ask them if they want\n // to start it\n else if (this.state.readyToStart) {\n if (this.state.skipStartPage) {\n return (\n <div className=\"center marginTop20px\">\n <CircularProgress color=\"primary\" />\n </div>\n );\n }\n return this.startEvalPrompt();\n }\n // shouldn't be able to get here\n else {\n console.log(\"Something is wrong.\");\n return <MiscError />;\n }\n }", "renderHTML() {\n \n }", "_render() {\n\t\tthis.tracker.replaceSelectedMeasures();\n }", "function renderPage() {\n startPage();\n startQuiz();\n submitQuestion();\n restartQuiz();\n}", "function renderQuestionView() {\n //render the current question\n console.log('question_array is: ', QUESTION_ARRAY);\n if (QUESTION_ARRAY.length > 0) {\n const question = QUESTION_ARRAY[STORE.currentQuestion].makeQuestionString();\n const currentState = renderCurrentState();\n //render a submit button\n // const button = generateButton(STORE.button.class, STORE.button.label);\n return `${question} ${currentState}`;\n }\n else {\n return 'Quiz is loading...';\n }\n\n}", "function render() { \n\n $body.append(templates['container']({'id':_uid}))\n $j('#' + _uid).append(templates['heading-no-links']({'title':'Countdown Promotion'}));\n $j('#' + _uid).append(templates['countdown-promo']({'id':_uid}));\n \n chtLeaderboard = new CHART.CountdownLeaderboard(_uid + '-charts-promo-leaderboard', _models.promo.getData('all'), _models.promo.getTargetSeries(20000));\n tblLeaderboard = new TABLE.CountdownLeaderboard(_uid + '-tables-promo-leaderboard', _models.promo.groupByOwner('all', 20000), _models.promo.getTotal('all', 180000)); \n chtLastWeek = new CHART.CountdownLeaderboard(_uid + '-charts-promo-lastweek', _models.promo.getData('lastweek'), _models.promo.getTargetSeries(1540));\n tblLastWeek = new TABLE.CountdownLeaderboard(_uid + '-tables-promo-lastweek', _models.promo.groupByOwner('lastweek', 1540), _models.promo.getTotal('lastweek', 13860)); \n chtWeeklySales = new CHART.CountdownWeeklySales(_uid + '-charts-promo-weeklysales', _models.promo.getData('all'));\n\n }", "function xformKatex()\n{\n var katexes = document.getElementsByClassName('katex--inline');\n var i = 0;\n for (i=0;i<katexes.length;i++)\n {\n var text = katexes[i].firstChild.data;\n katex.render(text, katexes[i], {\n throwOnError: false\n });\n }\n\n katexes = document.getElementsByClassName('katex--display');\n var i = 0;\n for (i=0;i<katexes.length;i++)\n {\n var text = katexes[i].firstChild.data;\n katex.render(text, katexes[i], {\n throwOnError: false\n });\n }\n}", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "render() {\n this.notify('initial-load', {});\n /**\n * Used to load context menu\n */\n this.trigger('load');\n this.notify('initial-end', {});\n this.renderElements();\n this.renderComplete();\n }", "function showAnswers() {\n let resultsHtml = $(`<div class=\"results\">\n <form id=\"js-restart-quiz\">\n <fieldset>\n <div class=\"top\">\n <div class=\"quiz\">\n <legend>Your Final Score is: ${STORE.score}/${STORE.questions.length}</legend>\n </div>\n </div>\n \n <div class=\"top\">\n <div class=\"quiz\">\n <button type=\"button\" id=\"restart\"> Restart Quiz </button>\n </div>\n </div>\n </fieldset>\n </form>\n </div>`);\n STORE.progress = 0;\n STORE.score = 0;\n $(\"main\").html(resultsHtml);\n}", "function renderAQuestion() {\r\n let question = STORE.questions[STORE.currentQuestion];\r\n updateQuestionAndScore();\r\n const questionHtml = $(`\r\n <div>\r\n <form id=\"js-questions\" class=\"question-form\">\r\n \r\n \r\n <div class=\"row question\">\r\n <div class=\"col-12\">\r\n <h2> ${question.question}</h2>\r\n </div>\r\n </div>\r\n \r\n <div class=\"row options\">\r\n <div class=\"answer-options\">\r\n <div class=\"js-options\"> </div>\r\n </div>\r\n </div>\r\n \r\n \r\n <div class=\"row\">\r\n <div class=\"col-12\">\r\n <button type = \"submit\" id=\"answer\" tabindex=\"5\">Submit</button>\r\n <button type = \"button\" id=\"next-question\" tabindex=\"6\"> Next >></button>\r\n </div>\r\n </div>\r\n \r\n </form>\r\n </div>`);\r\n $(\"main\").html(questionHtml);\r\n updateOptions();\r\n $(\"#next-question\").hide();\r\n }", "function render() {\n renderCards();\n renderValue();\n}", "function printoutput(res){\n\tdeleteoldDivs();\n\tvar p = 0;\n\tfor (var i in res){\n\t\tvar div = document.createElement(\"div\");\n\t\tdiv.setAttribute('class', 'equation_small'); \n\t\tdiv.setAttribute('id', p);\n\t\tif(typeof(res[i])==\"object\" &&!listcontains(res[i].toString(),[\"[[\"])){//for arrays e.g: eigenvalue(\"[[1.789,0,0],[0,0,0],[0,0,1]]\")\n\t\t\tvar arr=res[i];\n\t\t\tvar tmp =\"\";\n\t\t\tfor(var u=0;u<arr.length;u++){\n\t\t\t\tif(u<arr.length-1){\n\t\t\t\t\ttmp+=arr[u].toString()+\" ,\";\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttmp+=arr[u].toString();\n\t\t\t\t}\n\t\t\t}\n\t\t\tdiv.setAttribute('data-expr', i+\"=\"+tmp); \n\t\t}\n\t\telse{\n\t\t\tdiv.setAttribute('data-expr', i+\"=\"+simact.Algebrite.run('printlatex('+res[i].toString()+')')); \n\t\t}\n\t\t//console.log(div); important if you want to copy that to engine.html\n\t\tdocument.getElementById(\"output\").appendChild(div);\n\t\tp++;\n\t }\n\tmyRenderer();\n}", "function renderQuiz() {\n if (store.quizStarted === false) {\n $('main').html(generateStartPage());\n return;\n } else if (store.questionNumber < store.questions.length) {\n $('main').html(generateQuestionPage());\n return;\n } else {\n $('main').html(generateFinalPage());\n return;\n }\n}", "function renderQuestionPage() {\n var currentQuestionObj = state.questions[state.currentQuestionIndex];\n renderQuestion();\n renderQuestionChoices(currentQuestionObj.answers);\n // $(\".popup-inner\").addClass(\"hidden\");\n}", "function render() {\n htmlString = `<div>\n <h1>${state.pageHeader}</h1>\n ${renderGames()} \n <div onclick='addGame()'>[Add Games]</div>\n </div>`;\n\n document.getElementById(\"app\").innerHTML = htmlString;\n }", "static renderStateMachines() {\n let contenu = `\n <div id=\"return\" style=\"display: flex; flex-direction:row; height: 25px; align-items: center; margin-right: 5px;\">\n <button type=\"text\" class=\"btn btn-outline-secondary\" style=\"border-radius: 100%;\">⬅</button>\n <h5><em>State of Machines</em></h5>\n </div>\n <div id=\"dash\">\n </div>\n </div>`;\n document.querySelector(\"#dashboard\").innerHTML = contenu;\n\n $(\"#return\").click(event => {\n event.preventDefault();\n Dashboard.renderGlobalView();\n });\n }", "function drawUI(){\n\tdrawTree();\n\tdocument.getElementById(\"totalnetworkval\").textContent = \"Total Network Value: \" + totalNetworkValue;\n}", "render(){\r\n\r\n\t}", "function displayResults() {\n if (STORE.score >= 4) {\n return `<div class=\"results\">\n <form id=\"js-restart-quiz\">\n <fieldset>\n <div class=\"score\">\n <span>Your score is: ${STORE.score}/${STORE.questions.length}</span><br>\n <span>Excellent!</span>\n </div>\n <img src=\"images/waynes-world.jpg\" alt=\"image of Wayne from Wayne's World\" width=400>\n <div class=\"restart-button\">\n <button type=\"button\" id=\"restart\">Restart Quiz</button>\n </div>\n </fieldset>\n </form>\n </div>`\n } else {\n return `<div class=\"results\">\n <form id=\"js-restart-quiz\">\n <fieldset>\n <div class=\"score\">\n <span>Your score is: ${STORE.score}/${STORE.questions.length}</span><br>\n <span>Keep practicing!</span>\n </div>\n <img src=\"images/grant-green-1.jpg\" alt=\"image of Grant Green\" width=400>\n <div class=\"restart-button\">\n <button type=\"button\" id=\"restart\">Restart Quiz</button>\n </div>\n </fieldset>\n </form>\n </div>`\n };\n}", "renderScreenContent(){}", "function display() {\n\n doSanityCheck();\n initButtons();\n}" ]
[ "0.6383839", "0.6190383", "0.6176528", "0.6128449", "0.60487026", "0.6046704", "0.602431", "0.5948815", "0.5840887", "0.5837687", "0.58325773", "0.5830766", "0.5809856", "0.5793779", "0.5771437", "0.576579", "0.5740257", "0.5732045", "0.5717729", "0.57110393", "0.5671824", "0.56588936", "0.565314", "0.565282", "0.5620917", "0.56140363", "0.561273", "0.5600214", "0.5594349", "0.55884874", "0.5584429", "0.55831224", "0.55820274", "0.5572339", "0.55717516", "0.5568065", "0.5556146", "0.5545447", "0.55333894", "0.55272716", "0.55234486", "0.55209345", "0.5498426", "0.54879916", "0.54722154", "0.54488784", "0.54484653", "0.5448346", "0.5443394", "0.5443394", "0.544203", "0.5433495", "0.54313517", "0.5423773", "0.5423005", "0.5419967", "0.5418654", "0.54114246", "0.54113823", "0.5410302", "0.5407157", "0.5406986", "0.54049665", "0.540392", "0.5402674", "0.5400124", "0.5396827", "0.5396827", "0.5396827", "0.539484", "0.5390036", "0.5381537", "0.5377288", "0.53676254", "0.5367133", "0.5366913", "0.53639835", "0.53629196", "0.5359238", "0.53588855", "0.5355106", "0.532987", "0.5327605", "0.5326025", "0.5324883", "0.531594", "0.531594", "0.531594", "0.5315274", "0.531392", "0.5311827", "0.53028786", "0.53004444", "0.52969724", "0.52957964", "0.52918", "0.52913177", "0.5286782", "0.5286421", "0.52851844", "0.5283169" ]
0.0
-1
I have some usecases where this details pane changes itself as the animation continues, TODO: I should probably remove this local state and move this up the chain with redux actions
constructor(props) { super(props); this.state = { ...props }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transitionDetailsMiniToMini() {\n this.rePopulateMiniDetailsTitleWithAnimation();\n\n //Do the right thing with the next and previous arrows\n var element = document.getElementById(\"ONEUPGRID_details_content_mini_previous_div\");\n if (this.selectedEventId == this.currentViewFirstEventId) {\n this.hide_ONEUPGRID_details_content_mini_nav_div(element, false);\n }\n\n element = document.getElementById(\"ONEUPGRID_details_content_mini_next_div\");\n if (this.selectedEventId == this.currentViewLastEventId) {\n this.hide_ONEUPGRID_details_content_mini_nav_div(element, false);\n }\n\n this.showMiniDetailsNavArrows();\n }", "toggleDetails() {\n this.props.toggleExpanded(\n this.props.resultIdx,\n !this.props.expanded[this.props.resultIdx]\n )\n }", "handleDetailsClick() {\n const property = this.props.property;\n const img = this.state.image;\n this.props.getProperty(property, img);\n this.props.changeView('details')\n }", "function showDetails() {\r\n 'use strict';\r\n // 7.2.5 - Triggering transitions with JavaScript\r\n var frame = document.querySelector(DETAIL_FRAME_SELECTOR);\r\n\r\n document.body.classList.remove(HIDDEN_DETAIL_CLASS);\r\n\r\n // 7.2.5 - Triggering transitions with JavaScript\r\n frame.classList.add(TINY_EFFECT_CLASS);\r\n // 7.2.5 - Triggering transitions with JavaScript\r\n //frame.classList.remove(TINY_EFFECT_CLASS);\r\n setTimeout(function () {\r\n frame.classList.remove(TINY_EFFECT_CLASS);\r\n }, 50);\r\n\r\n}", "toggleDetails() {\n this.setState((prevState, props) => (\n {showSummary: !prevState.showSummary}\n ))\n }", "function transitionDetailsDiv(finalDetailsState, shouldPreserveSelectedId) {\n switch(this.detailsDivState){\n case 0:\n if (finalDetailsState == 1) { //CLOSE->OPEN\n\n } else if (finalDetailsState == 2) { //CLOSE->MINI\n this.transitionDetailsCloseToMini();\n }\n break;\n case 1:\n if (finalDetailsState == 0) { //OPEN->CLOSE\n //If the details drawer is open, close it\n this.ONEUPGRID_details_close_div_click();\n } else if (finalDetailsState == 2) { //OPEN->MINI\n this.transitionDetailsFullToMini();\n }\n break;\n case 2:\n if (finalDetailsState == 0) { //MINI->CLOSE\n //If the details drawer is open, close it\n this.ONEUPGRID_details_close_div_click(shouldPreserveSelectedId);\n } else if (finalDetailsState == 1) { //MINI->OPEN\n\n } else if (finalDetailsState == 2) { //MINI->MINI\n this.transitionDetailsMiniToMini();\n }\n break;\n }\n }", "function prepareToShow() {}", "function _sh_overview_showing(){\n\tin_overview = true;\n\twrap_plane_clone.visible = true;\n\tpaused_preserve = (paused == undefined) ? false : paused;\n\tresume();\n}", "function viewTransition(appBarButtonsView, finalDetailsState) {\n //Determine if we are in the map or not\n if (appBarButtonsView == \"Map\") {\n this.mapInView = true;\n } else {\n this.mapInView = false;\n }\n\n //Transition Details\n this.transitionDetailsDiv(finalDetailsState, true);\n\n //Hide App Bar (but don't disable it)\n document.getElementById(\"theAppBar\").winControl.hide();\n\n //Hide the map button and show the itinerary button\n appBarManager.showOneUpCommands(appBarButtonsView);\n }", "display() {\n this.view.board.checkSelectedCells(this.selectedPiece);\n this.stateMachine();\n \n let ignore = true;\n if (this.checkSelected() == \"OK\")\n ignore = false;\n \n this.view.updateTimer();\n this.view.chronometer.display();\n this.view.marker.display();\n \n\n this.scene.pushMatrix();\n this.makePickingValidCells(null);\n\n this.view.board.display();\n if(this.state != 'START')\n this.makePickingPieces();\n else\n this.showPieces();\n\n\n this.scene.clearPickRegistration();\n this.scene.popMatrix();\n\n }", "toggle(){\n // Measure heights and animate transition\n const {_details: details} = this;\n const initialHeight = getComputedStyle(details).height;\n const wasOpen = details.open;\n details.open= !details.open;\n const finalHeght = getComputedStyle(details).height;\n details.open= true; // Close after animation ends\n const keyframes = [\n {height: initialHeight},\n {height: finalHeght}\n ];\n const options = { duration: 150 };\n const animation = details.animate(keyframes, options);\n // This makes the animation consistent between states\n if(wasOpen){\n details.classList.remove(\"open\");\n animation.onfinish = () => {\n details.open = false;\n };\n }else\n details.classList.add(\"open\");\n }", "view_GameMovie(){\n let currMoviePlayInfo = this.model.getCurrentMoviePlayInfo();\n this.view.updateCurrentMoviePiece(currMoviePlayInfo[0][0], currMoviePlayInfo[0][1], currMoviePlayInfo[1][1]);\n this.view.redoPlay(currMoviePlayInfo[0][0], currMoviePlayInfo[0][1], currMoviePlayInfo[1][1]);\n this.state = 'WAIT_GM_ANIMATION_END';\n }", "transitionCompleted() {\n // implement if needed\n }", "toggleInfo() {\n this.setState((prevState, props) => ({\n // here we invert our showInfo boolean by using the \n // previous state and the ! exclamation mark\n showInfo: !prevState.showInfo\n }));\n }", "function continueReveal() {\n if (state.hidden_clusters > 0) {\n state.hidden_clusters -= 1;\n rebuild();\n state.reveal_timer = setTimeout(continueReveal, delay);\n } else {\n state.reveal_timer = null;\n }\n }", "detailsButtonClicked() {\n const detailsOpen = !this.state.detailsOpen;\n\n this.setState({detailsOpen});\n }", "firstState() {\n\n\t\t$(\"#btn_panel\").on(\"click\", () => {\n\t\t\tif ($(\"#panel_info\").css(\"display\") === \"block\") {\n\t\t\t\t$(\"#panel_info\").hide(500);\n\t\t\t\t$(\"#panel_canvas\").show(500, () => {\n\t\t\t\t\tthis.canvas.size();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "open_dataInspector_scene(){\n if(Object.keys(iziToast.children).length){return console.error('Wait, alrealy open')}\n const dataValues = $stage.getDataValues();\n const bgList = Object.values(this.data2).filter(data => data.isBackground );\n iziToast.info( this.izit_SceneSetup(dataValues,bgList) );\n new Accordion(document.getElementById(\"accordion\"), );\n const dataIntepretor = document.getElementById(\"dataIntepretor\");\n dataIntepretor.onchange = (e) => {\n const div = e.target;\n const textureName = div.value;\n const dataBase = this.data2[div.value];\n const dataObj = $objs.newDataObjs_dataBase(dataBase,textureName,true);\n $stage.scene.createBackgroundFrom(dataObj);\n $camera.initialize($stage.scene);\n };\n dataIntepretor.onclick = (e) => {\n if(e.target.type === \"button\"){\n switch (e.target.id) {\n case \"clearScene\": this.clear_scene(); break;\n case \"apply\": this.close_dataInspector(); break;\n case \"cancel\": cage.asignDataObjValues(backUp); this.close_dataInspector(); break;\n default:break;\n };\n };\n };\n }", "didTransition() {\n this.controller.set('isTransitionDone', true);\n // This is needed in order to update the links in this parent route,\n // giving the \"currentRouteName\" time to resolve\n later(this, () => {\n if (this.router.currentRouteName.includes('explore')) {\n this.controller.set('isEditModeActive', false);\n }\n });\n }", "render(){\n\n // get variables from props\n const article = this.props.item;\n const clickHandler = this.props.clickHandler;\n\n // Define display values based on iformation is the article selected or not \n const display = this.props.isSelected ? '' : 'none';\n const minHeight = this.props.isSelected ? '300px' : '';\n const height = this.props.isSelected ? 'auto' : '';\n const btnTitle = this.props.isSelected ? 'Hide details!' : 'Show details!';\n const backgroundColor= this.props.isSelected ? '#ca4646' : '';\n const color = this.props.isSelected ? 'white' : 'black';\n const divWrapBackgroundColor = this.props.isSelected ? \"#ebc4a3\" : '';\n\n return ( \n <div className=\"flexi\" onClick={() => clickHandler(article)}>\n <div id=\"wrap\" style={{backgroundColor: divWrapBackgroundColor}}>\n <div id=\"wraptext\">\n <p>Article number: {this.props.str}</p><br/> \n <h3>{this.state.data.title}</h3><br/>\n <p>{this.state.data.description}</p><br/>\n </div>\n <div id=\"imgbutWrap\">\n <img className=\"aa\" id=\"imm\" src={this.state.data.image} ></img>\n <button className=\"collapsible\" style={{backgroundColor: backgroundColor, color: color}}>{btnTitle}</button><br/>\n </div>\n </div>\n <div className=\"content\" style={{display: display, minHeight: minHeight, height: height}} >\n <div>\n <ul id=\"ull\" >\n <li>Source: {article.source}</li>\n <li>Section name: {article.section_name}</li>\n <li>Desk: {article.news_desk}</li>\n <li>Document: {article.document_type}</li>\n <li>Type: {article.type_of_material}</li>\n <li>Words: {article.word_count}</li>\n <li>Published: {article.pub_date}</li>\n <li>Snippet: {article.snippet}</li>\n <li>URL:<a target=\"_blank\" href= {article.web_url}>{article.web_url}</a></li> \n </ul>\n </div>\n </div>\n </div>\n );\n }", "switchContainers(target, e) {\n \n const cloneState = this.deepClone(this.state.tree),\n cloneState_ = this.deepClone(this.state.tree),\n draggedId = this.dragElementId,\n targetId = parseInt(target);\n \n cloneState_[targetId] = Object.assign({}, cloneState[targetId], {header: cloneState[draggedId].header, content: cloneState[draggedId].content, style: {border: '1px solid blue'}});\n cloneState_[draggedId] = Object.assign({}, cloneState[draggedId], {header: cloneState[targetId].header, content: cloneState[targetId].content});\n this.dropped = true;\n this.dragElement = null;\n this.setState({tree: Object.assign({}, cloneState, cloneState_)});\n }", "showMoveMade(step) {\n const retrieveHistory = this.state.history[step];\n return retrieveHistory.moveMade;\n }", "renderSmallTrail(e,ind){\n //the number to beginning numbering trails for pagination\n // const pageNumStart=(this.props.pageNumber-1)*this.props.trailsPerPage+1\n\n\n\n // const renderDimmableImage = (trail) => {\n // return(\n // <Dimmer.Dimmable as={Image} blurring dimmed={this.state.dimmedId===e.id} onMouseEnter={()=>this.setState({dimmedId:e.id})} onMouseLeave={()=>{this.setState({dimmedId:null})}}>\n // <Image fluid>\n // {this.renderImage(e)}\n // </Image>\n // <Dimmer active={this.state.dimmedId===e.id} inverted>\n // <Link to={`/trails/${e.id}`}>\n // <div className='ui primary button'>\n // More Info\n // </div>\n // </Link>\n // </Dimmer>\n // </Dimmer.Dimmable>\n // )\n // }\n\n return(\n // <div key={e.id} className='ui card' onMouseEnter={()=>this.props.infoWindow(e.id)} onMouseLeave={()=>this.props.infoWindow(null)}> //this line can be used instead of the following one in order to change state when card is hovered over\n <div key={e.id} className='ui raised card enlarge-on-hover'>\n {/* Can either render a dimmable or non-dimmable image: */}\n {/* {renderDimmableImage(e)} */}\n {this.renderImage(e)}\n <div className='center aligned content'>\n <Link to={`/trails/${e.id}`} style={{color:'black'}} className='header'>{`${ind+1}. ${e.name}`}</Link>\n <Link to={`/trails/${e.id}`} style={{color:'black', marginTop:'.5em', display:'block'}} className='description'>\n <Rating icon='star' rating={Math.round(e.stars)} maxRating={5}/> - {e.length.toString().length===1 ? `${e.length}.0` : e.length} Miles\n </Link>\n </div>\n <TodoCompleteButtons trail={e} user={this.props.user} redirectTo='/trails'/>\n </div>\n )\n }", "inspectionShow () {\n fgmState.piles.forEach((pile) => {\n pile.hide();\n });\n\n this.inspectionReset();\n }", "show (args){ this.transitioner.show(args) }", "showTileBeforeHiding() {\n const openTiles = this.getNumberOfOpenTiles();\n if (openTiles == 2) {\n setTimeout(() => {\n this.channel.push(\"hide\", {}).receive(\"ok\", response => {\n this.setState(response.game);\n });\n }, 1000);\n }\n this.hasGameEnded();\n }", "showEvent(e) {\n // if we're already opened and we get told to open again....\n // swap out the contents\n if (this.opened) {\n // wipe the slot of our drawer\n while (dom(this).firstChild !== null) {\n dom(this).removeChild(dom(this).firstChild);\n }\n setTimeout(() => {\n this.show(\n e.detail.title,\n e.detail.elements,\n e.detail.invokedBy,\n e.detail.align,\n e.detail.clone\n );\n }, 100);\n } else {\n this.show(\n e.detail.title,\n e.detail.elements,\n e.detail.invokedBy,\n e.detail.align,\n e.detail.size,\n e.detail.clone\n );\n }\n }", "animationChangeHandler () {\n this.store.dispatch(setAnimation(!fgmState.animation));\n }", "function prepareToShow() {\n\t}", "function toggleDetails() {\n ToggleComponent('shipment.detailView').toggle();\n }", "itemClick(){\n //store list item data\n UIActionCreators.simpleListItemRequest(this.props.store);\n //store transition\n RouterStore.storeNextTransitionKey(this.props.transitionKey || 'show-from-right');\n }", "show(direction, opts) {\n // start the grid item's movement (mousemove)\n this.startMovement();\n\n return new Promise(resolve => {\n const imageElems = this.gridItems.map(item => item.DOM.image);\n const glitchElems = this.gridItems.map(item => item.DOM.glitch);\n\n gsap\n .timeline({\n // this grid becomes the current one\n onStart: () => {\n this.DOM.el.classList.add('content__slide--current');\n this.isCurrent = true;\n },\n onComplete: resolve\n })\n .addLabel('start')\n // Set the items to be in the center of the viewport, scaled, rotated and not visible\n .set(imageElems, {\n // set x,y so the item is in the center of the viewport\n x: pos => {\n const rect = this.gridItems[pos].getRect();\n return winsize.width/2 - rect.left - rect.width/2;\n },\n y: pos => {\n const rect = this.gridItems[pos].getRect();\n return winsize.height/2 - rect.top - rect.height/2;\n },\n // randomly rotate the item\n rotation: () => getRandomNumber(-10,10),\n // scale it up\n scale: 2,\n // hide it\n opacity: 0\n })\n // now show each item one after the other\n .set(imageElems, {\n opacity: 1,\n stagger: 0.1\n }, 'start+=0.1')\n .addLabel('visible')\n // animate the body color\n .to(document.body, {\n duration: 0.5,\n ease: 'Power2.easeOut',\n backgroundColor: getComputedStyle(document.body).getPropertyValue('--color-bg'),\n //delay: 0.8\n }, 'visible+=0.1')\n // And once they are all stacked, animate each one to their default positions\n .to(imageElems, 0.9, {\n ease: 'Expo.easeOut',\n x: 0,\n y: 0,\n rotation: 0,\n scale: 1,\n stagger: 0.05\n }, 'visible+=0.1')\n // Adding a custom callback (after all the items are back in the grid)\n .add(() => opts?.halfWayCallback())\n // Set the grid texts to be translated up/down and hidden\n .set(this.DOM.texts, {\n y: direction === -1 ? '-50%' : '50%',\n opacity: 0,\n }, 'start')\n // Then animate them in\n .to(this.DOM.texts, 0.9, {\n ease: 'Expo.easeOut',\n y: 0,\n opacity: 1,\n stagger: direction * 0.15\n }, 'visible+=0.6');\n });\n }", "switchtoInfo() {\n this._setState('InfoState');\n }", "openWorkoutPreview(info) {\n this.setState(() => {\n return {\n workoutPreview: info\n }\n })\n document.getElementById(\"workoutPreview\").style.display = \"block\";\n }", "_handleEditAction(isShareDetailActionSheet = false) {\n if (isShareDetailActionSheet) {\n if (!this.state.isShareDetailActionSheet) {\n //this.props.navigation.state.params.isheaderRightShow = false\n this.props.navigation.setParams({\n isheaderRightShow: false\n });\n this.setState({\n isShareDetailActionSheet: true\n }, () => {\n this.collapseElement()\n });\n\n }\n else {\n this.props.navigation.setParams({\n isheaderRightShow: true\n });\n this.setState({\n isShareDetailActionSheet: false\n }, () => {\n this.expandElement()\n });\n }\n } else {\n if (!this.state.isEditMode) {\n //this.props.navigation.state.params.isheaderRightShow = false\n // this.props.navigation.setParams({\n // isheaderRightShow: false\n // });\n this.setState({\n isEditMode: true\n }, function () {\n this.collapseElement()\n });\n\n }\n else {\n this.setState({\n isEditMode: false\n }, function () {\n this.expandElement()\n });\n }\n }\n\n }", "renderMonitorsPanel () {\n this.$upandrunning = $(this.queryByHook('up-and-running'))\n this.$monitorsPanel = $(this.queryByHook('monitors-container'))\n\n this.renderSubview(\n new MonitorsOptions(),\n this.queryByHook('monitors-panel-header')\n )\n\n this.renderSubview(\n new TasksOptions(),\n this.queryByHook('tasks-panel-header')\n )\n\n this.monitorRows = this.renderCollection(\n this.groupedResources,\n MonitorRowView,\n this.queryByHook('monitors-container'),\n {\n emptyView: MonitoringOboardingPanel\n }\n )\n\n const rowtooltips = this.query('[data-hook=monitors-container] .tooltiped')\n $(rowtooltips).tooltip()\n\n this.monitorsFolding = this.renderSubview(\n new ItemsFolding({}),\n this.queryByHook('monitors-fold-container')\n )\n\n // this.listenToOnce(App.state.onboarding, 'first-host-registered', () => {\n // this.onBoarding.onboardingStart()\n // })\n\n this.listenToAndRun(App.state.dashboard.groupedResources, 'add change sync reset', () => {\n var monitorOptionsElem = this.queryByHook('monitor-options')\n if (App.state.dashboard.groupedResources.length > 0) {\n if (monitorOptionsElem) {\n monitorOptionsElem.style.visibility = ''\n }\n if (this.monitorsFolding) {\n this.monitorsFolding.showButton()\n }\n } else {\n if (monitorOptionsElem) {\n monitorOptionsElem.style.visibility = 'hidden'\n }\n if (this.monitorsFolding) {\n this.monitorsFolding.hideButton()\n }\n }\n this.sortGroupedResouces()\n })\n\n this.listenTo(this.monitors, 'sync change:state', this.setUpAndRunningSign)\n this.listenTo(this.monitors, 'add', () => {\n this.monitorsFolding.unfold()\n App.state.dashboard.groupResources()\n })\n\n SearchboxActions.addRowsViews(this.monitorRows.views)\n }", "showCreator() {\n this.setState({ viewSelector: 1 })\n }", "_updateActiveMessagePane() {\n // If we're summarizing, might as well clear the message display so that\n // when we return to it, we don't display prev selected message. If we're\n // *not* summarizing, clear the summary display so that the summary can\n // clean itself up.\n if (!this.singleMessageDisplay) {\n this.clearDisplay();\n } else {\n gSummaryFrameManager.clear();\n }\n\n // _singleMessageDisplay can be null, so use the property (getter)\n document.getElementById(\"singleMessage\").hidden = !this\n .singleMessageDisplay;\n document.getElementById(\"multimessage\").hidden = this.singleMessageDisplay;\n\n let messagePaneName = this.singleMessageDisplay\n ? \"messagepane\"\n : \"multimessage\";\n\n let findToolbar = document.getElementById(\"FindToolbar\");\n findToolbar.browser = document.getElementById(messagePaneName);\n\n // If the message pane is currently focused, make sure we have the\n // currently-visible content window (single- or multi-message) focused.\n if (\n this.folderDisplay.focusedPane ==\n document.getElementById(\"messagepanebox\")\n ) {\n document.getElementById(messagePaneName).focus();\n }\n }", "componentWillUnmount(){\n const { result: { \"@id\": resultID }, updateDetailPaneStateCache } = this.props;\n\n if (typeof updateDetailPaneStateCache !== \"function\") {\n return;\n }\n\n const { familiesOpen } = this.state;\n\n const anyOpen = Object.keys(familiesOpen).length > 0;\n updateDetailPaneStateCache(resultID, anyOpen ? { ...this.state } : null);\n }", "updateIndex(){\n this.props.updateIndex(this.props.currentState.index + 10);\n this.props.removeAllStoriesFromSelection(true); // This is done to ensure that there are no selected stories when we go to the next set of stories\n this.props.toggleLoader(true); // Show the loader again, since the new set of stories will be fetched from the api\n this.props.setLoaderText('Fetching stories');\n }", "function backToDetails() {\n secondPart.classList.add(\"displayNone\");\n\n firstPart.classList.remove(\"displayNone\");\n firstPart.classList.add(\"slideInLeft\");\n\n bullet2.classList.remove(\"text-info\");\n bullet2.classList.add(\"text-black-50\");\n}", "stateTransition(){return}", "function updateDisplayAndGetState() {\n let state = getGridStateAndNumFilled();\n statusNumFilled.innerHTML = numCellsFilled\n let ci = currentClueIndex\n if (clues[ci] && clues[ci].parentClueIndex) {\n ci = clues[ci].parentClueIndex\n }\n let revOrphan = isOrphanWithReveals(ci)\n checkButton.disabled = (activeCells.length == 0) && !revOrphan\n let theClue = clues[ci]\n let haveReveals = (activeCells.length > 0 && !hasUnsolvedCells) ||\n (theClue && (theClue.anno || theClue.solution || revOrphan));\n if (!haveReveals && numCellsToOrphan > 0 && activeCells.length > 0) {\n let orphanClue = cellsToOrphan[JSON.stringify(activeCells)];\n if (orphanClue) {\n let oc = clues[orphanClue]\n haveReveals =\n oc && (oc.anno || oc.solution || isOrphanWithReveals(orphanClue));\n }\n }\n revealButton.disabled = !haveReveals;\n clearButton.disabled = revealButton.disabled && activeCells.length == 0;\n return state\n}", "showDetail(entity, isArchive) {\n this.setState({\n detail: {\n show: true,\n entity,\n isArchive\n }\n });\n }", "slideIn() {\n //\n if (!this.state.isRendered) {\n this.viewContent = this.renderView();\n this.setState({ isRendered: true });\n }\n return this._animate(0);\n }", "rejectedMain(data, i) {\n\t\t\t this.setState({details :data});\n\t\t\t console.log(this.state.details);\n\t\t\t this.setState({ showrejectedModal: true })\n\t\t }", "showMilestones(container){\n this.milestones = new Milestones\n var nodes=this.props.milestones;\n this.milestones.request = this.props._id;\n this.milestones.buildTree(nodes);\n this.milestones.visualize(null,container)\n }", "function showDetails(){\n 'use strict';\n var frame = document.querySelector(DETAIL_FRAME_SELECTOR);\n document.body.classList.remove(HIDDEN_DETAIL_CLASS);\n frame.body.classList.add(IS_TINY_CLASS);\n setTimeout(function(){\n // setTimeout method: adds delay time since js doesnot have its own sleep function or built-in delay\n frame.classList.remove(IS_TINY_CLASS);\n },50);\n}", "_onBackgroundPhotoLoadEnd(){\n this.setState({\n runShowTitleAnimation:true\n });\n }", "closeDetail(){\n this.selItem = null;\n this.props.itemSel(this.selItem);\n\n this.setState({\n isShowDetail : false,\n detailItem : {}\n });\n this.forceUpdate();\n }", "onFrameShow() {\n this.isFrameShowing = true;\n if (!this.isSelected) {\n this.shiftDisplayLabels();\n }\n }", "onDismiss() {\n this.setState({ visible: false });\n this.props.defaultLoadedState();\n }", "actionToState(action,rasp,source,initialRASP){\n var nextRASP={}, delta={}; // nextRASP will be the next state, delta is where all the changes to state are recorded. There may be other properties in the state, only change them deliberatly \n if(action.type===\"TOGGLE\") { // the user clicks on a subject which sends the toggle event, to either open or close the article\n if(rasp.open==='open') { // if the article was open close it, but \n this.toChild['open']({type: \"CLEAR_PATH\"}); // first clear the state of all the sub children, so when they are reopened they are back to their initial state.\n // this is good for 3 reasons: 1) reduces the number of items we need to save state for,\n // 2) reduces the state information we have to encode in to the URL path\n // 3) it fits many use cases that when something becomes visibile it consistently starts in the same state\n delta.open=null; // closed\n delta.minimize=null; // not minimized anymore\n this.qaction(()=>this.props.rasp.toParent({type: \"DESCENDANT_UNFOCUS\"}));\n } else { \n delta.open='open'; // was closed, now open\n delta.minimize=null; // not minimized\n this.qaction(()=>this.props.rasp.toParent({type: \"DESCENDANT_FOCUS\"}))\n }\n } else if(action.type===\"DESCENDANT_FOCUS\" && action.distance > 2 && !rasp.minimize ){\n // a 2+ distant sub child has chanaged to open, so minimize, but don't minimize if already minimized which will change the shape of the propogating message\n delta.minimize=true;\n } else if(action.type===\"DESCENDANT_UNFOCUS\" && action.distance >= 2 && rasp.minimize){\n // a 2+ distant sub child has changed from open, and we are minimized, so unminimize\n delta.minimize=false;\n } else\n return null; // if we don't understand the action, just pass it on\n // we did understand the action and so now calculate the computed state information\n Object.assign(nextRASP,rasp,delta); // calculate the new state based on the previous state and the delta. There may be other properties in the previous state (like depth). Don't clobber them.\n nextRASP.shape= nextRASP.open==='open' ? 'open' : initialRASP.shape; // shape is the piece of state information that all RASP components can understand\n // build the pathSegment out of parts for each state property\n var parts=[];\n if(nextRASP.open==='open') parts.push('o');\n if(nextRASP.minimize) parts.push('m');\n nextRASP.pathSegment= parts.join(','); // pathSegment is be incorporated into the URL path. It should be calculated and the minimal length necessary to do the job\n return nextRASP;\n }", "function show_flight_ticket_item_main_details_set(number){\n\n document.getElementById(\"flight_ticket_item_details_each_top_option_details_btn\"+number).classList.add(\"active\");\n document.getElementById(\"flight_ticket_item_details_each_top_option_fairs_btn\"+number).classList.remove(\"active\");\n\n $(\"#flight_ticket_item_details_section_content_set\"+number).slideDown(\"fast\");\n $(\"#flight_ticket_item_fairs_details_section_content_set\"+number).slideUp(\"fast\");\n\n}", "revealCard(){\n this.props.revealCard(this.props.card.id);\n }", "_show() {\n $.setDataset(this._target, { uiAnimating: 'in' });\n\n $.addClass(this._target, 'active');\n $.addClass(this._node, 'active');\n\n $.fadeIn(this._target, {\n duration: this._options.duration,\n }).then((_) => {\n $.setAttribute(this._node, { 'aria-selected': true });\n $.removeDataset(this._target, 'uiAnimating');\n $.triggerEvent(this._node, 'shown.ui.tab');\n }).catch((_) => {\n if ($.getDataset(this._target, 'uiAnimating') === 'in') {\n $.removeDataset(this._target, 'uiAnimating');\n }\n });\n }", "prepareScene() {\n /* for example\n if (this.shouldShowObject) {\n this.pushToScene(this.obj);\n }\n */\n }", "function showDetailHandler() {\n\t\t\t//delay creation of options to pretend quicker reaction\n\t\t\tExt.create('Ext.util.DelayedTask', function () {\n detail.fireEvent('showdetaildelayed');\n }).delay(150);\n\t\t}", "prepareTransition() {\n this.setState({isLoading: true});\n\n clearTimeout(this.loadingTimerId);\n this.loadingTimerId = setTimeout(() => this.setState({isLoading: false}), 150);\n }", "componentWillReceiveProps(nextProps) {\n const records = nextProps.records;\n records.forEach(record => {\n record.animation = '';\n });\n\n this.setState({\n records\n })\n\n requestAnimationFrame(() => {\n const animateRecords = this.state.records;\n animateRecords.forEach(record => {\n record.animation = '-show';\n this.setState( {records} );\n })\n })\n }", "function showDetails() {\n $(this).closest('.panel-body').find('.projInfo').slideDown();\n }", "toggleMetric(entry) {\n const index = this.state.openedMetric.indexOf(entry.id);\n if (index > -1) {\n this.state.openedMetric.splice(index, 1);\n } else {\n this.state.openedMetric.push(entry.id);\n }\n const sampleArr = this.$parent.sampleArr;\n const guidValue = this.$parent.guidValue;\n const globalDiag = this.$parent.globalDiagnostic;\n const addCol = this.$parent.columnsForChosenDiagnostic;\n const storiesEntries = [];\n\n\n const stories = this\n .getStoriesByMetric(entry.metric, sampleArr, guidValue);\n for (const key of stories) {\n storiesEntries.push({\n story: key\n });\n }\n if (addCol !== null) {\n const diagValues = this\n .getSampleByStoryBySubdiagnostics(entry,\n sampleArr, guidValue, 'labels');\n for (const e of storiesEntries) {\n for (const diag of addCol) {\n e[diag] = fromBytesToMiB(average(diagValues\n .get(e.story).get(diag)));\n }\n }\n }\n this.uncheckLabelsButtons();\n this.state.storiesEntries = storiesEntries;\n this.state.metric = entry;\n this.empty();\n }", "_onBackgroundPhotoLoadEnd() {\n this.setState({\n runShowTitleAnimation:true\n });\n }", "openItemDetails(item){if(!this._isDetailsOpened(item)){this.push(\"detailsOpenedItems\",item)}}", "assesCard(result) {\n // set results in localstore\n let\n cards = JSON.parse(localStorage.cards), // get cards from localStorage\n crdID = this.props.cards[this.state.current].id, // get the current cards id\n crdIn = cards.findIndex(c => c.id === crdID), // find its index in local storage cards\n [oldCor, oldTot] = cards[crdIn].results, // extract results\n newCor = oldCor + (result ? 1 : 0); // increment correct if result truthy\n\n cards[crdIn].results = [newCor, ++oldTot]; // modify results here\n localStorage.setItem(\"cards\", JSON.stringify(cards)); // set localstore with updated results\n\n // disable buttons while animate\n const newState = this.state;\n newState.animationIsOn = true;\n this.setState(newState);\n\n this.animateProgressBar();\n\n // give detailed results for charts\n cards[crdIn].topics.forEach(topic => { // go through cards topics\n if (!newState.detailedResults[topic]) { // if obj doesnt have key add it\n newState.detailedResults[topic] = [0, 0]; // with 0 (it will be incremented later)\n } // end of if\n let res = newState.detailedResults[topic]; // store topic result\n newState.detailedResults[topic] = // update detailed results topic\n [+res[0] + (result ? 1 : 0), +res[1] + 1]; // increment only if reuslt is truthy\n }); // end of topics foreach\n\n // general results\n newState.results.push(result); // collect results for evaluation without topics\n\n // delay changes letting the animations time\n const delayForAnimation = setTimeout(() => {\n // change state\n const newState = this.state;\n newState.current++; // here increment current with the delay\n newState.animationIsOn = false; // turn of animation\n\n if (this.state.current >= this.props.cards.length) { // show results if last card has gone\n newState.showResult = true; // set state to show result\n } // end of if last card has gone\n this.setState(newState); // change state HERE\n\n clearTimeout(delayForAnimation);\n }, 1500); // end of delayForAnimation\n }", "function stateCalled(e){\r\n hideSharePopUp();\r\n\r\n // update current slide number with history state slide number value\r\n presentSlideNumber = setSlideNumberFromURL();\r\n\r\n // using scene go slide since we update state in our go method\r\n window.scene.goSlide( presentSlideNumber );\r\n\r\n updateState();\r\n updateGUI();\r\n }", "function showMemoDetail(inMemo) {\n currentMemo = inMemo;\n displayMemo();\n listView.classList.add(\"hidden\");\n detailView.classList.remove(\"hidden\");\n}", "function infoBtnAction(direction){\n if (direction === 'left'){\n if((allModals[(scrollIndex)]) !== (allModals[0])){\n returnDetails(allModals[(scrollIndex - 1)]);\n scrollIndex += -1;\n } else if ((allModals[(scrollIndex)]) === (allModals[0])){\n returnDetails(allModals[allModals.length-1]);\n scrollIndex = allModals.length-1;\n }\n }\n if (direction === 'right'){\n if((allModals[(scrollIndex +1)]) !== (allModals[allModals.length])){\n returnDetails(allModals[(scrollIndex + 1)]);\n scrollIndex += 1;\n } else if ((allModals[scrollIndex +1]) === (allModals[allModals.length])){\n returnDetails(allModals[0]);\n scrollIndex = 0;\n }\n }\n}", "handleClick(id) {\n //taking the state object in another variable\n let data = this.state.tileData;\n //Getting the currently active tiles\n let currentActive = _.filter(data, {'status': 'active'})\n //To prevent actions during delay\n if (currentActive.length < 2) {\n //For matched tiles nothing is to be done\n if (data[id]['status'] != 'complete') {\n //Finding the active tile index/key\n let activeKey = _.findKey(data, {'status': 'active'})\n //Clicking on currently active tile again\n if (activeKey != id) {\n //If this is the second active tile check for next scenario i.e match or not\n if (activeKey != undefined) {\n //For match condition\n if (data[activeKey]['letter'] == data[id]['letter']) {\n this.updateTiles(data, [activeKey, id], 'complete', true)\n } else {\n //For not match condition\n //First show the selected tiles as active\n this.updateTiles(data, [id], 'active', true)\n //Update state after the delay\n setTimeout(() => {\n this.updateTiles(data, [activeKey, id], 'hide')\n }, 1000);\n }\n } else {\n //For first active tile update the state with active\n this.updateTiles(data, [id], 'active', true)\n }\n }\n }\n }\n }", "afterShown() {}", "function _sh_overview_hidden(){\n\tin_overview = false;\n\twrap_plane_clone.visible = false;\n\tif( paused_preserve ) pause();\n}", "display() {\n if (!this.state.updatedLights) {\n if (this.state instanceof MyStatePlaying || this.state instanceof MyStateMovie) {\n this.scene.updateLights(this.scene.sceneGraphs[this.state.sceneGraphIndex].lights);\n } else {\n this.scene.updateLights(this.scene.menus.lights);\n }\n this.state.updatedLights = true;\n }\n this.state.display();\n }", "function orientWorking(nodes, duration) {\r\n\t//Reopen the settings\r\n\tnodes.printSettings.style.visibility = \"hidden\";\r\n\tnodes.dateArea.style.display = \"none\";\r\n\tnodes.settings.style.display = \"block\";\r\n\r\n\t//Animate the top details area open\r\n\tdojo.animateProperty({\r\n\t\tnode: nodes.detailsPort.domNode,\r\n\t\tduration: duration,\r\n\t\tproperties: { \r\n\t\t\theight: { end: \"0\", units: \"px\" }\r\n\t\t},\r\n\t\tonEnd: function(){\r\n\t\t\t//Remove the sidebar, add the print details on top\r\n\t\t\tvar hidden = nodes.detailsPort.domNode;\r\n\t\t\t\r\n\t\t\tnodes.mapPane.removeChild(nodes.detailsPort);\r\n\t\t\tdojo.place(hidden, dojo.byId(\"hidden\")); \r\n\t\t\tnodes.mapPane.addChild(nodes.detailsLand);\r\n\t\t\tnodes.mapPane.resize();\r\n\t\t\tnodes.mapPane.layout();\r\n\t\t\t\r\n\t\t\tdojo.animateProperty({\r\n\t\t\t\tnode: \"printPane\",\r\n\t\t\t\tduration: duration,\r\n\t\t\t\tproperties: { \r\n\t\t\t\t\twidth: { start: \"0\",end: \"100\", units: \"%\" },\r\n\t\t\t\t\theight: { start: \"0\",end: \"100\", units: \"%\" },\r\n\t\t\t\t\tpadding: { start: \"30\",end: \"0\", units: \"px\"},\r\n\t\t\t\t\tmarginTop: { start: \"10\",end: \"0\", units: \"px\"}\r\n\t\t\t\t},\r\n\t\t\t\tonEnd: function(){\r\n\t\t\t\t\t//Resize the dojo bordercontainer\r\n\t\t\t\t\tnodes.mapPane.domNode.style.width=\"100%\";\r\n\t\t\t\t\tnodes.mapPane.domNode.style.height=\"100%\";\r\n\t\t\t\t\tnodes.mapPane.resize();\r\n\t\t\t\t\tnodes.mapPane.layout();\r\n\t\t\t\t\tsidebar(dijit.byId(\"toggleButton\"), 300, false);\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\tgetNewHeight();\r\n\t\t\t\t\t}, 400);\t\t\t\t\t\r\n\t\t\t\t\t//Resize the map\r\n\t\t\t\t\tvar controls = [\"mapType\", \"pan\", \"streetView\", \"zoom\"];\r\n\t\t\t\t\tfor (var k in controls) {\r\n\t\t\t\t\t\tmap.set(controls[k]+\"Control\", true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}).play();\r\n\t\t}\r\n\t}).play();\r\n}", "async function loadDetails() {\r\n try {\r\n setShow(true);\r\n\r\n const response = await api.get(`/etapas/${project._id}/${step._id}`, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n\r\n const { data } = response;\r\n\r\n if (data) {\r\n setDetails(data.detalhes);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n } else {\r\n setDetails([]);\r\n }\r\n\r\n setShow(false);\r\n } catch (err) {\r\n console.log('err ', err);\r\n setErr(true);\r\n }\r\n }", "handleDetail(item) {\n if (this.props.onDetail) this.props.onDetail(item);\n }", "hiddenClick(index) {\n let newItems = this.state.items.slice();\n let newHides = this.state.hidden.slice();\n const sorter = this.state.sortBy;\n const coll = !this.state.collapse;\n const signed = this.state.sign;\n const cols = this.state.columns.slice();\n this.setState({\n items: newItems,\n sortBy: sorter,\n sign: signed,\n columns: cols,\n hidden: newHides,\n collapse: coll\n });\n }", "_refreshVisibility() {\n this._sideBar.setHidden(this._sideBar.titles.length === 0);\n this._stackedPanel.setHidden(this._sideBar.currentTitle === null);\n }", "processAnimations(coords) {\n let moveTime = 1 / this.gameboard.orchestrator.moveSpeed\n let removeTime = moveTime * 1.75 / this.gameboard.orchestrator.moveSpeed\n\n this.moveAnimationAux = {\n animation: Animations[this.gameboard.orchestrator.moveAnimation],\n initialPosition: [0, 0.1, 0],\n finalPosition: [this.destTile.x - this.origTile.x, 0, this.destTile.y - this.origTile.y],\n duration: moveTime,\n heightLevels: [{instant: 0, height: 0.1}, {instant: moveTime * 0.5, height: 0.66}, {instant: moveTime, height: 0}]\n }\n\n this.moveAnimation = new EasingAnimation(this.moveAnimationAux, () => { this.notifyMoveAnimationCompleted(\"move\") })\n\n this.removeAnimationAux = {\n animation: Animations[this.gameboard.orchestrator.moveAnimation],\n initialPosition: [0, 0, 0],\n finalPosition: [coords.x + this.gameboard.size * 1.3 - 1 - this.destTile.x, 0.15 + coords.y * 0.2, ((this.gameboard.size / 2 - 2 + coords.z) - this.destTile.y)],\n duration: removeTime,\n heightLevels: [{instant: 0, height: 0}, {instant: removeTime * 0.3333, height: 1.5}, {instant: removeTime * 0.90 , height: 1.5}, {instant: removeTime, height: 0.15 + coords.y * 0.2}]\n }\n\n this.removeAnimation = new EasingAnimation(this.removeAnimationAux, () => { this.notifyMoveAnimationCompleted(\"remove\") })\n }", "acceptedMain(data, i) {\n\t\t\t this.setState({details :data});\n\t\t\t console.log(this.state.details);\n\t\t\t this.setState({ showacceptedModal: true })\n\t\t }", "onBackClick() {\n\t\t\tthis.props.uiState.isAlignmentDetailVisible = false;\n\t\t}", "@action updateDataToShow(value) {\n this.dataToShow = value;\n this.selectedData = this.data[0].details;\n this.activeDetailTab = this.data[0].label;\n }", "handleInstructionsExpandChange(newExpandedState) {\n //console.log(\"Expand change: \" + newExpandedState);\n this.setState({\n showInstructions: newExpandedState,\n })\n }", "onToggleDetail() {\n\n\t\t$(\".account-history\").on(\"click\", \".history-item .action .btn\", ev => {\n\n\t\t\tconst target = $(ev.currentTarget).closest(\".history-item\");\n\t\t\tconst details = $(\".account-history-detail\", target);\n\n\t\t\t$(\".btn.show\", target).toggleClass('hidden');\n\t\t\t$(\".btn.close\", target).toggleClass('hidden');\n\n\t\t\tslideToggle(details[0], 300);\n\n\t\t\treturn false;\n\t\t});\n\t}", "function updatePracticePane()\n {\n evaluateInput()\n setTargetText()\n displayTargetText()\n updateProgress()\n updateSpeed()\n updateError()\n updateSmiley()\n\n if (my.current.state == my.STATE.COMPLETED) {\n displayAdvice()\n setResultTooltips()\n\n log('state', my.current.state.toUpperCase(),\n 'unit', my.current.unitNo + '.' + my.current.subunitNo,\n 'type', my.settings.unit,\n 'wpm', my.current.wpm,\n 'error', my.current.errorRate.toFixed(1))\n }\n }", "check_GameMovie(){\n if(this.scene.showGameMovie){\n for (let i = this.model.playsCoords.length - 1; i >= 0; i--) {\n let playCoords = this.model.playsCoords[i];\n let playValues = this.model.playsValues[i];\n this.view.setPieceToStartPos(playCoords[0], playCoords[1], playValues[1]);\n }\n this.state = 'WAIT_GM_1st_ANIMATION_END';\n \n }\n }", "showOriginalImage() {\n setTimeout(() => {\n dom.canvasContainers[0].classList.remove('hidden');\n }, this.transitionTime);\n }", "function App() {\n const [view, setView] = useState(false);\n return (\n <>\n <button\n onClick={() => {\n setView(!view);\n }}\n >\n Detalhes\n </button>\n {view && (\n <Details\n closed={() => {\n setView(false);\n }}\n />\n )}\n </>\n );\n}", "setPane(e) {\n this.props.setPane(e.target.id);\n }", "renderInitialView() {\n const ds = new ListView.DataSource({\n rowHasChanged: (r1, r2) => r1!== r2,\n });\n switch (this.state.selected) {\n case 'crypto':\n this.dataSource = ds.cloneWithRows(this.props.cryptoPuzzles);\n break;\n case 'cyber':\n this.dataSource = ds.cloneWithRows(this.props.cyberPuzzles);\n break;\n case 'logic':\n this.dataSource = ds.cloneWithRows(this.props.logicPuzzles);\n break;\n case 'admin':\n this.dataSource = ds.cloneWithRows(this.props.newPuzzles);\n break;\n default:\n break;\n }\n\n return (this.props.detailView) ?\n <SinglePuzzle /> :\n <View style={styles.container}>\n <ScrollView showsVerticalScrollIndicator={false} style={styles.scroll}>\n <AppHeader />\n <View style={styles.tabs}>\n <TouchableOpacity \n style={[styles.tab, {backgroundColor: this.state.selected == 'crypto' ? '#9a67ea' : null}]} \n onPress={() => {this.setState({selected: 'crypto'})}} \n >\n <Icon name='key-variant' type='material-community' color='#fff' containerStyle={{height: 25}} />\n <Text style={styles.tabText}>Cryptography</Text>\n </TouchableOpacity>\n <TouchableOpacity \n style={[styles.tab, {backgroundColor: this.state.selected == 'cyber' ? '#9a67ea' : null}]} \n onPress={() => {this.setState({selected: 'cyber'})}} \n >\n <Icon name='security' color='#fff' containerStyle={{height: 25}} />\n <Text style={styles.tabText}>Cybersecurity</Text>\n </TouchableOpacity>\n <TouchableOpacity \n style={[styles.tab, {backgroundColor: this.state.selected == 'logic' ? '#9a67ea' : null}]} \n onPress={() => {this.setState({selected: 'logic'})}} \n >\n <Icon name='puzzle-piece' type='font-awesome' color='#fff' containerStyle={{height: 25}} />\n <Text style={styles.tabText}>Logic</Text>\n </TouchableOpacity>\n {(this.props.user.admin) ?\n <TouchableOpacity \n style={[styles.tab, {backgroundColor: this.state.selected == 'admin' ? '#9a67ea' : null}]} \n onPress={() => {this.setState({selected: 'admin'})}} \n >\n <Icon name='lock' type='font-awesome' color='#fff' containerStyle={{height: 25}} />\n <Text style={styles.tabText}>Admin</Text>\n </TouchableOpacity> \n : null}\n </View>\n <List containerStyle={styles.list}>\n <ListView \n refreshControl={\n <RefreshControl \n refreshing={this.state.refreshing} \n onRefresh={this.onRefresh.bind(this)}\n />}\n enableEmptySections\n dataSource={this.dataSource} \n renderRow={(rowData) =>\n <ListItem \n containerStyle={styles.listItem} \n title={rowData.title}\n subtitle={'Level: ' + rowData.rating + ' ' + (JSON.stringify(this.props.user.solved).includes(rowData.id) ? 'Solved' : '')}\n subtitleStyle={styles.subtitle}\n onPress={() => this.props.selectPuzzle(rowData, this.state.selected)} \n />\n } \n />\n </List>\n </ScrollView>\n </View>\n }", "getPostDetails() {\n fetchPostDetails(this.props.id)\n .then(details => this.setState(() => ({\n ...this.state,\n originalDetails: {...details},\n modifiedDetails: {...details},\n })))\n }", "function onPreExpandStarted(){}", "render() {\n\t\treturn <>\n\t\t\t<div className={`detailedView ingredientDetail text-light bg-dark p-4 container-fluid detailedView-${this.state.id===undefined ? \"off\" : \"on\"}`}>\n\t\t\t\t<div className=\"row\">\n\t\t\t\t\t<div className=\"col-md-1\">\n\t\t\t\t\t\t<button className=\"btn btn-danger closeDetailedView\" onClick={event => {\n\t\t\t\t\t\t\tthis.setState({id:undefined});\n\t\t\t\t\t\t\tthis.props.changeIngredient(undefined);\n\t\t\t\t\t\t}}>\n\t\t\t\t\t\t\t<FaWindowClose size={28} />\n\t\t\t\t\t\t</button>\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-md-12\">\n\t\t\t\t\t\t<h1>{capitalize(this.state.details.name)}</h1>\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-md-6\">\n\t\t\t\t\t\t<div className=\"py-3 bg-secondary\">\n\t\t\t\t\t\t\t<h5>Alcohol Type</h5>\n\t\t\t\t\t\t\t<div className={`btn h4 text-white bg-${this.state.details.percentage===null ? \"danger\" : (this.state.details.liquor ? \"warning\" : \"info\") }`}>{\n\t\t\t\t\t\t\t\tthis.state.details.percentage===null ? <FaWindowClose size={22} /> : (this.state.details.liquor ? \"Liquor\" : \"Liqueur\")\n\t\t\t\t\t\t\t}</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"py-3 bg-secondary\">\n\t\t\t\t\t\t\t<h5>{this.state.details.percentage===null ? \"Sweet\" : \"Percentage\" }</h5>\n\t\t\t\t\t\t\t<div className={`btn h4 text-white bg-${this.state.details.percentage===null ? (this.state.details.isSweet ? \"success\" : \"danger\") : (this.state.details.liquor ? \"warning\" : \"info\") }`}>{\n\t\t\t\t\t\t\t\tthis.state.details.percentage===null ? (this.state.details.isSweet ? <FaCheckSquare size={22} /> : <FaWindowClose size={22} />) : `${this.state.details.percentage}%`\n\t\t\t\t\t\t\t}</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"py-3 bg-secondary\">\n\t\t\t\t\t\t\t<h5>Glass</h5>\n\t\t\t\t\t\t\t<div className={`btn h4 text-white bg-${this.state.details.glassId===null ? \"danger\" : \"success\"}`}>{\n\t\t\t\t\t\t\t\tthis.state.details.glassId===null ? \"None\" : this.state.details.glassName\n\t\t\t\t\t\t\t}</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"py-3 bg-secondary\">\n\t\t\t\t\t\t\t<h5>Quantity Available</h5>\n\t\t\t\t\t\t\t<div className={`btn h4 text-white bg-${this.state.details.quantity > 10 ? \"success\" : (this.state.details.quantity<1 ? \"danger\" : \"warning\" )}`}>{this.state.details.quantity}</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"col-md-6\">\n\t\t\t\t\t\t<img src={`https://www.thecocktaildb.com/images/ingredients/${this.state.details.name}.png`} alt={this.state.details.name}/>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t\t<div className=\"row justify-content-end mt-auto\">\n\t\t\t\t\t{\n\t\t\t\t\t\t(this.props.deleteCallback ? <>\n\t\t\t\t\t\t\t<button className=\"col-md-2 btn btn-success text-white\" onClick={this.updateRefresh}><h3>ORDER</h3></button>\n\t\t\t\t\t\t\t<button className=\"col-md-2 btn btn-danger\" onClick={this.deleteIngredient}><h3>DELETE</h3></button>\n\t\t\t\t\t\t</> : <></>)\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</>;\n\t}", "function clonedAnimationDone(){\n // scroll body\n anime({\n targets: \"html, body\",\n scrollTop: 0,\n easing: easingSwing, // swing\n duration: 150\n });\n\n // fadeOut oldContainer\n anime({\n targets: this.oldContainer,\n opacity : .5,\n easing: easingSwing, // swing\n duration: 300\n })\n\n // show new Container\n anime({\n targets: $newContainer.get(0),\n opacity: 1,\n easing: easingSwing, // swing\n duration: 300,\n complete: function(anim) {\n triggerBody()\n _this.done();\n }\n });\n\n $newContainer.addClass('one-team-anim')\n }", "function ViewModel() {\n\n // Private variables\n\n // Use jQuery to handle events\n let events = $({});\n let model;\n let itemsDetails;\n let orderNumberItemCurrentlyVisited;\n let orderNumberClickedItem;\n let orderNumberOfItemOfWhichToShowContent;\n\n let viewportWidth;\n let viewportHeight;\n\n let animationToNextItemRunning;\n let itemToShow;\n let nidOfItemToShow;\n let rebuildingPageOnPopStateEvent;\n\n const determineOrderNumberOfItemOfWhichToShowContent = () => {\n\n // We need the order number of the item we are going to show\n // There are two cases:\n // 1. The user clicked on an item\n // 2. The user clicked on an arrow and we are going to the next or to the previous item\n\n let orderNumberOfItemToShow;\n\n if (orderNumberClickedItem) {\n\n // The user clicked on an item\n\n orderNumberOfItemToShow = orderNumberClickedItem;\n\n orderNumberClickedItem = undefined;\n\n } else {\n\n // The users clicked on an arrow\n\n orderNumberOfItemToShow = orderNumberItemCurrentlyVisited;\n\n }\n\n return orderNumberOfItemToShow;\n\n };\n\n /**\n * When we move to an item we need to change the URL to match it\n * @param itemCurrentlyShown\n */\n const changeURLToMatchItemWhoseContentIsShown = (itemCurrentlyShown) => {\n\n const urlForItemCurrentlyShown = itemCurrentlyShown.path;\n\n // Only if the url is not the same as the one shown, we push the new url\n // to the history\n if (urlForItemCurrentlyShown !== document.location.pathname) {\n\n history.pushState(null, null, urlForItemCurrentlyShown);\n\n }\n\n };\n\n const changePageTitle = (title) => {\n\n if (title)\n document.title = `Emanuele Santanche, writer — ${title}`;\n else\n document.title = \"Emanuele Santanche, writer\";\n\n };\n\n /**\n * Used to rebuild the page on popstate event\n *\n * @see registerBrowserNavigationEventHandler\n * @param pathnameWhereToGo\n */\n const rebuildPageOnChangeOfURL = (pathnameWhereToGo) => {\n\n rebuildingPageOnPopStateEvent = true;\n\n showItemContentOnNonEmptyPathname(pathnameWhereToGo);\n\n };\n\n const registerBrowserNavigationEventHandler = () => {\n\n // When the user clicks on the back or the forward buttons,\n // we get a popstate event here\n // The URL changes and we need to rebuild the page to show the item\n // the URL is about (it can be the home as well)\n\n // Sometimes there is no popstate event, but that's fine\n\n window.onpopstate = function() {\n\n //console.log('onpopstate document.location.pathname', document.location.pathname);\n\n rebuildPageOnChangeOfURL(document.location.pathname);\n\n };\n\n };\n\n const preparingToShowTheMap = () => {\n\n // This is the case in which the url is about an item (/item/99/slug-here)\n // We need to set orderNumberItemCurrentlyVisited otherwise the item's content\n // doesn't show up\n if (nidOfItemToShow) {\n const item = itemsDetails.filter(item => {\n return parseInt(item.nid) === nidOfItemToShow;\n })[0];\n\n orderNumberItemCurrentlyVisited = parseInt(item.field_order_number);\n } else {\n\n // In this case we are on the starting point of the spiral, to which\n // we assign url /web-writer-tech-and-humanity\n\n const urlWebWriterTechAndHumanity = \"/web-writer-tech-and-humanity\";\n\n if (urlWebWriterTechAndHumanity !== document.location.pathname) {\n history.pushState(null, null, urlWebWriterTechAndHumanity);\n }\n\n }\n\n // Telling views that the items are ready to be used to build the map\n events.trigger('ViewModel.map.show');\n\n\n // When the user clicks on the home page button we show the map, the items,\n // the arrows and we show the menu button as well\n events.trigger('ViewModel.menu.showbutton');\n\n }\n\n /**\n * It's where we rebuild the page when the url is about an item or when we need to\n * go to the home\n *\n * @memberOf ViewModel\n * @param {string} pathname The URL of the item to show or \"/\" for the home\n */\n const showItemContentOnNonEmptyPathname = (pathname) => {\n\n // The user landed on a non-empty URL. It's not the home they landed on\n // The url is something like http://localhost/item/99/introducing-articles\n\n // This means that I now hide the home page, show the map, draw the items, move to the item\n // whose nid is in the url, show the item's content, etc\n\n // The non-empty URL can be /web-writer-tech-and-humanity, which is the starting point of the spiral\n\n if (/^\\/item\\/\\d+\\//.test(pathname) || /^\\/web-writer-tech-and-humanity/.test(pathname)) {\n\n if (/^\\/item\\/\\d+\\//.test(pathname))\n nidOfItemToShow = parseInt(pathname.match(/^\\/item\\/(\\d+)\\//)[1]);\n else\n nidOfItemToShow = undefined; // case of /web-writer-tech-and-humanity\n\n /**\n * Event triggered when the page is loaded with a non-empty pathname.\n *\n * @event ViewModel#ViewModelnonemptypathnameshow\n * @memberOf ViewModel\n */\n events.trigger('ViewModel.nonemptypathname.show');\n //requestItemsDetailsFromModel();\n\n preparingToShowTheMap();\n\n } else if (pathname === \"/\") {\n\n // Oops, in this case it's really the home page we have to go to\n\n // Need to reset variables and trigger\n // events to hide some elements and show others\n\n orderNumberItemCurrentlyVisited = 0;\n animationToNextItemRunning = false;\n rebuildingPageOnPopStateEvent = false;\n orderNumberClickedItem = undefined;\n orderNumberOfItemOfWhichToShowContent = undefined;\n itemToShow = undefined;\n nidOfItemToShow = undefined;\n\n changePageTitle();\n\n // This will tell HomeMessageView.js to show the home\n // It will tell ItemView.js to hide carpet, map and everything\n // It will tell ItemContentView.js to hide the item content dialog\n\n /**\n * Event triggered when we need to go to the home page\n *\n * @event ViewModel#ViewModelhomegoto\n * @memberOf ViewModel\n */\n events.trigger(\"ViewModel.home.goto\");\n\n } else {\n\n Sentry.captureMessage(\"The url is wrong \" + pathname);\n\n }\n\n };\n\n /**\n * registerEventHandlers is the standard name for the function that attaches event handlers\n * I'm talking about my custom jquery events\n * No standard events like click\n * @memberOf ViewModel\n */\n const registerEventHandlers = () => {\n\n model.attachEventHandler('Model.itemContent.ready', () => {\n\n // The Model has just fetched the content of the item we have to display\n // We put in itemToShow the item the appropriate view has to show\n\n itemToShow = itemsDetails.filter(item => {\n return parseInt(item.field_order_number) === orderNumberOfItemOfWhichToShowContent;\n })[0];\n\n // If we fetched the item's content because the user clicked on an arrow, we need\n // to change the url to reflect the item currently shown\n // If the url was already there and we got a popstate event, we don't need to change the\n // url. The current one is already the correct one\n if (!rebuildingPageOnPopStateEvent)\n changeURLToMatchItemWhoseContentIsShown(itemToShow);\n\n changePageTitle(itemToShow.title);\n\n rebuildingPageOnPopStateEvent = false;\n\n // Letting know the views that the item itemToShow is ready\n events.trigger('ViewModel.item.show');\n\n });\n\n model.attachEventHandler('Model.contactmeform.success', () => {\n\n // Letting views know that the contact me form details have been\n // successfully sent to the backend\n events.trigger(\"ViewModel.contactme.formsuccessfullysaved\");\n\n });\n\n model.attachEventHandler('Model.contactmeform.error', () => {\n\n // Letting views know that there has been an error when sending\n // the contact me form details to the backend\n events.trigger(\"ViewModel.contactme.error\");\n\n });\n\n };\n\n return {\n\n init: (modelToUse) => {\n\n model = modelToUse;\n\n if (itemsDetails)\n model.setItemsDetails(itemsDetails);\n else\n Sentry.captureMessage(\"itemsDetails not defined in ViewModel::init\");\n\n viewportWidth = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);\n viewportHeight = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);\n\n orderNumberItemCurrentlyVisited = 0;\n animationToNextItemRunning = false;\n rebuildingPageOnPopStateEvent = false;\n\n registerBrowserNavigationEventHandler();\n\n registerEventHandlers();\n\n // The URL is not just the home, it's the URL of an item\n if (window.location.pathname !== \"/\") {\n\n showItemContentOnNonEmptyPathname(window.location.pathname);\n\n } else {\n\n // In case the path is \"/\", we go to the home page\n\n events.trigger(\"ViewModel.home.goto\");\n\n }\n\n },\n\n setItemsDetails: (itemsDetailsFromItemView) => {\n\n itemsDetails = itemsDetailsFromItemView;\n\n },\n\n getItemsDetails: () => {\n\n return itemsDetails;\n },\n\n getNumberOfItems: () => {\n\n return itemsDetails.length;\n },\n\n getViewPort: () => {\n\n return { width: viewportWidth, height: viewportHeight };\n },\n\n itIsASmallScreen: () => {\n\n return viewportWidth < APP_CONFIGURATION.smallScreenWidth;\n },\n\n attachEventHandler: (event, handler) => {\n\n events.on(event, handler);\n\n },\n\n userClickedOnHomePageButton: () => {\n\n preparingToShowTheMap();\n\n },\n\n getItemToVisitNext: (giveMeTheNextItemNotThePrevious = true) => {\n\n if (giveMeTheNextItemNotThePrevious)\n orderNumberItemCurrentlyVisited++;\n else {\n orderNumberItemCurrentlyVisited--;\n if (orderNumberItemCurrentlyVisited < 1)\n orderNumberItemCurrentlyVisited = 1;\n }\n\n // Sure there is one only item with id orderNumberItemCurrentlyVisited,\n // but the method filter returns an array anyway\n let arrayCurrentlyVisitedItem = itemsDetails.filter(item => {\n return parseInt(item.field_order_number) === orderNumberItemCurrentlyVisited;\n });\n\n // If the item has not been found, it's because the order number\n // orderNumberItemCurrentlyVisited is too high. We go back to item number 1\n if (arrayCurrentlyVisitedItem.length === 0) {\n\n // Back to the item 1\n orderNumberItemCurrentlyVisited = 1;\n\n return itemsDetails.filter(item => {\n return parseInt(item.field_order_number) === 1;\n })[0];\n }\n else\n return arrayCurrentlyVisitedItem[0];\n\n },\n\n setAnimationToNextItemRunning: (animationRunning) => {\n\n animationToNextItemRunning = animationRunning;\n\n // When the carpet is moving from an item to another,\n // the item content and the contact me dialogs have to be closed\n events.trigger(\"ViewModel.itemcontent.close\");\n events.trigger(\"ViewModel.contactme.close\");\n\n },\n\n getAnimationToNextItemRunning: () => {\n\n return animationToNextItemRunning;\n },\n\n showItem: (order_number) => {\n\n if (order_number)\n orderNumberClickedItem = order_number;\n\n // If order_number is not defined, we need to show the current item\n // The function determineOrderNumberOfItemOfWhichToShowContent will return the item currently visited\n\n orderNumberOfItemOfWhichToShowContent = determineOrderNumberOfItemOfWhichToShowContent();\n\n itemToShow = itemsDetails.filter(item => {\n return parseInt(item.field_order_number) === orderNumberOfItemOfWhichToShowContent;\n })[0];\n\n if (itemToShow.field_item_type === \"ContactMe\") {\n\n // If we got to the contact me page because the user clicked on an arrow, we need\n // to change the url to reflect the item currently shown, the contact me form\n // If the url was already there and we got a popstate event, we don't need to change the\n // url. The current one is already the correct one\n if (!rebuildingPageOnPopStateEvent)\n changeURLToMatchItemWhoseContentIsShown(itemToShow);\n\n changePageTitle(itemToShow.title);\n\n rebuildingPageOnPopStateEvent = false;\n\n events.trigger(\"ViewModel.contactme.show\");\n\n } else {\n\n model.fetchItemContent(orderNumberOfItemOfWhichToShowContent);\n\n // Now go to have a look at function registerEventHandlers that handles the event Model.itemContent.ready\n // It's the event that the model will trigger after it gets the item's content\n\n }\n\n },\n\n getItemToShow: () => {\n\n const itemToReturn = itemToShow;\n\n itemToShow = undefined;\n\n return itemToReturn;\n },\n\n setContentIsBeingShown: (contentIsBeingShown) => {\n\n if (contentIsBeingShown)\n events.trigger('ViewModel.itemcontent.beingshown');\n else\n events.trigger('ViewModel.itemcontent.beinghidden');\n\n },\n\n setContactMeIsBeingShown: (contactMeIsBeingShown) => {\n\n if (contactMeIsBeingShown)\n events.trigger('ViewModel.contactme.beingshown');\n else\n events.trigger('ViewModel.contactme.beinghidden');\n\n },\n\n getItemToShowBecauseItIsInTheURL: () => {\n\n let itemToShowBecauseItIsInTheURL = null;\n\n if (nidOfItemToShow) {\n\n itemToShowBecauseItIsInTheURL = itemsDetails.filter(item => {\n return parseInt(item.nid) === nidOfItemToShow;\n })[0];\n\n nidOfItemToShow = undefined;\n\n }\n\n return itemToShowBecauseItIsInTheURL;\n },\n\n // This function is used by MenuView.js to go to the home\n // when the home button on the menu is clicked\n // It may be used somewhere else as well\n goToHome: () => {\n\n history.pushState(null, null, \"/\");\n rebuildPageOnChangeOfURL(\"/\");\n\n },\n\n saveContactMeForm: (fullname, email, message) => {\n\n model.saveContactMeForm(fullname, email, message);\n\n }\n\n }\n\n}", "function toggleDetails() {\n\t\t\treturn vm.details = !vm.details;\n\t\t}", "updateAnimation() {\n return;\n }", "function toggleInfo() {\n infoContent.toggle();\n upperContent.toggle();\n $('#ketchup').animate({\n bottom: '-300px'\n }, 0.5);\n $('#ketchup').animate({\n bottom: '0px'\n }, \"slow\");\n burgerContainer.toggleClass('strong-blur');\n if (lowerContent.children().length) lowerContent.toggle();\n collapseHeader(lowerContent.is(':visible') && !firstRun);\n}", "function objectListPop(){\n if(!objectBtnState){\n objectList.style.display = \"block\";\n objectList.style.animation = \"goUp 0.7s ease-out forwards\";\n objectBtn.style.animation = \"reflect_1 0.7s ease-out forwards\";\n}\n else{\n objectList.style.display = \"block\";\n objectList.style.animation = \"goDown 0.7s ease-out forwards\";\n objectBtn.style.animation = \"reflect_2 0.7s ease-out forwards\";\n }\n objectBtnState=!objectBtnState;\n}", "componentDidUpdate() {\n switch (Actions.currentScene) {\n case (Actions.Frontpage.name):\n this.setState({ frontSelect: true, obsSelect: false });\n break;\n case (Actions.Observation.name):\n this.setState({ frontSelect: false, obsSelect: true });\n break;\n }\n }", "function action_showBoardInfo(board_id) {\n $('#board-panel').attr('style', \"\");\n $('#img-panel').attr('style', \"display: none;\");\n $('#upto-board').attr('style', \"display: none;\");\n $('#add-board').attr('style', \"\");\n $('#add-board').attr('onclick', \"javascript:action_modal_addBoard();\");\n autoResizeDiv();\n\n // Set board location..\n boardLocation = 0;\n\n refreshBoardList(boardList);\n}", "open() {\n\t\t// Add an overflow on the <details> to avoid content overflowing\n\t\tthis.element.style.overflow = 'hidden';\n\n\t\t// Get the current fixed height of the element\n\t\tconst startHeight = `${this.element.offsetHeight}px`;\n\t\t// Calculate the open height of the element (summary height + content height)\n\t\tconst endHeight = `${this.summary.offsetHeight + this.content.offsetHeight}px`;\n\n\t\t// Apply a fixed height on the element\n\t\tthis.element.style.height = startHeight;\n\t\tthis.state = true;\n\t\t// Wait for the next frame to call the expand function\n\t\tthis.element.dispatchEvent(this.openEvent);\n\t\twindow.requestAnimationFrame(() => {\n\n\t\t\t// Set the element as \"being expanding\"\n\t\t\tthis.isExpanding = true;\n\t\t\t// this.element.classList.add('is-expanding');\n\n\t\t\t// If there is already an animation running\n\t\t\tif (this.animation) {\n\t\t\t\t// Cancel the current animation\n\t\t\t\tthis.animation.cancel();\n\t\t\t}\n\n\t\t\t// Start a WAAPI animation\n\t\t\tthis.animation = this.element.animate({\n\t\t\t\theight: [startHeight, endHeight]\n\t\t\t}, {\n\t\t\t\tduration: this.animationSpeedMs,\n\t\t\t\teasing: 'ease'\n\t\t\t});\n\t\t\tconsole.log(this.animation);\n\t\t\t// When the animation is complete, call #onAnimationFinish()\n\t\t\tthis.animation.onfinish = () => {\n\t\t\t\tthis.#onAnimationFinish(true)\n\t\t\t};\n\t\t\t// If the animation is cancelled, isExpanding variable is set to false\n\t\t\tthis.animation.oncancel = () => {\n\t\t\t\tthis.isExpanding = false\n\t\t\t};\n\t\t});\n\t}" ]
[ "0.627069", "0.62153673", "0.59161925", "0.5885372", "0.58744067", "0.5857169", "0.58353156", "0.57286674", "0.5712948", "0.57061726", "0.570514", "0.5670081", "0.5662614", "0.5643484", "0.5627786", "0.56256914", "0.5615325", "0.56130856", "0.55983734", "0.55826616", "0.5576563", "0.5561186", "0.5535138", "0.55335", "0.55256313", "0.55238646", "0.55226463", "0.5520724", "0.55198175", "0.5514028", "0.5505317", "0.5498912", "0.5480636", "0.5465736", "0.5463616", "0.5461041", "0.5459654", "0.54560953", "0.54529285", "0.5451956", "0.54434514", "0.5440271", "0.54333985", "0.54310596", "0.54308385", "0.5428619", "0.5412709", "0.5412016", "0.54112107", "0.5404665", "0.54045993", "0.5403384", "0.53892845", "0.5380134", "0.5380015", "0.53741074", "0.53736776", "0.5372858", "0.53681356", "0.53565294", "0.53559625", "0.53472775", "0.5343094", "0.533617", "0.53319716", "0.5331687", "0.53190255", "0.5316671", "0.53134733", "0.53012455", "0.5299244", "0.5294906", "0.5288512", "0.52865374", "0.5284625", "0.52815944", "0.5279888", "0.52748686", "0.5270435", "0.52630067", "0.5262835", "0.5259554", "0.5252981", "0.5243413", "0.52407235", "0.5240112", "0.5239852", "0.5235471", "0.52305114", "0.52285737", "0.52279335", "0.52268296", "0.5226627", "0.52245754", "0.52238536", "0.52233064", "0.52225614", "0.5221718", "0.52200556", "0.52096575", "0.52064925" ]
0.0
-1
import Dashboard from './components/Dashboard';
function PrivateRoute({ component: RouteComponent, authed, ...rest }) { console.log(authed); return ( <Route {...rest} render={props => authed === false ? ( <RouteComponent {...props} /> ) : ( <Redirect to={'/dash/main'} /> ) } /> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function App() {\n return (\n <div className=\"App\">\n <Router>\n <Switch>\n <Route path=\"/\">\n <AuthDashboard />\n </Route>\n </Switch>\n </Router>\n </div>\n );\n}", "function LoginRoutes() {\n return (\n <Switch>\n <Route path=\"/\" component={() => (\n <Dashboard/>\n )}/>\n </Switch>\n )\n\n}", "function App() {\n return (\n <div className=\"App\">\n <Router>\n <Route path='/' exact component={OverviewDashboard} />\n <Route path='/overview' exact component={OverviewDashboard} />\n </Router>\n </div>\n );\n}", "function UserDashboard() {\n\n return (\n <div className=\"App123\">\n <div className=\"progress\">\n <Progress />\n </div>\n <div className=\"toDoList\">\n <ToDo />\n </div>\n <div className=\"carousel\">\n <Slideshow /> \n </div>\n </div>\n );\n}", "function Dashboard(props) {\n return (\n <div className=\"dashboard-container\">\n <Header handleLogout={props.handleLogout}/>\n <Main />\n <Sidebar />\n </div>\n )\n}", "function Dashboard() {\n return (\n <div className=\"dashboard-container\">\n <Link className=\"dashboard-content\" to=\"/create-user\">Create User</Link><br />\n <Link className=\"dashboard-content\" to=\"/users\">List Users</Link>\n </div>\n )\n}", "function Dashboard() {\n return /*#__PURE__*/react_default.a.createElement(FeatureBox, null, /*#__PURE__*/react_default.a.createElement(FeatureHeader, {\n alignItems: \"center\"\n }, /*#__PURE__*/react_default.a.createElement(FeatureHeaderTitle, null, \"Dashboard\"), /*#__PURE__*/react_default.a.createElement(Dashboard_DebugInfoButton, {\n ml: \"auto\"\n })), /*#__PURE__*/react_default.a.createElement(Dashboard_OperationBanner, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_MetricsCharts, null), /*#__PURE__*/react_default.a.createElement(Dashboard_LatestEventList, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_OperationList, {\n mb: \"4\"\n }), /*#__PURE__*/react_default.a.createElement(Dashboard_AppList, null));\n}", "function Admin() {\n\n return (\n <Container>\n {/* <Header /> */}\n <Content>\n <SideNav />\n <Dashboard>\n\n </Dashboard>\n </Content>\n </Container>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n {/*<Entry/>*/}\n <DefaultLayout>\n { /* <Dashboard /> */}\n <AddTicket/>\n </DefaultLayout>\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 LoginRoutesHistoria() {\n return (\n <Switch>\n <Route path=\"/\" component={() => (\n <DashboardHistoria/>\n )}/>\n </Switch>\n )\n\n}", "componentDidMount() {\n // alert(\"se acaba de cargar el componente\")\n }", "function LoginRoutesCarga() {\n return (\n <Switch>\n <Route path=\"/\" component={() => (\n <DashboardCarga/>\n )}/>\n </Switch>\n )\n\n}", "function App() {\n\t\n\n return (\n <Router>\n <Switch>\n <Route path=\"/\" component= {Home} exact />\n <Route path=\"/signin\" component={SigninPage} exact />\n <Route path=\"/Login\" component={LoginPage} exact /> \n <Route path=\"/Dashboard\" component={DashBoardNavbarPage} exact />\n \n \n </Switch>,\n \n \n </Router>\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 App(){\n return(\n <Routes />\n\n );\n}", "function App() {\n return (\n <Switch className=\"App\">\n <Route exact path=\"/\"component={Login} />\n <Route exact path=\"/profile\" component={Dashboard}/>\n </Switch>\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}", "render() {\n const { dashboardStyle } = styles;\n\n return(\n <View style={ dashboardStyle }>\n <Header headerText={'Dashboard'}/>\n { this.renderDash() }\n </View>\n );\n }", "function App() {\n return (\n <div> \n <Routes />\n </div>);\n}", "function Admin(){\n return(\n <BrowserRouter>\n <Fragment>\n <Switch>\n <Route path=\"/admin\" render={(props) => <DashboardAdmin {...props} />} />\n <Redirect to=\"/admin/dashboard\" />\n </Switch>\n </Fragment>\n </BrowserRouter>\n )\n}", "function App() {\n return (\n <div className=\"lucas-app\">\n <Board />\n <Menu />\n </div>\n );\n}", "function App() {\n return (\n<div>\n\n<Homepage />\n\n</div>\n\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Switch>\n\n <Route exact path='/' render={ () => (\n <Home />\n )}/>\n\n <Route path='/dashboard' render={ () => (\n <Login />\n )}/>\n\n </Switch>\n\n </div>\n );\n}", "function App() {\n return (\n //JSX=>needs to import React\n <div >\n Hello Worldfff\n </div>\n );\n}", "function App() {\n return (\n <Routes />\n );\n}", "function App() {\n\n \n return (\n <Routes />\n\n );\n}", "function App() {\n return (\n <PublicHome />\n );\n}", "render() {\n return (\n <div className=\"dashboard\">\n <div className=\"dashboard-username\">\n Username: {this.props.username}\n </div>\n <div className=\"dashboard-name\">Name: {this.props.name}</div>\n <div className=\"dashboard-protected-data\">\n Protected data: {this.props.protectedData}\n </div>\n </div>\n );\n }", "function App() {\n\n\n return (\n\n <Login>\n\n </Login>\n\n\n );\n}", "function Routing() {\r\n return (\r\n <>\r\n <Router>\r\n <Nav />\r\n <Switch>\r\n <Route path='/' exact component={Dashboard} />\r\n <Route path='/reports' exact component={Reports} />\r\n <Route path='/products' exact component={Product} />\r\n <Route path='/services' exact component={Services}/>\r\n <Route path='/dashboard/users' exact component={User}/>\r\n <Route path='/dashboard/revenue' exact component={Revenue}/>\r\n <Route path='/products/mens' exact component={Mens}/>\r\n <Route path='/products/womens' exact component={Womens}/>\r\n <Route path='/reports/report1' exact component={Report1}/>\r\n </Switch>\r\n </Router>\r\n </>\r\n );\r\n}", "function App() {\n\n return (\n <Routes/>\n );\n}", "render() {\n return (\n <div className=\"Backend\">\n </div>\n );\n }", "onComponentMount() {\n\n }", "function App() {\n return (\n <Routes />\n );\n}", "function App() {\n return (\n <div>\n <Switch>\n <Route exact path=\"/\" component={Chat}></Route>\n <Route exact path=\"/dashboard/admin\" component={Dashboard}></Route>\n <Route exact path=\"/dashboard/admin/bot\" component={Bot}></Route>\n <Route\n exact\n path=\"/dashboard/admin/user/:id\"\n component={UserSettings}\n ></Route>\n <Route\n exact\n path=\"/dashboard/admin/bot/:id\"\n component={ManageBot}\n ></Route>\n <Route exact path=\"/dashboard/admin/user\" component={UserList}></Route>\n <Route\n exact\n path=\"/dashboard/admin/company\"\n component={CompaniesComponent}\n ></Route>\n <Route exact path=\"/auth/register\" component={Register}></Route>\n <Route exact path=\"/auth/login\" component={Login}></Route>\n <Route exact path=\"/auth/verify_email\" component={VerifyEmail}></Route>\n <Route exact path=\"/preview\" component={EmbedCode}></Route>\n <Route component={Error}></Route>\n </Switch>\n </div>\n );\n}", "componentDidMount() {\n this.importBDD();\n }", "function App() {\n return (\n <Router>\n <Switch> \n <Route exact path=\"/\" component={Login}/>\n <NavBar/>\n {/* <Sidebar/> */}\n </Switch>\n <Switch>\n <Route exact path=\"/dashAdmin\" component={DashBordAdmin}/>\n <Route exact path=\"/showProfile\" component={ShowProfile}/>\n <Route exact path=\"/addTicket\" component={AddTicket}/>\n \n \n \n </Switch>\n </Router>\n );\n}", "render () {\n return (\n <div className=\"o-container-main\">\n <Switch>\n\n <Route path=\"/Dashboard\" component={Loged} />\n <Route path=\"/API\" component={apiPage} />\n <Route path=\"/HomePage\" component={HomePage} />\n <Redirect to=\"/Dashboard/Home\" />\n\n </Switch>\n </div>\n );\n }", "function App() {\n return (\n <div className=\"App\">\n <Router>\n <Headernav />\n <Switch>\n <Route path=\"/\" exact component = {ProductListing}/>\n <Route path=\"/Crypto\" component = {CryptoListing}/>\n <Route path=\"/Bigchart\" render={() => <Bigchart legendPosition=\"bottom\"/>}/>\n </Switch>\n </Router>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Router>\n {/* <TopBar /> */}\n <div className=\"app-layout\">\n <Switch>\n <Route path=\"/\" exact>\n <LoginScreen />\n </Route>\n <Route path=\"/signup\">\n <SignUpScreen />\n </Route>\n <Route path=\"/dashboard\" exact>\n <DashboardScreen />\n </Route>\n </Switch>\n </div>\n </Router>\n </div>\n );\n}", "component() {\n return import(/* webpackChunkName: \"about\" */ '../views/About.vue');\n }", "function App() {\n return (\n <Login ></Login>\n\n );\n}", "function Logout() {\r\n return (\r\n <div>\r\n This is the Logout component\r\n </div>\r\n )\r\n}", "componentWillMount() {\n // alert(\"se va a montar el componente\")\n\n }", "function App() {\n return (\n <Router basename={process.env.PUBLIC_URL}>\n <Switch>\n <Route path='/' exact component={Home} />\n {/* <Route path='/timeline' component={TimeLine} /> */}\n </Switch>\n </Router>\n );\n}", "function App() {\n return (\n <BrowserRouter>\n <NavigationBar />\n <Switch>\n <Route exact path=\"/\" component={AdminIndexPage} />\n <Route exact path=\"/OCR\" component={OCR} />\n </Switch>\n </BrowserRouter>\n );\n}", "function App() {\n return (\n <Router> \n \n <div className=\"container\">\n<Topbar/>\n<Sidebar/> \n <Switch>\n <Route path='/dashboard' >\n <Home/>\n </Route> \n <Route path='/post'>\n <Post/>\n </Route>\n <Route path='/newpost'>\n <NewPost/>\n </Route> \n <Route path='/table'>\n <Formtable/>\n </Route> \n <Route path='/error'>\n <Error/>\n </Route> \n <Route path='/profile'>\n <Profile/>\n </Route> \n </Switch> \n</div>\n<Footer />\n </Router>\n );\n}", "function HelloReact() {\n return (\n <div className=\"container\">\n Hello React!\n {/*Another imported component*/}\n <Counter/>\n </div>\n )\n}", "function App() {\n return (<div className=\"app\">\n <Route\n path=\"/home\"\n exact\n render={routerProps=> (\n <Home></Home>\n )}\n ></Route>\n <Route\n path=\"/\"\n exact\n render={routerProps=> (\n <Onboarding>\n\n </Onboarding>\n )}>\n\n </Route>\n </div>\n )\n}", "get AppView() {\n return {\n title: 'Expenso',\n component: require('../Containers/App').default,\n leftButton: 'HAMBURGER',\n };\n }", "function App() {\n return <div ClassName=\"App\">\n <Route exact path=\"/\" component={Home} />\n <Route path=\"/projects\" component={Projects} />\n <Route path=\"/about\" component={About} />\n </div>;\n}", "function App() {\n return (\n <Wrapper>\n <Title>Employee Directory</Title>\n\n </Wrapper>\n );\n}", "function include(path) {\nreturn () => import('@/components/' + path)\n}", "function Index() {\n return <Homepage />;\n}", "static define() {\n Akili.component('component', Component);\n }", "function Dashboard() {\n return (\n <div className=\"dashboard\">\n <div >\n < Header />\n </div>\n <p><strong>Dashboard</strong> ICE Market data | Own Analysis | Historic market data <span style={{marginLeft:535}}>Settings | Analytics | Watchlist</span></p>\n <div>\n <Option />\n </div>\n <div>\n <Chart />\n </div>\n <div className=\"chart-flex\">\n <div className=\"chart\">\n <LineChart />\n </div>\n <div className=\"piechart\">\n <PieChart />\n </div>\n </div>\n </div>\n )\n}", "function App() {\n return (\n <div className={css.App}>\n {//<NavBarSimple />\n }\n <NavBarForm />\n <Sidebar />\n <ContentHooksAPI />\n </div>\n );\n}", "render() {\n\n return (\n <div className=\"App\">\n <h1>Matching Game</h1>\n <Board />\n </div>\n );\n\n }", "componentDidMount() {\n // if (this.props.auth.isAuthenticated) {\n // this.props.history.push(\"/dashboard\");\n // }\n }", "function App() {\n return <Layout />\n}", "function App() {\n return (\n <Router>\n <Route exact path=\"/\">\n <Analytics />\n </Route>\n </Router>\n );\n}", "function App() {\n return (\n <div>\n {/*<MapDashboard/>*/}\n {/*<Func/>*/}\n <Map />\n {/*<Ward />*/}\n </div>\n );\n}", "function App(props) {\n return (\n <Router>\n <Switch>\n <Route path=\"/signup\" component={Signup} />\n <Route path=\"/login\" component={Login} />\n <Route exact path=\"/\" component={Dashboard} />\n <Route path=\"/forgot-password\" component={ForgotPassword} />\n <Route path=\"/edit-profile\" component={EditProfile} />\n <Route path=\"/add-transaction\" component={AddTransactionPage} />\n <Route path=\"/portfolio\" component={PortfolioPage} />\n <Route path=\"/edit-balance\" component={EditBalance} />\n </Switch>\n </Router>\n );\n}", "function App() { \n return (\n <div className=\"app\">\n\n </div>\n);\n}", "function App(){\n return(<div>\n \n <Navbar/>\n <Banner/>\n \n \n </div>)\n\n}", "function App() {\n return (\n <Router history={hist}>\n <Switch>\n <Route path=\"/login\" component={Login} />\n <Route path=\"/register\" component={Register} />\n <Route path=\"/dashboard/:subPage\" component={Dashboard} />\n <Redirect from=\"/\" to=\"/dashboard/home\" />\n </Switch>\n </Router>\n );\n}", "function App() {\n\treturn (\n\t\t<div className=\"App\">\n\t\t\t<Board />\n\t\t</div>\n\t);\n}", "render() {\n\n if(!this.props.isLoggedIn)\n {\n return <Redirect to=\"/\" />;\n }\n\n return (\n <div className=\"adminDashboardContainer\">\n <h2 className = \"DashboardWelcome\"> {this.state.businessName}</h2>\n\n <Tabs defaultActiveKey=\"viewWorkers\" id=\"uncontrolled-tab-example\">\n <Tab eventKey=\"viewWorkers\" title=\"All Workers\" >\n <ViewWorkerList workers={this.state.workers} services={this.state.services} />\n </Tab>\n\n <Tab eventKey=\"viewServices\" title=\"All Services\" >\n <ViewServicesList services={this.state.services}/>\n </Tab>\n </Tabs>\n\n </div>\n )\n }", "function App() {\n return (\n <div>\n App\n </div>\n );\n}", "function App() {\n return (\n\n <div >\n\n <Header></Header>\n <AuctionPlayers></AuctionPlayers>\n\n </div>\n );\n}", "function App() {\n\treturn (\n\t\t<>\n\t\t\t<Router>\n\t\t\t\t<Switch>\n\t\t\t\t\t{/* user view */}\n\t\t\t\t\t<Route path=\"/\" exact>\n\t\t\t\t\t\t<Homepage />\n\t\t\t\t\t</Route>\n\t\t\t\t\t<Route path=\"/calendar\" exact>\n\t\t\t\t\t\t<NewCalendar />\n\t\t\t\t\t</Route>\n\t\t\t\t\t<Route path=\"/about-us\" exact>\n\t\t\t\t\t\t<AboutUs />\n\t\t\t\t\t</Route>\n\t\t\t\t\t<Route path=\"/blog\" exact>\n\t\t\t\t\t\t<Blog />\n\t\t\t\t\t</Route>\n\t\t\t\t\t<Route path=\"/portfolio\" exact>\n\t\t\t\t\t\t<Portfolio />\n\t\t\t\t\t</Route>\n\t\t\t\t\t<Route path=\"/join\" exact>\n\t\t\t\t\t\t<SignUp />\n\t\t\t\t\t</Route>\n\t\t\t\t\t<Route path=\"/login\" exact>\n\t\t\t\t\t\t<SignIn />\n\t\t\t\t\t</Route>\n\t\t\t\t\t<Route path=\"/myaccount\" exact>\n\t\t\t\t\t\t<Profile />\n\t\t\t\t\t</Route>\n\t\t\t\t\t<Route path=\"/contest/enter-a-contest/\" exact>\n\t\t\t\t\t\t<EnterContest />\n\t\t\t\t\t</Route>\n\t\t\t\t\t<Route path=\"/blog/readblog/\" exact>\n\t\t\t\t\t\t<ReadBlog />\n\t\t\t\t\t</Route>\n\t\t\t\t\t<Route\n\t\t\t\t\t\tpath=\"/Forgetpassword\"\n\t\t\t\t\t\tcomponent={ForgetPassword}\n\t\t\t\t\t\texact\n\t\t\t\t\t/>\n\t\t\t\t\t<Route\n\t\t\t\t\t\tpath=\"/Changepassword\"\n\t\t\t\t\t\tcomponent={ChangePassword}\n\t\t\t\t\t\texact\n\t\t\t\t\t/>\n\t\t\t\t\t{/* for Contest */}\n\t\t\t\t\t<Route path=\"/active-contest/\" component={Contest} exact />\n\t\t\t\t\t{/* For Admin Panel */}\n\t\t\t\t\t<Route path=\"/admin\" component={AdminLogin} exact />\n\t\t\t\t\t<Route\n\t\t\t\t\t\tpath=\"/admin/dashboard\"\n\t\t\t\t\t\tcomponent={Dashboard}\n\t\t\t\t\t\texact\n\t\t\t\t\t/>\n\t\t\t\t\t{/* <Route path=\"/test\" component={Table} exact /> */}\n\t\t\t\t\t<Route path=\"/admin/imglist\" component={ImageList} exact />\n\t\t\t\t\t<Route path=\"/payment\" component={Payment} exact />\n\t\t\t\t\t<Route path=\"/pricing\" component={Pricing} exact />\n\t\t\t\t\t<Route path=\"/winner\" component={WinnerPage} exact />\n\t\t\t\t\t<Route path=\"/test\" component={Demo} exact />\n\t\t\t\t\t<Route path=\"/reset\" component={ResetPass} exact />\n\t\t\t\t\t<Route component={Notfound} exact />\n\t\t\t\t</Switch>\n\t\t\t</Router>\n\t\t</>\n\t);\n}", "render(){\n return (\n <div className=\"App\">\n <Navbar>\n <Route path=\"/\" exact component={HomeContainer} />\n <Route exact path=\"/tools/new\" component={AddToolContainer} />\n <Route exact path=\"/tools\" component={SavedTools} />\n <HangForm />\n <HangBoardSession />\n </Navbar>\n </div>\n )\n }", "function App() {\n return (\n <div className=\"App\">\n <Tabs></Tabs>\n </div>\n );\n}", "function App() {\n return (\n <div>\n <Nav/>\n <Landing/>\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 App() {\n return(\n <div>\n <Navbar/>\n <Homepage/>\n <SignUp/>\n </div>\n );\n \n}", "function App() {\n return (\n <div>\n <Login />\n </div>\n );\n}", "componentDidMount() {\n if (this.props.auth.isAuthenticated) {\n this.props.history.push(\"/dashboard\");\n }\n }", "function renderDashboardView(context) {\n const viewAbsolutePath = path_1.default.join(__dirname, 'dashboard.handlebars');\n const renderView = handlebars_1.default.compile(fs_1.default.readFileSync(viewAbsolutePath, { encoding: 'utf8' }));\n return renderView(context);\n}", "function App(){\n return(\n<div>\n <GlobalSidebar/>\n</div>\n\n // <s.App>\n // <Sidebar/>\n // <MainView/>\n // </s.App>\n \n )\n}", "render() {\n\n return (\n <Routes/> \n )\n }", "function App() {\n return (\n\n <div className = {classes.app}>\n <Router>\n <Switch>\n <Route path = \"/\" exact component = {Home}/>\n <Route path = \"/contact\" exact component = {Contact}/>\n <Route path = \"/access/:type\" exact component = {CustomerAccess}/>\n <Route path = \"/account\" exact component = {Account}/>\n </Switch>\n </Router>\n </div>\n );\n}", "function App() {\n return(\n <div>\n <BrowserRouter>\n <Switch>\n <Route path=\"/articles\">\n <Articles/>\n </Route>\n <Route path=\"/signup\">\n <SignUp/>\n </Route>\n <Route path=\"/signin\">\n <SignIn />\n </Route>\n <Route path=\"/\">\n <Home/>\n </Route>\n </Switch> \n </BrowserRouter>\n </div>\n )\n}", "render() {\n console.log(`component WelcomeComponent da dc render`);\n return(\n <h1> Welcome you !</h1>\n )\n }", "function App() {\n return (\n <Router>\n <Route exact path=\"/\" component={Login} />\n <Route exact path=\"/register\" component={Register} />\n <Route exact path=\"/forgotpassword\" component={Forgotpassword} />\n <Route exact path=\"/adminlogin\" component={AdminLogin} />\n <Route exact path=\"/adminregister\" component={AdminRegister} />\n <Route exact path=\"/adminforgotpassword\" component={AdminForgotpassword} />\n {/* <Route exact path=\"/login\" component={LoginDemo} /> */}\n\n <Route exact path=\"/dashboard\" component={Dashboard} />\n <Route exact path=\"/settings\" component={Settings} />\n <Route exact path=\"/contacts\" component={Contacts} />\n <Route exact path=\"/userprofile\" component={UserProfile} />\n\n\n\n \n </Router>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n <Header/>\n <Chart/> \n </div>\n );\n}", "function App() {\n return (\n <div>\n <Header />\n <Routes/>\n <Footer />\n </div>\n )\n}", "function App() {\n\n return (\n <div className=\"App\">\n <Router>\n <Home path=\"/\"/>\n <Main path=\"/admin\"/>\n {/* <AdminHome path=\"/login/hi\"/> */}\n <BuyTicket path=\"/tickets/:id\"/>\n <BuyersList path=\"/admin/info\"/>\n <MoviesAdmin path=\"/admin/movies\"/>\n </Router>\n </div>\n );\n}", "function App() {\n //Write JavaScriopt here\n\n\n return (\n <div className=\"App\">\n <h1>Hello React </h1>\n <div className=\"home\">\n <Nav />\n <Tweets />\n </div>\n </div>\n );\n}", "function App() {\n return (\n <div className=\"App\">\n\n </div>\n );\n}", "render(){\n return <AppContainer />\n }", "componentDidMount() {\n if (this.props.auth.isAuthenticated) {\n this.props.history.push('/dashboard');\n }\n }", "componentDidMount() {\n if (this.props.auth.isAuthenticated) {\n this.props.history.push('/dashboard');\n }\n }", "function App() {\n return (\n <>\n <Router>\n <Header />\n <Switch>\n <PrivateRoute path=\"/dashboard\" component={Dashboard} />\n <PrivateRoute path=\"/add-activity\" component={ActivityForm} />\n <PrivateRoute\n path=\"/update-activity/:id\"\n component={UpdateActivityForm}\n />\n\n <Route path=\"/sign-up\" component={Signup} />\n <Route exact path=\"/\" component={Login} />\n </Switch>\n </Router>\n </>\n );\n}", "function App() {\n return (\n <Container>\n <NavBarComponent />\n\n <h1>hello</h1>\n </Container>\n );\n}", "function App() {\n return (\n <div>\n <Router routes={ROUTES} />\n </div>\n );\n}", "function App() {\n return (\n <Router>\n {/* <GlobalProvider> */}\n {/* <Header /> */}\n\n <div className=\"App\">\n <Switch>\n <Route exact path='/' component={land} />\n\n </Switch>\n </div>\n {/* </GlobalProvider> */}\n </Router>\n );\n}", "componentDidMount() {\n if(this.props.auth.isAuthenticated) {\n this.props.history.push('/dashboard');\n }\n }", "function App() {\n return <HelloDiv />;\n}", "function App() {\n return (\n <DndProvider backend={HTML5Backend}>\n <ThemeProvider theme={theme}>\n <Router>\n <Switch>\n <Route exact path=\"/\">\n <Board/>\n </Route>\n </Switch>\n </Router>\n <GlobalStyles/>\n </ThemeProvider>\n </DndProvider>\n );\n}" ]
[ "0.68579805", "0.6487618", "0.63905984", "0.63713104", "0.63658607", "0.6292143", "0.62123334", "0.6210654", "0.6181105", "0.61140823", "0.6110992", "0.6073694", "0.60248464", "0.59878796", "0.5964491", "0.59467715", "0.59441316", "0.5943454", "0.59359527", "0.5923643", "0.59118074", "0.58969676", "0.5886484", "0.58863735", "0.5874536", "0.5841865", "0.58127964", "0.57762706", "0.57751524", "0.57747686", "0.5772421", "0.5767607", "0.57562846", "0.5756153", "0.5753188", "0.5750664", "0.57470006", "0.57441896", "0.573901", "0.5737702", "0.573205", "0.57259405", "0.571992", "0.57176864", "0.57128465", "0.5707624", "0.5704631", "0.57005525", "0.56969184", "0.5687735", "0.56820554", "0.5668704", "0.5645539", "0.5645126", "0.5642746", "0.5641501", "0.5632466", "0.5618469", "0.56183493", "0.5609095", "0.5604925", "0.5602499", "0.56003344", "0.5599349", "0.55969226", "0.55957526", "0.55884755", "0.5585613", "0.5581926", "0.558171", "0.5580257", "0.55729806", "0.55668694", "0.5565126", "0.5562364", "0.5559603", "0.55543673", "0.5548349", "0.553362", "0.55269307", "0.552222", "0.5519057", "0.5516047", "0.55137163", "0.5513104", "0.55104136", "0.55095065", "0.5502453", "0.5500936", "0.5500926", "0.549868", "0.5498542", "0.54949045", "0.54949045", "0.5492049", "0.5488181", "0.5483373", "0.5480173", "0.5477309", "0.54733044", "0.54717493" ]
0.0
-1
Check which submission types have been marked as available, and disable required checkboxes as necessary.
function submissionTypeChanged() { checkAvailability(submissionTypes.file, submissionTypes.text); checkAvailability(submissionTypes.text, submissionTypes.file); if (submissionTypes.text.available.prop('checked') && submissionTypes.file.available.prop('checked')) { enableRequired(submissionTypes.text); enableRequired(submissionTypes.file); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function validateAllOptionsToAllowSubmit() {\r\n // if suitable array and criteria conditions align ...\r\n\r\n /*\r\n selectionIndexes: {\r\n ethnicities: [],\r\n ageBands: [],\r\n genders: [],\r\n nationalities: [],\r\n religions: [],\r\n health: [],\r\n qualifications: [],\r\n },\r\n */\r\n\r\n if (\r\n aleph.selectionIndexes.ethnicities &&\r\n aleph.selectionIndexes.ethnicities.length > 0 &&\r\n aleph.selectionIndexes.ageBands &&\r\n aleph.selectionIndexes.ageBands.length > 0 &&\r\n aleph.selectionIndexes.genders &&\r\n aleph.selectionIndexes.genders.length > 0 &&\r\n aleph.selectionIndexes.nationalities &&\r\n aleph.selectionIndexes.nationalities.length > 0 &&\r\n aleph.selectionIndexes.religions &&\r\n aleph.selectionIndexes.religions.length > 0 &&\r\n aleph.selectionIndexes.health &&\r\n aleph.selectionIndexes.health.length > 0 &&\r\n aleph.selectionIndexes.qualifications &&\r\n aleph.selectionIndexes.qualifications.length > 0\r\n ) {\r\n // enable reset and submit buttons\r\n document.getElementById(\"line-submit\").disabled = false;\r\n document.getElementById(\"line-clear\").disabled = false;\r\n } else {\r\n // disable reset and submit buttons\r\n document.getElementById(\"line-submit\").disabled = true;\r\n document.getElementById(\"line-clear\").disabled = true;\r\n }\r\n\r\n return;\r\n}", "function checkRequiredFields(){\n\tvar enable = true;\n\tjQuery(':input[required]').each(function(){\n\t\tvar s = jQuery(this).val();\n\t\tif(s == null || s.trim().length == 0){\n\t\t\treturn enable = false;\n\t\t}\n\t});\n\n\tif(typeof sforce != 'undefined'){\n\t\tSfdc.canvas.publisher.publish({name:'publisher.setValidForSubmit', payload: enable});\n\t} else {\n\t\tif(enable){\n\t\t\tjQuery('#submit').removeClass('ui-state-disabled');\n\t\t} else {\n\t\t\tjQuery('#submit').addClass('ui-state-disabled');\n\t\t}\n\t}\n}", "function checkSelectionSubmit() {\n for (var opt in survey[questionIndex]['answers']) {\n if($(\"#Select\"+opt).is(':checked')) {\n $('#submit').attr('disabled',false);\n return;\n }\n } \n $('#submit').attr('disabled',true);\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}", "function checkProductControls()\r\n {\r\n if ($claimType == 'Warranty')\r\n {\r\n productControls(false); // disable\r\n }\r\n else if ($claimType == 'Non-Warranty')\r\n {\r\n productControls(false); // disable\r\n }\r\n else if($claimStatus == 'Created')\r\n {\r\n productControls(true); // enable\r\n }\r\n else\r\n {\r\n productControls(false); // disable\r\n }\r\n }", "function requiredFields() {\n\tvar application_type = jQuery(\"input[name='application_type']:checked\").val();\n\tvar requiredAll = ['#degree-start', '#title','#surname','#firstname','#contact-number','#preferred-email','#nationality','#college','#degree','#subject','#term','#term-year','#acc-prefer-1','#acc-prefer-2','#tenancy-accept'];\n\tvar requiredJoint = ['#partner-title','#partner-lastname','#partner-firstname','#partner-relationship','#partner-nationality','#partner-preferred-email','#partner-contact-no','#partner-college','#partner-degree','#partner-subject','#partner-degree-start'];\n\tvar requiredFamily = ['#spouse-title','#spouse-firstname','#spouse-lastname','#spouse-relationship','#spouse-nationality'];\n\t\n\tjQuery('div.required').removeClass('required');\n\t\n\tjQuery(requiredAll).each(function(i,v) {\n\t\tjQuery(v).closest('div').addClass('required');\n\t});\n\t\n\tif (typeof application_type !== 'undefined' && application_type === 'Joint') {\n\t\tjQuery(requiredJoint).each(function(i,v){\n\t\t\tjQuery(v).closest('div').addClass('required');\n\t\t});\n\t}\n\telse if (typeof application_type !== 'undefined' && application_type === 'Couple/Family') {\n\t\tjQuery(requiredFamily).each(function(i,v){\n\t\t\tjQuery(v).closest('div').addClass('required');\n\t\t});\n\t}\n\t\n}", "function checkRepairAgentControls()\r\n {\r\n if ($claimType == 'Warranty' || $claimType == 'Non-Warranty')\r\n { \r\n if ($claimStatus != 'Created' && $claimStatus != 'RA Requested' && \r\n $('#claimdetails-repairagent-select').val() != null)\r\n {\r\n $('#claimdetails-repairagent-new-button').prop(\"disabled\", true);\r\n $('#claimdetails-repairagent-update-button').prop(\"disabled\", true);\r\n $('#claimdetails-repairagent-delete-button').prop(\"disabled\", true);\r\n $('#claimdetails-repairagent-select').prop(\"disabled\", true);\r\n\r\n // always disable repair agent inputs on page load\r\n disableRepairAgentInputs(true);\r\n }\r\n else\r\n {\r\n $('#claimdetails-repairagent-new-button').prop(\"disabled\", false);\r\n $('#claimdetails-repairagent-update-button').prop(\"disabled\", false);\r\n $('#claimdetails-repairagent-delete-button').prop(\"disabled\", false);\r\n $('#claimdetails-repairagent-select').prop(\"disabled\", false);\r\n\r\n // always disable repair agent inputs on page load\r\n disableRepairAgentInputs(true);\r\n }\r\n }\r\n }", "function checkboxRequiredhandler() {\n var $checkboxes = $(this).closest('.js-webform-type-checkboxes, .js-form-type-webform-checkboxes-other').find('input[type=\"checkbox\"]');\n if ($checkboxes.is(':checked')) {\n $checkboxes.removeAttr('required aria-required');\n }\n else {\n $checkboxes.attr({'required': 'required', 'aria-required': 'true'});\n }\n }", "function instanceAddCheckType() {\n var instanceType = $(instanceAddPage.typeFilter).val();\n var validInstanceTypes = $(instanceAddPage.typeSelect + ' option').map(function() { return $(this).val(); });\n\n if($.inArray(instanceType, validInstanceTypes) === -1) {\n instanceAddDisplayErrorMsg(\"Instance type must be valid.\");\n } else {\n instanceAddClearErrorMsg();\n instanceAddSubmitInstance();\n }\n }", "function ContinueComprehension()\n{\n\tvar q1 = $('input[name=q1]:checked').val();\n\tvar q2 = $('input[name=q2]:checked').val();\n\tvar q3 = $('input[name=q3]:checked').val();\n\tvar q4 = $('input[name=q4]:checked').val();\n\tvar q5 = $('input[name=q4]:checked').val();\n\n\tif (typeof q1 != 'undefined' & typeof q2 != 'undefined' &\n\t\ttypeof q3 != 'undefined' & typeof q4 != 'undefined' &\n\t\ttypeof q5 != 'undefined')\n\t{\n\t\tdocument.getElementById(\"comprehension\").disabled = false;\n\t}\n}", "function checkAll(nmType, elem)\n{\n\t\n\tif(elem.value == 1 || elem.value == 32 || elem.value == 64 || elem.value == 128 || elem.value == 512 || elem.value == 1024 )\n {\n\t\tnmType[0].checked = false; \n }\n else\n\t{\n\t for (var i = 1; i < nmType.length; i++)\n\t \tnmType[i].checked = false;\n\t}\n}", "function newJobPermissions(jobTypeSelect) {\n if(isQAExists())\n jobTypeSelect.children('[value=\"' + jobTypes['qa'] + '\"]').attr('disabled', true);\n if(isConformExists())\n jobTypeSelect.children('[value=\"' + jobTypes['conform'] + '\"]').attr('disabled', true);\n if(isTranscribeExists())\n $('#subProvided input').attr('disabled', true);\n else\n $('#subProvided input').attr('disabled', false);\n}", "function checkActiveRequirementOne() {\n var msg_group_content = $('.message_container_input .message_bot_area .fixedsidebar-content'),\n is_input_requiment = msg_group_content.find('input.btn_is_input_requiment')[0].checked,\n input_required_list = msg_group_content.find('.type_group .is_required');\n\n if(is_input_requiment != void 0 && is_input_requiment){\n input_required_list.hide();\n icheckAuto('uncheck', input_required_list);\n }else {\n input_required_list.show();\n }\n}", "function checkSelect(o) {\n var se = o || $(\"se_unit\");\n var val = se.options[se.selectedIndex].value;\n if (val == \"bid\" || val == \"ask\") {\n $(\"se_type\").disabled = true;\n $(\"se_type2\").disabled = true;\n $(\"se_type3\").disabled = true;\n $(\"set1\").disabled = true;\n $(\"set2\").disabled = true;\n } else {\n $(\"se_type\").disabled = false;\n //check type2\n var type2 = $(\"se_type2\");\n typeSelect(type2, \"type2\");\n type2.disabled = false;\n //check type3\n var type3 = $(\"se_type3\");\n typeSelect(type3, \"type3\");\n type3.disabled = false;\n }\n}", "function checkRequiredData() {\n var\n title_check = true,\n url_check = true,\n updating = $('#feed_title').length;\n\n // title is only checked when the feed it updated\n if ($('#feed_title').length) {\n title_check = ($('#feed_title').val() != '');\n } else {\n url_check = ($('#feed_url').val() != '');\n }\n\n if (!url_check || !$('#feed_lang').val() || !title_check) {\n $('#' + (updating ? 'edit_feed' : 'add_selected_feeds')).attr('disabled', 'disabled');\n } else {\n $('#' + (updating ? 'edit_feed' : 'add_selected_feeds')).removeAttr('disabled');\n }\n }", "function enabledisablesubmit() {\n if (firstnameinput.value && lastnameinput.value && ageinput.value) {\n if (parseInt(ageinput.value) >= 18 && licenseinput.value) {\n submit.disabled = false;\n } else if (parseInt(ageinput.value) < 18 && !licenseinput.value) {\n submit.disabled = false;\n } else {\n submit.disabled = true;\n }\n } else {\n submit.disabled = true;\n }\n}", "function checkFrameworks() {\n\tif (checkboxes[1].checked) {\n\t\tcheckboxes[3].disabled = true;\n\t\tcheckboxes[3].parentNode.style.color = 'grey';\n\t\tcheckboxes[3].parentElement.disabled = true;\n\t} else {\n\t\tcheckboxes[3].disabled = false;\n\t\tcheckboxes[3].parentNode.style = '';\n\t}\n}", "function optInRequired(optInReqClass, submitBtnClass, btnDisabledClass) {\n\n\t\tvar $optInReq = $('.' + optInReqClass),\n\t\t optInReqNum = $optInReq.length; // get how many are required opt-ins\n\n\t\t// check how many required opt-ins are 'checked'\n\t\tvar optInCheck = $optInReq.filter(function () {\n\t\t\treturn $(this).prop('checked');\n\t\t});\n\n\t\t// if all required opt-ins are checked, enable submit button\n\t\tvar $submitBtn = $('.' + submitBtnClass);\n\t\tif (optInCheck.length === optInReqNum) {\n\t\t\t$submitBtn.prop('disabled', false);\n\t\t\t$submitBtn.removeClass(btnDisabledClass);\n\t\t} else {\n\t\t\t$submitBtn.prop('disabled', true);\n\t\t\t$submitBtn.addClass(btnDisabledClass);\n\t\t}\n\t}", "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 check_for_missing_required_fields(the_form)\r\n{\r\n\tvar flag = true;\r\n\tvar i;\r\n\tvar input;\r\n\tvar field_type;\r\n\tvar field_name;\r\n\tvar field_id;\r\n\tvar field_title;\r\n\tvar the_message = \"You are required to enter/select/check data for the following fields :\\n\";\r\n\tvar index;\r\n\tvar num_missing_select = 0;\r\n\r\n\tvar radio_hashlist = new Array();\r\n\tvar num_uncheked_radio_buttons = 0;\r\n\tvar num_radios = 0;\r\n\r\n\tvar cbox_hashlist = new Array();\r\n\tvar num_unchecked_cbox = 0;\r\n\tvar num_cbox = 0;\r\n\r\n\tfor ( i = 0 ; i < num_required_fields ; ++i ) {\r\n\t\tfield_id = required_fields[i];\r\n\t\tinput = document.getElementById(field_id);\r\n\r\n\t\tfield_type = input.type.toLowerCase();\r\n\t\tfield_name = input.name;\r\n\t\tfield_title = input.title;\r\n\t\tif ( field_type == \"submit\" ) {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif ( field_type == \"select-one\" || field_type == \"select-multiple\" ) {\r\n\t\t\t// alert(\"Found a missing select\");\r\n\t\t\tindex = input.selectedIndex;\r\n\t\t\tif ( index <= 0 ) {\r\n\t\t\t\tnum_missing_select += 1;\r\n\t\t\t\t// alert(\"Nothing selected for list \" + field_title);\r\n\t\t\t\tthe_message += \"\\n\" + field_title;\r\n\t\t\t}\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif ( field_type == \"radio\" ) {\r\n\t\t\tnum_radios += 1;\r\n\t\t\tif ( ! (field_name in radio_hashlist) ) {\r\n\t\t\t\tradio_hashlist[field_name] = 0;\r\n\t\t\t}\r\n\t\t\tif ( input.checked == true ) {\r\n\t\t\t\tradio_hashlist[field_name] = 1;\r\n\t\t\t}\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif ( field_type == \"checkbox\" ) {\r\n\t\t\tnum_cbox += 1;\r\n\t\t\tif ( ! (field_name in cbox_hashlist) ) {\r\n\t\t\t\tcbox_hashlist[field_name] = 0;\r\n\t\t\t}\r\n\t\t\tif ( input.checked == true ) {\r\n\t\t\t\tcbox_hashlist[field_name] = 1;\r\n\t\t\t}\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\tif ( input.value == \"\" ) {\r\n\t\t\tflag = false;\r\n\t\t\t// alert(\"No value was specified for field \" + field_title + \" which is a \" + field_type);\r\n\t\t\tthe_message += \"\\n\" + field_title;\r\n\t\t}\r\n\t} // FOR loop over all ihnput fields\r\n\r\n\tif ( num_radios > 0 ) {\r\n\t\tfor ( var hashkey in radio_hashlist ) {\r\n\t\t\tif ( radio_hashlist[hashkey] == 0 ) {\r\n\t\t\t\t// alert(\"Nothing checked for radio button group '\" + hashkey + \"'\");\r\n\t\t\t\tthe_message += \"\\n\" + hashkey;\r\n\t\t\t\tnum_uncheked_radio_buttons += 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif ( num_cbox > 0 ) {\r\n\t\tfor ( var hashkey in cbox_hashlist ) {\r\n\t\t\tif ( cbox_hashlist[hashkey] == 0 ) {\r\n\t\t\t\t// alert(\"Nothing checked for checkbox button group '\" + hashkey + \"'\");\r\n\t\t\t\tthe_message += \"\\n\" + hashkey;\r\n\t\t\t\tnum_unchecked_cbox += 1;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tif ( flag && num_uncheked_radio_buttons == 0 && num_unchecked_cbox == 0 && num_missing_select == 0 ) {\r\n\t\t// alert(\"All fields are ok\");\r\n\t}\r\n\telse {\r\n\t\talert(the_message);\r\n\t}\r\n\treturn flag;\r\n} // end of check_for_missing_required_fields", "function checkForAllBarChartInputs(){\n if(barchartNameFilled && numBarGatesFilled && numBarReqsFilled){\n $('#barchart_save_chart_properties_btn').removeAttr('disabled');\n }\n else{\n $('#barchart_save_chart_properties_btn').attr('disabled', 'disabled');\n }\n}", "function checkDefinitionFields() {\n const requiredFields = Array.from(document.querySelectorAll(\".validate\"))\n const btn = document.querySelector(\".submit-btn\");\n const dropdown = document.querySelector(\"#game_name\")\n const gameOptions = Array.from(dropdown.childNodes)\n const validInputs = requiredFields.every(field => field.classList.contains(\"valid\"))\n \n if (validInputs && gameOptions[1].selected == false) {\n btn.classList.remove(\"disabled\");\n } else {\n btn.classList.add(\"disabled\");\n }\n}", "function onCheckboxClicked(e) {\n var checked = $(\".attendee.block input:checkbox\").is(':checked');\n if(checked)\n $(\"#attendee_actions .attendees input:submit, #attendee_actions .attendees select\").removeAttr(\"disabled\")\n else\n $(\"#attendee_actions .attendees\").find(\"select, input:submit\").attr(\"disabled\", \"disabled\");\n }", "function statesCheckboxesRequiredEventHandler() {\n var $element = $(this).closest('.js-webform-type-checkboxes, .js-webform-type-webform-checkboxes-other');\n checkboxesRequired($element);\n }", "function checkAllValid() {\n const requiredFields = Array.from(document.querySelectorAll(\".validate\"))\n const btn = document.querySelector(\".submit-btn\");\n const allValid = requiredFields.every(field => field.classList.contains(\"valid\"))\n \n if (allValid) {\n btn.classList.remove(\"disabled\");\n } else {\n btn.classList.add(\"disabled\");\n }\n}", "function checkRegisterForActivities() {\n\n const checkBoxes = $(\"input[type='checkbox']\");\n\n let isABoxChecked = false;\n\n $.each(checkBoxes, function (index, checkbox) {\n if(checkbox.checked) {\n\n isABoxChecked = true;\n\n } else {\n\n $(\"p#select-activity\").show().text(\"Must check one box before submitting\");\n }\n });\n\n if(isABoxChecked) {\n $(\"p#select-activity\").hide();\n return true;\n } else {\n\n return false;\n\n }\n\n\n}", "function checkForAllBarGateChartInputs(){\n if(gateBarTitleFilled && gateBarRemainingFilled && gateBarActualFilled && gateBarAvgDaysFilled){\n $('#barchart_next_gate_btn').removeAttr('disabled');\n }\n else{\n $('#barchart_next_gate_btn').attr('disabled', 'disabled');\n }\n}", "function checkSubmitButton() {\n if ($('#over18').val() && $('#privacy').val() && $('#name').val() && $('#email').val()) {\n $('#submit').removeAttr('disabled')\n } else {\n $('#submit').attr('disabled', 'disabled')\n }\n}", "function checkSubmit() {\n if ($('#here').attr(\"checked\") == \"checked\") {\n if(keywordStatus == true && getCurrentLoc == true) {\n $('#submit').attr(\"disabled\",false);\n } else {\n $('#submit').attr(\"disabled\",true);\n }\n } else {\n if(keywordStatus == true && getCurrentLoc == true && otherLocationStatus == true) {\n $('#submit').attr(\"disabled\",false);\n } else {\n $('#submit').attr(\"disabled\",true);\n }\n }\n}", "function sendRACheckBox()\r\n {\r\n if ($claimType == 'Non-Warranty')\r\n {\r\n $('#ra-checkbox').prop(\"disabled\", true);\r\n $('#ra-checkbox').attr('checked', false);\r\n }\r\n else if ($claimStatus != 'Created')\r\n {\r\n $('#ra-checkbox').prop(\"disabled\", true);\r\n $('#ra-checkbox').attr('checked', false);\r\n }\r\n else\r\n {\r\n $('#ra-checkbox').prop(\"disabled\", false);\r\n }\r\n }", "function sendRACheckBox()\r\n {\r\n if ($claimType == 'Non-Warranty')\r\n {\r\n $('#ra-checkbox').prop(\"disabled\", true);\r\n $('#ra-checkbox').attr('checked', false);\r\n }\r\n else if ($claimStatus != 'Created')\r\n {\r\n $('#ra-checkbox').prop(\"disabled\", true);\r\n $('#ra-checkbox').attr('checked', false);\r\n }\r\n else\r\n {\r\n $('#ra-checkbox').prop(\"disabled\", false);\r\n }\r\n }", "function validateRequireFields() {\n var page = 0;\n [\n 'proposal.attachments',\n 'proposal.gameDesignDocuments[EN]',\n 'proposal.gameDesignDocuments[JA]'\n ].forEach(angular.bind(this, function(key) {\n var found = pageFieldList[page].indexOf(key);\n if (found > -1) {\n pageFieldList[page].splice(found, 1);\n }\n\n if(conceptCommonServiceField.field(key).required()) {\n pageFieldList[page].push(key);\n }\n }));\n\n }", "function check_allowed() {\n var material = $(select_div+\" \"+\"#pd-material-type\").find(\"option[selected]\").attr(\"value\");\n var material_dict = get_material_dict(data, material);\n var allowed = material_dict.allowed;\n for(var i = 0; i < allowed.length; i++) {\n var good = true;\n var chem = allowed[i];\n for(var j = 0; j < elements_nums.length; j++) {\n if(chem[elements_nums[0]] != elements_nums[1]){\n good = false;\n break;\n }\n }\n if(good){\n return true\n }\n }\n return false\n }", "function OptionCheck() {\n $('.tree-form').submit(function(event) {\n /* Act on the event */\n event.preventDefault();\n if ($('input[type=checkbox]:checked').length > 0 === false) {\n $('.ActivityError').removeClass('is-hidden')\n } else if ($('input[type=checkbox]:checked').length > 0 === true) {\n $('.ActivityError').addClass('is-hidden')\n }\n });\n\n }", "function initCheckToResetPrdoucts()\n {\n if ( $('#productListingsHolder .view-empty').length > 0 ) {\n productCatSubmit();\n }\n }", "function checkForm(){\n //if all outcomes are true, this means all inputs have correct data\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){ //if all inputs filled correctly, allow user to send form\n btn.disabled = false; //enable submit btn\n }else{\n btn.disabled = true;\n }\n }", "function missingRequiredValues(){\n var missing = false;\n\tvar requireds = document.getElementsByClassName('required');\n\tfor (var i = 0; i < requireds.length; ++i) {\n\t var item = requireds[i]; \n\t if (requireds[i].value == 'unselected')\n\t \tmissing = true;\n\t}\n\n return missing;\n \n}", "function uncheckedAll()\n\t{\n\t \t var pollchecks = document.getElementsByTagName(\"INPUT\");\n\t\t var _return = false;\t \n\t\t for (var i = 0; i < pollchecks.length; i++)\n\t\t {\t\t\t\n\t\t\tif(pollchecks[i].type == \"checkbox\")\n\t\t\t{\n\t\t\t\t pollchecks[i].checked = false;\n\t\t\t\t\n\t\t\t}\n\t\t }\n\t\t \n\t}", "function equivSelectCheck() {\n var otherDrop = document.getElementById('outsideCourse').value;\n var uwoDrop = document.getElementById('uwoCourse').value;\n if (otherDrop != \"0\" && uwoDrop != \"0\") {\n document.getElementById('uwoCreateEquiv').disabled = false;\n }\n else {\n document.getElementById('uwoCreateEquiv').disabled = true;\n }\n}", "function notValid() {\n if (isValidName() && isValidEmail() && isValidTShirt() && isValidShops()) {\n return false;\n }\n if (jobSelector.value === 'other' && isValidTitle()) {\n return false;\n }\n if (paymentSelector.selectedIndex === 1 && isValidCC() && isValidZip() && isValidCVV()) {\n return false;\n }\n return true;\n}", "function checkSubmission() {\r\n //checks the array for any values in\r\n //the allErrors array\r\n //displays any error messages\r\n console.log(allErrors.length);\r\n if (allErrors.length > 0 && allErrors.length <= 3) {\r\n //iterates the allErrors array\r\n allErrors.forEach(element => {\r\n //sets the width of the wrapper element\r\n //to accomodate the message errors\r\n setWrapperAtts(\"1000px\");\r\n\r\n //tests to see which item will set the element\r\n if (element.type === \"e\") {\r\n $(\"#lblEmailError\").html(element.error);\r\n } else if (element.type === \"m\") {\r\n $(\"#lblPhoneError\").html(element.error);\r\n } else if (element.type === \"p\") {\r\n $(\"#lblPassError\").html(element.error);\r\n } else if (element.type === \"pc\") {\r\n $(\"#lblConPassError\").html(element.error);\r\n } else {\r\n //do nothing!\r\n console.log(\"is it a bug?\");\r\n }\r\n });\r\n } else {\r\n //send all values to the server! - serialise\r\n setWrapperAtts(\"620px\");\r\n\r\n //TODO = set a tick Icon next to the elements\r\n\r\n //diags\r\n console.log(`all values will be sent to the server`);\r\n }\r\n\r\n //removes the data from the array, for the next submission\r\n for (i = -1; i <= allErrors.length; i++) {\r\n //removes all the items in the array\r\n removeDataAllErrors();\r\n }\r\n //diags to display the array - should be 0 elements\r\n console.log(allErrors);\r\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 js_check_all(formobj)\n{\n\texclude = new Array();\n\texclude[0] = 'keepattachments';\n\texclude[1] = 'allbox';\n\texclude[2] = 'removeall';\n\tjs_toggle_all(formobj, 'checkbox', '', exclude, formobj.allbox.checked);\n}", "function evaluateCheckboxes() {\n var checked = $('#photoTable :checkbox:checked');\n deleteButton.attr('disabled', checked.size() === 0);\n }", "function jobTypeClick(jobTypeId) {\n // Video Language And Due Date must be checked\n if($('.videoLang select').val() == '' || $('.videoLength input').val() == '') { \n showMessage('Please choose Video Language and Video Length before continue');\n shouldDisabled = new Array(jobTypes['qa'], jobTypes['conform'], jobTypes['translate'], jobTypes['transcribe']);\n subtitleProvided($(\"#\" + jobTypeId), shouldDisabled);\n } else {\n // when subtitle is provided\n if(isSbtlProvided())\n subtitleProvided($(\"#\" + jobTypeId), [jobTypes['transcribe']]);\n // when subtitle is not provided and transcribe job exists\n else if(!isSbtlProvided() && isTranscribeExists())\n subtitleProvided($(\"#\" + jobTypeId), [jobTypes['transcribe']]);\n // when subtitle is not provided and no jobs are exists, must be show only transcribe\n else\n subtitleProvided($(\"#\" + jobTypeId), [jobTypes['qa'], jobTypes['conform'], jobTypes['translate']]);\n\n /**\n * This method is allowing or disallowing add Conform, QC(allow if not yet),\n * Also allowing provide subtitle if transcribe job is not exists\n */\n newJobPermissions($(\"#\" + jobTypeId));\n }\n}", "function checkDisabled() {\r\n\tif (lineups[0].length == lineup_size && lineups[1].length == lineup_size && pitchers[0] !== 0 && pitchers[1] !== 0) {\r\n\t\t$(\"#finalize\").removeAttr(\"disabled\");\r\n\t} else {\r\n\t\t$(\"#finalize\").attr(\"disabled\", \"disabled\");\r\n\t}\r\n}", "function validateMaptypes() {\n var maptypes = $('input[name^=\"maptype\"]');\n var help_block = $('#help-block');\n var id = 'maptypes';\n if (maptypes.filter(':checked').length == 0) {\n maptypes.closest('.form-group').validationState('has-error');\n help_block.textState('text-danger').text('No map types selected').attr('data-source', id);;\n } else {\n maptypes.closest('.form-group').validationState();\n if (help_block.attr('data-source') == id) {\n help_block.text('');\n }\n }\n}", "function checkProductInputVals() {\n var fields = [\n 'cat-make',\n 'cat-model',\n 'cat-drivetype',\n 'cat-category'\n ];\n\n for (var indx = 0; indx < fields.length; indx++) {\n if( $('#' + fields[indx]).val() ) {\n $('#' + fields[indx]).prop('disabled', false);\n $('#' + fields[indx]).parent('.products-filter__select').removeClass('select--disabled');\n }\n }\n }", "function enableOrDisableSubmitButton() {\n\n if (isNameValid &&\n isEmailValid &&\n isPasswordValid &&\n isPasswordMathced) {\n\n if (isStudentSignup) {\n if (isBatchSelected &&\n isProgramSelected &&\n isNumberValid) {\n\n buttonSubmit.prop('disabled', false);\n }\n } else {\n buttonSubmit.prop('disabled', false);\n }\n\n } else {\n buttonSubmit.prop('disabled', true);\n }\n\n }", "function amc_submit_check()\n{\n reset_fields();\n var checking_status = true;\n date_check($(\"customer_contract_date\")) ? \"\" : checking_status = false;\n elementObject = $(\"customer_amc_type\");\n if(elementObject.selectedIndex == 0)\n {\n elementObject.setAttribute(\"class\", \"error_fields\");\n checking_status = false;\n }\n check_name(\"customer_name\") ? \"\" : checking_status = false;\n check_address() ? \"\" : checking_status = false;\n (!contact_numbers(\"customer_mobile_number\") || !contact_numbers(\"customer_phone_number\")) ? checking_status = false : \"\";\n check_paid_amount(\"customer_contract_amount\") ? \"\" : checking_status = false;\n check_name(\"customer_model_name\") ? \"\" : checking_status = false;\n checking_status ? \"\" : error_message();\n return checking_status;\n}", "function checkForm(){\n if(name_outcome && email_outcome && tel_outcome && msg_outcome){\n btn.disabled = false; //enable submit btn if form filled correctly\n }else{\n btn.disabled = true;\n }\n }", "function activateAllowDenyFlag(val,formObj,disabledFlag) {\r\n for (i = 0; i < formObj[val].length; i++) {\r\n if (formObj[val][i].type == \"radio\") { //skip the checkbox with matching id\r\n formObj[val][i].disabled = disabledFlag;\r\n }\r\n }\r\n}", "function disableAllGrades() {\n // Unselect button & hide content for all grades\n // Grade 1\n btnGradeOne.classList = \"\";\n // console.log(formImageSettings_G1.children)\n for (let item of formImageSettings_G1.children) {\n item.style.display = 'none';\n };\n formImageSettings_G1.classList.add('d-none');\n formQuestionsContainer_G1.classList.add('d-none');\n // Grade 2\n btnGradeTwo.classList = \"\";\n for (let item of formImageSettings_G2.children) {\n item.style.display = 'none';\n };\n formQuestionsContainer_G2.classList.add('d-none');\n // Grade 3\n btnGradeThree.classList = \"\"; \n for (let item of formImageSettings_G3.children) {\n item.style.display = 'none';\n }; \n formQuestionsContainer_G3.classList.add('d-none');\n // Grade 4\n btnGradeFour.classList = \"\";\n for (let item of formImageSettings_G4.children) {\n item.style.display = 'none';\n }; \n formQuestionsContainer_G4.classList.add('d-none');\n\n}", "function submitApptRequest() {\r\n\t\r\n\tvar $aptfirstname = $(\"#aptfirstname\");\r\n\tvar $aptlastname = $(\"#aptlastname\");\r\n\tvar $aptaddress = $(\"#aptaddress\");\r\n\tvar $aptcity = $(\"#aptcity\");\r\n\tvar $aptstate = $(\"#aptstate\");\r\n\tvar $aptzip = $(\"#aptzip\");\r\n\tvar $aptphonenumber = $(\"#aptphonenumber\");\r\n\tvar $aptpetname = $(\"#aptpetname\");\r\n\tvar $aptpettype = $(\"#aptpettype\");\r\n\tvar $aptbreed = $(\"#aptbreed\");\r\n\r\n\r\n\tvar $aptemail = $(\"#aptemail\"); // ------ this is optional \r\n\tvar $aptpetage = $(\"#aptpetage\"); // ------ this is optional \r\n\tvar $aptneutered = $(\"#aptneutered\").is(':checked'); // ------ this is optional \r\n\t\r\n\tfunction submitValidate(element) {\r\n\t\t$(element).parent().addClass(\"has-error\");\r\n\t\t$(element).next(\"span\").addClass(\"glyphicon-remove\");\r\n\t\t$(element).next(\"span\").next().html(\"Required information.\")\r\n\t};\r\n\r\n\r\n\tif (!$aptfirstname.val() || !$aptlastname.val() || !$aptaddress.val() || !$aptcity.val() || $aptstate.val() == \"select\" || !$aptzip.val() || !$aptphonenumber.val() || !$aptpetname.val() || $aptpettype.val() == \"select\" || ($aptpettype.val() == \"Dog\" && $aptbreed.val() == \"select\")) {\r\n\r\n\t\t$(\"#newrequestbutton\").disabled = true;\r\n\r\n\t\tif (!$aptfirstname.val()) {\r\n\t\t\tsubmitValidate($aptfirstname);\r\n\t\t};\r\n\r\n\t\tif (!$aptlastname.val()) {\r\n\t\t\tsubmitValidate($aptlastname);\r\n\t\t};\r\n\r\n\t\tif (!$aptaddress.val()) {\r\n\t\t\tsubmitValidate($aptaddress);\r\n\t\t};\r\n\r\n\t\tif (!$aptcity.val()) {\r\n\t\t\tsubmitValidate($aptcity);\r\n\t\t};\r\n\t\r\n\t\tif ($aptstate.val() == \"select\") {\r\n\t\t\tsubmitValidate($aptstate);\t\r\n\t\t};\r\n\t\t\r\n\t\tif (!$aptzip.val()) {\r\n\t\t\tsubmitValidate($aptzip);\r\n\t\t};\r\n\r\n\t\tif (!$aptphonenumber.val()) {\r\n\t\t\tsubmitValidate($aptphonenumber);\r\n\t\t};\r\n\r\n\t\tif (!$aptpetname.val()) {\r\n\t\t\tsubmitValidate($aptpetname);\r\n\t\t};\r\n\r\n\t\tif ($aptpettype.val() == \"select\") {\r\n\t\t\tsubmitValidate($aptpettype);\r\n\t\t};\r\n\r\n\t\tif ($aptpettype.val() == \"Dog\" && $aptbreed.val() == \"select\") {\r\n\t\t\tsubmitValidate($aptbreed);\r\n\t\t}\r\n\r\n\t} else { \r\n\t\tsendRequest();\r\n\t};\r\n}", "function checkFormValues() {\n if (signupFormItems.acceptTerms.checked) {\n for (let i = 0; i < signupFormItems.all.length; i++) {\n if (signupFormItems.all[i].value) {\n signupFormItems.signupBtn.removeAttribute(\"disabled\");\n signupFormItems.signupBtnContainer.classList.remove(\"not-allowed-mouse\");\n } else {\n signupFormItems.signupBtn.setAttribute(\"disabled\", \"disabled\");\n signupFormItems.signupBtnContainer.classList.add(\"not-allowed-mouse\");\n }\n }\n } else {\n signupFormItems.signupBtn.setAttribute(\"disabled\", \"disabled\");\n signupFormItems.signupBtnContainer.classList.add(\"not-allowed-mouse\");\n }\n}", "checkReadyForSubmit(){\n if(this.checkAnswersReady() && this.checkAddressReady() && this.checkMembership()){\n return true;\n }\n else{\n return false;\n }\n }", "function checkFields(){\n if (!first_name || !last_name || !email){\n setDisableButton('disable_btn');\n }else{\n setDisableButton('');\n }\n }", "function checkTemplateItems() {\n if ($('#newTemplateItems .nt-item.is-selected').length > 0 && $('#templateNameField').val() !== '') {\n $('#saveTemplate').removeClass('disabled').prop('disabled', false);\n } else {\n $('#saveTemplate').addClass('disabled').prop('disabled', true);\n }\n}", "function unCheckAllDepartmentBoxes() {\n $(\"#legend input[type='checkbox']\").removeAttr(\"checked\");\n hideAllCoursesAndLinks();\n}", "function forbiden(){\n\tdocument.getElementById(\"sub\").disabled = true;\n\tdocument.getElementById(\"A_choice\").disabled = true;\n\tdocument.getElementById(\"B_choice\").disabled = true;\n\tdocument.getElementById(\"C_choice\").disabled = true;\n\tdocument.getElementById(\"D_choice\").disabled = true;\n}", "function toggleRequiredClass() {\n var loadType = $('.IA-C-2.IA-C-3:checked').val();\n if (isPartial(loadType)) {\n $('.field-loadcar-model, .field-loadcar-quantity').addClass('required');\n } else {\n $('.field-loadcar-model, .field-loadcar-quantity').removeClass('required');\n }\n}", "function addListenersToCheckboxes() {\n\n let cb = document.querySelectorAll(\"input[type='checkbox']\"); \n cb.forEach(element => {\n element.addEventListener('click', event => {\n markAsCompleteIncomplete(event);\n });\n });\n}", "function processSubmit(e) {\n if (typeof (docLoaded) != \"undefined\") {\n if (!docLoaded) {\n alert(\"This page has not loaded completed. Please wait for the page to load before submitting the form. If the page has loaded, there may have been an error. Please refresh the page.\");\n return false;\n }\n }\n var x = document.getElementsByTagName(\"input\");\n for (var i = 0; i < x.length; i++) {\n if ((x[i].type == \"submit\") && (x[i] != e)) {\n x[i].disabled = true;\n }\n }\n}", "function tick(){\n if($(\"#ticky\").prop(\"checked\")){\n $(\"#submit\").prop(\"disabled\", false);\n } else {\n $(\"#submit\").prop(\"disabled\", true);\n }\n}", "function validateInputs() {\n\n let isValid = true;\n\n if (workoutType === \"resistance\") {\n if (nameInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (weightInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (setsInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (repsInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (resistanceDurationInput.value.trim() === \"\") {\n isValid = false;\n }\n } else if (workoutType === \"cardio\") {\n if (cardioNameInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (durationInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (distanceInput.value.trim() === \"\") {\n isValid = false;\n }\n }\n\n if (isValid) {\n completeButton.removeAttribute(\"disabled\");\n addButton.removeAttribute(\"disabled\");\n } else {\n completeButton.setAttribute(\"disabled\", true);\n addButton.setAttribute(\"disabled\", true);\n }\n }", "function setEnabledBT(){\r\n $('#age').removeAttr('readonly');\r\n $('#syEntered').removeAttr('readonly');\r\n $('#yrLevel').removeAttr('readonly');\r\n $('#genAverage').removeAttr('readonly');\r\n $('#btn-sub-fees').removeAttr('readonly');\r\n $('#btn-fee-full-back').removeAttr('disabled');\r\n $('#btn-fee-full-next').removeAttr('disabled');\r\n $('#btn-fee-MS-back').removeAttr('disabled');\r\n $('#btn-fee-MS-next').removeAttr('disabled');\r\n}", "function checkFieldsOfBoardManager() {\n if($(\"#input-board-size-tile:invalid, #input-board-nb-tiles:invalid\").length === 0) {\n if($(__RESET_BUTTON__).attr(\"disabled\"))\n $(__RESET_BUTTON__).attr(\"disabled\", false);\n } else {\n if(!$(__RESET_BUTTON__).attr(\"disabled\"))\n $(__RESET_BUTTON__).attr(\"disabled\", true);\n }\n if($(\"#input-board-time-between-generations:invalid\").length === 0) {\n if(nbTiles !== 0 && $(__RUN_BUTTON__).attr(\"disabled\"))\n $(__RUN_BUTTON__).attr(\"disabled\", false);\n } else {\n if(!$(__RUN_BUTTON__).attr(\"disabled\"))\n $(__RUN_BUTTON__).attr(\"disabled\", true);\n }\n}", "function disableInputs() {\n Array.from(emailForm.children).forEach((item) => {\n if (item.tagName === \"INPUT\" || item.tagName === \"TEXTAREA\") {\n item.disabled = true;\n\n if (item.type !== \"submit\") {\n item.style.transition = \"color 1.5s\";\n item.style.color = \"#5e5e5e\";\n }\n }\n });\n }", "function adjPresAffPlainCheckError() {\n let optionsGroup = document.getElementById(\"adjective-type-group\");\n let errorElement = optionsGroup.getElementsByClassName(\"must-choose-one-text\")[0];\n\n let selected = checkInputsForError(inputsToSelectAdjPresAffPlain, true);\n let unselected = checkInputsForError(inputsToDeselectAdjPresAffPlain, false);\n\n let iAdjInput = document.querySelectorAll('input[name=\"adjectivei\"]')[0];\n let irrAdjInput = document.querySelectorAll('input[name=\"adjectiveirregular\"]')[0];\n let naAdjInput = document.querySelectorAll('input[name=\"adjectivena\"]')[0];\n if (selected && unselected && !naAdjInput.checked && (iAdjInput.checked || irrAdjInput.checked)) {\n toggleError(errorElement, \"*Invalid combination: い/irregular, present, affirmative, plain\", true);\n // element could be hidden because verb is unchecked, so check to enable back button\n checkToEnableBackButton();\n } else if (document.querySelectorAll('input[name=\"adjective\"]')[0].checked){\n optionsGroupCheckError(optionsGroup);\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 checkValidity() {\n if (invalidWidgetIds.length > 0) {\n msgService.showInfoRight(localization.getString('emailbuilder.error.unfilledrequiredproperties'));\n } else {\n msgService.hideInfoRight();\n }\n }", "function maybe_enable_aggregate_create() {\n $(\"#add_class_modal input[type='submit']\")\n .prop('disabled',\n ($(\"#aggregate-by-checkbox\").is(':checked')\n ? $(\"#constituent-subgroups input[type='checkbox']:checked\").length\n : $(\"#constituent-classes input[type='checkbox']:checked\").length)\n < 2);\n}", "function checkActivityStatusForCPR()\n\t\t{\n\t\t\tvar collectionProtocolRegistrationVal = parseInt(document.forms[0].collectionProtocolRegistrationValueCounter.value);\n\t\t\tvar isAllActive = true;\n\t\t\tfor(i = 1 ; i <= collectionProtocolRegistrationVal ; i++)\n\t\t\t{\n\t\t\t\tvar name = \"collectionProtocolRegistrationValue(ClinicalStudyRegistration:\" + i +\"_activityStatus)\";\n\t\t\t\tif((document.getElementById(name) != undefined) && document.getElementById(name).value==\"Disabled\")\n\t\t\t\t{\n\t\t\t\t\tisAllActive = false;\n\t\t\t\t\tvar go = confirm(\"Disabling any data will disable ALL its associated data also. Once disabled you will not be able to recover any of the data back from the system. Please refer to the user manual for more details. \\n Do you really want to disable?\");\n\t\t\t\t\tif (go==true)\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.forms[0].submit();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\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\tif (isAllActive==true)\n\t\t\t{\n\t\t\t\tdocument.forms[0].submit();\n\t\t\t}\n\t\t}", "function enableInputs() {\n Array.from(emailForm.children).forEach((item) => {\n if (item.tagName === \"INPUT\" || item.tagName === \"TEXTAREA\") {\n item.disabled = false;\n\n if (item.type !== \"submit\") {\n item.style.transition = \"color 1.5s\";\n item.style.color = \"#fff\";\n }\n }\n });\n }", "function specialAccommodations() {\n if ($(\"#special_accommodations_toggle_on\").is(\":checked\") || $(\"#special_accommodations_toggle_off\").is(\":checked\")) {\n if($('#special_accomodations_text').val().trim().length > 0) {\n $('#checkbox2').show(\"slide\", { direction: \"up\" }, 500);\n $('#step_3').prop('disabled', false);\n $('#step_3').removeClass('bg-disable');\n $('#bg-legend_3').removeClass('bg-legend');\n $('#step_3').css(\"background\",\"rgb(237,203,180)\");\n $(\"#rock\").addClass('clickable');\n }\n }\n}", "function check_additionals(form_elem){\n const additionals = form_elem.querySelectorAll('input[name=\"additionals\"]');\n var chooses = form_elem.querySelectorAll('input[name=\"additionals\"]:checked');\n let product = form_elem['product'].value;\n let max_add = parseInt(getData('products')[product]['additionals']['max'], 10);\n \n if (max_add > 0) {\n if (chooses.length >= max_add) {\n for (let i=0; i < additionals.length; i++){\n if (!additionals[i].checked) {\n additionals[i].disabled = true;\n }\n }\n } else {\n for (let i=0; i < additionals.length; i++){\n additionals[i].disabled = false;\n }\n }\n }\n \n return chooses.length;\n}", "function submit_disabled(request) {\r\n var element = document.getElementsByTagName(\"input\");\r\n for (var i = 0; i < element.length; i++) {\r\n // if (element[i].type === 'button') {\r\n element[i].disabled = request;\r\n // }\r\n }\r\n var element = document.getElementsByTagName(\"button\");\r\n for (var i = 0; i < element.length; i++) {\r\n // if (element[i].type === 'button') {\r\n element[i].disabled = request;\r\n // }\r\n }\r\n}", "function onlySubmit(){\r\n disableButtons() // make sure you can only press the save button once\r\n document.getElementById('evaluationForm').submit();\r\n }", "function hasDefault(){\n // for type\n const typeInputs = document.querySelectorAll(\"input[name='type']\");\n let checkedType = false;\n\n for (let i=0; i<=typeInputs.length-1; i++){\n if(typeInputs[i].checked){\n checkedType = true;\n break;\n }\n }\n if (!checkedType){\n typeInputs[0].checked = true;\n }\n\n // for location\n const locationInputs = document.querySelectorAll(\"input[name='location']\");\n let checkedlocation = false;\n\n for (let i=0; i<=locationInputs.length-1; i++){\n if(locationInputs[i].checked){\n checkedlocation = true;\n break;\n }\n }\n if (!checkedlocation){\n locationInputs[0].checked = true;\n }\n }", "function removeButtonDisabled() {\n return (vm.annotType.options.length <= 1);\n }", "function check_types() {\n\tif(dofilter==false)\n\t\treturn true;\n\twith(document.forms[0])\n\t{\n\t\t/*\n\t\t * with who uses with?\n\t\t * i do, i am an ancient. ok?\n\t\t */\n\t\t\n\t\tfor(i=0 ; i < elements.length ; i++)\n\t\t{\n\t\t\tif(elements[i].value.match(re))\n\t\t\t{\n\t\t\t\talert('Sorry ' + elements[i].value + ' is not allowed');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "function checkDietaryPreference() {\n const allergyChecked = document.getElementById(\"allergy\").checked;\n const veganChecked = document.getElementById(\"vegan\").checked;\n\n document.getElementById(\"nutty\").disabled = allergyChecked || veganChecked;\n document.querySelector(\"label[for=nutty]\").className = (allergyChecked || veganChecked) ? \"strikethrough\" : \"\";\n\n document.getElementById(\"dark\").disabled = veganChecked;\n document.querySelector(\"label[for=dark]\").className = veganChecked ? \"strikethrough\" : \"\";\n\n document.getElementById(\"mint\").disabled = veganChecked;\n document.querySelector(\"label[for=mint]\").className = veganChecked ? \"strikethrough\" : \"\";\n\n document.getElementById(\"mexican\").disabled = veganChecked;\n document.querySelector(\"label[for=mexican]\").className = veganChecked ? \"strikethrough\" : \"\";\n\n document.getElementById(\"whip\").disabled = veganChecked;\n document.querySelector(\"label[for=whip]\").className = veganChecked ? \"strikethrough\" : \"\";\n\n const milk = document.getElementById(\"milk\").value;\n if(veganChecked && (milk === \"whole\" || milk === \"two\")) {\n document.getElementById(\"milk\").value = \"none\";\n }\n\n document.getElementById(\"whole\").disabled = veganChecked;\n document.getElementById(\"two\").disabled = veganChecked;\n}", "function disableMultiTraining() {\n var opt = document.getElementById('trainingTypeOption'+TRAININGTYPE.MULTI);\n opt.disabled = true;\n opt.selected=0;\n\n // remove the attribute options from the dropdowns but re-add the 'None' options\n multiTrainSelect2.innerHTML='';\n\taddElement('option', null, multiTrainSelect2, {value: null, innerHTML: 'None'});\n multiTrainSelect2.selectedIndex=0;\n\n multiTrainSelect3.innerHTML='';\n\taddElement('option', null, multiTrainSelect3, {value: null, innerHTML: 'None'});\n multiTrainSelect3.selectedIndex=0;\n\n multiTrainSelect4.innerHTML='';\n\taddElement('option', null, multiTrainSelect4, {value: null, innerHTML: 'None'});\n multiTrainSelect4.selectedIndex=0;\n\n // if any of the multi trains were selected, the first multi train dropdown might still have some options disabled\n //TODO enable them here\n for (var i=0; i<multiTrainSelect1.options.length; i++) {\n multiTrainSelect1.options[i].disabled = false;\n }\n\n trainingTypeChanged(0);\n}", "function checkAtLeastOneCurrentGradeSelected(){\r\n\tvar isDisable = !document.getElementById(\"currentBlock\").checked;\r\n\tif(isDisable){\r\n\t\treturn true;\r\n\t}\r\n\tvar form = document.getElementById(\"scoreSearchForm\");\r\n\tif(!(form.currentGradeNum[0].checked \r\n\t\t\t|| form.currentGradeNum[1].checked\r\n\t\t\t|| form.currentGradeNum[2].checked\r\n\t\t\t|| form.currentGradeNum[3].checked\r\n\t\t\t|| form.currentGradeNum[4].checked\r\n\t\t\t|| form.currentGradeNum[5].checked\r\n\t\t\t|| form.currentGradeNum[6].checked\r\n\t\t\t|| form.currentGradeNum[7].checked\r\n\t\t\t|| form.currentGradeNum[8].checked\r\n\t\t\t|| form.currentGradeNum[9].checked\r\n\t\t\t|| form.currentGradeNum[10].checked)){\r\n\t\tif($(\"#selectCurrentGrade\").val()==\"\"){\r\n\t\t\t$(\"#selectCurrentGrade\").val(SELECT_GRADE);\r\n\t\t}\r\n\t\treturn false;\r\n\t}else {\r\n\t\t$(\"#selectCurrentGrade\").val(\"\"); \r\n\t\treturn true;\r\n\t}\r\n}", "function checkAndDisable() {\n if (document.getElementById('firstProject').checked === true) {\n document.getElementById('firstProjectHidden').disabled = true;\n }\n if (document.getElementById('secondProject').checked === true) {\n document.getElementById('secondProjectHidden').disabled = true;\n }\n if (document.getElementById('latestWork').checked === true) {\n document.getElementById('latestWorkHidden').disabled = true;\n }\n if (document.getElementById('webDesign').checked === true) {\n document.getElementById('webDesignHidden').disabled = true;\n }\n if (document.getElementById('webflow').checked === true) {\n document.getElementById('webflowHidden').disabled = true;\n }\n if (document.getElementById('concept').checked === true) {\n document.getElementById('conceptHidden').disabled = true;\n }\n if (document.getElementById('appDesign').checked === true) {\n document.getElementById('appDesignHidden').disabled = true;\n }\n if (document.getElementById('hackathon').checked === true) {\n document.getElementById('hackathonHidden').disabled = true;\n }\n if (document.getElementById('hideProject').checked === true) {\n document.getElementById('hideProjectHidden').disabled = true;\n };\n}", "function chooseActivities(){\n tuesNineToTwelve.find(':first-child').attr('class','tues-nine-twelve');\n tuesOneToFour.find(':first-child').attr('class','tues-one-four');\n activitiesCheckboxes.prop('checked', status).change(function(){\n if (($(this).prop('checked') === true)) {\n totalCost += 100; \n $('#total').html(`<h2>Your Total Cost: $${totalCost}.00</h2>`);\n };\n if (($(this).prop('checked') === true) \n && ($(this).prop('name') === 'all')) {\n totalCost += 100; \n $('#total').html(`<h2>Your Total Cost: $${totalCost}.00</h2>`);\n };\n if (($(this).prop('checked') === false)) {\n totalCost -= 100; \n $('#total').html(`<h2>Your Total Cost: $${totalCost}.00</h2>`);\n };\n if (($(this).prop('checked') === false) \n && ($(this).prop('name') === 'all')) {\n totalCost -= 100; \n $('#total').html(`<h2>Your Total Cost: $${totalCost}.00</h2>`);\n };\n if (($(this).prop('checked') === true) \n && ($(this).prop('class') === 'tues-nine-twelve')){\n $('.tues-nine-twelve').prop('disabled', true);\n $(this).prop('disabled', false);\n };\n if (($(this).prop('checked') === false) \n && ($(this).prop('class') === 'tues-nine-twelve')){\n $('.tues-nine-twelve').prop('disabled', false);\n $(this).prop('disabled', false);\n };\n if (($(this).prop('checked') === true) \n && ($(this).prop('class') === 'tues-one-four')){\n $('.tues-one-four').prop('disabled', true);\n $(this).prop('disabled', false);\n };\n if (($(this).prop('checked') === false) \n && ($(this).prop('class') === 'tues-one-four')){\n $('.tues-one-four').prop('disabled', false);\n $(this).prop('disabled', false);\n };\n })\n}", "function checkTimeCheckboxes(checkbox) {\n // Maximum number of bookings per user\n const limit = 3;\n const userLimit = limit - curAcc.booked.length;\n var currentChecked = 0;\n const allTimeCheckbox = document.getElementsByName(\"timings\");\n \n for (let i = 0; i < allTimeCheckbox.length; i++) {\n const timeCheckbox = allTimeCheckbox[i];\n // Confirm check time\n if (timeCheckbox.checked && !timeCheckbox.disabled) {\n currentChecked++;\n document.getElementById(\"timeError\").innerHTML = \"\";\n document.getElementById(\"bookBtn\").disabled = false;\n }\n }\n \n // If checks over user limit\n if (currentChecked > userLimit) {\n document.getElementById(\"timeError\").innerHTML = \"You have reached the maximum bookings allowed.\";\n checkbox.checked = false;\n currentChecked--;\n }\n else {\n document.getElementById(\"timeError\").innerHTML = \"\";\n }\n updatePrices();\n}", "function validateAvailability() {\n if (!volunteerRegObject.availability.mon && !volunteerRegObject.availability.tue && !volunteerRegObject.availability.wed && !volunteerRegObject.availability.thu && !volunteerRegObject.availability.fri && !volunteerRegObject.availability.sat && !volunteerRegObject.availability.sun) {\n kony.ui.Alert({\n \"alertType\": constants.ALERT_TYPE_ERROR,\n \"alertTitle\": \"Action Required\",\n \"yesLabel\": \"OK\",\n \"message\": \"At least one day of the week must be selected.\",\n \"alertHandler\": null\n }, {\n \"iconPosition\": constants.ALERT_ICON_POSITION_LEFT\n });\n return false;\n }\n return true;\n}", "function enableDisableFields($)\n{\n let url = window.location.origin + '/cabinet/social-queue/create-get-fields';\n let csrf = $('meta[name=csrf-token]').attr(\"content\");\n let type_id = $('#socialqueueform-type_id').val();\n $.ajax({\n url: url,\n type: 'POST',\n data: {\n type_id: type_id,\n _csrf : csrf\n },\n success: function (data) {\n if (data.code == 200) {\n let inputs = data.inputs;\n price = data.price;\n disableHideFields();\n $.each(inputs,\n function (item, index) {\n $('#div_' + index).css('display', 'block');\n });\n $('.required-label').css('display', 'block');\n $('.required-fields').css('display', 'block');\n $('.non-required-fields').css('display', 'block');\n $('.non-required-label').css('display', 'block');\n if (inputs.length === 1) {\n $('.non-required-fields').css('display', 'none');\n $('.non-required-label').css('display', 'none');\n } else {\n\n }\n $('#div_balance').css('display', 'block');\n\n is_answer = inputs.includes('answer');\n $('#div_price').css('display', 'block');\n calculatePrice($);\n }\n }\n });\n}", "function prepareInitialCheckboxes() {\n\tfor (var i = 1; i <= $v(\"totalLines\");) {\n\t\tif (cellValue(i, \"application\") == 'All') {\n\t\t\tvar topRowId = i;\n\t\t\tvar preCompanyId = cellValue(topRowId, \"companyId\");\n\t\t\tvar preFacilityId = cellValue(topRowId, \"facilityId\");\n\t\t\tfor (i++; i <= $v(\"totalLines\"); i++) {\n\t\t\t\tif (preCompanyId == cellValue(i, \"companyId\") && preFacilityId == cellValue(i, \"facilityId\")) { //check if the row is still within scope\n\t\t\t\t\tfor (var j = 0; j <= $v(\"headerCount\"); j++) {\n\t\t\t\t\t\tvar colName = config[5 + 2 * j].columnId;\n\t\t\t\t\t\t//Note: 5 being the no. of columns before the Permission columns (starting from 0)\n\t\t\t\t\t\t// 2 * j is the index of the columns contain check boxes (skipping preceding hidden columns)\n\t\t\t\t\t\tif (cell(topRowId, colName).isChecked()) {\n\t\t\t\t\t\t\tif (cell(i, colName).isChecked())\n\t\t\t\t\t\t\t\tcell(i, colName).setChecked(false);\n\t\t\t\t\t\t\tcell(i, colName).setDisabled(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\n\t\t\t\t\tpreCompanyId = cellValue(i, \"companyId\");\n\t\t\t\t\tpreFacilityId = cellValue(i, \"facilityId\");\n\t\t\t\t} else\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} else\n\t\t\ti++;\n\t}\n}", "function disableParties() {\n var partiesCheckboxes = document.getElementsByClassName('party-checkbox');\n\n // loop through parties\n for(var i = 0; i < parties.length; i++) {\n if(parties[i].checked != false) {\n partiesCheckboxes[i].checked = false;\n document.getElementsByClassName('party-title')[i].style.fontWeight = 'normal';\n }\n }\n}", "function validateInputs() {\n // setting the isValid variable to true \n let isValid = true;\n\n // if the user chooses resistance \n if (workoutType === \"resistance\") {\n\n // if the name input of exercise form is left blank \n if (nameInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the weight input of exercise form is left blank \n if (weightInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the sets input of the exercise form is left blank \n if (setsInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the reps input of the exercise form is left blank \n if (repsInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the resistance input of the exercise form is left blank \n if (resistanceDurationInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the user chooses resistance \n } else if (workoutType === \"cardio\") {\n\n // if the name input of the exercise form is left blank \n if (cardioNameInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the duration input of the exercise form is left blank \n if (durationInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n\n // if the distance input of the exercise form is left blank \n if (distanceInput.value.trim() === \"\") {\n // set isValid to false \n isValid = false;\n }\n }\n\n // if isValid is true \n if (isValid) {\n // enable the complete and add exercise button \n completeButton.removeAttribute(\"disabled\");\n addButton.removeAttribute(\"disabled\");\n\n // if isValid is false \n } else {\n // disable the complete and add exercise button \n completeButton.setAttribute(\"disabled\", true);\n addButton.setAttribute(\"disabled\", true);\n }\n}", "hasNonSelectedItems() {\n let sanitizeItemList = document.querySelectorAll(\n \"#historyGroup > [preference]\"\n );\n for (let prefItem of sanitizeItemList) {\n if (!prefItem.checked) {\n return true;\n }\n }\n return false;\n }", "function checkItems() {\n if ($('#postItems .post-item__wrapper').length > 0) {\n $('#createNewTemplate').removeClass('disabled').prop('disabled', false);\n } else {\n $('#createNewTemplate').addClass('disabled').prop('disabled', true);\n }\n}", "function checkBoxValidator(){\n if ($(bucheckboxes).is(':checked')) {\n return true;\n } else {\n if ($(bucheckboxes).first().parent()[0].nextElementSibling) {\n $(bucheckboxes).first().parent()[0].nextElementSibling.remove();\n }\n $(bucheckboxes).first().parent().after('<span class=\"text-danger align-center\" style=\"display:block;\">At least <b>ONE</b> Authorization Scope should be selected</span>');\n return false;\n }\n}", "function validateInputs() {\n let isValid = true;\n\n if (workoutType === \"resistance\") {\n if (nameInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (weightInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (setsInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (repsInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (resistanceDurationInput.value.trim() === \"\") {\n isValid = false;\n }\n } else if (workoutType === \"cardio\") {\n if (cardioNameInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (durationInput.value.trim() === \"\") {\n isValid = false;\n }\n\n if (distanceInput.value.trim() === \"\") {\n isValid = false;\n }\n }\n\n if (isValid) {\n completeButton.removeAttribute(\"disabled\");\n addButton.removeAttribute(\"disabled\");\n } else {\n completeButton.setAttribute(\"disabled\", true);\n addButton.setAttribute(\"disabled\", true);\n }\n}", "function complete () {\r\n \r\n let complete = Array.from(inputs).every((input) => input.value);\r\n \r\n if (complete && !document.querySelector('.text-danger')) {\r\n submitBtn.disabled = false;\r\n submitBtn.classList.replace('btn-secondary','btn-primary');\r\n } else if (complete && submitBtn.disabled === false) {\r\n submitBtn.disabled = true;\r\n submitBtn.classList.replace('btn-primary','btn-secondary');\r\n }\r\n}", "function enableQuiz() {\n\tfor (var i = 0; i < qOneRadios.length; i++) {\n\t\tqOneRadios[i].disabled = false;\n\t}\n\tfor (var i = 0; i < qTwoRadios.length; i++) {\n\t\tqTwoRadios[i].disabled = false;\n\t}\n\tfor (var i = 0; i < qThreeRadios.length; i++) {\n\t\tqThreeRadios[i].disabled = false;\n\t}\n\tfor (var i = 0; i < qFourRadios.length; i++) {\n\t\tqFourRadios[i].disabled = false;\n\t}\n\tfor (var i = 0; i < qFiveRadios.length; i++) {\n\t\tqFiveRadios[i].disabled = false;\n\t}\n\t\n\tsubmitButton.disabled = false;\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}", "function allowContactSubmission(){\n\tvar nameLength = document.getElementById('entry_348166146').value.length;\n\t// Male sure this is an email\n\tvar email = document.getElementById('entry_73439495').value;\n\tvar subjectLength = document.getElementById('entry_274250116').value.length;\n\tvar messageLength = document.getElementById('entry_1098022282').value.length;\n\tvar testsPassed = 0;\n\t// Check to make sure a name was entered\n\tif (nameLength > 0){\n\t\ttestsPassed++\n\t}\n\t// Check to make sure an email was entered\n\tif (email.indexOf('@') > -1 && email.indexOf('.') > -1){\n\t\ttestsPassed++\n\t}\n\t// Check to make sure a subject was entered\n\tif (subjectLength > 0){\n\t\ttestsPassed++\n\t}\n\t// Check to make sure a message was entered\n\tif (messageLength > 0){\n\t\ttestsPassed++\n\t}\n\n\t// If all of the required information is there...\n\tif (testsPassed > 3){\n\t\tvar submitButton = document.getElementById('ss-submit');\n\t\t// Enable submit button\n\t\tsubmitButton.classList.remove('disabled');\n\t\t// Hide instructions\n\t\tdocument.getElementsByClassName('instructions')[0].classList.add('hidden');\n\t}\n\n}" ]
[ "0.618118", "0.61580664", "0.60174406", "0.60135734", "0.60098475", "0.59267527", "0.5898249", "0.5875279", "0.5862465", "0.585994", "0.5839352", "0.5807672", "0.57830715", "0.56888014", "0.5684944", "0.56291264", "0.560085", "0.5600042", "0.5574975", "0.55575174", "0.55539167", "0.55371445", "0.5533673", "0.5532814", "0.55152786", "0.5515248", "0.5503299", "0.5500014", "0.54843044", "0.5461179", "0.5461179", "0.5453315", "0.5446586", "0.5428663", "0.542589", "0.54111695", "0.53991187", "0.53977805", "0.5395166", "0.53904164", "0.5389724", "0.5380637", "0.5374284", "0.5372489", "0.5366434", "0.53643924", "0.5364053", "0.5356791", "0.53524613", "0.53499615", "0.5349778", "0.53460145", "0.53195906", "0.5316313", "0.52975774", "0.5277725", "0.52756757", "0.52745175", "0.5271407", "0.5266146", "0.5260826", "0.526042", "0.525811", "0.52576876", "0.52429116", "0.52350336", "0.5232847", "0.52298546", "0.52218175", "0.5220616", "0.5210477", "0.5205395", "0.51968485", "0.5192147", "0.51901984", "0.5186674", "0.51858443", "0.51839983", "0.5179842", "0.51797265", "0.5174061", "0.5171833", "0.5167092", "0.5159923", "0.5159296", "0.51572037", "0.5155698", "0.5151719", "0.5151472", "0.5144842", "0.5138971", "0.5138486", "0.512984", "0.5126678", "0.51240116", "0.51207703", "0.51175606", "0.5117356", "0.51137584", "0.51135737" ]
0.7203984
0
questions 1 to 5
function firstToFifthQuestion(questionNum) { var userResponse; var userAnswer = prompt('Guess if Laboni ' + questionArray[questionNum], 'Type yes or no').toLocaleLowerCase(); console.log('The user guessed' + userAnswer + 'for ' + questionNum + '.'); if(userAnswer === 'yes') { userResponse = true; } else if (userAnswer === 'no') { userResponse = false; } else {} if(responseArray[questionNum] === userResponse) { alert(correctAnswerArray[questionNum]); userPoints++; } else { alert('Sorry ' + user + ', you didn\'t get the correct answer. Better luck next time!'); } question++; alert('You currently have ' + userPoints + ' points and you have answered ' + question + ' questions!'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function questions(number) {\n if (number < quiz.length) {\n $(\"#question\").html(quiz[number].question);\n var choicesArr = quiz[number].choices;\n $(\"#choices\").removeClass(\"textStyle\");\n $(\"#choices\").text(\"\");\n for (var i = 0; i < choicesArr.length; i++) {\n var buttonChoices = $(\"<button>\");\n buttonChoices.attr(\"data-ans\", i);\n buttonChoices.html(choicesArr[i]);\n $(\"#choices\").append(buttonChoices);\n $(\"#choices\").append(\"<br>\");\n } \n } else { \n result();\n }\n }", "function populate() { \n// alert(\"function populate started\"); \n// this function gives each of the answers 0 points so if someone doesn't answer a question \n// the whole thing will continue to work \n for(var i=0; i<5; i++) { Quest[i]=0; } \n}", "function setQuestion() {\n\tcurrentQuestion = questions[index];\n\tif (index < 5) {\n\t\tshowQuestion() }\n\telse {\n\t\tendGame();\n\t\t}\n\t}", "function AllQuestionCheck()\n{\n Question1();\n Question2();\n Question3();\n Question4();\n Question5();\n Question6();\n Question7();\n Question8();\n Question9();\n Question10();\n Question11();\n Question12();\n Question13();\n Question14();\n Question15();\n}", "function afficherQuestion(num)\n{\n for(var i=1;i<=nbQuestions;i++)\n {\n hide(i);\n }\n show(num);\n}", "function questionTmp(it, i , num) { var out='<div class=\"list-group\"><a class=\"list-group-item active\"><h4>Q'+(i)+'. '+(it.title)+'</h4></a>';var arr1=it.answers;if(arr1){var value,index=-1,l1=arr1.length-1;while(index<l1){value=arr1[index+=1];out+='<div class=\"radio list-group-item\"><label><input type=\"radio\" name=\"q'+(i)+'\" value=\"'+(i)+'\">'+(value)+'</label></div>';} } out+='</div><footer>';if(i < num){out+='<a class=\"next-link\" href=\"#q'+(i+1)+'\"><div><span>Next Question</span></div><div><span class=\"glyphicon glyphicon-menu-down\"></span></div></a>';}if(i >= num){out+='<a class=\"next-link\" href=\"#q'+(i+1)+'\"><span>Submit</span></a>';}out+='</footer>';return out; }", "function nextQ(){\n\tquestionCount++;\n}", "function formulateQuestion(){\n\ty = 0; //static variable to ensure only questions are asked\n\t\n\tgeneratedQuestion = alert(questions[answerIncrementor][y]); //generates question\n\t\n}", "function fiveQuestions(){\n\n var questions = ['Have I ever done a triathlon?', 'Was I born in Seattle?', 'Do I have any children?', 'Do I like drinking whiskey?', 'Do I have a pet snake?']\n\n var yes_no_answers = [\n ['yes', 'no', 'yes', 'no', 'no'], //Answers to questions array\n ['You are correct, ', 'That is incorrect, '], //Correct/incorrect responses\n [', I have done 2.', ', I was born in Maryland.', ', I have 3 kids.', ', I am more of a beer drinker.', ', I have a pet cat named Moxie.'] //Elaborations to questions\n ];\n\n for (var i = 0; i < questions.length; i++) {\n var answer = prompt(questions[i]);\n if (answer.toLowerCase() === yes_no_answers[0][i]) {\n correctAnswers++;\n alert(yes_no_answers[1][0] + user + yes_no_answers[2][i]);\n } else {\n alert(yes_no_answers[1][1] + user + yes_no_answers[2][i]);\n }\n }\n }", "function displayQs() {\n\tfor (i = 1; i <=10; i++) {\t\n\t\t$(\"#displayQ\" + i).html(\"<h2>\" + trivia[currentQuestion].question + \"</h2>\");\n\t\tcurrentQuestion++;\n\t}\n}", "function people_ask_questions(count = 4) {\n document.querySelectorAll(\".ifM9O a\");\n //*getting the values of the href in the people also ask section\n var start_count_questions = 0;\n let question_links = document.querySelectorAll(\".ifM9O a\");\n let temp = new Array();\n for (i = start_count; i < start_count + 4; i++) {\n temp.push(question_links[i]);\n }\n}", "function populateQuestions() {\n const twentyQuestionsArray = getAllQuestionsAndAnswers();\n return buildQuestions(twentyQuestionsArray, 10);\n}", "function populate() {\n// alert(\"function populate started\"); \n// this function gives each of the answers 0 points so if someone doesn't answer a question\n// the whole thing will continue to work \n for(var i=0; i<3; i++) { Quest[i]=0; } \n}", "function populate() {\n// alert(\"function populate started\");\n// this function gives each of the answers 0 points so if someone doesn't answer a question\n// the whole thing will continue to work\n for(var i=0; i<3; i++) { Quest[i]=0; }\n}", "function runQuestions() {\n if (questionCounter < 6) {\n choicesEl.innerHTML = \"\";\n renderQuestion(quizQuestions[questionCounter]);\n createButton(quizQuestions[questionCounter]);\n createListeners();\n } else {\n endQuiz();\n }\n}", "function newQuestion() {\n scoreText.textContent = `Score: ${score}`\n questionNumber++\n if (questionNumber >= 25) {\n numOfQuestions.textContent = `Question 25 of 25`\n } else {\n numOfQuestions.textContent = `Question ${questionNumber} of 25`\n }\n question.setAttribute(`class`, `d-none`)\n question = document.getElementById(questionNumber);\n question.removeAttribute(`class`, `d-none`);\n answerchoices = question.querySelectorAll('p');\n }", "function getQuestion(ind)\n\t\t\t{\n\t\t\t\t//document.write(\"in question function\");\n\t\t\t\twindow.questions = [\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"Grand Central Terminal, Park Avenue, New York is the world's\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"largest railway station\", \"highest railway station\",\"longest railway station\",\"None of the above\"], \n\t\t\t\t\t\tcorrectChoice: \"highest railway station\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"Entomology is the science that studies\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"Behavior of human beings\", \"Insects\",\"history of technical and scientific terms\",\"The formation of rocks\"], \n\t\t\t\t\t\tcorrectChoice: \"Insects\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"For which of the following disciplines is Nobel Prize awarded?\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"Physics and Chemistry\", \"Physiology or Medicine\",\"Literature, Peace and Economics\",\"All of the above\"], \n\t\t\t\t\t\tcorrectChoice: \"All of the above\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"Hitler party which came into power in 1933 is known as\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"Labour Party\", \"Nazi Party\",\"Ku-Klux-Klan\",\"Democratic Party\"], \n\t\t\t\t\t\tcorrectChoice: \"Nazi Party\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"Each year World Red Cross and Red Crescent Day is celebrated on\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"May 8\", \"May 18\",\"June 8\",\"June 18\"], \n\t\t\t\t\t\tcorrectChoice: \"May 8\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"Where is the great Barrier Reef?\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"Africa\", \"N.America\",\"S.America\",\"Asia\",\"Australia\"], \n\t\t\t\t\t\tcorrectChoice: \"Asutralia\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"For the Olympics and World Tournaments, the dimensions of basketball court are\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"26 m x 14 m\", \"28 m x 15 m\",\"27 m x 16 m\",\"28 m x 16 m\"], \n\t\t\t\t\t\tcorrectChoice: \"28 m x 15 m\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"Filaria is caused by\", \n\t\t\t\t\t\tquestionType: 2, \n\t\t\t\t\t\tcorrectAnswer: \"Mosquito\", \n\t\t\t\t\t\tscore: 10 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"Fathometer is used to measure\", \n\t\t\t\t\t\tquestionType: 2, \n\t\t\t\t\t\tcorrectAnswer: \"Ocean depth\", \n\t\t\t\t\t\tscore: 10 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"For seeing objects at the surface of water from a submarine under water, the instrument used is\", \n\t\t\t\t\t\tquestionType: 2, \n\t\t\t\t\t\tcorrectAnswer: \"periscope\", \n\t\t\t\t\t\tscore: 10 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"East Timor, which became the 191st member of the UN, is in the continent of\", \n\t\t\t\t\t\tquestionType: 2, \n\t\t\t\t\t\tcorrectAnswer: \"Asia\", \n\t\t\t\t\t\tscore: 10 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"First Afghan War took place in\", \n\t\t\t\t\t\tquestionType: 2, \n\t\t\t\t\t\tcorrectAnswer: \"1839\", \n\t\t\t\t\t\tscore: 10 \n\t\t\t\t\t}\n\t\t\t\t];\n\n\t\t\t\tvar result = questions[ind]; \n\t\t\t\treturn result;\n\t\t\t}", "function generateQuestion() {\n let questionNumber = STORE.questionNumber;\n if (questionNumber <= STORE.questions.length+1) {\n return STORE.questions[questionNumber - 2].question;\n }\n else\n finalScore();\n}", "function questions() {\n return {\n 1: {\n ques: \"Archipiélago conocido como 'Las afortunadas'.\",\n ans: \"ISLAS CANARIAS\",\n showAns: \"I**AS **N*R*AS\"\n },\n 2: {\n ques: \"¿Cómo se llama el satélite de planeta Tierra?\",\n ans: \"LUNA\",\n showAns: \"L**A\"\n },\n 3: {\n ques: \"¿Cuál es la capital de Arizona?\",\n ans: \"PHOENIX\",\n showAns: \"P**E**X\"\n },\n 4: {\n ques: \"Personajes que han salido en todas las pelicula de Star Wars:\",\n ans: \"R2-D2 y C-3PO\",\n showAns: \"R*-D* y C-**O\"\n },\n 5: {\n ques: \"¿De qué color es el caballo blanco de Santiago?\",\n ans: \"BLANCO\",\n showAns: \"B**N*O\"\n },\n 6: {\n ques: \"¿Cómo se llama el mejor de amigo de John Snow?\",\n ans: \"SAMWELL TARLY\",\n showAns: \"S**W**L T*RL*\"\n },\n 7: {\n ques: \"¿En qué año se firmó la declaración de independencia de EEUU?\",\n ans: \"1776\",\n showAns: \"1**6\"\n }\n };\n}", "function setQuestions(){\n for(i = 0; i < quizLength; i++){\n var randomNum = Math.floor(Math.random() * quiz.length);\n if(questionsArray.indexOf(randomNum) != -1){\n i--;\n } else {\n questionsArray.push(randomNum);\n }\n }\n }", "function getQuestions() {\n if (currentQuestionIndex === 6) {\n clearInterval(timerInterval);\n endGame();\n } else {\n showQuestion(shuffleQuestions[currentQuestionIndex]);\n showAnswers(shuffleQuestions[currentQuestionIndex]);\n }\n}", "function randomQuestion(){\n return questionOrder[i];\n}", "function question(x) {\n if (whichQuestion > theQuestions.length -1) {\n score = score + timeLeft;\n end();\n }\n else {\n document.getElementById(\"q1\").innerHTML = theQuestions[x].question;\n document.getElementById(\"a1\").innerHTML = theQuestions[x].answer1;\n document.getElementById(\"a2\").innerHTML = theQuestions[x].answer2;\n document.getElementById(\"a3\").innerHTML = theQuestions[x].answer3;\n document.getElementById(\"a4\").innerHTML = theQuestions[x].answer4;\n }\n}", "function takeQuestions() {\n\t\tlet questions=[]\n\t\tinputList=questionsContent.childNodes\n\t\tfor (i=0;i<inputList.length;i++) {\n\t\t\tquestions.push([inputList[i].querySelector('.question').value,inputList[i].querySelector('.anserw').value])\n\t\t}\n\t\tquestions.forEach(function(el) {\n\t\t\tif (el[0].length===0) {el[0]=' '}\n\t\t\tif (el[1].length===0) {el[1]=' '}\n\t\t})\n\t\treturn questions\n\t}", "function getQuestionsIndex(){\n let questionIndexArray = [];\n for(let i = 0; i < 6; i++){\n questionIndexArray.push(Math.floor(Math.random()*5));\n }\n return questionIndexArray\n}", "async function generateQuestions(limit = 5) {\n const questions = [];\n for (let i = 0; i < limit; i++) {\n const q = await buildQuestion();\n questions.push(q);\n }\n return questions;\n}", "function createQuestions() {\n questions = [\n new TriviaQuestion(\"What is the name of bar the gang frequently visits?\",\n \"MacLaren's\",\n [\"MacLaren's\",\n \"MacLoughlin's\",\n \"MacLure's\",\n \"MacMaster's\"]\n ),\n new TriviaQuestion(\"What color and instrument does Ted steal for Robin?\",\n \"Blue French Horn\",\n [\"Blue French Horn\",\n \"Blue Trumpet\",\n \"Red French Horn\",\n \"Red Trumpet\"]\n ),\n new TriviaQuestion(\"Which acronym does Barney use to describe his job?\",\n \"P.L.E.A.S.E.\",\n [\"P.L.E.A.S.E.\",\n \"S.E.C.R.E.T.\",\n \"W.O.R.K.\",\n \"S.T.O.P.\"]\n ),\n new TriviaQuestion(\"What is the first Robin Sparkles song the gang listens to?\",\n \"Let's Go To The Mall\",\n [\"Let's Go To The Mall\",\n \"Sandcastles in the Sand\",\n \"The Beaver Song\",\n \"P.S. I Love You\"]\n ),\n new TriviaQuestion(\"What are the names of Ted's children?\",\n \"Luke and Penny\",\n [\"Luke and Penny\",\n \"Adam and Sara\",\n \"David and Jenna\",\n \"Jerry and Emily\"]\n ),\n new TriviaQuestion(\"If they owned a bar, what would Ted and Barney name it?\",\n \"Puzzles\",\n [\"Puzzles\",\n \"Clues\",\n \"Questions\",\n \"Kisses\"]\n ),\n new TriviaQuestion(\"What year is it when Ted is telling his children how he met their mother?\",\n \"2030\",\n [\"2030\",\n \"2015\",\n \"2020\",\n \"2025\"]\n ),\n new TriviaQuestion(\"At what occasion does Ted find a goat in his apartment?\",\n \"His 31th birthday\",\n [\"His 31th birthday\",\n \"His 30st birthday\",\n \"New Year's Day\",\n \"Halloween\"]\n ),\n new TriviaQuestion(\"Who narrates the show?\",\n \"Bob Saget\",\n [\"Bob Saget\",\n \"Jason Segel\",\n \"Josh Radnor\",\n \"Neil Patrick Harris\"]\n ),\n new TriviaQuestion(\"How many seasons are in the series?\",\n \"9\",\n [\"9\",\n \"7\",\n \"8\",\n \"10\"]\n ),\n new TriviaQuestion(\"Who is Robin's archenemy?\",\n \"Patrice\",\n [\"Patrice\",\n \"Clarisse\",\n \"Clara\",\n \"Paula\"]\n ),\n new TriviaQuestion(\"Which trio attended the same university together?\",\n \"Ted, Marshall, and Lily\",\n [\"Ted, Marshall, and Lily\",\n \"Marshall, Barney, and Ted\",\n \"Lily, Marshall, and Barney\",\n \"Robin, Lily, and Marshall\"]\n ),\n new TriviaQuestion(\"Which one of these is not one of Barney's catchphrases?\",\n \"Bottom's up!\",\n [\"Bottom's up!\",\n \"Legendary\",\n \"Have you met Ted?\",\n \"Suit up!\"]\n ),\n new TriviaQuestion(\"Which character got a tattoo of a butterfly on his/her lower back?\",\n \"Ted\",\n [\"Ted\",\n \"Barney\",\n \"Marshall\",\n \"Lily\"]\n ),\n new TriviaQuestion(\"Who is Linus?\",\n \"Lily's bartender\",\n [\"Lily's bartender\",\n \"One of Robin's exes\",\n \"Barney's half brother\",\n \"Ted's high school best friend\"]\n )\n ]\n }", "function generateQuestion() {\n if (questionNumber < STORE.length) {\n return createThing(questionNumber);\n } else {\n $('.questionBox').hide();\n finalScore();\n $('.questionNumber').text(10);\n }\n}", "function getQuestions(qCount, rand) {\n\n if (qCount === 9) {\n\n submit.innerHTML = \"Submit Test\";\n submit.style.backgroundColor = \"blue\";\n\n } else if (qCount > 9) {\n\n return;\n } \n\n setQuestion(qCount, rand);\n changeProgressBar(qCount);\n defaultButtonColor();\n \n}", "function nextQ() {\n\tif (iQ <= allQ.length) {\n\t\t$('.beginQuestion').text(currentQ.question);\n\t};\n\n}", "function makeQuestionsForQuiz(numQuestions) {\n // generate questions for quiz\n questions = generateQuestions(numQuestions || questionTemplates.length);\n // make questions-only list for quiz component\n return questions.map(q => ({\n id: q.id,\n type: q.type,\n question: q.question\n }));\n}", "function getTrivia(data) {\n\tvar count = 0;\n\tfor (let i = 0; i < data.results.length; i++) {\n\t\tquestion = data.results[i].question\n\t\tanswer = data.results[i].correct_answer\n\t\tif (count % 5 == 0) {\n\t\t\t$(\"#triviaBox\").append(`<div class=\"columns has-background-dark\" id=\"${count}\"></div>`);\n\t\t\tvar lastelem = count;\n\t\t}\n console.log(question)\n\t\t$(`#${lastelem}`).append(\n `<div class=\"column is-one-fifth\"><div class=\"box\"><p>${question}</p><ul><li>True</li><li>False</li></ul><div class=\"box answer has-background-success\" style=\"display: none;\">${answer}</div></div></div>`);\n\t\tcount++\n\t}\n}", "function generateQuestion(){\n if (questionNumber < STORE.length){\n return createQuestion(questionNumber);\n } else {\n $('.questionBox').hide();\n finalScore();\n $('.questionNumber').text(10);\n }\n}", "function numberOfQuestions () {\n return quiz.questions.length\n}", "function numberOfQuestions () {\n return quiz.questions.length\n}", "function numberOfQuestions () {\n return quiz.questions.length\n}", "function Quiz(questions) {\n this.score = 0;\n this.questions = questions;\n this.questionIndex = 0;\n}", "function Quiz(questions) {\n this.score = 0;\n this.questions = questions;\n this.questionIndex = 0;\n}", "constructor(questions) {\n /**\n * A list of questions\n * @private\n */\n this._questions = questions\n /**\n * Current index of questions iterator\n * @type {number}\n * @private\n */\n this._currentQuestionIndex = -1\n }", "function fillPage(questions) {\n var output = \"\"\n\n questions.forEach(q=>{\n output += getQuestionText(q);\n })\n\n return output;\n}", "function nextQuestion(){\n questionIndex++\n if (theQuestions.length > questionIndex){\n showQuestion()\n } else {\n quizEnd()\n }\n}", "function takeQuestion() {\n if (randomQuestion() === 1 && countAnswer1 < questions1.length) nextQuestion(questions1, questions2, countAnswer1, countAnswer2);\n else if (countAnswer2 < questions2.length) nextQuestion(questions2, questions1, countAnswer2, countAnswer1);\n else nextQuestion(questions1, questions2, countAnswer1, countAnswer2);\n}", "function nextQuestion() {\n newQuestion();\n}", "function nextQuestion() {\n\n}", "function questionCounter() {\n if (counter < 4) {\n counter++;\n startTrivia();\n timer = 10;\n timeHolder();\n } else {\n finishTrivia();\n }\n }", "function setQuestion(qCount, rand) {\n\n let ques = quesObject[rand];\n \n question.textContent = (qCount+1) + \". \" + ques.question;\n option1.textContent = ques.option1;\n option2.textContent = ques.option2;\n option3.textContent = ques.option3;\n option4.textContent = ques.option4;\n\n}", "function getQuestion(counter) {\n\n if (counter == 1) {\n answer = [\"Integer\", \"String\", \"Boolean\", \"Array\"]\n questionText = \"What type of variable is not primitive?\";\n return question1;\n }\n else if (counter == 2) {\n answer = [\"<section>\", \"<div>\", \"<article>\", \"<aside>\"]\n questionText = \"What should not be used in semantic html?\";\n\n return question2;\n }\n else if (counter == 3) {\n answer = [\"$\", \"#\", \"-\", \"+\"]\n questionText = \"What symbol is used in concatination?\";\n\n return question3;\n }\n else if (counter == 4) {\n answer = [\"var\", \"int\", \"String\", \"fuction\"]\n questionText = \"What syntax is used to declare a variable in javascript?\";\n\n return question4;\n }\n else if (counter == 5) {\n answer = [\"'pressed'\", \"'key_up'\", \"'click'\", \"'mouse'\"]\n questionText = \"What is used in an eventListener to define a button press?\";\n\n return question5;\n }\n\n}", "function createQuestion(questions) {\n for (var i = 0; i < questions.length; i++) {\n $(\".start\").hide();\n $(\"#questions\").append('<form id=\"' + i + '\" class=\"center-text\"><p>Question ' + (i + 1) + ' of ' + questions.length + '</p><h3 class=\"question\">' + questions[i].q + '</h3>' + radioButtons(questions[i].s, i) + '<button type=\"submit\" class=\"next\">NEXT</button></p></form>');\n }\n //This hides all except the first question:\n for (var k = questions.length - 1; k > 0; k--) {\n $('#' + k).hide();\n }\n }", "function questionCounter() {\n if(STORE.currentQuestion <= 4) {\n renderQuiz(STORE.currentQuestion);\n console.log(\"We just passed \" + STORE.currentQuestion + \"to renderQuiz\")\n STORE.currentQuestion++;\n } else {\n showResultsAndRetake();\n }\n\n}", "function generateRandomQ() {\r\n let randomQuestion = Math.floor(Math.random()*questionsArray.length) + 1;\r\n let questionToAsk = questionsArray[randomQuestion - 1];\r\n\r\n return questionToAsk;\r\n }", "function showQuizQuestions(questions, containerOfQuiz){\n let output = [];\n let answers;\n for(let i=0; i<questions.length; i++){\n // reset the list of answers\n answers = [];\n /* for each available answer, add a radio button for selection of only one answer (this will be \n removed via CSS and the whole label will be selectable by the user with stylings affecting the whole label) to show selection*/\n for(let letter in questions[i].answers){\n if (questions.hasOwnProperty(i)){\n answers.push(\n '<input type=\"radio\" id=\"'+ questions[i].answers[letter] +'\" name=\"question'+i+'\" value=\"'+letter+'\">' + '<label for=\"'+ questions[i].answers[letter] +'\">'+ questions[i].answers[letter] +'</label>'\n );\n }\n }\n // add questions and its answers to the quiz \n output.push(\n '<div class=\"question\"><h3 id=\"quiz-questions\">' +[i+1] + '. ' + questions[i].question + '</h3></div><br>' + '<div class=\"answers\">' + answers.join('') + '</div><br>'\n );\n }\n // combine question and it's answers into one string of html and put it on the page (for all 20 questions)\n containerOfQuiz.innerHTML = output.join('');\n }", "function ask(i)\r\n{\r\n\tprocess.stdout.write(`\\n\\n\\n\\n\\n\\n ${questions[i]}`);\r\n\tprocess.stdout.write(\" > \");\r\n}", "function AppendQfive() {\n $(\"#question5\").append(questions[4].Question);\n $(\"#btnA5\").append(questions[4].AnswerOne);\n $(\"#btnB5\").append(questions[4].AnswerTwo);\n $(\"#btnC5\").append(questions[4].AnswerThree);\n}", "function showNewQuestion() {\n currentQuestionNumber++;\n\n if (currentQuestionNumber > 5) {\n $(\".questionAndScore\").hide();\n showFinalResults();\n } else {\n $(\".quizForm\").html(`<legend class=\"displayedQuestion\">${STORE.questions[currentQuestionNumber-1].question}</legend><br>`)\n\n displayTestInfo();\n showAnswerChoices();\n }\n}", "function defaultQuestions(questionnaire)\n{\n \t'use strict';\n questionnaire.insert({question:'Who was the first computer programmer?', answer:'Ada Lovelace', answerId:++answerId});\n questionnaire.insert({question:'Who launched GNU?', answer:'Richard Stallman', answerId:++answerId});\n questionnaire.insert({question:'Who founded apple?', answer:'Steve Jobs', answerId:++answerId});\n questionnaire.insert({question:'Who founded MicroSoft?', answer:'Bill Gates', answerId:++answerId});\n}", "function randomQ(){\n num = Math.floor(Math.random()*qBank.length+1); //generates random number from 1-7\n console.log(questions[num-1]); //displays question in console according to array index\n \n for(let i =0; i < answerChoices[num-1].length; i++){\n console.log(i+': '+answerChoices[num-1][i]); //displays all options for particular question, each value in array is an array\n }\n\n input = prompt('What is your answer to the question?'\n +' Choose an answer based on the number next to each option. '+\n 'Enter exit or EXIT to end the game.');\n \n //how to end the game\n if(input === 'exit' || input === 'EXIT')\n {\n stillPlaying = false;\n } \n }", "function nextQuestion() {\n currentQuestion = currentQuestion + 1;\n if (currentQuestion < questions.length) {\n question();\n } else {\n gameSummary();\n }\n}", "function countQuestions(length) {\n \n if (index > length) {\n index = length;\n } else if (index < 1) {\n index = 1;\n }\n $(\"#questionCounter\").html(\"Question: \" + (index) + \"/\" + length);\n}", "function generateQuestionsPerPage() {\n var q = \"\";\n q += \"<div class=\\\"ui-field-contain\\\"><legend>Questions per page:</legend>\";\n quiz.questionsPerPage.forEach(function(a){\n q += \"<label for=\"+a+\">\"+a+\"</label>\";\n q += \"<input type=\\\"radio\\\" class=\\\"qpp\\\" name=\\\"qpp\\\" id=\"+a+\" value=\"+a+\">\";\n });\n q += \"</div>\";\n\n $(\"#qpp\").append(q);\n \n // Shows all options generate in var q\n $(\"#qpp div\").first().addClass(\"active\");\n $(\".active\").show();\n \n // Activates change event listner in .qpp\n $(\".qpp\").change(function() {\n \n // Number of questions to be shown\n questions = parseInt($(this).val());\n \n // Loads the number of questions selected by user\n getFirstQuestion(questions);\n });\n}", "function Quiz(questions) {\n this.questions = questions;\n this.currentQuestion = 0;\n }", "function askQuestion(questionNumber) {\n\n}", "function Quiz(questions) {\n this.student = \"\";\n this.score = 0;\n this.questions = questions;\n this.questionIndex = 0;\n this.myAnswers = [];\n}", "function setRandomQues(){\n randomQues = randomNumber(0, VocabSets.length-1);\n setScreen(\"questionScr\");\n setText(\"questionLbl\", VocabSets[randomQues].meera +\" はどういう意味ですか? \");\n //countriesSets.splice(randomQues, 1);\n randomAnswerBtns(randomQues);\n}", "function questionSelector(){\n \n for(var i = 0 ;i<=x;i++){\n \n if (container[x]==q1){\n \n console.log(q1.question);//Question will be displayed\n answersSelector();//Answer will be displayed\n \n var choices = prompt('Enter your choice'); \n if(choices >q1.answers.length){\n console.log('Out of the length!!');\n return-1\n }else{\n if(choices == q1.correct){\n console.log(q1.answers[choices]+ ' is correct');\n }else{\n console.log(q1.answers[choices]+ ' is wrong');\n\n }\n break;\n \n }\n\n \n }else if(container[x]==q2){\n \n console.log(q2.question);\n answersSelector();\n \n var choices = prompt('Enter your choice'); \n if(choices >q1.answers.length){\n console.log('Out of the length!!');\n return-1\n }else{\n if(choices == q2.correct ){\n console.log(q2.answers[choices]+ ' is correct');\n }else{\n console.log(q2.answers[choices]+ ' is wrong');\n\n }\n break;\n }\n }\n \n else{\n console.log(q3.question);\n answersSelector();\n var choices = prompt('Enter your choice'); \n if(choices>q3.answers.length){\n console.log('Out of the length!!');\n return-1\n }else{\n if(choices == q1.correct){\n console.log(q3.answers[choices]+ ' is correct');\n }else{\n console.log(q3.answers[choices]+ ' is wrong');\n\n }\n break;\n }\n \n }\n \n }\n \n}", "function populateQuestions() {\n questions = [//the array contains all the questions we've written\n {//the questions are structured as objects\n //there are six key value pairs that hold the information to pose a question\n question: \"A female nymph associated with a tree is called what?\",\n //the question to be asked is listed along with 4 multiple choice answers\n a1: \"Faun\",\n a2: \"Goblin\",\n a3: \"Banshee\",\n a4: \"Dryad\",\n //the correct answer of the four choices is defined as an integer\n correct: 4\n },\n //the same format is followed for every object\n {\n question: \"Dryads were said to have raised what god while he was an infant?\",\n a1: \"Zeus\",\n a2: \"Artemis\",\n a3: \"Allah\",\n a4: \"Hades\",\n correct: 1\n },\n {\n question: \"The dryad comes from what cultural mythology?\",\n a1: \"Persian\",\n a2: \"Celtic\",\n a3: \"Greek\",\n a4: \"Japanese\",\n correct: 3\n },\n {\n question: \"The genie of the lamp that was found by Aladdin *first* appeared in what anthology of fictional stories?\",\n a1: \"Disney\",\n a2: \"A Thousand and One Nights\",\n a3: \"The Quoran\",\n a4: \"Homer's Illiad\",\n correct: 2\n },\n {\n question: \"Which of the following cultures do the tales of the Genie, or Djinn come from?\",\n a1: \"Greek\",\n a2: \"Japanese\",\n a3: \"American Indian\",\n a4: \"Arabic\",\n correct: 4\n },\n {\n question: \"The Djinn were known for what of the following traits?\",\n a1: \"Punishing humans for harm, whether intentional or not.\",\n a2: \"Being benevolent helpers of mankind.\",\n a3: \"Having control over the weather.\",\n a4: \"Having large horns and sharp teeth.\",\n correct: 1\n },\n {\n question: \"The thunderbird was so large it could pick up what?\",\n a1: \"The moon\",\n a2: \"Whales\",\n a3: \"A Man\",\n a4: \"A Car\",\n correct: 2\n },\n {\n question: \"The thunderbird got its name because of what?\",\n a1: \"The ACDC song Thunderstruck\",\n a2: \"Its mating call\",\n a3: \"The sound its wings made when flapping\",\n a4: \"Because it only came when it stormed.\",\n correct: 3\n },\n {\n question: \"The Thunderbird is a symbol of what?\",\n a1: \"Greatness\",\n a2: \"Weakness\",\n a3: \"Good\",\n a4: \"Strength\",\n correct: 4\n },\n {\n question: \"Mermaid legends are first found in what culture?\",\n a1: \"Irish\",\n a2: \"Syrian\",\n a3: \"Greek\",\n a4: \"Roman\",\n correct:2\n },\n {\n question: \"What is a gorgon’s power?\",\n a1: \"Ability to seduce men\",\n a2: \"Ability to heal\",\n a3: \"Causing people to go insane\",\n a4: \"Turning people to stone and killing them by looking at them\",\n correct:4\n },\n {\n question: \"What was the name of the gorgon sister who perished?\",\n a1: \"Stheno\",\n a2: \"Medusa\",\n a3: \"Akasha\",\n a4: \"Euryale\",\n correct:2\n },\n {\n question: \"Who ws Medusa slain by?\",\n a1: \"Perseus\",\n a2: \"Poseidon\",\n a3: \"Athena\",\n a4: \"Zeus\",\n correct:1\n },\n {\n question:\" A creature that is half female human, and half fish is known as what?\",\n a1:\"kelpie\",\n a2:\"vampire\",\n a3:\"faun\",\n a4:\"mermaid\",\n correct:4\n },\n {\n question:\"In sailor folklore, this mythical creature can signify either good or bad luck:\",\n a1:\"fairy\",\n a2:\"dragon\",\n a3:\"centaur\",\n a4:\"mermaid\",\n correct:4\n },\n {\n question:\"It is frequent for this creature to be carved into the bow of ships to bring good fortune to a voyage.\",\n a1:\"mermaid\",\n a2:\"griffin\",\n a3:\"kelpie\",\n a4:\"werewolf\",\n correct:1\n },\n {\n question:\"The mythology of the vampire originates from what culture?\",\n a1:\"Greek\",\n a2:\"Medieval Europe\",\n a3:\"Syria\",\n a4:\"Ireland\",\n correct:2\n },\n {\n question: \"Vampires have a weakness or fear to what of the following?\",\n a1:\"Holy symbols and garlic\",\n a2:\"Water\",\n a3:\"Grass\",\n a4:\"Their name\",\n correct:1\n },\n {\n question: \"Bram Stoker's Dracula is a famous novel about what type of mythical creature?\",\n a1: \"Fairies\",\n a2: \"Mermaids\",\n a3: \"Centaurs\",\n a4: \"Vampires\",\n correct:4\n },\n {\n question: \"One possible origin of Werewolf legends is:\",\n a1: \"Homer's Odyysey\",\n a2: \"Bram Stoker's Dracula\",\n a3: \"The Epic of Gilgamesh\",\n a4: \"Seafarer's Stories\",\n correct:3\n },\n {\n question: \"Werewolves can only be hurt by what?\",\n a1:\"silver\",\n a2:\"garlic and holy symbols\",\n a3:\"water\",\n a4:\"arrows\",\n correct:1\n },\n {\n question: \"Werewolves exhibit their half human, half beast form on which days of the month?\",\n a1: \"Tuesdays\",\n a2: \"Their Birthday\",\n a3: \"The fourth day of each month\",\n a4: \"The nights of the Full Moon\",\n correct:4\n },\n {\n question: \"A werewolf is a creature that is the combination of a human and what animal?\",\n a1: \"Bat\",\n a2: \"Horse\",\n a3: \"Wolf\",\n a4: \"Fish\",\n correct:3\n },\n {\n question: \"Centaurs Originated from what culture?\",\n a1: \"American\",\n a2: \"German\",\n a3: \"Greek\",\n a4: \"Japanese\",\n correct:3\n },\n {\n question: \"Centaurs are known to have the torso of a man and a body of a what?\",\n a1: \"Horse\",\n a2: \"Man\",\n a3: \"Chicken\",\n a4: \"Dinosaur\",\n correct: 1\n },\n {\n question: \"Which Greek god were the Centaurs followers of?\",\n a1: \"Zeus\",\n a2: \"Hades\",\n a3: \"Hermes\",\n a4: \"Dionysus\",\n correct: 4\n },\n {\n question: \"Chiron was a well known Centaur. Who below did he NOT tutor?\",\n a1: \"Jason\",\n a2: \"Leonidas\",\n a3: \"Achilles\",\n a4: \"Hercules\",\n correct: 2\n },\n {\n question: \"Cyclops found their origins in which culture?\",\n a1: \"Greek\",\n a2: \"Roman\",\n a3: \"Jewish\",\n a4: \"Asian\",\n correct: 1\n },\n {\n question: \"Cyclops only had 1 of what body part?\",\n a1: \"arms\",\n a2: \"toes\",\n a3: \"eyes\",\n a4: \"nipples\",\n correct: 3\n },\n {\n question: \"The Greeks considered Cyclops a race of what type of creatures?\",\n a1: \"Warriors\",\n a2: \"Lawyers\",\n a3: \"Lawless\",\n a4: \"Lazy\",\n correct: 3\n },\n {\n question: \"Cyclops were known to craft what?\",\n a1: \"weapons and armor\",\n a2: \"shoes and shoe strinks\",\n a3: \"houses\",\n a4: \"roads\",\n correct: 1\n },\n {\n question: \"Dragons came from which culture?\",\n a1: \"Greek\",\n a2: \"Asian\",\n a3: \"Egyptian\",\n a4: \"All of the above\",\n correct: 4\n },\n {\n question: \"Dragons had ___ which allowed them to fly:\",\n a1: \"Feet\",\n a2: \"Wings\",\n a3: \"A Head\",\n a4: \"A big heart\",\n correct: 2\n },\n {\n question: \"In their lair, what would dragons have in it?\",\n a1: \"Treasure\",\n a2: \"A tv\",\n a3: \"Rocks\",\n a4: \"A bed\",\n correct: 1\n },\n {\n question: \"Griffins have the head of an eagle and body of a what?\",\n a1: \"Lion\",\n a2: \"Chicken\",\n a3: \"Horse\",\n a4: \"Dragon\", \n correct:1\n },\n {\n question: \"What did Griffins do other than have capability of flight?\",\n a1: \"Lung capacity for when they swim\",\n a2: \"Guard treasure\",\n a3: \"Kept their human(s) safe\",\n a4: \"Hunt humans at night\",\n correct:2\n },\n {\n question: \"What do griffins symbolize? Strength and ______?\",\n a1: \"Outgoing\",\n a2: \"Agility\",\n a3: \"Clumsiness\",\n a4: \"Intelligence\",\n correct:4\n },\n {\n question: \"Where did fairies originate from?\",\n a1: \"Eastern Europe\",\n a2: \"Greek Mythology\",\n a3: \"Norse Mythology\",\n a4: \"Celtic\",\n correct:2\n },\n {\n question: \"What were 'Banshees' known for?\",\n a1: \"Being kind creatures\",\n a2: \"Being malevolent creatures who appear usually before something bad happens\",\n a3: \"Being intimidating\",\n a4: \"Are a sign of luck when encountered\",\n correct:2\n },\n {\n question: \"Where were fairies known to be demons?\",\n a1: \"Asia\",\n a2: \"Europe\",\n a3: \"Puritanism\",\n a4: \"Scottland\",\n correct:3 \n },\n {\n question: \"The kelpie is a horse that can shape-shift into a _______?\",\n a1: \"Human\",\n a2: \"Monkey\",\n a3: \"Unicorn\",\n a4: \"Dragon\", \n correct:1 \n },\n {\n question: \"What kind of tail do kelpies have?\",\n a1: \"Lion\",\n a2: \"Fish\",\n a3: \"Wolf\",\n a4: \"Mermaid-like\",\n correct:4\n },\n {\n question: \"Where do kelpies spend most of their time?\",\n a1: \"In the desert\",\n a2: \"By caves\",\n a3: \"By rivers and lakes or wherever water is present\",\n a4: \"Mountainous regions\",\n correct:3\n }\n ];\n\n}", "function increaseQuestionIndex() {\n questionIndex++;\n}", "function generateQuiz(questions, currentQuestionNumber) {\n clearViewContainer();\n generateQuestionNumber(currentQuestionNumber + 1);\n // render the quiz\n\n let count = 0;\n if (currentQuestionNumber > count) {\n count = currentQuestionNumber;\n };\n\n let currentQuestion = questions[count];\n //This creates the array for each question that will be sorted.\n let answerButtonText = [\n currentQuestion.answer,\n currentQuestion.decoy_1,\n currentQuestion.decoy_2,\n currentQuestion.decoy_3\n ];\n const newQuestion = createQuestionContent(currentQuestion, 'answer_box', answerButtonText);\n $('.content_container').append(newQuestion);\n\n //create new button under each question\n const nextButton = createButton('Next', 'next_button', 'next_button', false);\n $('.next_btn_container').append(nextButton);\n\n handleAnswerClick(currentQuestion, currentQuestionNumber);\n handleAnswerKeypress(currentQuestion, currentQuestionNumber);\n}", "function runQuestionPage(){\n questionPage(questions[++currentQuestion]);\n }", "function getQuestion2(ind)\n\t\t\t{\n\t\t\t\t//document.write(\"in question function\");\n\t\t\t\twindow.questions2 = [\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"The Homolographic projection has the correct representation of\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"shape\", \"area\",\"baring\",\"distance\"], \n\t\t\t\t\t\tcorrectChoice: \"area\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"The hazards of radiation belts include\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"Behavior of human beings\", \"Insects\",\"history of technical and scientific terms\",\"The formation of rocks\"], \n\t\t\t\t\t\tcorrectChoice: \"Insects\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"For which of the following disciplines is Nobel Prize awarded?\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"deterioration of circuits\", \"damage of solar cells\",\"adverse living organisms\",\"All of the above\"], \n\t\t\t\t\t\tcorrectChoice: \"All of the above\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"The great Victoria Desert is located in\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"Canada\", \"West Africa\",\"Australia\",\"North America\"], \n\t\t\t\t\t\tcorrectChoice: \"Australia\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"The intersecting lines drawn on maps and globes are\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"latitudes\", \"longitudes\",\"geographic grids\",\"None of the above\"], \n\t\t\t\t\t\tcorrectChoice: \"geographic grids\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"The light of distant stars is affected by\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"the earth's atmosphere\", \"interstellar dust\",\"both (a) and (b)\",\"None of the above\"], \n\t\t\t\t\t\tcorrectChoice: \"both (a) and (b)\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"The landmass of which of the following continents is the least?\", \n\t\t\t\t\t\tquestionType: 1, \n\t\t\t\t\t\tchoices: [ \"Africa\", \"Asia\",\"Australia\",\"Europe\"], \n\t\t\t\t\t\tcorrectChoice: \"Australia\", \n\t\t\t\t\t\tscore: 5 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"Apart from water, what runs through the mouth of the River Amazon and Lake Victoria?\", \n\t\t\t\t\t\tquestionType: 2, \n\t\t\t\t\t\tcorrectAnswer: \"Equator\", \n\t\t\t\t\t\tscore: 10 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"Which country was previously called Abyssinia?\", \n\t\t\t\t\t\tquestionType: 2, \n\t\t\t\t\t\tcorrectAnswer: \"Ethiopia\", \n\t\t\t\t\t\tscore: 10 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"What is the world's third largest sea\", \n\t\t\t\t\t\tquestionType: 2, \n\t\t\t\t\t\tcorrectAnswer: \"Mediterranean\", \n\t\t\t\t\t\tscore: 10 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"Which country at the southern tip of the Arabian Peninsula was previously known as Aden?\", \n\t\t\t\t\t\tquestionType: 2, \n\t\t\t\t\t\tcorrectAnswer: \"Yemen\", \n\t\t\t\t\t\tscore: 10 \n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tquestion: \"First Afghan War took place in\", \n\t\t\t\t\t\tquestionType: 2, \n\t\t\t\t\t\tcorrectAnswer: \"1839\", \n\t\t\t\t\t\tscore: 10 \n\t\t\t\t\t}\n\t\t\t\t];\n\t\t\t\t\n\t\t\t\tvar result = questions2[ind]; \n\t\t\t\treturn result;\n\t\t\t}", "function displayQuestions() {\n //gets the current question from global variable currentQuestion\n // display a question\n currentQuestion++;\n $(\".questions\").text(triviaQuestions[currentQuestion].questions);\n }", "function setmaxNumberOfQuestions() { \n maxNumberOfQuestions = 60;\n}", "function nextQuestion() {\n if (currentQuestion <= 4) {\n reset();\n displayQuestions();\n displayChoices();\n console.log(currentQuestion);\n } else {\n gameOver();\n }\n}", "function waitBeforeNextQuestion() {\n setTimeout(function nextQuestion() {\n \n questionIndex++;\n if (questionIndex === 4) {\n submitScore();\n } else {\n\n showQuestion();\n }\n \n \n \n }, 1000);\n}", "function renderQuestion() {\n if (questionNum < STORE.length) {\n renderQuestAns(questionNum);\n } else {\n $(\"questionNumber\").text(7);\n results();\n }\n}", "function nextQuestion() {\r\n if (STORE.questionNumber < STORE.questions.length - 1) {\r\n STORE.submittedAnswer = false;\r\n STORE.view = 'question';\r\n STORE.questionNumber++;\r\n }\r\n else {\r\n STORE.view = 'score';\r\n finalScore();\r\n }\r\n}", "function showQuestion() {\n if (questionCount === questionsObj.length) {\n stop();\n }\n else {\n $(\"#question\").html(questionsObj[questionCount].question);\n $(\"#answer1\").html(questionsObj[questionCount].choices[0]);\n $(\"#answer2\").html(questionsObj[questionCount].choices[1]);\n $(\"#answer3\").html(questionsObj[questionCount].choices[2]);\n $(\"#answer4\").html(questionsObj[questionCount].choices[3]);\n questionTime = 5;\n }\n }", "function setNextQuestion() {\n clearQuestions();\n showQuestion(randomQuestions[currentQuestionIndex])\n}", "function generateQuestions(index) {\n //Select each question by passing it a particular index\n const question = questions[index];\n const option1Total = questions[index].answer1Total;\n const option2Total = questions[index].answer2Total;\n const option3Total = questions[index].answer3Total;\n //Populate html elements\n questionEl.innerHTML = `${index + 1}. ${question.question}`\n option1.setAttribute('data-total', `${option1Total}`);\n option2.setAttribute('data-total', `${option2Total}`);\n option3.setAttribute('data-total', `${option3Total}`);\n option1.innerHTML = `${question.answer1}`\n option2.innerHTML = `${question.answer2}`\n option3.innerHTML = `${question.answer3}`\n}", "function nextQuestion(){\r\n if(i<questionBank.length-1)\r\n {\r\n i=i+1;\r\n displayQuestion();\r\n }\r\n else{\r\n points.innerHTML= score+ '/'+ questionBank.length;\r\n quizContainer.style.display= 'none';\r\n scoreboard.style.display= 'block'\r\n }\r\n}", "function iterateQuestionsAndAnswers() {\n\tif (questionIndex < questions.length - 1) {\n\t\tquestionIndex++;\n\t\tdisplayQuestions();\n\t} else if (questionIndex === questions.length - 1 && currentScoreValue > 12) {\n\t\twinner();\n\t}\n}", "function nextQuestion()\n\t\t\t{\n\t\t\t\t$(\"#oneword\").hide();\n\t\t\t\t$(\"#multiple\").hide();\n\n\t\t\t\tif(count >= 10)\n\t\t\t\t{\n\t\t\t\t\tcount = 0;\n\t\t\t\t\tendQuiz();\t\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\tcount++;\n\n\t\t\t\t\t//get the question object for next question\n\t\t\t\t\tif(day%2 == 0)\n\t\t\t\t\t\tquestion = getQuestion(randomArr[count-1]);\n\t\t\t\t\telse\n\t\t\t\t\t\tquestion = getQuestion(randomArr[count-1]);\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(count > 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t//update the progress bar\n\t\t\t\t\t\tprogressBar();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t//update the score\n\t\t\t\t\t\tupdateScore();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t//reset the form values\n\t\t\t\t\t\tdocument.getElementById(\"formName\").reset();\n\t\t\t\t\t}\n\n\t\t\t\t\t\n\t\t\t\t\t//if multiple choice question\n\t\t\t\t\tif(question.questionType == 1)\n\t\t\t\t\t{\n\t\t\t\t\t\t$(\"#multiple\").show();\n\n\t\t\t\t\t\tdocument.getElementById(\"question1\").innerHTML = question.question;\n\t\t\t\t\t\tdocument.getElementById(\"label1\").innerHTML = question.choices[0];\n\t\t\t\t\t\tdocument.getElementById(\"label2\").innerHTML = question.choices[1];\n\t\t\t\t\t\tdocument.getElementById(\"label3\").innerHTML = question.choices[2];\n\t\t\t\t\t\tdocument.getElementById(\"label4\").innerHTML = question.choices[3];\n\n\t\t\t\t\t\tdocument.getElementById(\"radio1\").setAttribute(\"value\",question.choices[0]);\n\t\t\t\t\t\tdocument.getElementById(\"radio2\").setAttribute(\"value\",question.choices[1]);\n\t\t\t\t\t\tdocument.getElementById(\"radio3\").setAttribute(\"value\",question.choices[2]);\n\t\t\t\t\t\tdocument.getElementById(\"radio4\").setAttribute(\"value\",question.choices[3]);\n\t\t\t\t\t}\n\t\t\t\t\t//if single line question\n\t\t\t\t\telse if(question.questionType == 2)\n\t\t\t\t\t{\n\t\t\t\t\t\t$(\"#oneword\").show();\n\t\t\t\t\t\tdocument.getElementById(\"question2\").innerHTML = question.question;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function handleQuestions() { \n while (shuffledQuestions.length <= 7) {\n const random = questions[Math.floor(Math.random() * questions.length)];\n if (!shuffledQuestions.includes(random)) {\n shuffledQuestions.push(random);\n }\n }\n }", "function moreQuestions() {\n\n \n $(\"#qOne\").text(questions[0]);\n $(\"#buttonTwo\").text(answerOne[0]);\n $(\"#buttonThree\").html(answerOne[1]);\n\n $(\"#qTwo\").text(questions[1]);\n $(\"#buttonFour\").text(answerOne[0]);\n $(\"#buttonFive\").html(answerOne[1]);\n\n $(\"#qThree\").text(questions[2]);\n $(\"#buttonSix\").text(answerOne[0]);\n $(\"#buttonSeven\").html(answerOne[1]);\n\n $(\"#qFour\").text(questions[3]);\n $(\"#buttonEight\").text(answerOne[0]);\n $(\"#buttonNine\").html(answerOne[1]);\n \n $(\"#qFive\").text(questions[4]);\n $(\"#buttonTen\").text(answerOne[0]);\n $(\"#buttonElev\").html(answerOne[1]);\n \n}", "function getQuestions(answers) {\n \n // Generates a list of all question in the DOM\n generateQuestionList(answers);\n \n // Finds out if selected quiz has questionsPerPage option\n if (quiz.hasOwnProperty('questionsPerPage')) {\n \n // Generates questions per page option\n generateQuestionsPerPage();\n \n // Loads #questionPerPage page\n $( \":mobile-pagecontainer\" ).pagecontainer( \"change\", \"index.html#questionPerPage\", {\n role: \"page\",\n transition: \"slide\"\n });\n $(\".ui-content\").trigger(\"create\");\n \n } else {\n questions = 1;\n // Shows first question in #question page\n getFirstQuestion(questions);\n }\n}", "function takeQuiz() {\n // Quiz is below\n if (count <= 9) {\n if (play === 0) {\n var Questions = function(question, ans1, ans2, ans3, correct) {\n this.question = question;\n this.ans1 = ans1;\n this.ans2 = ans2;\n this.ans3 = ans3;\n this.correct = correct;\n };\n\n // var question0 = new Questions(\n // \"Which of these is a fruit?\",\n // \"A. apple\",\n // \"B. rock\",\n // \"C. paper\",\n // \"apple\"\n // );\n // var question1 = new Questions(\n // \"which is best?\",\n // \"A. andriod\",\n // \"B. ios\",\n // \"C. kaios\",\n // \"android\"\n // );\n // var question2 = new Questions(\n // \"Which is a place from india?\",\n // \"A. Delhi\",\n // \"B. karchi\",\n // \"C. dhaka\",\n // \"Delhi\"\n // );\n\n var question0 = new Questions(\n \"Who was the author of the famous storybook 'Alice's Adventures in Wonderland'?\",\n \"A.Rudyard Kipling\",\n \"B.John Keats\",\n \"C.Lewis Carroll\",\n \"C\"\n );\n var question1 = new Questions(\n \"Who wrote the famous 1885 poem 'The Charge of the Light Brigade'?\",\n \"A.Lord Alfred Tennyson\",\n \"B.Chirstopher Marlowe\",\n \"C.Johannes Gutenberg\",\n \"A\"\n );\n var question2 = new Questions(\n \"Who wrote 'Where ignorance is bliss,itis folly to be wise'?\",\n \"A.Browning\",\n \"B.Marx\",\n \"C.Shakspeare\",\n \"C\"\n );\n var question3 = new Questions(\n \"Name the book which opens with the line 'All children,except one grew up'?\",\n \"A.The Railway Children\",\n \"B.Winnnie the Pooh\",\n \"C.Peter Pan\",\n \"C\"\n );\n var question4 = new Questions(\n \"Which is the first Harry Potter book?\",\n \"A.HP and The Goblet Of The Fire\",\n \"B.HP and The Philospher's Stone\",\n \"C.HP and The Chamber Of Secrets\",\n \"B\"\n );\n var question5 = new Questions(\n \"In which century were Geoffrey Chaucer's Canterbury Tales written?\",\n \"A.13th-14th\",\n \"B.14th-15th\",\n \"C.15th-16th\",\n \"A\"\n );\n var question6 = new Questions(\n \"What was the nationality of Robert Louis Stevenson,writer of 'Treasure Island'?\",\n \"A.Scottish\",\n \"B.Welsh\",\n \"C.Irish\",\n \"A\"\n );\n var question7 = new Questions(\n \"'Jane Eyre' was written by Bronte sister?\",\n \"A.Anne\",\n \"B.Charlotte\",\n \"C.Emily\",\n \"B\"\n );\n var question8 = new Questions(\n \"What is the book 'Lord of the Flies'about?\",\n \"A.A round trip around the USA\",\n \"B.A swarm of killer flies\",\n \"C.Schoolboys on the desert island\",\n \"C\"\n );\n var question9 = new Questions(\n \"In the book 'The Lord Of The Rings',who or what is bilbo?\",\n \"A.Drwaf\",\n \"B.Wizard\",\n \"C.Hobbit\",\n \"C\"\n );\n QuestionsArray = [\n question0,\n question1,\n question2,\n question3,\n question4,\n question5,\n question6,\n question7,\n question8,\n question9\n ];\n\n // QuestionsArray = [question0, question1, question2];\n if (play === 0) {\n random = Math.floor(Math.random() * 10);\n console.log(random);\n console.log(askedQuestions);\n\n for (i = 0; i < askedQuestions.length; i++) {\n if (random == askedQuestions[i]) {\n questionIsAsked = 1;\n console.log(\"question repeted\");\n }\n }\n if (questionIsAsked == 0) {\n document.getElementById(\"playerName\").textContent =\n \"Hello \" + name;\n console.log(name);\n\n document.getElementById(\"question\").innerHTML +=\n \"<h3>\" +\n questionNo +\n \". \" +\n QuestionsArray[random].question +\n \"<br/>\" +\n QuestionsArray[random].ans1 +\n \"<br/>\" +\n QuestionsArray[random].ans2 +\n \"<br/>\" +\n QuestionsArray[random].ans3 +\n \"<br/>\" +\n \"------------------------------------\";\n\n questionNo += 1;\n askedQuestions.push(random);\n } else if (questionIsAsked == 1) {\n questionIsAsked = 0;\n takeQuiz();\n }\n }\n }\n }\n}", "function choice(){\n var answer = document.getElementsByName('q');\n for(i = 0; i < answer.length; i++) {\n if (answer[i].checked) {\n friend.selections.push(parseInt(answer[i].value));\n } \n // else {\n // \treturn alert(\"Please choose\");\n // \tquestionNumber--;\n // }\n }\n }", "function nextAnswers() {\n\t\tif (CURRENT_QNUM <= NUM_QUESTIONS) {\n\t\t\tvar index = order[CURRENT_QNUM-1]-1;\n\t\t\treturn answers[index];\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}", "function printQuestions(){\n\t\t//Access div on page to hold the questions\n\t\tquestionEl = document.getElementById(\"questionEl\");\n\t\t//start with a blank question area each time the game is played\n\t\tquestionEl.innerHTML = \"\";\n\t\tfor(var i = 0; i < questions.length; i++){\n\t\t\t//Put the question on the page\n\t\t\tquestionEl.innerHTML += '<h3>Question ' + (i + 1)+ ': ' + questions[i] + '</h3>';\n\t\t}\n\t}", "function displayQuestion(n){\n\tif(n<questions.length){\n\t\tcountDownTimer = \n\t\t\tsetInterval(function(){ \n\t\t\t\t$(\"#timer\").html(--counter);\n\t\t\t\tif(counter==0) {\n\t\t\t\t\tclearInterval(countDownTimer); \n\t\t\t\t\tcheckAnswer(questionNumber, \"\"); \n\t\t\t\t} \n\t\t\t}, 1000);\n\t\t$(\"p\").html(questions[n].question + \"<br>\");\n\t\tvar answers = JSON.parse(JSON.stringify(questions[n].wrong_answers)); \n\t\tanswers.push(questions[n].answer); \n\t\tanswers.sort(function(a,b){ //randomizes order of answers in the array\n\t\t\treturn 0.5-Math.random();\n\t\t})\n\t\tfor(var i=0; i<answers.length; i++){\n\t\t\tvar button = $(\"<button>\"); \n\t\t\tbutton.text(answers[i]); \n\t\t\t$(\"p\").append(button); \n\t\t}\n\t\tquestionNumber++; \n\t}else{\n\t\tdisplayScore();\n\t}\t\n}", "function generateQuestion(quiz, ip) {\n const number1 = genNum();\n const number2 = genNum();\n quiz.questions.push({\n ip,\n askTime: new Date(),\n number1,\n number2,\n answerCorrect: number1 * number2\n });\n}", "function showQuestion() {\n if (trackQuestion == questions.length) {\n scorePage();\n } else {\n questionElement.textContent = questions[trackQuestion].question;\n btn1.textContent = questions[trackQuestion].answers[0];\n btn2.textContent = questions[trackQuestion].answers[1];\n btn3.textContent = questions[trackQuestion].answers[2];\n btn4.textContent = questions[trackQuestion].answers[3];\n trackQuestion++;\n console.log(trackQuestion);\n }\n}", "function nextQuestion() {\n currentQuestion++;\n \n if (currentQuestion < quiz.length) {\n displayQuestion();\n } else {\n showResult();\n }\n }", "function insertquestion(arrayname, qnumber) {\n\t$('.questions, #answers').empty();\n\tconsole.log('starting forloop');\n\tfor (var i = 0; i < arrayname.length; i++){\n\t\tif (i === qnumber) {\n\t\t\t$('#qnum').empty().append('Question ' + (i + 1));\n\t\t\t$('.questions').prepend('<h2 id=\"q\">' + arrayname[i].question + '</h2>');\n\t\tfor (var j = 0; j <= 4; j++) {\n\t\t\t$('#answers').append('<h3 class=\"anschoice\">' + arrayname[i].answers[j] + '</h3>');\n\t\t\t}\n\t\t}\n\t\telse {console.log('fail')};\n\t}\n}", "function displayQs() {\n activeQuestion = questionsAndAnswers[Math.floor(Math.random() * questionsAndAnswers.length)];\n $(\"#question-div\").html(\"<p>\" + activeQuestion.q + \"</p>\");\n}", "function generateQuestions (index) {\n //Select each question by passing it a particular index\n const question = questions[index];\n const option1Total = questions[index].answer1Total;\n const option2Total = questions[index].answer2Total;\n const option3Total = questions[index].answer3Total;\n //Populate html elements \n questionEl.innerHTML = `${index + 1}. ${question.question}`\n option1.setAttribute('data-total', `${option1Total}`);\n option2.setAttribute('data-total', `${option2Total}`);\n option3.setAttribute('data-total', `${option3Total}`);\n option1.innerHTML = `${question.answer1}`\n option2.innerHTML = `${question.answer2}`\n option3.innerHTML = `${question.answer3}`\n}", "function generateQuestions (index) {\n //Select each question by passing it a particular index\n const question = questions[index];\n const option1Total = questions[index].answer1Total;\n const option2Total = questions[index].answer2Total;\n const option3Total = questions[index].answer3Total;\n //Populate html elements \n questionEl.innerHTML = `${index + 1}. ${question.question}`\n option1.setAttribute('data-total', `${option1Total}`);\n option2.setAttribute('data-total', `${option2Total}`);\n option3.setAttribute('data-total', `${option3Total}`);\n option1.innerHTML = `${question.answer1}`\n option2.innerHTML = `${question.answer2}`\n option3.innerHTML = `${question.answer3}`\n}", "function nextQuestion() {\n questionNumber++;\n\n // empty text area and remove message\n $(\"#correct\").fadeIn(500).addClass(\"d-none\");\n $(\"#input-answer\").val(\"\");\n $(\"#input-answer\").css(\"color\", \"#212429\");\n\n arrayPositionSelect++;\n if (questionNumber < 5 && numberOfLives >= 0) {\n showQuestion(); // Dont need to call generate question (all questions generated)\n } else if (questionNumber > 4 && numberOfLives >= 0) {\n roundComplete();\n // Start Round\n } else if (numberOfLives < 0) {\n gameOver();\n }\n}", "function next_question() {\n if (q_index < 49) {\n q_index++;\n let new_question = questions[q_index];\n console.log(new_question);\n $('.question').text(new_question);\n } else {\n calculate_results();\n $(\".test_interface\").addClass(\"hidden\");\n $(\".test_done\").removeClass(\"hidden\");\n }\n}", "function getQuiz() {\n var cnt = 0;\n Quiz.aggregate([{ $sample: { size: 3 } }]).foreach((element) => {\n //random generate 3 quizzes from db\n quiz[cnt] = element;\n cnt++;\n });\n return quiz;\n }", "function Question(num) {\n this.num = num;\n this.question = questions[num].question;\n this.choices = questions[num].choices;\n this.correctAnswer = questions[num].correctAnswer;\n}", "function Question(num) {\n this.num = num;\n this.question = questions[num].question;\n this.choices = questions[num].choices;\n this.correctAnswer = questions[num].correctAnswer;\n}" ]
[ "0.6871267", "0.6706954", "0.66714334", "0.6667242", "0.6599888", "0.65858513", "0.658443", "0.65774673", "0.65694326", "0.65512866", "0.6536591", "0.6510275", "0.64973545", "0.6485486", "0.6452612", "0.6437645", "0.64375615", "0.64278245", "0.6426504", "0.6415988", "0.6412324", "0.6404654", "0.6343279", "0.63423324", "0.63401794", "0.6316799", "0.63115054", "0.62983817", "0.6285312", "0.62759995", "0.62741953", "0.6270244", "0.62610346", "0.6260892", "0.6260892", "0.6260892", "0.6246056", "0.6246056", "0.62386364", "0.6231868", "0.62313664", "0.6218755", "0.620245", "0.62015045", "0.6200436", "0.6196046", "0.6188371", "0.61874855", "0.6184584", "0.6180067", "0.617717", "0.61588615", "0.61556864", "0.61466646", "0.6144941", "0.6141751", "0.61395323", "0.6134116", "0.61329436", "0.61311245", "0.6113389", "0.6113181", "0.611056", "0.6108805", "0.6099981", "0.60997176", "0.60953295", "0.60943544", "0.60921276", "0.6084073", "0.6079771", "0.6068599", "0.60684484", "0.6064803", "0.60643643", "0.6060129", "0.6059245", "0.6054652", "0.60521406", "0.6050862", "0.6043939", "0.6038761", "0.6035027", "0.60336524", "0.6014734", "0.60115457", "0.60089636", "0.6007759", "0.60076684", "0.60036963", "0.6000451", "0.599911", "0.5996622", "0.59962964", "0.5996004", "0.5996004", "0.599471", "0.5993828", "0.59921676", "0.5990689", "0.5990689" ]
0.0
-1
! The buffer module from node.js, for the browser.
function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function createBuffer() {\n var ptr = exports.hb_buffer_create();\n return {\n ptr: ptr,\n /**\n * Add text to the buffer.\n * @param {string} text Text to be added to the buffer.\n **/\n addText: function (text) {\n const str = createJsString(text);\n exports.hb_buffer_add_utf16(ptr, str.ptr, str.length, 0, str.length);\n str.free();\n },\n /**\n * Set buffer script, language and direction.\n *\n * This needs to be done before shaping.\n **/\n guessSegmentProperties: function () {\n return exports.hb_buffer_guess_segment_properties(ptr);\n },\n /**\n * Set buffer direction explicitly.\n * @param {string} direction: One of \"ltr\", \"rtl\", \"ttb\" or \"btt\"\n */\n setDirection: function (dir) {\n exports.hb_buffer_set_direction(ptr, {\n ltr: 4,\n rtl: 5,\n ttb: 6,\n btt: 7\n }[dir] || 0);\n },\n /**\n * Set buffer flags explicitly.\n * @param {string[]} flags: A list of strings which may be either:\n * \"BOT\"\n * \"EOT\"\n * \"PRESERVE_DEFAULT_IGNORABLES\"\n * \"REMOVE_DEFAULT_IGNORABLES\"\n * \"DO_NOT_INSERT_DOTTED_CIRCLE\"\n * \"PRODUCE_UNSAFE_TO_CONCAT\"\n */\n setFlags: function (flags) {\n var flagValue = 0\n flags.forEach(function (s) {\n flagValue |= _buffer_flag(s);\n })\n\n exports.hb_buffer_set_flags(ptr,flagValue);\n },\n /**\n * Set buffer language explicitly.\n * @param {string} language: The buffer language\n */\n setLanguage: function (language) {\n var str = createAsciiString(language);\n exports.hb_buffer_set_language(ptr, exports.hb_language_from_string(str.ptr,-1));\n str.free();\n },\n /**\n * Set buffer script explicitly.\n * @param {string} script: The buffer script\n */\n setScript: function (script) {\n var str = createAsciiString(script);\n exports.hb_buffer_set_script(ptr, exports.hb_script_from_string(str.ptr,-1));\n str.free();\n },\n\n /**\n * Set the Harfbuzz clustering level.\n *\n * Affects the cluster values returned from shaping.\n * @param {number} level: Clustering level. See the Harfbuzz manual chapter\n * on Clusters.\n **/\n setClusterLevel: function (level) {\n exports.hb_buffer_set_cluster_level(ptr, level)\n },\n /**\n * Return the buffer contents as a JSON object.\n *\n * After shaping, this function will return an array of glyph information\n * objects. Each object will have the following attributes:\n *\n * - g: The glyph ID\n * - cl: The cluster ID\n * - ax: Advance width (width to advance after this glyph is painted)\n * - ay: Advance height (height to advance after this glyph is painted)\n * - dx: X displacement (adjustment in X dimension when painting this glyph)\n * - dy: Y displacement (adjustment in Y dimension when painting this glyph)\n * - flags: Glyph flags like `HB_GLYPH_FLAG_UNSAFE_TO_BREAK` (0x1)\n **/\n json: function () {\n var length = exports.hb_buffer_get_length(ptr);\n var result = [];\n var infosPtr = exports.hb_buffer_get_glyph_infos(ptr, 0);\n var infosPtr32 = infosPtr / 4;\n var positionsPtr32 = exports.hb_buffer_get_glyph_positions(ptr, 0) / 4;\n var infos = heapu32.subarray(infosPtr32, infosPtr32 + 5 * length);\n var positions = heapi32.subarray(positionsPtr32, positionsPtr32 + 5 * length);\n for (var i = 0; i < length; ++i) {\n result.push({\n g: infos[i * 5 + 0],\n cl: infos[i * 5 + 2],\n ax: positions[i * 5 + 0],\n ay: positions[i * 5 + 1],\n dx: positions[i * 5 + 2],\n dy: positions[i * 5 + 3],\n flags: exports.hb_glyph_info_get_glyph_flags(infosPtr + i * 20)\n });\n }\n return result;\n },\n /**\n * Free the object.\n */\n destroy: function () { exports.hb_buffer_destroy(ptr); }\n };\n }", "function haveBuffer() {\n return typeof commonjsGlobal !== 'undefined' && typeof commonjsGlobal.Buffer !== 'undefined';\n}", "function Buffer(arg){if(!(this instanceof Buffer)){ // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\nif(arguments.length>1)return new Buffer(arg,arguments[1]);return new Buffer(arg);}if(!Buffer.TYPED_ARRAY_SUPPORT){this.length=0;this.parent=undefined;} // Common case.\nif(typeof arg==='number'){return fromNumber(this,arg);} // Slightly less common case.\nif(typeof arg==='string'){return fromString(this,arg,arguments.length>1?arguments[1]:'utf8');} // Unusual.\nreturn fromObject(this,arg);}", "function typedBuffer() {\n }", "function isBuffer(f){return!!f.constructor&&\"function\"==typeof f.constructor.isBuffer&&f.constructor.isBuffer(f)}", "function isBuffer(val){\nreturn val.constructor&&typeof val.constructor.isBuffer==='function'&&val.constructor.isBuffer(val);\n}", "function Buffer (arg) {\n\t\t if (!(this instanceof Buffer)) {\n\t\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t\t return new Buffer(arg)\n\t\t }\n\t\t\n\t\t this.length = 0\n\t\t this.parent = undefined\n\t\t\n\t\t // Common case.\n\t\t if (typeof arg === 'number') {\n\t\t return fromNumber(this, arg)\n\t\t }\n\t\t\n\t\t // Slightly less common case.\n\t\t if (typeof arg === 'string') {\n\t\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t\t }\n\t\t\n\t\t // Unusual.\n\t\t return fromObject(this, arg)\n\t\t}", "function SyncBuffer(buffer)\n{\n this.buffer = buffer;\n this.byteLength = buffer.byteLength;\n}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function wrapBuffer(buffer) {\n return buffer;\n}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t this.length = 0\n\t this.parent = undefined\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor\n && typeof val.constructor.isBuffer === 'function'\n && val.constructor.isBuffer(val);\n}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function isBuffer(val) {\n return val.constructor && typeof val.constructor.isBuffer === 'function' && val.constructor.isBuffer(val);\n}", "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\n\tif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "function isBuffer(value) {\n var _a;\n return typeof value === 'object' && ((_a = value === null || value === void 0 ? void 0 : value.constructor) === null || _a === void 0 ? void 0 : _a.name) === 'Buffer';\n}", "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t this.length = 0;\n\t this.parent = undefined;\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "function StringBuffer()\n{ \n this.buffer = []; \n}", "function Buffer(arg,encodingOrOffset,length){\n// Common case.\nif(typeof arg===\"number\"){if(typeof encodingOrOffset===\"string\"){throw new Error(\"If encoding is specified then the first argument must be a string\")}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}", "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "function Buffer(arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1]);\n\t return new Buffer(arg);\n\t }\n\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0;\n\t this.parent = undefined;\n\t }\n\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg);\n\t }\n\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8');\n\t }\n\n\t // Unusual.\n\t return fromObject(this, arg);\n\t}", "function getBufferFromIfPresent() {\n return root.Buffer && root.Buffer.from && root.Buffer.from.bind(root.Buffer);\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n this.length = 0\n this.parent = undefined\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n }", "function loadBuffer(url) {\n if(typeof document !== 'undefined') {\n buffer = new Uint8Array([30]);\n } else {\n buffer = fs.readFileSync(url);\n }\n}", "function DBusBuffer(buffer, startPos, options) {\n if (typeof options !== 'object') {\n options = { ayBuffer: true, ReturnLongjs: false };\n } else if (options.ayBuffer === undefined) {\n // default settings object\n options.ayBuffer = true; // enforce truthy default props\n }\n this.options = options;\n this.buffer = buffer;\n (this.startPos = startPos ? startPos : 0), (this.pos = 0);\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}", "function Buffer (arg) {\n if (!(this instanceof Buffer)) {\n // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n if (arguments.length > 1) return new Buffer(arg, arguments[1])\n return new Buffer(arg)\n }\n\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n this.length = 0\n this.parent = undefined\n }\n\n // Common case.\n if (typeof arg === 'number') {\n return fromNumber(this, arg)\n }\n\n // Slightly less common case.\n if (typeof arg === 'string') {\n return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n }\n\n // Unusual.\n return fromObject(this, arg)\n}" ]
[ "0.7284428", "0.7284428", "0.7284428", "0.7284428", "0.7284428", "0.7284428", "0.7242275", "0.72009933", "0.71086955", "0.7015804", "0.68968946", "0.68760246", "0.6799534", "0.67715156", "0.67568755", "0.67568755", "0.67568755", "0.67568755", "0.67568755", "0.67568755", "0.67568755", "0.6752469", "0.6745758", "0.6745758", "0.6745758", "0.6745758", "0.6745758", "0.6745758", "0.6725982", "0.6725982", "0.6725982", "0.6725982", "0.6725982", "0.6725982", "0.6725982", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.67132896", "0.66970664", "0.66970664", "0.66970664", "0.66970664", "0.66970664", "0.66970664", "0.669554", "0.6689592", "0.6687056", "0.6687056", "0.6684711", "0.6674804", "0.66706926", "0.66634446", "0.6645289", "0.6645289", "0.6629586", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.66273725", "0.65895003", "0.65895003", "0.6577366", "0.657413", "0.6556236", "0.65463054", "0.65463054", "0.65463054", "0.65463054", "0.65463054", "0.65463054", "0.65463054", "0.65463054", "0.65463054", "0.65463054", "0.65463054" ]
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function s(t){var r=t;return e.isBuffer(r)||(r=e.from(r)),o.default.encode(r)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "function test_candu_graphs_vm_compare_host_vsphere65() {}", "protected internal function m252() {}", "function setup() {\n\n\n}", "function setup() {\n\n\n}", "function hc(){}", "IP() {\n // return \"47.106.171.247\";\n return \"tcjump.anyh5.com\";\n // return \"tcrhythm.anyh5.com\";\n }", "function NetworkUtil(){ \n}", "function vB_PHP_Emulator()\n{\n}", "function test_utilization_host() {}", "info() { }", "ping() {\n return \"pong!\"\n }", "function _____SHARED_functions_____(){}", "function ZNPSerial() {\n}", "function setup() {\n \n}", "function test_candu_graphs_datastore_vsphere6() {}", "static private protected internal function m118() {}", "static private internal function m121() {}", "function version(){ return \"0.13.0\" }", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "playCAS(casfile) {\n//------\nlggr.warn(\"SigningAvatar: playCAS: Not implemented\");\nreturn void 0;\n}", "function NetworkUtil(){}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "static final protected internal function m110() {}", "function setup() {\r\n}", "transient private internal function m185() {}", "static MAGIC_NUMBER(){\n return \"PIXPIPE_PIXBIN\";\n }", "static fromCASFile(casfile) {\n//-----------\nlggr.warn(\"fromCASFile: Not implemented\");\nreturn void 0;\n}", "transient protected internal function m189() {}", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "function setup() {\n \n}", "function setup() {\n \n}", "function DWRUtil() { }", "supportsPlatform() {\n return true;\n }", "getPort2() {\n return 0;\n }", "transient private protected internal function m182() {}", "function version() {\n outlet(2, 249);\n}", "function SigV4Utils() { }", "function init(){\n // loadHeaders(); //load platform headers\n}", "function rc(){}", "static protected internal function m125() {}", "function mbcs() {}", "function mbcs() {}", "function setup() { \n\n}", "function fos6_c() {\n ;\n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "get BC7() {}", "package() {\n let rxString = this.rx.toString(2);\n rxString = '00'.substr(rxString.length) + rxString;\n let ryString = this.rx.toString(2);\n ryString = '00'.substr(ryString.length) + ryString;\n \n this.output = \n this.noop.toString() +\n this.inputc.toString() +\n this.inputcf.toString() +\n this.inputd.toString() +\n this.inputdf.toString() +\n this.move.toString() +\n this.loadi.toString() +\n this.add.toString() +\n this.addi.toString() +\n this.sub.toString() +\n this.subi.toString() +\n this.load.toString() +\n this.loadf.toString() +\n this.store.toString() +\n this.storef.toString() +\n this.shiftl.toString() +\n this.shiftr.toString() +\n this.cmp.toString() +\n this.jump.toString() +\n this.bre.toString() +\n this.brne.toString() +\n this.brg.toString() +\n this.brge.toString() + \n this.rx +\n this.ry;\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static final private public function m104() {}", "function CCUtility() {}", "static isMAC(mac){ return F.isMAC(mac) }", "__ssl() {\n /// TODO: nothing, I guess?\n }", "initialize() {}" ]
[ "0.6103753", "0.6020775", "0.5490901", "0.5483451", "0.5433593", "0.54231304", "0.53348273", "0.5305822", "0.52803075", "0.526343", "0.526343", "0.52513844", "0.5251022", "0.5234475", "0.52090615", "0.52019906", "0.5190295", "0.5179984", "0.51776373", "0.5133519", "0.5129299", "0.51271933", "0.5123561", "0.511986", "0.5112801", "0.51098186", "0.50971055", "0.5094048", "0.50901127", "0.50901127", "0.50901127", "0.50901127", "0.50867635", "0.5082001", "0.5077779", "0.5074136", "0.50722253", "0.50620097", "0.506176", "0.5058936", "0.5058936", "0.5058526", "0.50550914", "0.5051468", "0.504649", "0.5036022", "0.50280994", "0.5020488", "0.5017164", "0.50159746", "0.50085485", "0.50085485", "0.49979907", "0.49968764", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.4994609", "0.4985803", "0.49842164", "0.49842164", "0.49842164", "0.49835196", "0.49710009", "0.4960199", "0.49594826", "0.4952787" ]
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function c(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];if(e.add)e.add.apply(e,r);else if(e.set)e.set.apply(e,r);else{if(!e.push)throw new TypeError("Could not determine how to insert into the specified container");e.push.apply(e,r)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "function test_candu_graphs_vm_compare_host_vsphere65() {}", "protected internal function m252() {}", "function setup() {\n\n\n}", "function setup() {\n\n\n}", "function hc(){}", "IP() {\n // return \"47.106.171.247\";\n return \"tcjump.anyh5.com\";\n // return \"tcrhythm.anyh5.com\";\n }", "function NetworkUtil(){ \n}", "function vB_PHP_Emulator()\n{\n}", "function test_utilization_host() {}", "info() { }", "ping() {\n return \"pong!\"\n }", "function _____SHARED_functions_____(){}", "function ZNPSerial() {\n}", "function setup() {\n \n}", "function test_candu_graphs_datastore_vsphere6() {}", "static private protected internal function m118() {}", "static private internal function m121() {}", "function version(){ return \"0.13.0\" }", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "playCAS(casfile) {\n//------\nlggr.warn(\"SigningAvatar: playCAS: Not implemented\");\nreturn void 0;\n}", "function NetworkUtil(){}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "static final protected internal function m110() {}", "function setup() {\r\n}", "transient private internal function m185() {}", "static MAGIC_NUMBER(){\n return \"PIXPIPE_PIXBIN\";\n }", "static fromCASFile(casfile) {\n//-----------\nlggr.warn(\"fromCASFile: Not implemented\");\nreturn void 0;\n}", "transient protected internal function m189() {}", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "function setup() {\n \n}", "function setup() {\n \n}", "function DWRUtil() { }", "supportsPlatform() {\n return true;\n }", "getPort2() {\n return 0;\n }", "transient private protected internal function m182() {}", "function version() {\n outlet(2, 249);\n}", "function SigV4Utils() { }", "function init(){\n // loadHeaders(); //load platform headers\n}", "function rc(){}", "static protected internal function m125() {}", "function mbcs() {}", "function mbcs() {}", "function setup() { \n\n}", "function fos6_c() {\n ;\n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "get BC7() {}", "package() {\n let rxString = this.rx.toString(2);\n rxString = '00'.substr(rxString.length) + rxString;\n let ryString = this.rx.toString(2);\n ryString = '00'.substr(ryString.length) + ryString;\n \n this.output = \n this.noop.toString() +\n this.inputc.toString() +\n this.inputcf.toString() +\n this.inputd.toString() +\n this.inputdf.toString() +\n this.move.toString() +\n this.loadi.toString() +\n this.add.toString() +\n this.addi.toString() +\n this.sub.toString() +\n this.subi.toString() +\n this.load.toString() +\n this.loadf.toString() +\n this.store.toString() +\n this.storef.toString() +\n this.shiftl.toString() +\n this.shiftr.toString() +\n this.cmp.toString() +\n this.jump.toString() +\n this.bre.toString() +\n this.brne.toString() +\n this.brg.toString() +\n this.brge.toString() + \n this.rx +\n this.ry;\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static final private public function m104() {}", "function CCUtility() {}", "static isMAC(mac){ return F.isMAC(mac) }", "__ssl() {\n /// TODO: nothing, I guess?\n }", "initialize() {}" ]
[ "0.61048126", "0.6021762", "0.54909676", "0.5483541", "0.54344064", "0.54226637", "0.5334779", "0.53060097", "0.52813524", "0.52649856", "0.52649856", "0.52509665", "0.52495617", "0.52337855", "0.52084035", "0.5202822", "0.5191053", "0.5180246", "0.5178851", "0.51328206", "0.51305735", "0.51283973", "0.5124183", "0.5120446", "0.5111861", "0.51103055", "0.5097001", "0.5093396", "0.5091417", "0.5091417", "0.5091417", "0.5091417", "0.5086482", "0.50835353", "0.5078473", "0.5074227", "0.5072048", "0.5062735", "0.50611293", "0.5060342", "0.5060342", "0.505904", "0.50549984", "0.50514144", "0.5047543", "0.5035478", "0.5027165", "0.502045", "0.5017937", "0.5016311", "0.5008021", "0.5008021", "0.49996668", "0.49966475", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49940896", "0.498576", "0.49837768", "0.49837768", "0.49837768", "0.49832895", "0.497061", "0.49594927", "0.49581265", "0.4955257" ]
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function s(e){return new n.default(function(t){t(c(e))})}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "function test_candu_graphs_vm_compare_host_vsphere65() {}", "protected internal function m252() {}", "function setup() {\n\n\n}", "function setup() {\n\n\n}", "IP() {\n // return \"47.106.171.247\";\n return \"tcjump.anyh5.com\";\n // return \"tcrhythm.anyh5.com\";\n }", "function hc(){}", "function NetworkUtil(){ \n}", "function vB_PHP_Emulator()\n{\n}", "function test_utilization_host() {}", "info() { }", "ping() {\n return \"pong!\"\n }", "function _____SHARED_functions_____(){}", "function ZNPSerial() {\n}", "function setup() {\n \n}", "function test_candu_graphs_datastore_vsphere6() {}", "static private protected internal function m118() {}", "static private internal function m121() {}", "function version(){ return \"0.13.0\" }", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "playCAS(casfile) {\n//------\nlggr.warn(\"SigningAvatar: playCAS: Not implemented\");\nreturn void 0;\n}", "function NetworkUtil(){}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "static final protected internal function m110() {}", "function setup() {\r\n}", "transient private internal function m185() {}", "static MAGIC_NUMBER(){\n return \"PIXPIPE_PIXBIN\";\n }", "static fromCASFile(casfile) {\n//-----------\nlggr.warn(\"fromCASFile: Not implemented\");\nreturn void 0;\n}", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "transient protected internal function m189() {}", "function setup() {\n \n}", "function setup() {\n \n}", "function DWRUtil() { }", "supportsPlatform() {\n return true;\n }", "getPort2() {\n return 0;\n }", "transient private protected internal function m182() {}", "function version() {\n outlet(2, 249);\n}", "function SigV4Utils() { }", "function init(){\n // loadHeaders(); //load platform headers\n}", "function rc(){}", "static protected internal function m125() {}", "function mbcs() {}", "function mbcs() {}", "function setup() { \n\n}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "function fos6_c() {\n ;\n }", "get BC7() {}", "package() {\n let rxString = this.rx.toString(2);\n rxString = '00'.substr(rxString.length) + rxString;\n let ryString = this.rx.toString(2);\n ryString = '00'.substr(ryString.length) + ryString;\n \n this.output = \n this.noop.toString() +\n this.inputc.toString() +\n this.inputcf.toString() +\n this.inputd.toString() +\n this.inputdf.toString() +\n this.move.toString() +\n this.loadi.toString() +\n this.add.toString() +\n this.addi.toString() +\n this.sub.toString() +\n this.subi.toString() +\n this.load.toString() +\n this.loadf.toString() +\n this.store.toString() +\n this.storef.toString() +\n this.shiftl.toString() +\n this.shiftr.toString() +\n this.cmp.toString() +\n this.jump.toString() +\n this.bre.toString() +\n this.brne.toString() +\n this.brg.toString() +\n this.brge.toString() + \n this.rx +\n this.ry;\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static final private public function m104() {}", "function CCUtility() {}", "static isMAC(mac){ return F.isMAC(mac) }", "__ssl() {\n /// TODO: nothing, I guess?\n }", "initialize() {}" ]
[ "0.61022836", "0.6019248", "0.549201", "0.5484461", "0.5432154", "0.5421906", "0.5335171", "0.5306816", "0.52785707", "0.5263736", "0.5263736", "0.5251904", "0.52512866", "0.52353966", "0.52072793", "0.5203911", "0.5190287", "0.51809", "0.51764977", "0.51338243", "0.5129332", "0.51276904", "0.5121869", "0.5117747", "0.51098585", "0.51097494", "0.5095425", "0.5095414", "0.5090264", "0.5090264", "0.5090264", "0.5090264", "0.5085239", "0.5082261", "0.5075212", "0.5073538", "0.5069976", "0.50602305", "0.5059622", "0.50591534", "0.50591534", "0.50580686", "0.5054442", "0.50525934", "0.5044211", "0.50350094", "0.5026606", "0.5021062", "0.5016607", "0.5014172", "0.50066394", "0.50066394", "0.49982893", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952123", "0.49933246", "0.49846366", "0.49845675", "0.49845675", "0.49845675", "0.49816498", "0.49690256", "0.49615988", "0.4957238", "0.49529642" ]
0.0
-1
! util/algconfig.js Functions for managing algorithm set options Copyright (c) 2015 Cisco Systems, Inc. See LICENSE file.
function n(e){return e.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "getConfigOptions(polygon) {\n return CONFIG.options.reduce((result, key) => {\n result[key] = this.getPolylabelType() === 'collection' ? polygon.options.get(key) : polygon.options[key];\n return result;\n }, {});\n }", "async getAlgorithms () {\n try {\n const res = await api().get('/algorithm')\n return Array.isArray(res.data) ? res.data : []\n } catch (e) {\n return []\n }\n }", "function algorithmOptions(frameNum) {\n\tlet mapping = {\n\t\t'3': [3, 1], // Reading frame codons\n\t\t'1': [3, 3], // Protein sequence\n\t\t'3bp': [3, 1], // Tri-nucleotides\n\t\t'2bpx2': [2, 1], // Di-nucleotide pairs\n\t\t'2bp': [2, 2], // Di-nucleotides\n\t\t'1bp': [1, 1] // Mono-nucleotides\n\t};\n\treturn mapping[frameNum];\n}", "get alg() {\n return this.keys[0].alg;\n }", "getConfig () {}", "function checkAlgoliaConfig() {\n let configOK = true;\n\n\n if (ALGOLIA_APPLICATION_ID == \"undefined\" || ALGOLIA_APPLICATION_ID == \"\") {\n console.error(\"checkAlgoliaConfig: ALGOLIA_APPLICATION_ID = NOT set\");\n configOK = false;\n }\n\n if (ALGOLIA_SEARCH_ONLY_APIKEY == \"undefined\" || ALGOLIA_SEARCH_ONLY_APIKEY == \"\") {\n console.error(\"checkAlgoliaConfig: ALGOLIA_SEARCH_ONLY_APIKEY = NOT set\");\n configOK = false;\n }\n\n if (ALGOLIA_ADMIN_APIKEY == \"undefined\" || ALGOLIA_ADMIN_APIKEY == \"\") {\n console.error(\"checkAlgoliaConfig: ALGOLIA_ADMIN_APIKEY = NOT set\");\n configOK = false; \n }\n\n if (ALGOLIA_INDEXNAME == \"undefined\" || ALGOLIA_INDEXNAME == \"\") {\n console.error(\"checkAlgoliaConfig: ALGOLIA_INDEXNAME = NOT set\");\n configOK = false; \n }\n\n return configOK;\n\n}", "setAlgorithm(index) {\n if (index > algorithms.length || index < 0) throw 'algorithm not valid';\n\n this._initRouting();\n this.algorithm = algorithms[index];\n\n // bus routing\n this.algorithm.output.forEach((routing, i) => {\n routing.forEach(function (outputIndex) {\n this.operators[i].source.connect(this.outputBusses[outputIndex]);\n }, this);\n });\n\n // modulator routing\n this.algorithm.modulations.forEach((modulations, i) => {\n modulations.forEach(modIndex => {\n if (i === modIndex) { // feedback\n this.feedbackNodes[i].gain.connect(this.operators[i].source);\n } else {\n this.operators[i].gain.connect(this.operators[modIndex].source);\n }\n });\n });\n\n }", "configure() {\n var el = document.getElementById(\"starts\");\n var which = this.cfgs[el.selectedIndex];\n console.log(\"configure: which = \", which);\n var mtx = this.output_matrix();\n switch (which) {\n case \"clear\":\n console.log(\"configure: clear the canvas\");\n for (var y = 0 ; y < this.height ; y++) {\n for (var x = 0 ; x < this.width ; x++) {\n mtx[y][x] = 0;\n }\n }\n break;\n\n case \"glider\":\n mtx[10][10] = 1;\n mtx[10][11] = 1;\n mtx[10][12] = 1;\n mtx[9][12] = 1;\n mtx[8][11] = 1;\n console.log(\"configure: bit count = \", this.bitCount(mtx));\n break;\n\n case \"acorn\":\n console.log(\"configure: set up acorn\");\n break;\n\n default:\n console.log(\"configure: something else\")\n }\n\n this.draw();\n }", "function configure(alg, pswd, sto) {\n algorithm = alg;\n password = pswd;\n sessionTimeout = sto;\n}", "function init(root) {\n\tsettings = config.getSettings();\n\n\talgorithm = settings.encryption.algorithm;\n\tvar supportedAlgorithms = crypto.getCiphers();\n\n\tif(supportedAlgorithms.indexOf(algorithm) === -1) {\n\t\tthrow new ConfigError('The given algorithm ( ' + algorithm + ' ) in the config file is not supported.');\n\t}\n}", "get options() {}", "function buildParameterCollection(operationName, parameterSet) {\r\n\r\n var parameterCollection = { operationType: operationName },\r\n operationParameterSet = subtleParametersSets[operationName];\r\n\r\n for (var i = 0; i < operationParameterSet.length; i += 1) {\r\n\r\n var expectedParam = subtleParameters[operationParameterSet[i]];\r\n var actualParam = parameterSet[i];\r\n\r\n // Verify the required parameters are present.\r\n if (actualParam==null) {\r\n if (expectedParam.required) {\r\n throw new Error(expectedParam.name);\r\n } else {\r\n continue;\r\n }\r\n }\r\n\r\n // If this parameter is a typed-array convert it to a regular array.\r\n if (actualParam.subarray) {\r\n actualParam = utils.toArray(actualParam);\r\n }\r\n\r\n // If this parameter is an ArrayBuffer convert it to a regular array.\r\n if (utils.getObjectType(actualParam) == \"ArrayBuffer\") {\r\n actualParam = utils.toArray(actualParam);\r\n }\r\n\r\n // Verify the actual parameter is of the expected type.\r\n if (msrcryptoUtilities.getObjectType(actualParam) !== expectedParam.type) {\r\n throw new Error(expectedParam.name);\r\n }\r\n\r\n // If this parameter is an algorithm object convert it's name to lowercase.\r\n if (expectedParam.name === \"algorithm\") {\r\n\r\n actualParam.name = actualParam.name.toLowerCase();\r\n\r\n // If the algorithm has a typed-array IV, convert it to a regular array.\r\n if (actualParam.iv) {\r\n actualParam.iv = utils.toArray(actualParam.iv);\r\n }\r\n\r\n // If the algorithm has a typed-array Salt, convert it to a regular array.\r\n if (actualParam.salt) {\r\n actualParam.salt = utils.toArray(actualParam.salt);\r\n }\r\n\r\n // If the algorithm has a typed-array AdditionalData, convert it to a regular array.\r\n if (actualParam.additionalData) {\r\n actualParam.additionalData = utils.toArray(actualParam.additionalData);\r\n }\r\n\r\n // If this algorithm has a hash property in the form 'hash: hashName'\r\n // Convert it to hash: {name: hashName} as per the W3C spec.\r\n if (actualParam.hash && !actualParam.hash.name && msrcryptoUtilities.getObjectType(actualParam.hash) === \"String\") {\r\n actualParam.hash = { name: actualParam.hash };\r\n }\r\n }\r\n\r\n // KeyWrap has two keyHandle paramters. We add '1' to the second param name\r\n // to avoid a duplicate name.\r\n if (parameterCollection.hasOwnProperty(expectedParam.name)) {\r\n parameterCollection[expectedParam.name + \"1\"] = actualParam;\r\n } else {\r\n parameterCollection[expectedParam.name] = actualParam;\r\n }\r\n }\r\n\r\n return parameterCollection;\r\n}", "confChecker(){\n\t\tlet checker = new ParameterChecker( this.conf, this.C )\n\t\tchecker.confCheckParameter( \"ACT_MEAN\", \"SingleValue\", \"String\", [ \"geometric\", \"arithmetic\" ] )\n\t\tchecker.confCheckParameter( \"LAMBDA_ACT\", \"KindArray\", \"NonNegative\" )\n\t\tchecker.confCheckParameter( \"MAX_ACT\", \"KindArray\", \"NonNegative\" )\n\t}", "function V(a,b,c){c=c||{};var d=\"autoSchema connectionTimeout size mechanisms policy isSerial Encryption\".split(\" \"),e;for(e in c)if(c.hasOwnProperty(e)&&-1==ib(d,e))throw new G('Unknown attribute \"'+e+'\" in options.');if(c.mechanisms){if(!u(c.mechanisms))throw new G(\"mechanisms attribute must be an array but \"+ba(c.mechanisms)+\" found.\");for(e=0;e<c.mechanisms.length;e++)if(!(0<=ib(se,c.mechanisms[e])))throw new G('Invalid mechanism \"'+c.mechanisms[e]+'\"');}this.o=c.mechanisms||se;this.h=c.size;\nthis.r=t(c.connectionTimeout)?c.connectionTimeout:3E3;this.a=null;this.d=[];this.na=!1;var f;if(b instanceof he)f=b;else if(y(b))for(c.autoSchema||!t(b.stores)?f=new le(b):f=new he(b),c=b.stores?b.stores.length:0,e=0;e<c;e++)d=U(f,b.stores[e].name),b.stores[e].Sync&&J(this.logger,\"Synchronization option for \"+d.getName()+\" ignored.\");else f=new le;this.b=f;for(e=0;e<this.b.count();e++)if((this.b.stores[e]||null).i)throw Error(\"encryption option must be defined\");t(a)&&this.l(a);this.g=null;this.e=\nnew F}", "InitializeFromAlgorithmName() {\n\n }", "function loadConfig(config) {\n\tmode = config.mode;\n\tclustering_mode = config.clustering_mode;\n\n\tglobalcorner = config.corner_threshold;\n\tdocument.getElementById('cornervalue').innerHTML = globalcorner;\n\tdocument.getElementById('corner').value = globalcorner;\n\t\n\tgloballength = config.length_threshold;\n\tdocument.getElementById('lengthvalue').innerHTML = globallength;\n\tdocument.getElementById('length').value = globallength;\n\t\n\tglobalsplice = config.splice_threshold;\n\tdocument.getElementById('splicevalue').innerHTML = globalsplice;\n\tdocument.getElementById('splice').value = globalsplice;\n\n\tglobalfilterspeckle = config.filter_speckle;\n\tdocument.getElementById('filterspecklevalue').innerHTML = globalfilterspeckle;\n\tdocument.getElementById('filterspeckle').value = globalfilterspeckle;\n\n\tglobalcolorprecision = config.color_precision;\n\tdocument.getElementById('colorprecisionvalue').innerHTML = globalcolorprecision;\n\tdocument.getElementById('colorprecision').value = globalcolorprecision;\n\n\tgloballayerdifference = config.layer_difference;\n\tdocument.getElementById('layerdifferencevalue').innerHTML = globallayerdifference;\n\tdocument.getElementById('layerdifference').value = globallayerdifference;\n\n}", "function choose_algorithm(algorithm) {\n sort_algo = algorithm;\n \n if (sort_algo == \"Bubble Sort\")\n document.getElementById(\"algo-type\").text = \"Bubble Sort\";\n else \n document.getElementById(\"algo-type\").text = \"Insertion Sort\";\n}", "function HAMMING_GA(props, layer, alg, stat) {\n // CONFIG DEFAULT PROPERTIES\n if (typeof props.arrow === 'undefined') props.arrow = {};\n // GENERAL properties\n props.id = props.id || 'en';\n props.name = props.name || 'Encoder';\n props.position = props.position || {x: 0, y: 0};\n props.fill = props.fill || 'FloralWhite';\n props.labelSize = props.labelSize || 20;\n props.labelDistance = props.labelDistance || 5;\n props.labelColor = props.labelColor || 'white';\n props.labelBgColor = props.labelBgColor || 'RoyalBlue';\n props.labelPadding = props.labelPadding || 4;\n props.pading = props.pading || 10;\n props.width = props.width || 550;\n props.height = props.height || 370;\n props.bitsNum = props.bitsNum || 12;\n props.errDet = props.errDet || 1;\n props.checkBits = props.checkBits || 4;\n props.draggable = props.draggable || false;\n props.process = props.process || 'en';\n\n if (typeof props.bit === 'undefined') props.bit = {};\n let ratio = 0.6, w = 26, h = w / ratio;\n props.bit.width = w;\n props.bit.height = h;\n let addDist = props.bit.width + props.pading * 1.0;\n let height = props.bit.height + 2 * props.pading + 300;\n let width = addDist * (props.bitsNum) + addDist / 1.4;\n let checkBitsIdx = [0, 1, 2, 4, 8, 16]; // for t=2\n let infoBitsIdx = [];\n for (let i = 0; i <= (props.bitsNum - props.errDet + 1); i++) {\n if (typeof checkBitsIdx.find(el => el === i) === 'undefined')\n infoBitsIdx.push(i);\n }\n\n let first = 0, ln = 0;\n if (props.errDet === 1) { // for t=1\n for (let i = 0; i < infoBitsIdx.length; i++) infoBitsIdx[i] -= 1;\n for (let i = 0; i < checkBitsIdx.length; i++) checkBitsIdx[i] -= 1;\n first = 1;\n ln = 1;\n }\n\n let bitsIdx = []; // indexes of the all bits\n for (let i = first; i < (props.checkBits + ln); i++) {\n bitsIdx.push({bit: 'C' + i, idx: checkBitsIdx[i]});\n }\n\n for (let i = 0; i < (props.bitsNum - props.checkBits); i++) {\n bitsIdx.push({bit: 'S' + (i + 1), idx: infoBitsIdx[i]});\n }\n\n let lang = props.lang;\n\n // CREATING REGISTER'S PANEL /////////////////////////////////////////////////////////////////\n let en = new PANEL(props);\n en.size({width: width, height: height});\n en.dragmove(true);\n\n // empty array for values\n en.process = props.process;\n en.vals = [];\n en.vals.length = props.bitsNum;\n en.vals.fill(0);\n en.bitsIdx = bitsIdx;\n // encoder language\n en.lang = props.lang;\n\n // CREATING BIT GROUPS\n // CREATING ENCODER'S BITS /////////////////////////////////////////////////////////////////\n // BIT properties\n props.bit.name = 'Bit';\n props.bit.hoverTxt = props.bit.hoverTxt || 'Set Bit';\n props.bit.fill = 'RosyBrown';\n //props.bit.stroke = 'RosyBrown';\n props.bit.txtColor = 'Snow';\n props.bit.defVal = '';\n props.bit.labelDistance = 5;\n\n // CREATING BITS\n en.bits = []; // empty array for encoder's bits\n // first bit position\n let pos = {\n x: addDist / 2,\n y: en.labelRect.y() + en.labelRect.height() + 50\n };\n let num = 1, sCount = 1, cCount = 1;\n if (props.errDet === 2) {\n num = 0;\n cCount = 0;\n }\n for (let i = 0; i < props.bitsNum; i++) {\n let bitType = '';\n if (num === 0 || num === 1 || num === 2 || num === 4 || num === 8 || num === 16) { // for control bits\n bitType = 'C';\n props.bit.id = bitType + cCount;\n props.bit.label = bitType + '_' + cCount;\n cCount++;\n } else { // for info bits\n bitType = 'S';\n props.bit.id = bitType + sCount;\n props.bit.label = bitType + '_' + sCount;\n sCount++;\n }\n\n let bit = new Button(props.bit);\n bit.txt.text('');\n bit.position(pos);\n if (bit.id().search('C') !== -1){\n bit.activeColor = 'RoyalBlue';\n }\n bit.active(true);\n bit.label.y(bit.rect.y() - bit.label.height() - 5);\n bit.label.visible(false);\n if (bitType === 'S') bit.hoverTxt = en.lang.insertToEqu;\n else bit.hoverTxt = en.lang.selectCbit;\n // bit's number\n bit.num = new Konva.Text({\n id: 'bitNum' + num,\n x: bit.label.x(),\n y: bit.label.y() - bit.label.height() - 3,\n width: bit.label.width(),\n text: num.toString(),\n fontSize: props.labelSize - 4,\n fontFamily: 'Calibri',\n padding: 0,\n align: 'center',\n verticalAlign: 'middle',\n fill: 'DimGray',\n });\n num++;\n pos.x += addDist; // change position for the next bit\n bit.add(bit.num);\n en.add(bit);\n en.bits.push(bit);\n }\n\n // creating temp labels\n en.labels = [];\n pos = {x: addDist / 2, y: en.bits[0].y() + en.bits[0].height() + 10};\n // control bit temp labels\n en.bits.forEach(bit => {\n if (bit.id().search('C') !== -1) {\n let label = bit.label.clone();\n label.width(bit.label.width());\n label.height(bit.label.height());\n bit.active(false);\n label.id('label-' + bit.id());\n label.position(pos);\n pos.x += addDist;\n label.visible(true);\n label.onPlace = false;\n label.draggable(true);\n en.add(label);\n label.hoverTxt = en.lang.placeLabel;\n //console.log(label.getType());\n label = hover1(label, en);\n label = over(label);\n en.labels.push(label);\n }\n });\n // info bit temp labels\n en.bits.forEach(bit => {\n if (bit.id().search('S') !== -1){\n let label = bit.label.clone();\n label.width(bit.label.width());\n label.height(bit.label.height());\n bit.active(false);\n label.id('label-' + bit.id());\n label.position(pos);\n pos.x += addDist;\n label.visible(true);\n label.onPlace = false;\n label.draggable(true);\n en.add(label);\n label.hoverTxt = en.lang.placeLabel;\n label = hover1(label, en);\n label = over(label);\n en.labels.push(label);\n }\n });\n\n // check for label intersection with the bit\n en.checkLabelIntersection = (label) => {\n let targetBit = en.findOne('#' + label.id().substr(6));\n label.moveToTop();\n if (typeof targetBit !== 'undefined')\n if (haveIntersection(label, targetBit)) {\n return true;\n } else {\n return false;\n }\n };\n\n // placing the labels on right places\n en.placeLabels = () => {\n en.labels.forEach(label => {\n let target = en.findOne('#' + label.id().substr(6));\n let pos = {\n x: target.x() + target.width() / 2 - label.x() - 10,\n y: target.y() + target.height() / 2 - label.y() - 8\n };\n label.move({x: pos.x, y: pos.y});\n label.onPlace = true;\n });\n en.getLayer().batchDraw();\n return true;\n };\n\n //creating button for check label position\n en.checkLabelBtn = new Button({\n id: 'checkLabelBtn',\n height: 25,\n defVal: en.lang.checkLabels,\n txtSize: 16,\n clickable: true,\n fill: 'LightGrey'\n }, layer);\n en.checkLabelBtn.position({x: en.rect.x() + 5, y: en.rect.height() - 40});\n\n en.checkLabelBtn.rect = over(en.checkLabelBtn.rect);\n en.add(en.checkLabelBtn);\n en.checkLabelBtn = hover1(en.checkLabelBtn, en); // first hover enable\n en.checkLabelBtn.enable(true); // second over events\n\n // check for correct labels positions\n en.checkLabels = () => {\n let check = true;\n for(let i=0; i<en.labels.length; i++){\n check = en.checkLabelIntersection(en.labels[i]);\n if(check === false) break;\n }\n if (check) {\n en.labels.forEach(label => {\n label.visible(false);\n });\n en.bits.forEach(bit => {\n bit.label.visible(true);\n });\n en.checkLabelBtn.visible(false);\n en.loadBtn.visible(true);\n en.getLayer().batchDraw();\n }\n return check;\n };\n\n // coloring and enabling encoder's bits\n en.enableBits = () => {\n en.bits.forEach(bit => {\n bit.active(true);\n });\n };\n\n // loading bits in encoder/decoder\n en.loadBits = (reg) => {\n let vals = reg.vals, bits = reg.bits;\n // check for bit moving animation\n if (typeof bits !== 'undefined'){\n for (let i = 0; i < bits.length; i++) {\n let cloneObj = bits[i].clone();\n bits[i].active(false);\n layer.add(cloneObj);\n cloneObj.position(bits[i].getAbsolutePosition());\n cloneObj.moveToTop();\n en.getLayer().batchDraw();\n // moving animation\n let movement = {};\n if(en.process === 'enc')\n movement = new SmoothMovement(cloneObj.position(), en.bits[infoBitsIdx[i]].getAbsolutePosition());\n else if(en.process === 'dec')\n movement = new SmoothMovement(cloneObj.position(), en.bits[i].getAbsolutePosition());\n movement.animate(\n 60,\n function (pos) { // update function\n cloneObj.position(pos);\n en.getLayer().batchDraw();\n },\n function () { // closure function\n if(en.process === 'enc'){\n en.vals[infoBitsIdx[i]] = vals[i];\n en.bits[infoBitsIdx[i]].txt.text(vals[i].toString());\n }\n else if(en.process === 'dec'){\n en.vals[i] = vals[i];\n en.bits[i].txt.text(vals[i].toString());\n }\n\n cloneObj.destroy();\n if (i === bits.length - 1) { // run its if is last bit\n en.enableBits();\n en.loadBtn.visible(false);\n en.equBtn.visible(true);\n en.createCbits();\n if(en.process === 'dec') en.createCBitCheck();\n else en.equs.visible(true);\n en.getLayer().batchDraw();\n }\n }\n );\n }\n reg.disable(); // disable the register's nodes\n }\n return true;\n };\n\n // load info bits button\n en.loadBtn = new Button({\n id: 'loadBtn',\n height: 25,\n defVal: en.lang.loadBits,\n txtSize: 16,\n fill: 'LightGrey'\n }, layer);\n en.loadBtn.position({x: en.rect.x() + 5, y: en.rect.height() - 40});\n en.add(en.loadBtn);\n en.loadBtn = hover1(en.loadBtn, en); // first hover enable\n en.loadBtn.enable(true); // second over events\n en.loadBtn.visible(false);\n\n // equation field/button\n en.equBtn = new Button({\n id: 'equBtn',\n height: 40,\n width: en.bits[en.bits.length - 1].x() + en.bits[0].width() - en.bits[0].x(),\n defVal: en.lang.equBtnTxt,\n txtSize: 14,\n fill: 'LightGrey',\n stroke: 'black',\n strokeWidth: 5\n }, layer);\n en.equBtn.position({x: en.bits[0].x(), y: en.bits[0].y() + 80});\n\n en.equBtn.visible(false);\n en.add(en.equBtn);\n en.equBtn.hoverTxt = en.lang.calcCbit;\n en.equBtn = hover1(en.equBtn, en);\n en.equBtn.enable(true);\n en.currCbit = '';\n\n // create error analysis (for decoding)\n if(en.process === 'dec') {\n // Cbits check panel\n en.CbitCheck = new PANEL({\n id: 'CbitCheck',\n name: en.lang.checkRes,\n position: {x: en.equBtn.x(), y: en.equBtn.y()+en.equBtn.height()+20},\n type: 2\n });\n en.CbitCheck.size({width: 65});\n en.CbitCheck.visible(false);\n en.CbitCheck.dragmove(false);\n\n en.add(en.CbitCheck);\n\n // error analysis panel\n en.error = new PANEL({\n id: 'resAnalysis',\n name: en.lang.resultAnalysis,\n position: {x: en.CbitCheck.x() + en.CbitCheck.width() + 10, y: en.CbitCheck.y()},\n type: 2\n });\n en.error.moveToTop();\n en.error.visible(false);\n en.error.size({width: 360, height: en.CbitCheck.height()});\n en.add(en.error);\n en.autoCorrSize();\n\n // binary code\n en.error.binCode = SUB('(?????)_2');\n en.error.binCode.id('binCode');\n en.error.binCode.defaultFill(en.equBtn.txt.fill());\n en.error.binCode.position({x: 10, y: 20});\n en.error.binCode.fontSize(18);\n en.error.binCode.auto = null;\n en.error.binCode.man = null;\n en.error.add(en.error.binCode);\n // equal symbol\n en.error.equal = new Konva.Text({text:' =>', fontSize:16,\n fill: en.error.binCode.fill(),\n position: {x: en.error.binCode.x() + en.error.binCode.width(), y: en.error.binCode.y()},\n height: en.error.binCode.height(),\n width: en.error.binCode.width(),\n visible: true\n });\n en.error.add(en.error.equal);\n\n en.error.binCode.hoverTxt = en.lang.setBinCode;\n en.error.binCode = hover1(en.error.binCode, en.error);\n en.error.binCode = over(en.error.binCode);\n en.error.binCode.on('dblclick tap', ()=>{\n alg.markCurrStep('curr');\n let thisObj = en.error.binCode;\n let str = thisObj.text();\n str = str.replace('(','');\n str = str.replace(')','');\n let oldStr =thisObj.str;\n thisObj.text(str);\n editable(thisObj, function(obj){\n let s = obj.text();\n thisObj.man = s;\n if(s.search('\\\\(') === -1 && s.search('\\\\)') === -1)\n thisObj.text('('+obj.text()+')_2');\n else if(s.search('\\\\(') === -1 && s.search('\\\\)') !== -1)\n thisObj.text('('+obj.text()+'_2');\n else if(s.search('\\\\(') !== -1 && s.search('\\\\)') === -1)\n thisObj.text(obj.text()+')_2');\n en.error.updatePos(); // update the equal and dec code positions\n str = thisObj.text();\n str = str.replace('(','');\n str = str.replace(')','');\n thisObj.man = str;\n if(oldStr !== str)\n if(en.error.check(thisObj))\n en.error.binCode.off();\n\n });\n });\n\n // decimal code\n en.error.decCode = SUB('(?)_10');\n en.error.decCode.visible(true);\n en.error.decCode.id('decCode');\n en.error.decCode.defaultFill(en.error.binCode.fill());\n en.error.decCode.fill('grey');\n en.error.decCode.position({x:en.error.binCode.x()+ en.error.binCode.width()+30, y:en.error.binCode.y()});\n en.error.decCode.fontSize(18);\n en.error.decCode.auto = null;\n en.error.decCode.man = null;\n en.error.add(en.error.decCode);\n\n en.error.decCode.active=()=>{\n en.error.decCode.fill(en.error.decCode.defaultFill());\n en.error.decCode.hoverTxt = en.lang.setDecCode;\n en.error.decCode = hover1(en.error.decCode,en.error);\n en.error.decCode = over(en.error.decCode);\n en.error.decCode.on('dblclick tap', ()=>{\n let thisObj = en.error.decCode;\n let str = thisObj.text();\n str = str.replace('(','');\n str = str.replace(')','');\n let oldStr =thisObj.str;\n thisObj.text(str);\n editable(thisObj, function(obj){\n let s = obj.text();\n thisObj.man = s;\n if(s.search('\\\\(') === -1 && s.search('\\\\)') === -1)\n thisObj.text('('+obj.text()+')_10');\n else if(s.search('\\\\(') === -1 && s.search('\\\\)') !== -1)\n thisObj.text('('+obj.text()+'_10');\n else if(s.search('\\\\(') !== -1 && s.search('\\\\)') === -1)\n thisObj.text(obj.text()+')_10');\n en.error.updatePos(); // update the equal and dec code positions\n str = thisObj.text();\n str = str.replace('(','');\n str = str.replace(')','');\n thisObj.man = str;\n if(oldStr !== str){\n if(en.error.check(thisObj) === true){\n en.error.decCode.fill(en.error.binCode.fill());\n en.error.errStatusShow();\n en.error.getLayer().batchDraw();\n en.error.decCode.off();\n }\n }\n });\n });\n };\n\n // no error text\n en.error.noErrTxt = SUB(en.lang.noErr);\n en.error.noErrTxt.visible(false);\n en.error.noErrTxt.id('noErrTxt');\n en.error.noErrTxt.fill('grey');\n en.error.noErrTxt.position({x:en.error.binCode.x(), y:en.error.binCode.y()+30});\n en.error.noErrTxt.fontSize(14);\n en.error.noErrTxt=over(en.error.noErrTxt);\n en.error.noErrTxt.hoverTxt = en.lang.selectErr;\n en.error.noErrTxt=hover1(en.error.noErrTxt, en.error);\n en.error.add(en.error.noErrTxt);\n\n // single error text\n en.error.sErrTxt = en.error.noErrTxt.clone();\n en.error.sErrTxt.text(en.lang.singleErr);\n en.error.sErrTxt.id('sErrTxt');\n en.error.sErrTxt.position({x:en.error.noErrTxt.x()+en.error.noErrTxt.width()+15, y:en.error.noErrTxt.y()});\n en.error.sErrTxt.off();\n en.error.sErrTxt = over(en.error.sErrTxt);\n en.error.sErrTxt.hoverTxt = en.lang.selectErr;\n en.error.sErrTxt=hover1(en.error.sErrTxt, en.error);\n en.error.add(en.error.sErrTxt);\n\n // double error text\n en.error.dErrTxt = en.error.noErrTxt.clone();\n en.error.dErrTxt.text(en.lang.doubleErr);\n en.error.dErrTxt.id('dErrTxt');\n en.error.dErrTxt.position({x:en.error.sErrTxt.x()+en.error.sErrTxt.width()+15, y:en.error.sErrTxt.y()});\n en.error.dErrTxt.off();\n en.error.dErrTxt=over(en.error.dErrTxt);\n en.error.dErrTxt.hoverTxt = en.lang.selectErr;\n en.error.dErrTxt=hover1(en.error.dErrTxt, en.error);\n en.error.add(en.error.dErrTxt);\n\n // decoded message label\n en.error.decMsgLabel = new Konva.Text({\n id: 'decMsgLabel',\n position: {x:en.error.noErrTxt.x(), y:en.error.noErrTxt.y()+30},\n text: en.lang.decodedMsg + ': X = ',\n fontSize: 16,\n fontFamily: 'Calibri',\n fill: 'Gray',\n visible: false\n });\n en.error.add(en.error.decMsgLabel);\n\n // decoded message label\n en.error.decMsg = en.error.decMsgLabel.clone();\n en.error.decMsg.text('?????????');\n en.error.decMsg.id('decMsg');\n en.error.decMsg.position({x:en.error.decMsgLabel.x()+en.error.decMsgLabel.width()+5, y:en.error.decMsgLabel.y()});\n en.error.decMsg=over(en.error.decMsg);\n en.error.decMsg.hoverTxt = en.lang.decodedMsg;\n en.error.decMsg=hover1(en.error.decMsg, en.error);\n en.error.add(en.error.decMsg);\n en.error.decMsg.on('dblclick tap', ()=>{\n let oldStr = en.error.decMsg.text();\n editable(en.error.decMsg, function(obj){\n let newStr = obj.text();\n if(oldStr !== newStr){\n if(en.decodedMsg.auto !== newStr){\n obj.fill('red');\n stat.error.add(en.lang.wrongDecMsg);\n en.error.decMsg.hover.show('e',en.lang.wrongDecMsg);\n }\n else{\n en.decodedMsg.man = newStr;\n en.error.decMsg.fill(en.error.binCode.fill());\n alg.increment();\n stat.timer.stop();\n }\n }\n if(newStr === '') en.error.decMsg.text(oldStr);\n en.getLayer().batchDraw();\n });\n });\n\n // no error event\n en.error.noErrTxt.on('click touchstart', function(){\n en.errStatus.man='noError';\n if(en.errStatus.auto !== en.errStatus.man){\n stat.error.add(en.lang.wrongErrStatus);\n return this.hover.show('e',en.lang.wrongErrStatus);\n }\n this.fill(en.error.binCode.fill());\n en.error.decMsgLabel.visible(true);\n en.error.decMsg.visible(true);\n en.error.getLayer().batchDraw();\n\n });\n // single error event\n en.error.sErrTxt.on('click touchstart', function(){\n en.errStatus.man='singleError';\n if(en.errStatus.auto !== en.errStatus.man){\n stat.error.add(en.lang.wrongErrStatus);\n return this.hover.show('e',en.lang.wrongErrStatus);\n }\n // single error correcting\n if(en.errStatus.auto === 'singleError'){\n let C0 = en.Cbits.find(Cbit => Cbit.id === 'C0');\n let pos = Number(en.error.decCode.man);\n if(typeof C0 === 'undefined') pos--;\n en.bits[pos].txt.text(en.vals[pos].toString());\n en.bits[pos].txt.fill('ForestGreen');\n //en.bits[pos].txt.moveToTop();\n }\n\n this.fill(en.error.binCode.fill());\n en.error.decMsgLabel.visible(true);\n en.error.decMsg.visible(true);\n en.error.getLayer().batchDraw();\n\n });\n // double error event\n en.error.dErrTxt.on('click touchstart', function(){\n en.errStatus.man='doubleError';\n if(en.errStatus.auto !== en.errStatus.man){\n stat.error.add(en.lang.wrongErrStatus);\n return this.hover.show('e',en.lang.wrongErrStatus);\n }\n this.fill(en.error.binCode.fill());\n en.error.decMsgLabel.visible(true);\n en.error.decMsg.visible(true);\n en.error.getLayer().batchDraw();\n });\n\n // show error status\n en.error.errStatusShow=()=>{\n en.error.noErrTxt.visible(true);\n en.error.sErrTxt.visible(true);\n en.error.dErrTxt.visible(true);\n en.getLayer().batchDraw();\n };\n\n //make error analysis for auto mode\n en.error.makeAnalysis = () =>{\n en.error.binCode.text('('+en.error.binCode.auto+')_2');\n en.error.decCode.text('('+en.error.decCode.auto+')_2');\n en.error.updatePos();\n let color = en.error.binCode.fill();\n en.error.decCode.fill(color);\n if(en.errStatus.auto === 'noError') en.error.noErrTxt.fill(color);\n else if(en.errStatus.auto === 'singleError') en.error.sErrTxt.fill(color);\n else en.error.dErrTxt.fill(color);\n en.error.errStatusShow();\n for(let i=0; i<en.vals.length; i++){\n if (en.vals[i].toString() !== en.bits[i].txt.text()) {\n en.bits[i].txt.text(en.vals[i].toString());\n en.bits[i].txt.fill('ForestGreen');\n }\n }\n en.error.decMsgLabel.visible(true);\n en.error.decMsg.fill(color);\n en.error.decMsg.text(en.decodedMsg.auto);\n en.error.decMsg.visible(true);\n\n en.error.autoCorrSize();\n en.error.getLayer().batchDraw();\n };\n\n // check the error bin code or position\n en.error.check = (thisObj)=>{\n //console.log('auto = '+thisObj.auto, 'man = '+thisObj.man);\n if(thisObj.man !== thisObj.auto){\n thisObj.fill('red');\n if(thisObj.id() === 'binCode') stat.error.add(en.lang.wrongBinCode);\n else if(thisObj.id() === 'decCode') stat.error.add(en.lang.wrongDecCode);\n return false;\n }\n else{\n thisObj.fill(thisObj.defaultFill());\n if(thisObj.id() === 'binCode') {\n en.error.equal.visible(true);\n en.error.decCode.active();\n }\n return true;\n }\n };\n\n en.error.updatePos = () =>{\n en.error.equal.position({x: en.error.binCode.x() + en.error.binCode.width(), y: en.error.binCode.y()});\n en.error.decCode.position({x:en.error.binCode.x()+ en.error.binCode.width()+30, y:en.error.binCode.y()});\n //en.error.rect.width(en.error.decCode.x()+en.error.decCode.width() - en.error.binCode.x() + 20);\n let width = en.error.decCode.x()+en.error.decCode.width() - en.error.binCode.x() + 20;\n if(en.error.size().width < width) en.error.size({width:width});\n };\n }\n\n\n // Equation button click procedures\n en.equBtnCallback = () => {\n if (en.currCbit === '') return en.lang.noSelectedBit; // check for selected Cbit\n let Cbit = en.Cbits.find(b => b.id === en.currCbit);\n if (Cbit.man.equ.length === 0) return en.lang.noEquMem + ' => ' + en.currCbit; // check for selected members\n let val = Cbit.man.res;\n if (val === '') val = 0;\n else val = Number(!val);\n en.Cbits.find(b => b.id === en.currCbit).man.res = val;\n if (Cbit.man.equ.length === Cbit.auto.equ.length) {\n for (let i = 0; i < Cbit.auto.equ.length; i++)\n if (Cbit.auto.equ[i].bitId !== Cbit.man.equ[i].bitId)\n return en.lang.wrongEqu + ' => ' + en.currCbit; // check for correct equation\n } else return en.lang.wrongEqu + ' => ' + en.currCbit; // check for correct equation\n // en.equBtn.text(Cbit.man.str + val.toString());\n let currWidth = en.equBtn.rect.width();\n en.equBtn.text(Cbit.man.str + val.toString());\n if(en.equBtn.txt.width() > currWidth) en.equBtn.txt.width(currWidth);\n\n en.getLayer().batchDraw();\n return true;\n };\n\n //creating bit's arrow\n en.bits.forEach(bit => {\n let arrow = {};\n let b = {x: bit.x() + bit.width() / 2, y: bit.y() + bit.height()};\n let e = {x: bit.x() + bit.width() / 2, y: en.equBtn.y()};\n arrow = new Connection();\n arrow.id('arr-' + bit.id());\n if (bit.id().search('S') !== -1){ // info bit\n arrow.dir = 'd'; // set arrow direction as down\n arrow.setP([b.x, b.y, e.x, e.y]);\n }\n else{ // control bit\n arrow.dir = 'u'; // set arrow direction as up\n arrow.setP([e.x, e.y, b.x, b.y]);\n //console.log(arrow.id().search('arr'));\n arrow.hoverTxt = en.lang.writeCbitVal;\n arrow.enableHover = (flag) => {\n if (typeof flag === 'undefined' || flag === true) {\n arrow = hover1(arrow, arrow.getParent());\n arrow = over(arrow);\n } else if (flag === false) {\n arrow.off('click touchstart');\n // mоuse hover event\n arrow.off('mouseover touchstart');\n // mоuse hover out event\n arrow.off('mouseout touchend');\n }\n };\n }\n arrow.stroke(bit.activeColor);\n arrow.visible(false);\n bit.arrow = arrow;\n en.add(arrow);\n });\n\n // current control bit calculation\n en.calckCurrCbit = (CbitId) => {\n for (let i = 0; i < en.Cbits.length; i++) {\n let Cbit = en.Cbits[i];\n if (Cbit.id() === CbitId) {\n let res = -1, val;\n Cbit.equ.forEach(el => {\n val = en.vals[en.bitsIdx.find(bit => bit.bit === el).idx];\n Cbit.bins.push(val);\n if (res === -1) res = val;\n else res ^= val;\n });\n en.vals[en.bitsIdx.find(bit => bit.bit === CbitId).idx] = res;\n en.bits.find(bit => bit.id() === en.currCbit).txt.text(res.toString());\n break;\n }\n }\n en.getLayer().batchDraw();\n };\n\n // method for creating parity equations for Cbits\n en.createCbits = () => {\n en.Cbits = [];\n let bitId = '';\n //let obj = {equ: [], bins: [], res: ''}; // temp object\n let ln = en.bits.length;\n for (let i = 0; i < ln; i++) {\n let bit = en.bits[i];\n bitId = bit.id();\n if (bit.id().substr(0, 1) !== 'C') continue;\n let obj = {\n equ: [],\n str: '',\n res: 0\n }; // temp object\n switch (en.bits[i].id()) {\n case 'C1':\n bit = {};\n val = 0;\n for (let j = i; j < ln; j += 2) {\n if (j === i) if(en.process === 'enc') continue;\n thisBit = en.bits[j];\n val = en.vals[j];\n obj.equ.push({\n num: Number(thisBit.num),\n bitId: thisBit.id(),\n bin: val\n });\n obj.res ^= val;\n }\n break;\n case 'C2':\n bit = {};\n val = 0;\n for (let j = i; j < ln; j += 4) {\n for (let t = j; t < j + 2; t++) {\n if (t === i) if(en.process === 'enc') continue;\n if (typeof en.bits[t] !== 'undefined') {\n thisBit = en.bits[t];\n val = en.vals[t];\n obj.equ.push({\n num: Number(thisBit.num),\n bitId: thisBit.id(),\n bin: val\n });\n obj.res ^= val;\n }\n }\n }\n break;\n case 'C3':\n bit = {};\n val = 0;\n for (let j = i; j < ln; j += 8) {\n for (let t = j; t < j + 4; t++) {\n if (t === i) if(en.process === 'enc') continue;\n if (typeof en.bits[t] !== 'undefined') {\n thisBit = en.bits[t];\n val = en.vals[t];\n obj.equ.push({\n num: Number(thisBit.num),\n bitId: thisBit.id(),\n bin: val\n });\n obj.res ^= val;\n } else break;\n }\n }\n break;\n case 'C4':\n bit = {};\n val = 0;\n for (let j = i; j < ln; j += 16) {\n for (let t = j; t < j + 8; t++) {\n if (t === i) if(en.process === 'enc') continue;\n if (typeof en.bits[t] !== 'undefined') {\n thisBit = en.bits[t];\n val = en.vals[t];\n obj.equ.push({\n num: Number(thisBit.num),\n bitId: thisBit.id(),\n bin: val\n });\n obj.res ^= val;\n } else break;\n }\n }\n break;\n case 'C5':\n bit = {};\n val = 0;\n for (let j = i; j < ln; j += 32) {\n for (let t = j; t < j + 16; t++) {\n if (t === i) if(en.process === 'enc') continue;\n if (typeof en.bits[t] !== 'undefined') {\n thisBit = en.bits[t];\n val = en.vals[t];\n obj.equ.push({\n num: Number(thisBit.num),\n bitId: thisBit.id(),\n bin: val\n });\n obj.res ^= val;\n } else break;\n }\n }\n break;\n case 'C0':\n bit = {};\n val = 0;\n let start = en.process === 'enc' ? 1 : 0;\n for (let j = start; j < ln; j++) {\n thisBit = en.bits[j];\n val = en.vals[j];\n obj.equ.push({\n num: Number(thisBit.num),\n bitId: thisBit.id(),\n bin: val\n });\n obj.res ^= val;\n }\n break;\n } // end of switch\n\n en.Cbits.push({\n id: bitId,\n auto: en.procesCbit(bitId, obj),\n man: {\n equ: [],\n str: '',\n res: ''\n }\n });\n } // end of for\n\n // set the events\n en.createCbitEvt();\n }; // end of method\n\n\n // crate control bits check for decoding\n en.createCBitCheck = () =>{\n en.CbitCheck.visible(true);\n en.CbitCheck.Cbits = [];\n for(let i=0; i<en.Cbits.length; i++){\n let thisCbitId = en.Cbits[i].id;\n let txt = null;\n let dist = 5;\n if(i === 0){\n txt = new Konva.Text({\n id: thisCbitId,\n text: thisCbitId + ' => ',\n fontSize: props.labelSize-2,\n fontFamily: 'Calibri',\n align: 'left',\n fill: en.equBtn.txt.fill(),\n x: 5,\n y: 10\n });\n }\n else{\n txt = null;\n txt = en.CbitCheck.Cbits[i-1].clone();\n if(en.CbitCheck.Cbits[i-1].id() === 'C0' && i === 1) dist *=2.5;\n txt.id(thisCbitId);\n txt.y(txt.y() + txt.height() + dist);\n txt.text(thisCbitId + ' => ');\n }\n txt.val='';\n txt.hoverTxt = en.lang.writeCbitCheck;\n en.CbitCheck.add(txt);\n en.CbitCheck.Cbits.push(txt);\n }\n en.CbitCheck.autoCorrSize();\n\n // events\n en.CbitCheck.Cbits.forEach(Cbit =>{\n Cbit = hover1(Cbit, en.CbitCheck);\n Cbit = over(Cbit);\n Cbit.on('click touchstart', function(){\n let msg = en.writeCbitRes('man');\n if (msg !== true){\n //error\n stat.error.add(msg);\n this.hover.show('e',msg);\n }\n else if(msg === true){\n alg.increment(); // pass write step\n }\n });\n });\n en.getLayer().batchDraw();\n }; // end of createCBitCheck\n\n // add member to the current control bit equation\n en.addToEqu = (bit) => {\n //check for selected control bit\n if (typeof en.Cbits === 'undefined' || en.currCbit === '') return en.lang.noSelectedBit;\n let thisCbit = en.Cbits.find(Cbit => Cbit.id === en.currCbit);\n if (bit.id().substr(0, 1) === 'C') bit.arrow.flip(true);\n\n if (!bit.arrow.visible()) { // add\n if (bit.id().substr(0, 1) === 'C') bit.arrow.flip(true);\n alg.markCurrStep('curr');\n bit.arrow.visible(true);\n thisCbit.man.equ.push({\n num: Number(bit.num.text()),\n bitId: bit.id(),\n bin: en.vals[en.bitsIdx.find(b => b.bit === bit.id()).idx]\n });\n } else { // remove\n bit.arrow.visible(false);\n thisCbit.man.equ = thisCbit.man.equ.filter(function (obj) {\n return obj.bitId !== bit.id();\n });\n }\n\n en.Cbits.find(Cbit => Cbit.id === en.currCbit).man = en.procesCbit(thisCbit.id, thisCbit.man);\n // en.equBtn.text(thisCbit.man.str);\n let currWidth = en.equBtn.rect.width();\n en.equBtn.text(thisCbit.man.str);\n if(en.equBtn.txt.width() > currWidth) {\n en.equBtn.txt.width(currWidth);\n en.equBtn.rect.width(currWidth);\n }\n en.getLayer().batchDraw();\n return true;\n };\n\n // creating click events for the all control bits\n en.createCbitEvt = () =>{\n en.Cbits.forEach(Cbit =>{\n en.bits.find(bit => bit.id() === Cbit.id).on('click touchstart', function () {\n if (en.currCbit === '') { // there is no selected Cbit, select this one\n alg.resetCycle(); // set all shapes in the algorithm for cyrrent cycle in default fill color\n // check for C0 - only for encoding process\n if (Cbit.id === 'C0' && en.process === 'enc') {\n let allCbitsHaveRes = true;\n en.bits.forEach(bit => {\n if (bit.id() !== 'C0' && bit.id().substr(0, 1) === 'C') {\n if (bit.txt.text() === '') allCbitsHaveRes = false;\n }\n });\n if (allCbitsHaveRes === false) {\n stat.error.add(model.en.lang.wronC0choice + ' => ' + Cbit.id);\n return this.hover.show('e', model.en.lang.wronC0choice);\n }\n }\n if(Cbit.man.res !== '') return this.hover.show('e', model.en.lang.wasCalculated);\n en.selectCbit(Cbit.id); // select this control bit\n alg.increment(); // enable next step\n }\n else if(en.currCbit === Cbit.id) { // reset the current control bit\n en.Cbits.find(b => b.id === Cbit.id).man.equ = [];\n en.Cbits.find(b => b.id === Cbit.id).man.res = '';\n en.currCbit = '';\n en.equBtn.text('');\n en.bits.forEach(b => {\n if (b.arrow.visible() === true) b.arrow.visible(false);\n if (b.id().substr(0, 1) === 'C') b.hoverTxt = en.lang.selectCbit;\n });\n alg.resetCycle(); // set all shapes in the algorithm for current cycle in default fill color\n } else { // add to the equation of current control bit\n en.addToEqu(this);\n }\n en.getLayer().batchDraw();\n });\n });\n };\n\n // select a control bit for calculating/checking\n en.selectCbit = (CbitId) =>{\n if (typeof en.Cbits === 'undefined') return console.error('The model is busy!');\n if (typeof CbitId === 'undefined' || CbitId === '') { // for auto mode\n let CbitSeq = ['C1', 'C2', 'C3', 'C4', 'C5', 'C0'];\n for (let i = 0; i < CbitSeq.length; i++) {\n let thisCbit = en.bits.find(b => b.id() === CbitSeq[i]);\n if(typeof thisCbit === 'undefined') continue;\n if(en.Cbits.find(b => b.id === thisCbit.id()).man.res === ''){\n CbitId = thisCbit.id();\n break;\n }\n if (i === CbitSeq.length - 1) {\n console.log('There is no control bit for calculating!');\n return;\n }\n }\n }\n\n let Cbit = en.Cbits.find(b => b.id === CbitId);\n if (typeof Cbit !== 'undefined') {\n if (typeof en.bits.find(b => b.id() === en.currCbit) !== 'undefined')\n en.bits.find(b => b.id() === en.currCbit).arrow.enableHover(false); // disable hover\n en.currCbit = Cbit.id;\n\n if (en.process === 'enc'){\n en.bits.find(b => b.id() === en.currCbit).arrow.enableHover(true);\n en.bits.find(bit => bit.id() === Cbit.id).arrow.flip(false); // set arrow direction to up\n }\n else en.bits.find(bit => bit.id() === Cbit.id).arrow.flip(true); // set arrow direction to down for decoding\n en.bits.forEach(b => { // hide all visible arrows\n if (b.arrow.visible() === true) b.arrow.visible(false);\n if (b.id().substr(0, 1) === 'C') b.hoverTxt = en.lang.insertToEqu;\n });\n let thisBit = en.bits.find(bit => bit.id() === Cbit.id);\n thisBit.hoverTxt = en.lang.selectCbit;\n if(en.process === 'dec') { // add to the equation\n en.equBtn.text('');\n en.addToEqu(thisBit);\n }\n else en.equBtn.text('');\n thisBit.arrow.visible(true); // show/hide arrow\n en.getLayer().batchDraw();\n } else console.log('Non-existent control bit =>', CbitId);\n return true;\n };\n\n // show current control bit equation\n en.showCurrCbitEqu = () => {\n en.Cbits.forEach(Cbit => {\n if (Cbit.id === en.currCbit) {\n let currWidth = en.equBtn.rect.width();\n en.equBtn.text(Cbit.auto.str);\n if(en.equBtn.txt.width() > currWidth) {\n en.equBtn.txt.width(currWidth);\n en.equBtn.rect.width(currWidth);\n }\n Cbit.auto.equ.forEach(el => {\n let thisBit = en.bits.find(bit => bit.id() === el.bitId);\n if (thisBit.id().substr(0, 1) === 'C') thisBit.arrow.flip(true);\n thisBit.arrow.visible(true);\n });\n en.getLayer().batchDraw();\n }\n });\n return true;\n };\n\n // show current control bit result\n en.showCurrCbitRes = () => {\n en.Cbits.forEach(Cbit => {\n if (Cbit.id === en.currCbit) {\n en.equBtn.text(Cbit.auto.str + Cbit.auto.res);\n en.getLayer().batchDraw();\n }\n });\n return true;\n };\n\n // write the control bit result\n en.writeCbitRes = (mode) => {\n if(en.currCbit === '') return en.lang.noSelectedBit;\n let Cbit = en.Cbits.find(bit => bit.id === en.currCbit);\n if (mode === 'auto') {\n if(en.process === 'enc'){\n en.vals[bitsIdx.find(bit => bit.bit === Cbit.id).idx] = Cbit.auto.res;\n en.bits.find(bit => bit.id() === Cbit.id).txt.text(Cbit.auto.res.toString());\n Cbit.man.res = Cbit.auto.res;\n Cbit.man.equ = Cbit.auto.equ;\n Cbit.man.str = Cbit.auto.str;\n\n }\n else if(en.process === 'dec'){ // for decoding\n let CbitCheck = en.CbitCheck.Cbits.find(b => b.id() === en.currCbit);\n CbitCheck.text(CbitCheck.text() + Cbit.auto.res);\n Cbit.man.res = Cbit.auto.res;\n Cbit.man.equ = Cbit.auto.equ;\n Cbit.man.str = Cbit.auto.str;\n }\n Cbit.man.res = Cbit.auto.res;\n }\n else if (mode === 'man') {\n if (en.equBtn.text() === '') return en.lang.noEqu;\n if (Cbit.man.equ.length !== Cbit.auto.equ.length) return en.lang.wrongEqu+' => '+en.currCbit;\n if (Cbit.man.res !== Cbit.auto.res) return en.lang.wrongCval+' => '+en.currCbit; // check for correct result\n if(en.process === 'enc'){\n en.vals[bitsIdx.find(bit => bit.bit === Cbit.id).idx] = Cbit.man.res;\n en.bits.find(bit => bit.id() === Cbit.id).txt.text(Cbit.man.res.toString());\n }\n else if(en.process === 'dec'){ // for decoding\n let CbitCheck = en.CbitCheck.Cbits.find(b => b.id() === en.currCbit);\n CbitCheck.text(CbitCheck.text() + Cbit.auto.res);\n }\n }\n\n if(en.process === 'enc') en.equs.add(en.equBtn.txt);\n en.currCbit = '';\n en.equBtn.text('');\n en.bits.forEach(b => {\n if (b.arrow.visible() === true) b.arrow.visible(false);\n });\n\n //if there is no other control bits for calculation disable all encoder's bit and hide the equation field\n if (en.isLastCbit() === true) {\n en.bits.forEach(bit => {\n bit.active(false);\n });\n en.equBtn.visible(false);\n if(en.process === 'enc'){\n alg.increment(); // enable next step\n }\n else if(en.process === 'dec'){ // for encoding\n let str = '';\n // creating result analaysis for auto mode\n for(let i=en.Cbits.length-1; i>=0; i--)\n {\n if(en.Cbits[i].id === 'C0') continue;\n str += en.Cbits[i].auto.res;\n }\n en.error.binCode.auto = str;\n en.error.decCode.auto = parseInt(str, 2).toString();\n\n // set error status\n en.errStatus={auto:'', man:''};\n let C0 = en.Cbits.find(Cbit => Cbit.id === 'C0');\n if(typeof C0 === 'undefined'){\n en.errStatus.auto = 'noError';\n en.Cbits.forEach(cBit => {\n if(cBit.auto.res !== 0) en.errStatus.auto = 'singleError';\n });\n }\n else{\n if(C0.auto.res === 0){\n let errCode=0;\n en.Cbits.forEach(cBit => {\n if(cBit.id !== 'C0' && cBit.auto.res !== 0) errCode = 1;\n });\n if(errCode === 0) en.errStatus.auto = 'noError';\n else en.errStatus.auto = 'doubleError';\n }\n else{ // C0=1\n en.errStatus.auto = 'singleError';\n }\n }\n\n // set decoded message\n en.decodedMsg = {auto:'', man:''};\n if(en.errStatus.auto === 'singleError'){ // single error correcting\n let pos = en.error.decCode.auto;\n //console.log('pos='+pos);\n let C0 = en.Cbits.find(Cbit => Cbit.id === 'C0');\n if(typeof C0 === 'undefined') pos--;\n en.vals[pos] = en.vals[pos] === 0 ? 1 : 0;\n }\n // creating decoded message\n if(en.errStatus.auto !== 'doubleError'){\n let msg = '', idx=-1;\n en.bits.forEach(bit =>{\n idx++;\n if (bit.id().substr(0,1) === 'S') msg += en.vals[idx].toString();\n });\n en.decodedMsg.auto = msg;\n }\n else en.decodedMsg.auto = '?';\n\n en.error.visible(true);\n en.CbitCheck.Cbits.forEach(Cbit =>{\n Cbit.off('click touchstart');\n Cbit.off('mouseover touchstart');\n });\n }\n }\n alg.increment(); // enable next step\n en.getLayer().batchDraw();\n return true;\n };\n\n // check for last control bit\n en.isLastCbit = () => {\n let check = true;\n en.Cbits.forEach(cbit =>{\n if(cbit.man.res === '') check = false;\n });\n\n return check;\n };\n\n // Control bit equations\n en.equs = new PANEL({\n id: 'cbitEqu',\n name: en.lang.equBtnTxt,\n position: { x: en.equBtn.x(), y: (en.equBtn.y() + en.equBtn.height() + 20)},\n type: 2,\n labelSize: 16\n });\n en.add(en.equs);\n en.autoCorrSize();\n en.equs.size({width: en.equBtn.width(), height:130});\n en.equs.visible(false);\n en.equs.dragmove(false);\n en.equs.poss=[];\n en.equs.objs=[];\n\n en.equs.add = (obj) => {\n if (typeof obj === 'undefined') return console.error('Non-existing object!');\n let newPos = {}, dist = 5;\n let cloneObj = obj.clone();\n cloneObj.position(en.equBtn.position());\n en.add(cloneObj);\n cloneObj.id(obj.id + '-clone');\n\n // for C0 - only equation and result\n if (cloneObj.text().substr(0, 2) === 'C0') {\n let str = cloneObj.text();\n cloneObj.text(str.split('=>')[0] + ' = ' + str.split('=>')[1].split('=')[1]);\n }\n // calculating the new position\n if (en.equs.poss.length === 0) {\n newPos = {x: en.equs.x() +10, y: en.equs.y() + en.equs.height() - cloneObj.height() - dist};\n } else {\n newPos.x = en.equs.x() + 10;\n newPos.y = en.equs.poss[en.equs.poss.length - 1].y - cloneObj.height() - dist;\n }\n\n // moving animation\n let movement = new SmoothMovement(cloneObj.position(), newPos);\n movement.animate(\n 60,\n function (currPos) { // update function\n cloneObj.position(currPos);\n en.getLayer().batchDraw();\n },\n function () { // closure function\n cloneObj.align('left');\n //cloneObj.fontSize(cloneObj.fontSize());\n //cloneObj.position(getRelativePosition(en.equs, cloneObj.getAbsolutePosition()));\n\n //cloneObj.destroy();\n }\n );\n en.equs.objs.push(cloneObj);\n en.equs.poss.push(newPos);\n };\n\n // creating control bit equation string and order by position number\n en.procesCbit = (bitId, obj) => {\n obj.equ.sort((a, b) => {\n return a.num - b.num\n }); // ordering by position\n let equStr = '', binStr = '';\n obj.equ.forEach(el => {\n if (equStr === '') {\n equStr = el.bitId;\n binStr = el.bin.toString();\n } else {\n equStr += '\\u2295' + el.bitId;\n binStr += \"\\u2295\" + el.bin.toString();\n }\n });\n obj.str = en.process === 'enc' ? bitId + ' = ' + equStr + ' => ' + binStr + ' = ' : bitId + ' => ' + binStr + ' = ';\n return obj;\n };\n return en;\n}", "setOptions() {\n let defaultObj = {numChar: 1, limitNum: 3, orderBlock: [\"suggest\",\"collection\",\"product\"]};\n if(!this.options)\n {\n this.options = defaultObj; // set default if user not put arg\n }\n else {\n for(let key in defaultObj) // \n {\n if(!this.options[key])\n {\n this.options[key] = defaultObj[key];\n }\n }\n }\n \n\n \n }", "function getParameterDefinitions() {\n /*\n This function returns a list of all user configureable\n options (used to parameterize the model).\n */\n return [\n\t\t{ name: 'grpTube', type: 'group', caption: 'Test tube settings' },\n\t\t{ name: 'tubeDiameter', type: 'float', caption: 'Tube outer diameter', default: 13 },\n\t\t{ name: 'tubeHeight', type: 'float', caption: 'Tube height', default: 100 },\n\n\t\t{ name: 'grpHolder', type: 'group', caption: 'Holder settings' },\n\t\t{ name: 'rows', type: 'int', caption: 'Rows', default: 5 },\n\t\t{ name: 'cols', type: 'int', caption: 'Columns', default: 2 },\n\t\t{ name: 'thickness', type: 'int', caption: 'Wall thickness', default: 1 },\n\t\t\n\t\t{ name: 'grpPrinter', type: 'group', caption: 'Printer' },\n\t\t{ name: 'scale', default: 1.0, type: 'float', caption: 'Scale' },\n\t\t{ name: 'correctionInsideDiameter', default: 1, type: 'float', caption: 'Inside diameter correction' },\n\t\t{ name: 'correctionOutsideDiameter', default: 0, type: 'float', caption: 'Outside diameter correction' },\n\t\t{ name: 'correctionInsideDiameterMoving', default: 0, type: 'float', caption: 'Inside diameter correction (moving)' },\n\t\t{ name: 'correctionOutsideDiameterMoving', default: 0, type: 'float', caption: 'Outside diameter correction (moving)' },\n\t\t{ name: 'resolutionCircle', default: 360, type: 'int', caption: 'Circle resolution (steps)' }\n ];\n}", "function checkAlgorithmParams(algorithm, array, target, func){\n\t\tif(typeof array !== 'undefined'){\n\t\t\tif (!(array instanceof Array)){\n\t\t\t\tif(typeof target !== 'undefined'){\n\t\t\t\t\tif(target instanceof Object){\n\t\t\t\t\t\tfunc = target;\n\t\t\t\t\t\ttarget = object.target;\n\t\t\t\t\t}\n\t\t\t\t\tarray = makeArray(array);\n\t\t\t\t}\n\t\t\t\telse if(array instanceof Object){\n\t\t\t\t\tfunc = array;\n\t\t\t\t\tarray = object.values.slice(0);\n\t\t\t\t\ttarget = object.target;\n\t\t\t\t}\n\t\t\t\telse if(typeof array === 'string'){\n\t\t\t\t\tarray = makeArray(array);\n\t\t\t\t\ttarget = object.target;\n\t\t\t\t}\n\t\t\t\telse if(isNumber(array)){\n\t\t\t\t\tarray = makeArray(array);\n\t\t\t\t\ttarget = object.target;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tarray = object.values.slice(0);\n\t\t\t\t\ttarget = object.target;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(typeof target !== 'undefined'){\n\t\t\t\tif(target instanceof Object){\n\t\t\t\t\tfunc = target;\n\t\t\t\t\ttarget = object.target;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tarray = object.values.slice(0);\n\t\t\ttarget = object.target;\n\t\t}\n\t\t\n\t\tif(typeof target === 'undefined'){\n\t\t\ttarget = object.target;\n\t\t}\n\t\t\n\t\tif(typeof func !== 'undefined'){\n\t\t\tfor(key in func){\n\t\t\t\tif((object.listenerFunctions.hasOwnProperty(key))&&(object.listenerFunctions[key].hasOwnProperty(algorithm))){\n\t\t\t\t\tobject.listenerFunctions[key][algorithm] = func[key];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfor(index in customAlgorithms){\n\t\t\t\t\t\tif(algorithm == index){\n\t\t\t\t\t\t\tobject.listenerFunctions[key][index] = func[key];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn [array.slice(0), target];\n\t}", "setupOptions() {\n this.options = {\n nodes: {\n shape: 'image',\n image: '/images/terminal.png'\n },\n edges: {\n arrows: 'to',\n color: '#aaa',\n smooth: {\n type: 'continuous',\n forceDirection: 'none'\n }\n },\n physics: {\n enabled: false\n },\n layout: {\n hierarchical: {\n direction: 'LR'\n }\n }\n };\n }", "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 setupAlgorithmSelection(currentSortAlgorithm){\n let currentQuestions = getCurrentQuestionsStruct(currentSortAlgorithm);\n showCurrentAlgorithmCodeAndInfo(currentSortAlgorithm);\n hideOtherAlgorithmCodeAndInfo(currentSortAlgorithm);\n addQuizQuestionsToHtml(currentSortAlgorithm);\n let infoBlockDiv = document.getElementById(\"algo-info-block\");\n let codeBlockDiv = document.getElementById(\"code-block\");\n codeBlockDiv.classList.add(\"code-block-div\");\n infoBlockDiv.classList.add(\"algo-info-div\");\n}", "getConfig() {\n let config = this.trs80.getConfig();\n for (const displayedOption of this.displayedOptions) {\n if (displayedOption.input.checked) {\n config = displayedOption.block.updateConfig(displayedOption.option.value, config);\n }\n }\n return config;\n }", "set options(value) {}", "function T(a,b,c){c=c||{};var d=\"autoSchema connectionTimeout size mechanisms policy isSerial Encryption\".split(\" \"),e;for(e in c)if(c.hasOwnProperty(e)&&-1==jb(d,e))throw new C('Unknown attribute \"'+e+'\" in options.');if(c.mechanisms){if(!u(c.mechanisms))throw new C(\"mechanisms attribute must be an array but \"+ca(c.mechanisms)+\" found.\");for(e=0;e<c.mechanisms.length;e++)if(!(0<=jb(Hf,c.mechanisms[e])))throw new C('Invalid mechanism \"'+c.mechanisms[e]+'\"');}this.u=c.mechanisms||Hf;this.h=c.size;\nthis.v=t(c.connectionTimeout)?c.connectionTimeout:3E3;this.b=null;this.d=[];this.Sa=!1;var f;if(b instanceof Df)f=b;else if(y(b))for(c.autoSchema||!t(b.stores)?f=new Ee(b):f=new Df(b),c=b.stores?b.stores.length:0,e=0;e<c;e++)d=X(f,b.stores[e].name),b.stores[e].Sync&&H(this.logger,\"Synchronization option for \"+d.getName()+\" ignored.\");else f=new Ee;this.a=f;for(e=0;e<this.a.count();e++)if((this.a.stores[e]||null).i)throw Error(\"encryption option must be defined\");t(a)&&this.o(a);this.e=null;this.f=\nnew B}", "_configOptions(config) {\n this.options = {\n containerSelector: '#gol-container',\n style: 'canvas',\n cellSize: 20,\n speed: 1,\n\n size: {\n width: 1860,\n height: 930\n }\n };\n \n if(config) {\n Object.assign(this.options, config);\n }\n }", "constructor() {\r\n // Algorithm State\r\n this.reset();\r\n this.heuristic = \"euclidean\";\r\n }", "confChecker(){\n\t\tlet checker = new ParameterChecker( this.conf, this.C )\n\t\tchecker.confCheckParameter( \"LAMBDA_VRANGE_MAX\", \"KindArray\", \"NonNegative\" )\n\t\tchecker.confCheckParameter( \"LAMBDA_VRANGE_MIN\", \"KindArray\", \"NonNegative\" )\n\t}", "function generateOptions() {\n if (checkedUpper) {\n options.push(...upperCase);\n }\n if (checkedLower) {\n options.push(...lowerCase);\n }\n if (checkedSpecial) {\n options.push(...special);\n }\n if (checkedNumbers) {\n options.push(...numbers);\n }\n}", "function algorithmSelectionChanged() {\n\n // cleanup anything from the previous algorithm\n if (hdxAV.currentAV != null) {\n hdxAVCP.cleanup();\n hdxAV.currentAV.cleanupUI();\n }\n \n const value = getSelectedAlgorithm();\n\n // set the current algorithm\n for (let i = 0; i < hdxAV.avList.length; i++) {\n if (value == hdxAV.avList[i].value) {\n hdxAV.currentAV = hdxAV.avList[i];\n break;\n }\n }\n\n document.getElementById(\"currentAlgorithm\").innerHTML =\n\thdxAV.currentAV.name;\n\n // display AV description\n document.getElementById(\"algDescription\").innerHTML =\n\thdxAV.currentAV.description;\n\n // initialize algorithm status display and log messaging\n hdxAV.algStat.style.display = \"\";\n hdxAV.algStat.innerHTML = \"Setting up\";\n hdxAV.logMessageArr = [];\n hdxAV.logMessageArr.push(\"Setting up\");\n \n // call its function to set up its remaining startup status and options\n hdxAV.currentAV.setupUI();\n}", "function scriptConfig() {\r\n\ttrace(\"scriptConfig() configuring the dialog\");\r\n\t\r\n\t// Configure Settings dialog\r\n\tGM_config.init('Emule Linker Settings dialog', {\r\n\t\t'section1' : { section: ['ed2k download mode', 'Please refer to your emule/amule/mldonkey configuration'], label: '', type: 'hidden'},\r\n\t\t/*'ed2kDlMethod': { label: 'Ed2k Download Method', title: 'local: local application that handle ed2k links (default)\\nemule: remote emule (via web frontend)\\namule: remote amule (via web frontend)\\nmldonkey: remote mldonkey (via web frontend)\\ncustom: custom server implementation (experimental)', type:'radio', options:['local','emule','amule','mldonkey','custom'], default: ed2kDlMethod },*/\r\n\t\t'ed2kDlMethod': { label: 'Ed2k Download Method', title: 'local: local application that handle ed2k links (default)\\nemule: remote emule (via web frontend)\\namule: remote amule (via web frontend)\\nmldonkey: remote mldonkey (via web frontend)\\ncustom: custom server implementation (experimental)', type:'select', options:{'local':'your system default','emule':'(remote) emule','amule':'(remote) amule','mldonkey':'(remote) mldonkey','custom':'custom (experimental)'}, default: ed2kDlMethod}, // default value doesn't work with a dropdown menu => see bugfix in the lib\r\n\t\t'emuleUrl': { label: 'Emule Url', title : 'The complete url of your emule web server ending by a / (example: http://127.0.0.1:4711/)', type: 'text', default: emuleUrl },\r\n\t\t'emulePwd': { label: 'Emule Password', title : 'the password you choose to access your emule web server', type: 'text', default: emulePwd },\r\n\t\t'emuleCat': { label: 'Category', title : 'categories available in your emule/amule application. You can add categories using the following template:\\ncategory_name1=corresponding_index_in_emule;category_name2=...\\nAdding a * before the name specify the default choice.\\nIf you don\\'t know what you are doing just specify this: *default=0', type: 'text', default: catToStr(emuleCat) },\r\n\t\t'section2' : { section: ['Popup Configuration', 'modify how the popup is displayed'], label: '', type: 'hidden'},\r\n\t\t'popupPos': { label: 'Popup Position', title : 'choosing \\'absolute\\', the popup will stay at the top. Choosing fixed, the popup will follow as you scroll within the page', type: 'radio', options:['absolute','fixed'], default: popupPos },\r\n\t\t'popupHeight': { label: 'Max Popup Height in px (0=unlimited)', title : 'Max height of the popup in pixels (0=unlimited)', type: 'int', default: popupHeight },\r\n\t\t'popupWidth': { label: 'Max Popup Width in px (0=unlimited)', title : 'Max width of the popup in pixels (0=unlimited)', type: 'int', default: popupWidth },\r\n\t\t'section3' : { section: ['Edit box Configuration', 'modify how the edit box is displayed'], label: '', type: 'hidden'},\r\n\t\t'editCol': { label: 'Number of columns', title : 'number of columns', type: 'radio', type: 'int', default: editCol },\r\n\t\t'editRow': { label: 'Number of rows', title : 'Number of rows', type: 'int', default: editRow },\r\n\t\t'editMaxLength': { label: 'MaxLength', title : 'Max number of char in the text area', type: 'int', 'default': editMaxLength },\r\n\t\t}, \r\n\t\t{\r\n\t\t//open: function() { GM_config.sections2tabs(); }, // not working (not included into the library)\r\n\t\tsave: function() { location.reload(); } // reload the page when configuration was changed\r\n\t\t}\r\n\t);\r\n\t\r\n\t// invoke the dialog\r\n\tif (GM_getValue(\"emule_config\", 0)<1)\r\n\t{\r\n\t\ttrace(\"scriptConfig() invoking the dialog\");\r\n\t\tGM_config.open();\r\n\t\tGM_setValue(\"emule_config\",1);\r\n\t}\r\n\r\n\t// store the settings\r\n\tsaveConfig();\r\n\r\n}", "function getOpt() {\n opt = {\n h: parseInt(eid(\"h\").value),\n k: parseInt(eid(\"k\").value),\n H: parseInt(eid(\"H\").value),\n K: parseInt(eid(\"K\").value),\n R2: parseFloat(eid(\"R2\").value),\n R3: parseFloat(eid(\"R3\").value),\n F: parseFloat(eid(\"F\").value),\n θ: radians(parseFloat(eid(\"θ\").value)),\n ψ: radians(parseFloat(eid(\"ψ\").value)),\n φ: radians(parseFloat(eid(\"φ\").value)),\n rotation: eid(\"rotation\").value,\n interval: parseInt(eid(\"interval\").value),\n };\n}", "function createConfig() {\n\tdocument.getElementById(\"chooseConfigDialog\").style.display = \"none\";\n\topenaccordion(\"currentConfigAcc\");\n\tresetConfig(); // includes the function \"optimizeforsource\"\n\tshowstep1();\n}", "setApolloNetworkOptions(opt = {}) {\n this.apolloNetworkOptions = opt;\n }", "selectAlgorithm(id, code) {\n $(\"#\" + id + \" .algorithm-overview\").each(function () {\n $(this).find(\".icon\").hide();\n $(this).find(\".subtitle\").text(\"Algorithmus auswählen\");\n });\n $(\".algorithm-overview[data-alg='\" + code + \"'] .icon\").show();\n $(\".algorithm-overview[data-alg='\" + code + \"'] .subtitle\").text(\"Algorithmus ausgewählt\");\n switch (code) {\n case \"suf\":\n this.algorithm = \"SuperFlo\";\n break;\n case \"air\":\n this.algorithm = \"AllInOneRow\";\n break;\n case \"slb\":\n this.algorithm = \"StartLeftBottom\";\n break;\n default: throw (\"unknown algorithm code: \" + code);\n }\n }", "function init_config() {\n set_config('global', 'enable_drc', INIT_GLOBAL_ENABLE_DRC);\n set_config('global', 'enable_eq', INIT_GLOBAL_ENABLE_EQ);\n set_config('global', 'enable_fft', INIT_GLOBAL_ENABLE_FFT);\n set_config('global', 'enable_swap', INIT_GLOBAL_ENABLE_SWAP);\n set_config('drc', 0, 'f', 0);\n set_config('drc', 1, 'f', INIT_DRC_XO_LOW);\n set_config('drc', 2, 'f', INIT_DRC_XO_HIGH);\n for (var i = 0; i < 3; i++) {\n set_config('drc', i, 'enable', INIT_DRC_ENABLE);\n set_config('drc', i, 'threshold', INIT_DRC_THRESHOLD);\n set_config('drc', i, 'knee', INIT_DRC_KNEE);\n set_config('drc', i, 'ratio', INIT_DRC_RATIO);\n set_config('drc', i, 'attack', INIT_DRC_ATTACK);\n set_config('drc', i, 'release', INIT_DRC_RELEASE);\n set_config('drc', i, 'boost', INIT_DRC_BOOST);\n }\n for (var i = 0; i <= 1; i++) {\n for (var j = 0; j < NEQ; j++) {\n set_config('eq', i, j, 'enable', INIT_EQ_ENABLE);\n set_config('eq', i, j, 'type', INIT_EQ_TYPE);\n set_config('eq', i, j, 'freq', INIT_EQ_FREQ);\n set_config('eq', i, j, 'q', INIT_EQ_Q);\n set_config('eq', i, j, 'gain', INIT_EQ_GAIN);\n }\n }\n}", "function use_config() {\n var n = arguments.length;\n var name = make_name(arguments, n - 1);\n all_configs[name] = arguments[n - 1];\n if (audio_graph) {\n audio_graph.config(name.split('.'), all_configs[name]);\n }\n if (audio_ui) {\n audio_ui.config(name.split('.'), all_configs[name]);\n }\n}", "function computeConfiguration(params, _token, _next) {\n if (!params.items) {\n return null;\n }\n let result = [];\n for (let item of params.items) {\n // The server asks the client for configuration settings without a section\n // If a section is present we return null to indicate that the configuration\n // is not supported.\n if (item.section) {\n result.push(null);\n continue;\n }\n let config;\n if (item.scopeUri) {\n config = vscode_1.workspace.getConfiguration('lspMultiRootSample', client.protocol2CodeConverter.asUri(item.scopeUri));\n }\n else {\n config = vscode_1.workspace.getConfiguration('lspMultiRootSample');\n }\n result.push({\n maxNumberOfProblems: config.get('maxNumberOfProblems')\n });\n }\n return result;\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 }", "commonOptions() {\n let config = this.config;\n let cmd = [];\n\n if (config.datadir) {\n cmd.push(`--datadir=${config.datadir}`);\n }\n\n if (Number.isInteger(config.verbosity) && config.verbosity >= 0 && config.verbosity <= 5) {\n switch (config.verbosity) {\n case 0:\n cmd.push(\"--lvl=crit\");\n break;\n case 1:\n cmd.push(\"--lvl=error\");\n break;\n case 2:\n cmd.push(\"--lvl=warn\");\n break;\n case 3:\n cmd.push(\"--lvl=info\");\n break;\n case 4:\n cmd.push(\"--lvl=debug\");\n break;\n case 5:\n cmd.push(\"--lvl=trace\");\n break;\n default:\n cmd.push(\"--lvl=info\");\n break;\n }\n }\n\n return cmd;\n }", "create_option_list(\n ui,\n local,\n entries,\n name,\n classes,\n disabled,\n on_check,\n properties,\n augment_svg = () => [],\n ) {\n const options_list = new DOM.Element(\"div\", { class: `options` });\n options_list.class_list.add(...classes);\n\n const create_option = (value, tooltip, data) => {\n const button = new DOM.Element(\"input\", {\n type: \"radio\",\n name,\n value,\n title: tooltip,\n }).listen(\"change\", (_, button) => {\n if (button.checked) {\n const selected_edges = Array.from(ui.selection).filter(cell => cell.is_edge());\n on_check(selected_edges, value, data);\n for (const edge of selected_edges) {\n edge.render(ui);\n }\n }\n });\n button.element.disabled = disabled;\n options_list.add(button);\n\n // We're going to create background images for the label alignment buttons\n // representing each of the alignments. We do this by creating SVGs so that\n // the images are precisely right.\n // We create two background images per button: one for the `:checked` version\n // and one for the unchecked version.\n const backgrounds = [];\n\n const svg = new DOM.SVGElement(\"svg\", { xmlns: \"http://www.w3.org/2000/svg\" }).element;\n\n const { shared, edge: { length, options, gap = null } } = properties(value, data);\n\n const { dimensions, alignment }\n = Edge.draw_edge(svg, options, length, Math.PI / 4, gap);\n // Align the background according the alignment of the arrow\n // (`\"centre\"` is default).\n if (alignment !== \"centre\") {\n // What percentage of the button to offset `\"left\"` or `\"right\"` aligned arrows.\n const BACKGROUND_PADDING = 20;\n\n button.element.style.backgroundPosition\n = `${alignment} ${BACKGROUND_PADDING}% center`\n }\n\n // Trigger the callback to modify the SVG in some way after drawing the arrow.\n // `colour_properties` is an array of `{ object, property }` pairs. Each will\n // be set to the current `colour` in the loop below.\n const colour_properties = augment_svg(svg, dimensions, shared);\n\n for (const colour of [\"black\", \"grey\"]) {\n svg.style.stroke = colour;\n for (const { element, property } of colour_properties) {\n element.style[property] = colour;\n }\n backgrounds.push(`url(data:image/svg+xml;utf8,${encodeURI(svg.outerHTML)})`);\n }\n button.element.style.backgroundImage = backgrounds.join(\", \");\n\n return button;\n };\n\n for (const [value, tooltip, data, classes = []] of entries) {\n create_option(value, tooltip, data).class_list.add(...classes);\n }\n\n options_list.element.querySelector(`input[name=\"${name}\"]`).checked = true;\n\n local.add(options_list);\n }", "getOptinConfig() {\n let CATNetwork, NISStopAccount;\n if (this._Wallet.network === nem.model.network.data.testnet.id) {\n CATNetwork = NetworkType.TEST_NET;\n NISStopAccount = 'TAXF5HUGBKGSC3MOJCRXN5LLKFBY43LXI3DE2YLS';\n } else if (this._Wallet.network === nem.model.network.data.mainnet.id) {\n CATNetwork = NetworkType.MAIN_NET;\n NISStopAccount = 'NAQ7RCYM4PRUAKA7AMBLN4NPBJEJMRCHHJYAVA72';\n } else if (this._Wallet.network === nem.model.network.data.mijin.id) {\n CATNetwork = NetworkType.MIJIN;\n } else {\n CATNetwork = NetworkType.MIJIN_TEST;\n }\n return {\n NIS: {\n endpoint: this._Wallet.node,\n network: this._Wallet.network,\n configAddress: NISStopAccount,\n },\n SYM: {\n network: CATNetwork,\n generationHash: '57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6'\n },\n snapshotInfoApi: 'http://post-optin.symboldev.com/'\n };\n }", "function addAlgsetElements(algsets) {\n for (let i = 0; i < algsets.length; i++) {\n var tag = algsets[i].event + \"-\" + algsets[i].name;\n // Add algset to the navigation bar\n switch (algsets[i].event) {\n case \"3x3\":\n $(\"#3x3\").append(\"<li><a data-selected='0' \" +\n \"class='algset' id='train-\" + tag +\n \"' href='javascript:void(0)'>\" + algsets[i].name +\n \"</a></li>\");\n break;\n case \"2x2\":\n $(\"#2x2\").append(\"<li><a data-selected='0' \" +\n \"class='algset' id='train-\" + tag +\n \"' href='javascript:void(0)'>\" + algsets[i].name +\n \"</a></li>\");\n break;\n }\n $(\"#train-\" + tag).attr(\"onclick\", \"train('\" +\n algsets[i].event + \"', '\" + algsets[i].name + \"')\");\n // Add algset to algset manager options\n $('.algsetselect').append(\"<option value='\" + tag + \"'>\" + tag + \"</option>\");\n }\n\n // Sort navigation bar\n\n\n // Sort options\n $('.algsetselect').append($('.algsetselect option').sort(function(a, b) {\n if (a.value > b.value) {\n return 1;\n } else if (a.value < b.value) {\n return -1;\n } else {\n return 0;\n }\n }));\n $('.algsetselect').val($('.algsetselect option:first').val());\n}", "setupUI() {\n\n hdxAV.algOptions.innerHTML = '';\n\t\n hdxAVCP.add(\"undiscovered\", visualSettings.undiscovered);\n hdxAVCP.add(\"visiting\", visualSettings.visiting);\n hdxAVCP.add(\"discarded\", visualSettings.discarded);\n for (let i = 0; i < this.categories.length; i++) {\n hdxAVCP.add(this.categories[i].name,\n this.categories[i].visualSettings);\n }\n }", "configureJava() {\n this.config.defaults(requiredConfig);\n }", "static async createOptimalIndexes(collections, options = {}) {\n }", "function Cfg(options) { // use \"new Cfg()\"\" to create a unique object\n\n var cfg = this ; // for returning our module properties and methods\n var ver = {} ; // a reference to the version compare helper module\n var opt = {} ; // to store argument object (options) passed to constructor\n\n options = options || {} ; // force an arguments object if none was passed\n opt = options ; // assign passed arguments to our permanent object\n\n if( opt.skipTest && (opt.skipTest !== true) )\n opt.skipTest = false ;\n\n if( opt.altPin && !Number.isInteger(opt.altPin) )\n opt.altPin = false ;\n\n try {\n require.resolve(\"mraa\") ;\n }\n catch(e) {\n console.error(\"Critical: mraa node module is missing, try 'npm install -g mraa' to fix.\", e) ;\n process.exit(-1) ;\n }\n cfg.mraa = require(\"mraa\") ; // initializes libmraa for I/O access\n ver = require(\"./version-compare\") ; // simple version strings comparator\n\n\n\n/**\n * Configure the I/O object constructor input arguments to default values.\n *\n * Includes a place to store the default values for the I/O object that is used\n * to manipulate the I/O pin(s) used by this application. The caller will create\n * the I/O object based on the parameter values we send back in the cfg object.\n *\n * The cfg.init() function must be called to configure for a specific IoT board.\n *\n * See mraa API documentation, especially I/O constructor, for details:\n * http://iotdk.intel.com/docs/master/mraa/index.html\n *\n * @member {Object} for storing mraa I/O object to be created by caller\n * @member {Number} Gpio class constructor parm, mraa GPIO pin #\n * @member {Boolean} Gpio class constructor parm, Gpio object lifetime owner\n * @member {Boolean} Gpio class constructor parm, Gpio object addressing mode\n */\n\n cfg.io = {} ; // used by caller to hold mraa I/O object\n cfg.ioPin = -1 ; // set to unknown pin (will force a fail)\n cfg.ioOwner = true ; // set to constructor default\n cfg.ioRaw = false ; // set to constructor default\n\n\n\n/**\n * Using the mraa library, detect which IoT platform we are running on\n * and make the appropriate adjustments to our io configuration calls.\n *\n * Check the case statements to find out which header pin is being\n * initialized for use by this app. Specifically, see the\n * `io = opt.altPin ...` lines in the code below.\n *\n * If we do not recognize the platform, issue an error and exit the app.\n *\n * NOTE: Regarding the Galileo Gen 1 board LED: this board requires the use of\n * raw mode to address the on-board LED. This board's LED is not connected to\n * pin 13, like the Edison and Gen2 Galileo boards. See this page for details\n * <https://iotdk.intel.com/docs/master/mraa/galileorevd.html>.\n *\n * @function\n * @return {Boolean} true if supported platform detected (and initialized)\n */\n\n cfg.init = function() {\n\n var io = opt.altPin || -1 ; // set to bad value if none provided by altPin\n var chkPlatform = true ; // start out hopeful!\n var mraaError = cfg.mraa.SUCCESS ; // for checking some mraa return codes\n\n if( opt.skipTest ) { // skip platform test?\n io = opt.altPin ; // force run on unknown platform with alt pin\n }\n else if( typeof(cfg.mraa.getPlatformType()) === \"undefined\" ) {\n console.error(\"getPlatformType() is 'undefined' -> possible problem with 'mraa' library?\") ;\n chkPlatform = false ; // did not recognize the platform\n }\n else {\n switch( cfg.mraa.getPlatformType() ) { // which board are we running on?\n\n case cfg.mraa.INTEL_GALILEO_GEN1: // Galileo Gen 1\n\n io = opt.altPin ? io : 3 ; // use alternate pin?\n cfg.ioOwner = false ; // raw mode is not recommended\n cfg.ioRaw = true ; // see NOTE above re use of RAW\n break ;\n\n\n case cfg.mraa.INTEL_GALILEO_GEN2: // Galileo Gen 2\n case cfg.mraa.INTEL_EDISON_FAB_C: // Edison\n\n io = opt.altPin ? io : 13 ; // use alternate pin?\n break ;\n\n\n case cfg.mraa.INTEL_GT_TUCHUCK: // Joule (aka Grosse Tete)\n case cfg.mraa.INTEL_JOULE_EXPANSION: // new preferred name for Joule platform\n\n io = opt.altPin ? io : 100 ; // use alternate pin?\n break ; // gpio 100, 101, 102 or 103 will work\n\n\n // following are most potential \"Gateway + Arduino 101 + firmata\" platforms\n case cfg.mraa.INTEL_DE3815: // DE3815 Baytrail NUCs\n case cfg.mraa.INTEL_NUC5: // 5th gen Broadwell NUCs\n case cfg.mraa.INTEL_CHERRYHILLS: // could be found on a NUC/Gateway\n case cfg.mraa.INTEL_UP: // Intel UP board (small Atom board)\n case cfg.mraa.NULL_PLATFORM: // most likely a generic platform/NUC/Gateway\n case cfg.mraa.UNKNOWN_PLATFORM: // might also be a generic platform/NUC/Gateway\n\n if( typeof(opt.devTty) === \"string\" || opt.devTty instanceof String ) {\n mraaError = cfg.mraa.addSubplatform(cfg.mraa.GENERIC_FIRMATA, opt.devTty) ;\n }\n else { // assume standard Arduino 101 serial-over-USB tty name for Linux\n mraaError = cfg.mraa.addSubplatform(cfg.mraa.GENERIC_FIRMATA, \"/dev/ttyACM0\") ;\n }\n\n // imraa + Arduino 101 should add \"+ firmata\" to getPlatformName(), but doesn't always happen\n if( (mraaError === cfg.mraa.SUCCESS) && (/firmata/.test(cfg.mraa.getPlatformName()) || cfg.mraa.hasSubPlatform()) ) {\n io = opt.altPin ? io : (13 + 512) ; // use alternate pin?\n }\n else {\n console.error(\"'firmata' sub-platform required but not detected: \" + cfg.mraa.getPlatformName()) ;\n console.error(\"Attach Arduino 101 (i.e., 'firmata' board) to USB port on your IoT Gateway/NUC.\") ;\n console.error(\"Try disconnecting and reconnecting your Arduino 101 to the USB port on your system.\") ;\n console.error(\"Use 'imraa -a' to initialize your Arduino 101 with the 'firmata' firmware image.\") ;\n chkPlatform = false ; // did not recognize the platform\n }\n break ;\n\n\n default:\n console.error(\"Unrecognized libmraa platform: \" + cfg.mraa.getPlatformType() + \" -> \" + cfg.mraa.getPlatformName()) ;\n chkPlatform = false ; // did not recognize the platform\n }\n }\n\n if( chkPlatform )\n cfg.ioPin = io ; // return the desired pin #\n\n return chkPlatform ;\n } ;\n\n\n\n/**\n * Confirms that we have a version of libmraa and Node.js that works\n * with this version of the app and on this board.\n *\n * If we detect incompatible versions, return false.\n *\n * @function\n * @return {Boolean} true if \"all systems go\"\n */\n\n cfg.test = function() {\n\n var checkNode = false ;\n var checkMraa = false ;\n var isUbuntu = false ;\n\n // check to see if running on Ubuntu\n // stricter requirements for mraa version\n // should also check for Ubuntu version, but not now...\n var fs = require(\"fs\") ;\n var fileName = \"/etc/os-release\" ;\n var fileData = \"\" ;\n if( fs.existsSync(fileName) ) {\n fileData = fs.readFileSync(fileName, \"utf8\") ;\n isUbuntu = fileData.toLowerCase().includes(\"ubuntu\") ;\n }\n\n if( opt.skipTest ) { // if bypassing version testing\n return true ; // pretend platform tests passed\n }\n else if( typeof(cfg.mraa.getPlatformType()) === \"undefined\" ) {\n console.error(\"getPlatformType() is 'undefined' -> possible problem with 'mraa' library?\") ;\n }\n else {\n switch( cfg.mraa.getPlatformType() ) { // which board are we running on?\n\n case cfg.mraa.INTEL_GALILEO_GEN1: // Gallileo Gen 1\n case cfg.mraa.INTEL_GALILEO_GEN2: // Gallileo Gen 2\n case cfg.mraa.INTEL_EDISON_FAB_C: // Edison\n checkNode = checkNodeVersion(\"4.0\") ;\n if( isUbuntu )\n checkMraa = checkMraaVersion(\"1.6.1\", cfg.mraa) ;\n else\n checkMraa = checkMraaVersion(\"1.0.0\", cfg.mraa) ;\n break ;\n\n case cfg.mraa.INTEL_GT_TUCHUCK: // old Joule name (aka Grosse Tete)\n case cfg.mraa.INTEL_JOULE_EXPANSION: // new preferred name for Joule platform\n checkNode = checkNodeVersion(\"4.0\") ;\n if( isUbuntu )\n checkMraa = checkMraaVersion(\"1.6.1\", cfg.mraa) ;\n else\n checkMraa = checkMraaVersion(\"1.3.0\", cfg.mraa) ;\n break ;\n\n case cfg.mraa.INTEL_DE3815: // DE3815 Baytrail NUCs\n case cfg.mraa.INTEL_NUC5: // 5th gen Broadwell NUCs\n case cfg.mraa.INTEL_CHERRYHILLS: // could be found on a NUC/Gateway\n case cfg.mraa.INTEL_UP: // Intel UP board (small Atom board)\n case cfg.mraa.NULL_PLATFORM: // most likely a generic platform/NUC/Gateway\n case cfg.mraa.UNKNOWN_PLATFORM: // might also be a generic platform/NUC/Gateway\n checkNode = checkNodeVersion(\"4.0\") ;\n if( isUbuntu )\n checkMraa = checkMraaVersion(\"1.6.1\", cfg.mraa) ;\n else\n checkMraa = checkMraaVersion(\"0.10.1\", cfg.mraa) ;\n break ;\n\n default:\n console.error(\"Unknown libmraa platform: \" + cfg.mraa.getPlatformType() + \" -> \" + cfg.mraa.getPlatformName()) ;\n }\n }\n return (checkMraa && checkNode) ;\n } ;\n\n\n // \"Private\" helper functions used by cfg.test() function, above.\n // Defined outside of cfg.test() to minimize chance of memory leaks;\n // per Gavin, our resident JavaScript guru.\n\n function checkNodeVersion(minNodeVersion) {\n if( ver.versionCompare(process.versions.node, \"0\") === false ) {\n console.error(\"Bad Node.js version string: \" + process.versions.node) ;\n return false ;\n }\n\n if( ver.versionCompare(process.versions.node, minNodeVersion) < 0 ) {\n console.error(\"Node.js version is too old, upgrade your board's Node.js.\") ;\n console.error(\"Installed Node.js version is: \" + process.versions.node) ;\n console.error(\"Required min Node.js version: \" + minNodeVersion) ;\n return false ;\n }\n else\n return true ;\n }\n\n function checkMraaVersion(minMraaVersion, mraa) {\n if( ver.versionCompare(mraa.getVersion(), \"0\") === false ) {\n console.error(\"Bad libmraa version string: \" + mraa.getVersion()) ;\n return false ;\n }\n\n if( ver.versionCompare(mraa.getVersion(), minMraaVersion) < 0 ) {\n console.error(\"libmraa version is too old, upgrade your board's mraa node module.\") ;\n console.error(\"Installed libmraa version: \" + mraa.getVersion()) ;\n console.error(\"Required min libmraa version: \" + minMraaVersion) ;\n return false ;\n }\n else\n return true ;\n }\n\n\n\n/**\n * Using standard node modules, identify platform details.\n * Such as OS, processor, etc.\n *\n * For now it just prints info to the console...\n *\n * @function\n * @return {Void}\n */\n\n cfg.identify = function() {\n\n if( opt.altPin )\n console.log(\"Alternate I/O pin \" + opt.altPin + \" was used.\") ;\n if( opt.skipTest )\n console.log(\"Platform compatibility tests were skipped.\") ;\n\n console.log(\"node version: \" + process.versions.node) ;\n console.log(\"mraa version: \" + cfg.mraa.getVersion()) ;\n console.log(\"mraa platform type: \" + cfg.mraa.getPlatformType()) ;\n console.log(\"mraa platform name: \" + cfg.mraa.getPlatformName()) ;\n\n var os = require('os') ;\n console.log(\"os type: \" + os.type()) ;\n console.log(\"os platform: \" + os.platform()) ;\n console.log(\"os architecture: \" + os.arch()) ;\n console.log(\"os release: \" + os.release()) ;\n console.log(\"os hostname: \" + os.hostname()) ;\n// console.log(\"os.cpus: \", os.cpus()) ;\n } ;\n\n\n return cfg ;\n}", "function optionDefinitions(){\n const od = [\n {\n name: 'help',\n type: Boolean,\n alias: 'h'\n },\n {\n name: 'csvfile0',\n type: String\n /* The 0th file that will be converted.\n *\n *\n * The file slcsp.csv given in the slcsp.zip archive.\n * It will be converted to the sqlite3 file given by dbfile0\n */\n },\n {\n name: 'dbfile0',\n type: String\n /* The database file which was converted from csvfile0. */\n /* This is a sqlite3 db file currently. */\n },\n {\n name: 'dbtable0',\n type: String\n /* When a csv file is converted into a database file, the\n * data in the csv file needs to live in a certain table.\n * That table is given by dbtable0, for the database file\n * dbfile0, which was converted from csvfile0.\n */\n },\n {\n name: 'cwd0',\n type: String\n /*\n * The files csvfile0 and dbfile0 need to live in some\n * directory. That location is given by cwd0.\n */\n },\n {\n name: 'csvfile1',\n type: String\n /* The second csvfile (0 based) that will be converted to a db file, given by dbfile1.\n * In general, this is anticipated to be zips.csv\n * The relationship between csvfile1, dbfile1, dbtable1, cwd1\n * is much the same as elaborated upon for csvfile0.\n */\n },\n {\n name: 'dbfile1',\n type: String,\n defaultOption: true\n /* The result of converting csvfile1 to a db file. */\n },\n {\n name: 'dbtable1',\n type: String\n /* The name of the table into which the data from csvfile1 is stored.*/\n /* The table is not implied nor found in the csvfile. */\n /* dbtable1 does double duty as a specifier for the schema when attach database is done. */\n /* The immediate above is a possible @todo - have schema1 as an option.*/\n },\n {\n name:'cwd1',\n type: String\n /* The location of the files csvfile1 and dbfile1. */\n },\n {\n name:'csvfile2',\n type: String\n /* The third csvfile (0 based) that will be converted to a db file, given by dbfile2.\n * In general, this is anticipated to be plans.csv from the archive\n * slcsp.zip.\n */\n },\n {\n name:'dbfile2',\n type: String\n /* The result of converting csvfile2 to a dbfile. */\n },\n {\n name:'dbtable2',\n type: String\n /* The name of the table into which the data from csvfile2 is stored.*/\n /* The table is not implied nor found in the csvfile. */\n /* dbtable2 does double duty as a specifier for the schema when attach database is done. */\n /* The immediate above is a possible @todo - have schema2 as an option.*/\n },\n {\n name: 'cwd2',\n type: String\n /* The location of the files csvfile2 and dbfile2. */\n },\n {\n name: 'output',\n type: String\n /*\n * The name of the output database file.\n * @todo As it stands on 2020-12-26 11:51EST, the concept\n * of output is underspecified. Specifically the location\n * of that database file is needed. Providing a remedy\n * for this will insure all options are seen somewhat alike.\n */\n },\n {\n name: 'keepdbfiles',\n type: Boolean,\n /*\n * Indicates whether or not the sqlite3 database (db) files are kept\n * after execution. Since the requirements do not specify the production\n * of these artifacts, this is by default set to false.\n */\n // defaultValue: false\n }\n ];\n return od;\n}", "function optionDefinitions(){\n const od = [\n {\n name: 'csvfile0',\n type: String\n /* The 0th file that will be converted.\n *\n *\n * The file slcsp.csv given in the slcsp.zip archive.\n * It will be converted to the sqlite3 file given by dbfile0\n */\n },\n {\n name: 'dbfile0',\n type: String\n /* The database file which was converted from csvfile0. */\n /* This is a sqlite3 db file currently. */\n },\n {\n name: 'dbtable0',\n type: String\n /* When a csv file is converted into a database file, the\n * data in the csv file needs to live in a certain table.\n * That table is given by dbtable0, for the database file\n * dbfile0, which was converted from csvfile0.\n */\n },\n {\n name: 'cwd0',\n type: String\n /*\n * The files csvfile0 and dbfile0 need to live in some\n * directory. That location is given by cwd0.\n */\n },\n {\n name: 'csvfile1',\n type: String\n /* The second csvfile (0 based) that will be converted to a db file, given by dbfile1.\n * In general, this is anticipated to be zips.csv\n * The relationship between csvfile1, dbfile1, dbtable1, cwd1\n * is much the same as elaborated upon for csvfile0.\n */\n },\n {\n name: 'dbfile1',\n type: String,\n defaultOption: true\n /* The result of converting csvfile1 to a db file. */\n },\n {\n name: 'dbtable1',\n type: String\n /* The name of the table into which the data from csvfile1 is stored.*/\n /* The table is not implied nor found in the csvfile. */\n /* dbtable1 does double duty as a specifier for the schema when attach database is done. */\n /* The immediate above is a possible @todo - have schema1 as an option.*/\n },\n {\n name:'cwd1',\n type: String\n /* The location of the files csvfile1 and dbfile1. */\n },\n {\n name:'csvfile2',\n type: String\n /* The third csvfile (0 based) that will be converted to a db file, given by dbfile2.\n * In general, this is anticipated to be plans.csv from the archive\n * slcsp.zip.\n */\n },\n {\n name:'dbfile2',\n type: String\n /* The result of converting csvfile2 to a dbfile. */\n },\n {\n name:'dbtable2',\n type: String\n /* The name of the table into which the data from csvfile2 is stored.*/\n /* The table is not implied nor found in the csvfile. */\n /* dbtable2 does double duty as a specifier for the schema when attach database is done. */\n /* The immediate above is a possible @todo - have schema2 as an option.*/\n },\n {\n name: 'cwd2',\n type: String\n /* The location of the files csvfile2 and dbfile2. */\n },\n {\n name: 'output',\n type: String\n /*\n * The name of the output database file.\n * @todo As it stands on 2020-12-26 11:51EST, the concept\n * of output is underspecified. Specifically the location\n * of that database file is needed. Providing a remedy\n * for this will insure all options are seen somewhat alike.\n */\n }\n ];\n return od;\n}", "_loadOptions() {\n let include = storage.data[OPT_INCLUDE] || this._incl;\n let range = storage.data[OPT_RANGE] || this._range;\n \n for (let [key, val] of Object.entries(include)) {\n this._cboxes[key].checked = val;\n if (val && key !== 'reversals') {\n this._numCBoxesChecked++;\n }\n }\n this._selectRangeRows(range.low, range.high);\n this._incl = include;\n this._range = range;\n this._updateRangeAvailability();\n }", "function setIterations() {\r\n\r\n\tif (document.form.iterations[0].checked) {\r\n\t\tMaxIterations = 256;\r\n\t\tdrawJulia();\r\n\t}\r\n\telse if (document.form.iterations[1].checked) {\r\n\t\tMaxIterations = 512;\r\n\t\tdrawJulia();\r\n\t}\r\n\telse if (document.form.iterations[2].checked) {\r\n\t\tMaxIterations = 1024;\r\n\t\tdrawJulia();\r\n\t}\r\n\t\r\n}", "setKnownToolStrategies () {\n this.toolStrategies = new Map()\n\n // Built-In Tools\n this.toolStrategies.set('go', 'GOROOTBIN')\n this.toolStrategies.set('gofmt', 'GOROOTBIN')\n this.toolStrategies.set('godoc', 'GOROOTBIN')\n this.toolStrategies.set('addr2line', 'GOTOOLDIR')\n this.toolStrategies.set('api', 'GOTOOLDIR')\n this.toolStrategies.set('asm', 'GOTOOLDIR')\n this.toolStrategies.set('cgo', 'GOTOOLDIR')\n this.toolStrategies.set('compile', 'GOTOOLDIR')\n this.toolStrategies.set('cover', 'GOTOOLDIR')\n this.toolStrategies.set('dist', 'GOTOOLDIR')\n this.toolStrategies.set('doc', 'GOTOOLDIR')\n this.toolStrategies.set('fix', 'GOTOOLDIR')\n this.toolStrategies.set('link', 'GOTOOLDIR')\n this.toolStrategies.set('nm', 'GOTOOLDIR')\n this.toolStrategies.set('objdump', 'GOTOOLDIR')\n this.toolStrategies.set('pack', 'GOTOOLDIR')\n this.toolStrategies.set('pprof', 'GOTOOLDIR')\n this.toolStrategies.set('tour', 'GOTOOLDIR')\n this.toolStrategies.set('trace', 'GOTOOLDIR')\n this.toolStrategies.set('vet', 'GOTOOLDIR')\n this.toolStrategies.set('yacc', 'GOTOOLDIR')\n\n // External Tools\n this.toolStrategies.set('git', 'PATH')\n\n // Other Tools Are Assumed To Be In PATH or GOBIN or GOPATH/bin\n // GOPATHBIN Can Be Used In The Future As A Strategy, If Required\n // GOPATHBIN Will Understand GO15VENDOREXPERIMENT\n }", "function config(opt) {\n options = Object.assign({}, options, opt);\n }", "function addDimensionOptions() {\n var i,\n iMax,\n dimensionsArray = [],\n j,\n jMax,\n option,\n input,\n label,\n text,\n br,\n half;\n // clear existing dimension checkboxes\n dimensionsCol1.innerHTML = '';\n dimensionsCol2.innerHTML = '';\n // add the return field options\n dimensionsArray = aapi_model.dimensions;\n i = dimensionsArray.length;\n while (i > 0) {\n i--;\n if (isItemInArray(aapi_model.combinations.video.incompatible_dimensions, dimensionsArray[i].name)) {\n dimensionsArray.splice(i, 1);\n }\n }\n iMax = dimensionsArray.length;\n half = Math.ceil(iMax / 2);\n for (i = 0; i < half; i += 1) {\n input = document.createElement('input');\n label = document.createElement('lable');\n input.setAttribute('name', 'dimensionsChk');\n input.setAttribute('id', 'dim' + dimensionsArray[i].name);\n input.setAttribute('data-index', 'i');\n input.setAttribute('type', 'checkbox');\n input.setAttribute('value', dimensionsArray[i].name);\n label.setAttribute('for', 'dim' + dimensionsArray[i].name);\n text = document.createTextNode(' ' + dimensionsArray[i].name);\n br = document.createElement('br');\n dimensionsCol1.appendChild(input);\n dimensionsCol1.appendChild(label);\n label.appendChild(text);\n dimensionsCol1.appendChild(br);\n }\n for (i = half; i < iMax; i += 1) {\n input = document.createElement('input');\n label = document.createElement('lable');\n input.setAttribute('name', 'dimensionsChk');\n input.setAttribute('id', 'dim' + dimensionsArray[i].name);\n input.setAttribute('data-index', 'i');\n input.setAttribute('type', 'checkbox');\n input.setAttribute('value', dimensionsArray[i].name);\n label.setAttribute('for', 'dim' + dimensionsArray[i].name);\n text = document.createTextNode(' ' + dimensionsArray[i].name);\n br = document.createElement('br');\n dimensionsCol2.appendChild(input);\n dimensionsCol2.appendChild(label);\n label.appendChild(text);\n dimensionsCol2.appendChild(br);\n }\n // get a reference to the checkbox collection\n dimensionCheckboxes = document.getElementsByName('dimensionsChk');\n }", "function addOption() {\n\n}", "function setAlgorithm(type){\n \n pathfindingStatus = status.ACTIVE;\n \n document.getElementById('PauseButton').disabled = false;\n document.getElementById('StopButton').disabled = false;\n \n if(velocity === velocityEnum.SLOW)\n frameRate(20); // Slow\n else if(velocity === velocityEnum.VERYSLOW)\n frameRate(8); // Very slow\n else\n frameRate(60); // Average (Default)\n \n \n \n \n \n if(type === 'A*_1'){\n // A* (Manhattan)\n currentHeuristicFunc = heuristicEnum.MANHATTAN;\n algorithmInProgress = 'Shortest';\n \n aStarInit();\n currentPathfinding = function(){\n return aStarStep();\n };\n \n }else if(type === 'A*_2'){\n // A* (Euclidean)\n currentHeuristicFunc = heuristicEnum.EUCLIDEAN;\n algorithmInProgress = 'Shortest';\n \n aStarInit();\n currentPathfinding = function(){\n return aStarStep();\n };\n \n }else if(type === 'A*_3'){\n // A* (Chebychev)\n currentHeuristicFunc = heuristicEnum.CHEBYCHEV;\n algorithmInProgress = 'Shortest';\n \n aStarInit();\n currentPathfinding = function(){\n return aStarStep();\n }; \n \n }else if(type === 'Dijkstra'){\n // Dijkstra (A* without heuristic)\n currentHeuristicFunc = heuristicEnum.NONE;\n algorithmInProgress = 'Shortest';\n \n aStarInit();\n currentPathfinding = function(){\n return aStarStep();\n };\n \n }else if(type === 'BFS'){\n // BFS (traversal)\n currentHeuristicFunc = heuristicEnum.NONE;\n algorithmInProgress = 'Traversal';\n \n bfsInit();\n currentPathfinding = function(){\n return bfsStep();\n };\n \n }else if(type === 'DFS'){\n // DFS (traversal)\n currentHeuristicFunc = heuristicEnum.NONE;\n algorithmInProgress = 'Traversal';\n \n dfsInit();\n currentPathfinding = function(){\n return dfsStep();\n };\n }\n}", "function algOptionsDonePressed() {\n\n // TODO: make sure no additional validation is needed to make sure\n // good options are chosen before we allow this to be dismissed.\n\n if (hdxAV.currentAV == null) {\n hdxAV.currentAV = hdxNoAV;\n }\n \n // set status depending on whether an AV was selected\n if (hdxAV.currentAV.value == hdxNoAV.value) {\n document.getElementById(\"topControlPanelPseudo\").style.display = \"none\";\n document.getElementById(\"speedChanger\").style.display = \"none\";\n hdxAV.setStatus(hdxStates.GRAPH_LOADED);\n }\n else {\n document.getElementById(\"topControlPanelPseudo\").style.display = \"\";\n document.getElementById(\"speedChanger\").style.display = \"\";\n hdxAV.setStatus(hdxStates.AV_SELECTED);\n\t// set all waypoints and connections to undiscovered to start\n initWaypointsAndConnections(true, true,\n visualSettings.undiscovered);\n showAVStatusPanel();\n }\n\n hideAlgorithmSelectionPanel();\n showTopControlPanel();\n}", "function options(o, k, a, i) {\n var e = k.indexOf('='), v = null, str = () => a[++i];\n if(e>=0) { v = k.substring(e+1); str = () => v; k = k.substring(o, e); }\n if(!o.provider) {\n for(var j=i, J=a.length; j<J; j++)\n if(a[j]==='-p' || a[j]==='--provider') { o.provider = a[++j]; break; }\n o.provider = o.provider||OPTIONS.provider;\n }\n if(k==='-p' || k==='--provider') o.provider = str();\n else return load(o.provider).options(o, k, a, i);\n return i+1;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function getOptDescriptions() {\r\n return {\r\n 'gelf-loglevel': 'Log level for GELF format',\r\n 'gelf-host': 'GELF server hostname - if set, enables GELF logging',\r\n 'gelf-port': 'GELF server UDP port',\r\n 'gelf-connectiontype': 'GELF connection type (wan or lan)',\r\n };\r\n}", "static async createOptimalIndexes(collections) {\n }", "function readConfig() {\n var $checked = document.querySelector('input[name=\"algebra\"]:checked');\n var $number = document.getElementById('gln');\n if ($number.valueAsNumber < 2)\n $number.value = '' + 2;\n if ($checked.value == 'sym')\n return AlgebraType.Sym;\n return AlgebraType.GL($number.valueAsNumber);\n}", "function getAIOptions()\r\n{\r\n\t// Create the AISaveOptions object to set the AI options\r\n\tvar AISaveOpts = new IllustratorSaveOptions();\r\n\t\r\n\tAISaveOpts.compatibility = saveVersion;\r\n\t\r\n\t// Setting AISaveOptions properties. Please see the JavaScript Reference\r\n\t// for a description of these properties.\r\n\t// Add more properties here if you like\r\n\r\n\treturn AISaveOpts;\r\n}", "onClickAboutAlgorithm(algorithm) {\n this.setState({ aboutAlgorithm: algorithm, aboutAlgorithmEnabled: true });\n }", "function processConfigOptions() {\n if (OPTIONS.base_dir === 'cwd' || OPTIONS.base_dir === './') {\n OPTIONS.base_dir = soi.utils.normalizeSysPath(process.cwd() + '/');\n } else {\n OPTIONS.base_dir = soi.utils.normalizeSysPath(\n path.resolve(process.cwd() + '/', OPTIONS.base_dir) + '/');\n }\n\n if (OPTIONS.dist_dir) {\n OPTIONS.dist_dir = soi.utils.normalizeSysPath(\n path.resolve(OPTIONS.base_dir, OPTIONS.dist_dir) + '/');\n }\n if (OPTIONS.module_loader) {\n OPTIONS.module_loader = soi.utils.normalizeSysPath(\n path.resolve(OPTIONS.base_dir, OPTIONS.module_loader));\n }\n if (OPTIONS.map_file) {\n OPTIONS.map_file = soi.utils.normalizeSysPath(\n path.resolve(OPTIONS.base_dir, OPTIONS.map_file));\n }\n if (OPTIONS.output_base) {\n OPTIONS.output_base = soi.utils.normalizeSysPath(\n path.resolve(OPTIONS.base_dir, OPTIONS.output_base) + '/');\n }\n\n // clean(OPTIONS.dist_dir, function(err) {});\n\n // newly added\n if (OPTIONS.bundles.img) {\n processStaticBundles(OPTIONS.bundles.img);\n }\n\n if (OPTIONS.bundles.swf) {\n processStaticBundles(OPTIONS.bundles.swf);\n }\n\n if (OPTIONS.bundles.htc) {\n processStaticBundles(OPTIONS.bundles.htc);\n }\n\n if (OPTIONS.bundles.font) {\n processStaticBundles(OPTIONS.bundles.font);\n }\n\n if (OPTIONS.bundles.css) {\n processDynamicBundles(OPTIONS.bundles.css);\n }\n\n if (OPTIONS.bundles.js) {\n processDynamicBundles(OPTIONS.bundles.js);\n }\n\n // added default ones, because we don't read in it as first\n // calling soi.config.extend\n soi.config.extend({\n optimizer: OPTIONS\n });\n}", "function selectAlgorithm(name) {\n unselectAllChildButtons(\"algorithm-select-container\")\n\n document.getElementsByName(name)[0].classList.toggle('selected');\n algorithm = name;\n updateHeadingAndComplexity();\n\n if (isSortingStarted) {\n resetBars();\n }\n}", "function _updateConfig() {\n var _JSElement = document.getElementById('_fed_an_ua_tag').getAttribute('src');\n _JSElement = _JSElement.replace(/\\?/g, '&');\n var _paramList = _JSElement.split('&');\n /* skip first element since it is just the url */\n for (var i = 1; i < _paramList.length; i++) {\n _keyValuePair = _paramList[i].toLowerCase();\n _key = _keyValuePair.split('=')[0];\n _value = _keyValuePair.split('=')[1];\n\n switch (_key) {\n case 'pua':\n var _UAList = _value.split(',');\n for (var j = 0; j < _UAList.length; j++)\n if (_isValidUANum(_UAList[j]))\n oCONFIG.GWT_UAID.push(_UAList[j].toUpperCase());\n break;\n case 'agency':\n oCONFIG.AGENCY = _value.toUpperCase();\n break;\n case 'subagency':\n oCONFIG.SUB_AGENCY = _value.toUpperCase();\n break;\n case 'maincd':\n _value = _cleanBooleanParam(_value);\n if ('true' == _value || 'false' == _value)\t\t /* only override the default if a valid value is passed */\n oCONFIG.USE_MAIN_CUSTOM_DIMENSIONS = _value;\n break;\n case 'fedagencydim':\n _value = _cleanDimensionValue(_value);\n\t\t\t\tif (''!=_value)\n\t\t\t\t\toCONFIG.MAIN_AGENCY_CUSTOM_DIMENSION_SLOT = _value.toLowerCase();\n break;\n case 'fedsubagencydim':\n _value = _cleanDimensionValue(_value);\n\t\t\t\tif (''!=_value)\n\t\t\t\t\toCONFIG.MAIN_SUBAGENCY_CUSTOM_DIMENSION_SLOT = _value.toLowerCase();\n break;\n case 'fedversiondim':\n _value = _cleanDimensionValue(_value);\n\t\t\t\tif (''!=_value)\n\t\t\t\t\toCONFIG.MAIN_CODEVERSION_CUSTOM_DIMENSION_SLOT = _value.toLowerCase();\n break;\n case 'parallelcd':\n _value = _cleanBooleanParam(_value);\n if ('true' == _value || 'false' == _value)\n oCONFIG.USE_PARALLEL_CUSTOM_DIMENSIONS = _value;\n break;\n case 'palagencydim':\n _value = _cleanDimensionValue(_value);\n\t\t\t\tif (''!=_value)\n\t\t\t\t\toCONFIG.PARALLEL_AGENCY_CUSTOM_DIMENSION_SLOT = _value.toLowerCase();\n break;\n case 'palsubagencydim':\n _value = _cleanDimensionValue(_value);\n\t\t\t\tif (''!=_value)\n\t\t\t\t\toCONFIG.PARALLEL_SUBAGENCY_CUSTOM_DIMENSION_SLOT = _value.toLowerCase();\n break;\n case 'palversiondim':\n _value = _cleanDimensionValue(_value);\n\t\t\t\tif (''!=_value)\n\t\t\t\t\toCONFIG.PARALLEL_CODEVERSION_CUSTOM_DIMENSION_SLOT = _value.toLowerCase();\n break;\n case 'cto':\n oCONFIG.COOKIE_TIMEOUT = parseInt(_value) * 2628000;\t\t// = 60 * 60 * 24 * 30.4166666666667;\n break;\n case 'sp':\n oCONFIG.SEARCH_PARAMS += '|' + _value.replace(/,/g, '|');\n break;\n case 'exts':\n oCONFIG.EXTS += '|' + _value.replace(/,/g, '|');\n break;\n case 'yt':\n _value = _cleanBooleanParam(_value);\n if ('true' == _value || 'false' == _value) /* only override the default if a valid value is passed */\n oCONFIG.YOUTUBE = _value;\n break;\n case 'autotracker':\n _value = _cleanBooleanParam(_value);\n if ('true' == _value || 'false' == _value) /* only override the default if a valid value is passed */\n oCONFIG.AUTOTRACKER = _value;\n break;\n case 'sdor':\n\t\t\t\t\toCONFIG.SUBDOMAIN_BASED = _cleanBooleanParam(_value);\n break;\n case 'dclink':\n _value = _cleanBooleanParam(_value);\n if ('true' == _value || 'false' == _value) /* only override the default if a valid value is passed */\n oCONFIG.DOUNBLECLICK_LINK = _value;\n break;\n case 'enhlink':\n _value = _cleanBooleanParam(_value);\n if ('true' == _value || 'false' == _value) /* only override the default if a valid value is passed */\n oCONFIG.ENHANCED_LINK = _value;\n break;\n case 'optout':\n _value = _cleanBooleanParam(_value);\n if ('true' == _value || 'false' == _value) /* only override the default if a valid value is passed */\n oCONFIG.OPTOUT_PAGE = _value;\n break;\n\t\t\tdefault:\n\t\t\t\tbreak;\n }\n }\n}", "function config(opts = process.env, _prefix = 'fuel_v1_', noresolution = false) {\n const network = opts.network || opts[_prefix + 'network'];\n const resolve = key => noresolution\n ? opts[key]\n : (opts[_prefix + network + '_' + key] || opts[_prefix + 'default_' + key]);\n\n // local provider\n const provider = opts.provider || ethers.getDefaultProvider(network, {\n infura: resolve('infura'),\n });\n\n // return config object\n return {\n archive: true,\n rootLengthTarget: opts.rootLengthTarget,\n produce: opts.produce,\n minimumTransactionsPerRoot: opts.minimumTransactionsPerRoot || 0,\n emit: () => {}, // emmitter for new outputs\n console: console,\n continue: opts.continue,\n network: utils.getNetwork(network),\n gasPrice: () => Promise.resolve('0x12a05f2000'), // 80 gwei\n gas_limit: 4000000, // default gas limit\n confirmations: 0, // required block confirmations\n block_time: 0, // 13 * 1000,\n db: database(copy(memdown(), memdown())),\n contract: opts.contract || {}, // new ethers.Contract(opts.contract || v1[network], abi.Fuel, provider), // selected Fuel contract object\n provider, // provider object\n operators: opts.operators || [], // 0 is main operator, the rest are for root deployment\n };\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n\t this.good_length = good_length;\n\t this.max_lazy = max_lazy;\n\t this.nice_length = nice_length;\n\t this.max_chain = max_chain;\n\t this.func = func;\n\t}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n\t this.good_length = good_length;\n\t this.max_lazy = max_lazy;\n\t this.nice_length = nice_length;\n\t this.max_chain = max_chain;\n\t this.func = func;\n\t}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n\t this.good_length = good_length;\n\t this.max_lazy = max_lazy;\n\t this.nice_length = nice_length;\n\t this.max_chain = max_chain;\n\t this.func = func;\n\t}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n\t this.good_length = good_length;\n\t this.max_lazy = max_lazy;\n\t this.nice_length = nice_length;\n\t this.max_chain = max_chain;\n\t this.func = func;\n\t}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n\t this.good_length = good_length;\n\t this.max_lazy = max_lazy;\n\t this.nice_length = nice_length;\n\t this.max_chain = max_chain;\n\t this.func = func;\n\t}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n\t this.good_length = good_length;\n\t this.max_lazy = max_lazy;\n\t this.nice_length = nice_length;\n\t this.max_chain = max_chain;\n\t this.func = func;\n\t}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n\t this.good_length = good_length;\n\t this.max_lazy = max_lazy;\n\t this.nice_length = nice_length;\n\t this.max_chain = max_chain;\n\t this.func = func;\n\t}", "config () {\n throw new Error(ERROR_MSG.INTERFACE_IMPl);\n }", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}", "function Config(good_length, max_lazy, nice_length, max_chain, func) {\n this.good_length = good_length;\n this.max_lazy = max_lazy;\n this.nice_length = nice_length;\n this.max_chain = max_chain;\n this.func = func;\n}" ]
[ "0.54408854", "0.53299993", "0.5329629", "0.5300134", "0.52983457", "0.52874106", "0.52522326", "0.5251918", "0.5209468", "0.5181975", "0.5160038", "0.51437545", "0.5133435", "0.51314694", "0.5067105", "0.50483507", "0.50251657", "0.50098217", "0.5003025", "0.49795043", "0.4972871", "0.49442568", "0.49397382", "0.4926795", "0.4924416", "0.4920306", "0.4916056", "0.48947543", "0.4889095", "0.4882625", "0.48767138", "0.48707289", "0.48658192", "0.48546267", "0.4842655", "0.48270392", "0.48195985", "0.48167685", "0.48145193", "0.48139164", "0.47792116", "0.47758967", "0.4772272", "0.47653314", "0.4753084", "0.47524178", "0.47509342", "0.47432852", "0.4730138", "0.47235554", "0.4717112", "0.47166544", "0.4712313", "0.4709003", "0.47064164", "0.47034246", "0.4678062", "0.46713954", "0.46704185", "0.46679837", "0.466718", "0.46654168", "0.46631885", "0.4662636", "0.46621302", "0.4662081", "0.46578455", "0.46577522", "0.46549058", "0.46541834", "0.46463305", "0.46430656", "0.46430656", "0.46430656", "0.46430656", "0.46430656", "0.46430656", "0.46430656", "0.46314302", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434", "0.46229434" ]
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function p(e,t,r){(e._derived[t]={fn:(0,s.default)(r)?r:r.fn,cache:!1!==r.cache,depList:r.deps||[]}).depList.forEach(function(r){e._deps[r]=(0,o.default)(e._deps[r]||[],[t])}),(0,n.default)(e,t,{get:function(){return this._getDerivedProperty(t)},set:function(){throw new TypeError("`"+t+"` is a derived property, it can't be set directly.")}})}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "function test_candu_graphs_vm_compare_host_vsphere65() {}", "protected internal function m252() {}", "function setup() {\n\n\n}", "function setup() {\n\n\n}", "function hc(){}", "IP() {\n // return \"47.106.171.247\";\n return \"tcjump.anyh5.com\";\n // return \"tcrhythm.anyh5.com\";\n }", "function NetworkUtil(){ \n}", "function vB_PHP_Emulator()\n{\n}", "function test_utilization_host() {}", "info() { }", "ping() {\n return \"pong!\"\n }", "function _____SHARED_functions_____(){}", "function ZNPSerial() {\n}", "function setup() {\n \n}", "function test_candu_graphs_datastore_vsphere6() {}", "static private protected internal function m118() {}", "static private internal function m121() {}", "function version(){ return \"0.13.0\" }", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "playCAS(casfile) {\n//------\nlggr.warn(\"SigningAvatar: playCAS: Not implemented\");\nreturn void 0;\n}", "function NetworkUtil(){}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "static final protected internal function m110() {}", "function setup() {\r\n}", "transient private internal function m185() {}", "static MAGIC_NUMBER(){\n return \"PIXPIPE_PIXBIN\";\n }", "static fromCASFile(casfile) {\n//-----------\nlggr.warn(\"fromCASFile: Not implemented\");\nreturn void 0;\n}", "transient protected internal function m189() {}", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "function setup() {\n \n}", "function setup() {\n \n}", "function DWRUtil() { }", "supportsPlatform() {\n return true;\n }", "getPort2() {\n return 0;\n }", "transient private protected internal function m182() {}", "function version() {\n outlet(2, 249);\n}", "function SigV4Utils() { }", "function init(){\n // loadHeaders(); //load platform headers\n}", "function rc(){}", "static protected internal function m125() {}", "function mbcs() {}", "function mbcs() {}", "function setup() { \n\n}", "function fos6_c() {\n ;\n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "get BC7() {}", "package() {\n let rxString = this.rx.toString(2);\n rxString = '00'.substr(rxString.length) + rxString;\n let ryString = this.rx.toString(2);\n ryString = '00'.substr(ryString.length) + ryString;\n \n this.output = \n this.noop.toString() +\n this.inputc.toString() +\n this.inputcf.toString() +\n this.inputd.toString() +\n this.inputdf.toString() +\n this.move.toString() +\n this.loadi.toString() +\n this.add.toString() +\n this.addi.toString() +\n this.sub.toString() +\n this.subi.toString() +\n this.load.toString() +\n this.loadf.toString() +\n this.store.toString() +\n this.storef.toString() +\n this.shiftl.toString() +\n this.shiftr.toString() +\n this.cmp.toString() +\n this.jump.toString() +\n this.bre.toString() +\n this.brne.toString() +\n this.brg.toString() +\n this.brge.toString() + \n this.rx +\n this.ry;\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static final private public function m104() {}", "function CCUtility() {}", "static isMAC(mac){ return F.isMAC(mac) }", "__ssl() {\n /// TODO: nothing, I guess?\n }", "initialize() {}" ]
[ "0.6103753", "0.6020775", "0.5490901", "0.5483451", "0.5433593", "0.54231304", "0.53348273", "0.5305822", "0.52803075", "0.526343", "0.526343", "0.52513844", "0.5251022", "0.5234475", "0.52090615", "0.52019906", "0.5190295", "0.5179984", "0.51776373", "0.5133519", "0.5129299", "0.51271933", "0.5123561", "0.511986", "0.5112801", "0.51098186", "0.50971055", "0.5094048", "0.50901127", "0.50901127", "0.50901127", "0.50901127", "0.50867635", "0.5082001", "0.5077779", "0.5074136", "0.50722253", "0.50620097", "0.506176", "0.5058936", "0.5058936", "0.5058526", "0.50550914", "0.5051468", "0.504649", "0.5036022", "0.50280994", "0.5020488", "0.5017164", "0.50159746", "0.50085485", "0.50085485", "0.49979907", "0.49968764", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.49964654", "0.4994609", "0.4985803", "0.49842164", "0.49842164", "0.49842164", "0.49835196", "0.49710009", "0.4960199", "0.49594826", "0.4952787" ]
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function o(e){var t=i[e];if(t)for(t=t.slice();!console[e];)e=t.pop();return function(){for(var t,r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];(t=console)[e].apply(t,n)}}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "function test_candu_graphs_vm_compare_host_vsphere65() {}", "protected internal function m252() {}", "function setup() {\n\n\n}", "function setup() {\n\n\n}", "function hc(){}", "IP() {\n // return \"47.106.171.247\";\n return \"tcjump.anyh5.com\";\n // return \"tcrhythm.anyh5.com\";\n }", "function NetworkUtil(){ \n}", "function vB_PHP_Emulator()\n{\n}", "function test_utilization_host() {}", "info() { }", "ping() {\n return \"pong!\"\n }", "function _____SHARED_functions_____(){}", "function ZNPSerial() {\n}", "function setup() {\n \n}", "function test_candu_graphs_datastore_vsphere6() {}", "static private protected internal function m118() {}", "static private internal function m121() {}", "function version(){ return \"0.13.0\" }", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "playCAS(casfile) {\n//------\nlggr.warn(\"SigningAvatar: playCAS: Not implemented\");\nreturn void 0;\n}", "function NetworkUtil(){}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "static final protected internal function m110() {}", "function setup() {\r\n}", "transient private internal function m185() {}", "static MAGIC_NUMBER(){\n return \"PIXPIPE_PIXBIN\";\n }", "static fromCASFile(casfile) {\n//-----------\nlggr.warn(\"fromCASFile: Not implemented\");\nreturn void 0;\n}", "transient protected internal function m189() {}", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "function setup() {\n \n}", "function setup() {\n \n}", "function DWRUtil() { }", "supportsPlatform() {\n return true;\n }", "getPort2() {\n return 0;\n }", "transient private protected internal function m182() {}", "function version() {\n outlet(2, 249);\n}", "function SigV4Utils() { }", "function init(){\n // loadHeaders(); //load platform headers\n}", "function rc(){}", "static protected internal function m125() {}", "function mbcs() {}", "function mbcs() {}", "function setup() { \n\n}", "function fos6_c() {\n ;\n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "get BC7() {}", "package() {\n let rxString = this.rx.toString(2);\n rxString = '00'.substr(rxString.length) + rxString;\n let ryString = this.rx.toString(2);\n ryString = '00'.substr(ryString.length) + ryString;\n \n this.output = \n this.noop.toString() +\n this.inputc.toString() +\n this.inputcf.toString() +\n this.inputd.toString() +\n this.inputdf.toString() +\n this.move.toString() +\n this.loadi.toString() +\n this.add.toString() +\n this.addi.toString() +\n this.sub.toString() +\n this.subi.toString() +\n this.load.toString() +\n this.loadf.toString() +\n this.store.toString() +\n this.storef.toString() +\n this.shiftl.toString() +\n this.shiftr.toString() +\n this.cmp.toString() +\n this.jump.toString() +\n this.bre.toString() +\n this.brne.toString() +\n this.brg.toString() +\n this.brge.toString() + \n this.rx +\n this.ry;\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static final private public function m104() {}", "function CCUtility() {}", "static isMAC(mac){ return F.isMAC(mac) }", "__ssl() {\n /// TODO: nothing, I guess?\n }", "initialize() {}" ]
[ "0.61048126", "0.6021762", "0.54909676", "0.5483541", "0.54344064", "0.54226637", "0.5334779", "0.53060097", "0.52813524", "0.52649856", "0.52649856", "0.52509665", "0.52495617", "0.52337855", "0.52084035", "0.5202822", "0.5191053", "0.5180246", "0.5178851", "0.51328206", "0.51305735", "0.51283973", "0.5124183", "0.5120446", "0.5111861", "0.51103055", "0.5097001", "0.5093396", "0.5091417", "0.5091417", "0.5091417", "0.5091417", "0.5086482", "0.50835353", "0.5078473", "0.5074227", "0.5072048", "0.5062735", "0.50611293", "0.5060342", "0.5060342", "0.505904", "0.50549984", "0.50514144", "0.5047543", "0.5035478", "0.5027165", "0.502045", "0.5017937", "0.5016311", "0.5008021", "0.5008021", "0.49996668", "0.49966475", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49963474", "0.49940896", "0.498576", "0.49837768", "0.49837768", "0.49837768", "0.49832895", "0.497061", "0.49594927", "0.49581265", "0.4955257" ]
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function u(e){return Boolean(e.self&&d(e.self))}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "function test_candu_graphs_vm_compare_host_vsphere65() {}", "protected internal function m252() {}", "function setup() {\n\n\n}", "function setup() {\n\n\n}", "IP() {\n // return \"47.106.171.247\";\n return \"tcjump.anyh5.com\";\n // return \"tcrhythm.anyh5.com\";\n }", "function hc(){}", "function NetworkUtil(){ \n}", "function vB_PHP_Emulator()\n{\n}", "function test_utilization_host() {}", "info() { }", "ping() {\n return \"pong!\"\n }", "function _____SHARED_functions_____(){}", "function ZNPSerial() {\n}", "function setup() {\n \n}", "function test_candu_graphs_datastore_vsphere6() {}", "static private protected internal function m118() {}", "static private internal function m121() {}", "function version(){ return \"0.13.0\" }", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "playCAS(casfile) {\n//------\nlggr.warn(\"SigningAvatar: playCAS: Not implemented\");\nreturn void 0;\n}", "function NetworkUtil(){}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "static final protected internal function m110() {}", "function setup() {\r\n}", "transient private internal function m185() {}", "static MAGIC_NUMBER(){\n return \"PIXPIPE_PIXBIN\";\n }", "static fromCASFile(casfile) {\n//-----------\nlggr.warn(\"fromCASFile: Not implemented\");\nreturn void 0;\n}", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "transient protected internal function m189() {}", "function setup() {\n \n}", "function setup() {\n \n}", "function DWRUtil() { }", "supportsPlatform() {\n return true;\n }", "getPort2() {\n return 0;\n }", "transient private protected internal function m182() {}", "function version() {\n outlet(2, 249);\n}", "function SigV4Utils() { }", "function init(){\n // loadHeaders(); //load platform headers\n}", "function rc(){}", "static protected internal function m125() {}", "function mbcs() {}", "function mbcs() {}", "function setup() { \n\n}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "function fos6_c() {\n ;\n }", "get BC7() {}", "package() {\n let rxString = this.rx.toString(2);\n rxString = '00'.substr(rxString.length) + rxString;\n let ryString = this.rx.toString(2);\n ryString = '00'.substr(ryString.length) + ryString;\n \n this.output = \n this.noop.toString() +\n this.inputc.toString() +\n this.inputcf.toString() +\n this.inputd.toString() +\n this.inputdf.toString() +\n this.move.toString() +\n this.loadi.toString() +\n this.add.toString() +\n this.addi.toString() +\n this.sub.toString() +\n this.subi.toString() +\n this.load.toString() +\n this.loadf.toString() +\n this.store.toString() +\n this.storef.toString() +\n this.shiftl.toString() +\n this.shiftr.toString() +\n this.cmp.toString() +\n this.jump.toString() +\n this.bre.toString() +\n this.brne.toString() +\n this.brg.toString() +\n this.brge.toString() + \n this.rx +\n this.ry;\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static final private public function m104() {}", "function CCUtility() {}", "static isMAC(mac){ return F.isMAC(mac) }", "__ssl() {\n /// TODO: nothing, I guess?\n }", "initialize() {}" ]
[ "0.61022836", "0.6019248", "0.549201", "0.5484461", "0.5432154", "0.5421906", "0.5335171", "0.5306816", "0.52785707", "0.5263736", "0.5263736", "0.5251904", "0.52512866", "0.52353966", "0.52072793", "0.5203911", "0.5190287", "0.51809", "0.51764977", "0.51338243", "0.5129332", "0.51276904", "0.5121869", "0.5117747", "0.51098585", "0.51097494", "0.5095425", "0.5095414", "0.5090264", "0.5090264", "0.5090264", "0.5090264", "0.5085239", "0.5082261", "0.5075212", "0.5073538", "0.5069976", "0.50602305", "0.5059622", "0.50591534", "0.50591534", "0.50580686", "0.5054442", "0.50525934", "0.5044211", "0.50350094", "0.5026606", "0.5021062", "0.5016607", "0.5014172", "0.50066394", "0.50066394", "0.49982893", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952176", "0.49952123", "0.49933246", "0.49846366", "0.49845675", "0.49845675", "0.49845675", "0.49816498", "0.49690256", "0.49615988", "0.4957238", "0.49529642" ]
0.0
-1
! Copyright (c) 20152019 Cisco Systems, Inc. See LICENSE file.
function h(e,t){return"jwk"===e?this[e].toJSON(!0):t}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "function test_crosshair_op_host_vsphere65() {}", "function test_host_tagged_crosshair_op_vsphere65() {}", "static final private internal function m106() {}", "function WSAPI() {\n }", "static get tag(){return\"hal-9000\"}", "function test_candu_graphs_vm_compare_host_vsphere65() {}", "protected internal function m252() {}", "function setup() {\n\n\n}", "function setup() {\n\n\n}", "function hc(){}", "IP() {\n // return \"47.106.171.247\";\n return \"tcjump.anyh5.com\";\n // return \"tcrhythm.anyh5.com\";\n }", "function NetworkUtil(){ \n}", "function vB_PHP_Emulator()\n{\n}", "function test_utilization_host() {}", "info() { }", "ping() {\n return \"pong!\"\n }", "function _____SHARED_functions_____(){}", "function ZNPSerial() {\n}", "function setup() {\n \n}", "function test_candu_graphs_datastore_vsphere6() {}", "static private protected internal function m118() {}", "static private internal function m121() {}", "function version(){ return \"0.13.0\" }", "function SBRecordsetPHP_analyzePlatformSpecific()\r\n{\r\n\r\n\r\n}", "playCAS(casfile) {\n//------\nlggr.warn(\"SigningAvatar: playCAS: Not implemented\");\nreturn void 0;\n}", "function NetworkUtil(){}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "function setup() {\n\n}", "static final protected internal function m110() {}", "function setup() {\r\n}", "transient private internal function m185() {}", "static MAGIC_NUMBER(){\n return \"PIXPIPE_PIXBIN\";\n }", "static fromCASFile(casfile) {\n//-----------\nlggr.warn(\"fromCASFile: Not implemented\");\nreturn void 0;\n}", "getHeader() {\n return `/**\n * IN2 Logic Tree File\n *\n * This file has been generated by an IN2 compiler.\n */\\n/*eslint-disable-line*/function run(isDryRun){\\n/* global player, core, engine */\nconst files = {};\nconst scope = {};\nconst CURRENT_NODE_VAR = '${CURRENT_NODE_VAR}';\nconst CURRENT_FILE_VAR = '${CURRENT_FILE_VAR}';\nconst LAST_FILE_VAR = '${LAST_FILE_VAR}';`;\n }", "function setup() {\n \n}", "function setup() {\n \n}", "transient protected internal function m189() {}", "function DWRUtil() { }", "supportsPlatform() {\n return true;\n }", "getPort2() {\n return 0;\n }", "transient private protected internal function m182() {}", "function version() {\n outlet(2, 249);\n}", "function SigV4Utils() { }", "function init(){\n // loadHeaders(); //load platform headers\n}", "function rc(){}", "static protected internal function m125() {}", "function mbcs() {}", "function mbcs() {}", "function setup() { \n\n}", "function fos6_c() {\n ;\n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "get BC7() {}", "package() {\n let rxString = this.rx.toString(2);\n rxString = '00'.substr(rxString.length) + rxString;\n let ryString = this.rx.toString(2);\n ryString = '00'.substr(ryString.length) + ryString;\n \n this.output = \n this.noop.toString() +\n this.inputc.toString() +\n this.inputcf.toString() +\n this.inputd.toString() +\n this.inputdf.toString() +\n this.move.toString() +\n this.loadi.toString() +\n this.add.toString() +\n this.addi.toString() +\n this.sub.toString() +\n this.subi.toString() +\n this.load.toString() +\n this.loadf.toString() +\n this.store.toString() +\n this.storef.toString() +\n this.shiftl.toString() +\n this.shiftr.toString() +\n this.cmp.toString() +\n this.jump.toString() +\n this.bre.toString() +\n this.brne.toString() +\n this.brg.toString() +\n this.brge.toString() + \n this.rx +\n this.ry;\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "static final private public function m104() {}", "function CCUtility() {}", "static isMAC(mac){ return F.isMAC(mac) }", "__ssl() {\n /// TODO: nothing, I guess?\n }", "initialize() {}" ]
[ "0.61020565", "0.60196084", "0.54914206", "0.5484528", "0.5431986", "0.54224306", "0.5334338", "0.5306336", "0.52790064", "0.52642965", "0.52642965", "0.5251283", "0.5249794", "0.52337575", "0.5207978", "0.52028906", "0.51893944", "0.518021", "0.51770973", "0.5132539", "0.51301146", "0.51275736", "0.5122015", "0.5118121", "0.510971", "0.51094466", "0.50976443", "0.50936884", "0.5090849", "0.5090849", "0.5090849", "0.5090849", "0.5084906", "0.5082767", "0.50752634", "0.5073209", "0.50716996", "0.50618845", "0.50597346", "0.50597346", "0.5059615", "0.50575536", "0.5053766", "0.5050746", "0.50442386", "0.503505", "0.5026648", "0.50205475", "0.501732", "0.50147223", "0.5007998", "0.5007998", "0.4998951", "0.4995889", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.4995187", "0.49922144", "0.49863958", "0.4983392", "0.4983392", "0.4983392", "0.49813697", "0.49691254", "0.49586675", "0.4957745", "0.49527374" ]
0.0
-1
Helper function to make paths for the filtered images, i.e. assets/filtered/somefilename_blur.jpg
function getDest(img, file, name) { return path.resolve(folder + file.filename + "_" + name + ".jpg"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filterImgs (dir) {\n return function (data) {\n // src=\"not_starting_with/slash\"\n return data.replace(/src=\"([^\\/][^\"]+)\"/g, 'src=\"' + dir + '$1\"')\n }\n}", "function buildFilterPaths() {\n var filterPaths = new Array();\n $.each(bwFilters, function (i,filterSet) {\n filterPaths[i] = new Array();\n if (filterSet.length) {\n $.each(filterSet, function (j, value) {\n path = $(\"#\" + value).attr(\"href\");\n filterPaths[i].push(path);\n });\n }\n });\n return filterPaths;\n}", "function appendSuffixToImage(path_image) {\n path_output = \"\"\n substrings = path_image.split(\".\")\n for(var i=0; i<substrings.length; i++){\n if(i<substrings.length-1) {\n path_output = path_output + substrings[i]\n }\n }\n path_output = path_output + \"_watermarked.\" + substrings[substrings.length-1];\n return path_output;\n}", "makeImagePath2(product) {\n return require(`../assets/images/${product.images[2]}`);\n }", "makeImagePath1(product) {\n return require(`../assets/images/${product.images[1]}`);\n }", "function getImagePath(name) {\n return IMG_DIR + name + \".jpg\";\n}", "static get tag() {\n return \"filtered-image\";\n }", "function imgsPath() {\n return src(files.imgPath)\n .pipe(browserSync.stream())\n // .pipe(imagemin())\n .pipe(dest('pub/images')\n );\n}", "function images() {\n return gulp.src('email/src/assets/img/**/*')\n .pipe($.imagemin())\n .pipe(gulp.dest('email/dist/assets/img'));\n}", "function buildAssetPath(imgSrc) {\n return `./dist/${imgSrc}`;\n}", "function filterPath(string) {\n return string\n .replace(/^\\//, '')\n .replace(/(index|default).[a-zA-Z]{3,4}$/, '')\n .replace(/\\/$/, '');\n }", "function minifyImages() {\n return src('src/assets/img/**/*')\n .pipe(imagemin())\n .pipe(webp())\n\t\t.pipe(dest('src/assets/img'))\n}", "function filterPath(string) {\n return string\n .replace(/^\\//, '')\n .replace(/(index|default).[a-zA-Z]{3,4}$/, '')\n .replace(/\\/$/, '');\n }", "function optimizeImages() {\n return gulp\n .src([\"./webpage/src/img/**/*.+(png|jpg|gif|svg)\"], {\n base: \"./webpage/src/img/\"\n })\n .pipe(changed(\"./webpage/dist/img\"))\n .pipe(imagemin())\n .pipe(gulp.dest(\"./webpage/dist/img\"));\n}", "function imagesPath() {\n var href = $(\"link[href*=cleditor]\").attr(\"href\");\n return href.replace(/^(.*\\/)[^\\/]+$/, '$1') + \"images/\";\n }", "function filterPath(string) {\n return string\n .replace(/^\\//,'')\n .replace(/(index|default).[a-zA-Z]{3,4}$/,'')\n .replace(/\\/$/,'');\n}", "function images() {\n return gulp.src( 'src/assets/img/**/*' )\n .pipe( gulp.dest( './build/assets/img' ) );\n}", "makeImagePath(product) {\n return require(`../assets/images/${product.images[0]}`);\n }", "function filterPath(string) {\n return string\n .replace(/^\\//,'')\n .replace(/(index|default).[a-zA-Z]{3,4}$/,'')\n .replace(/\\/$/,'');\n }", "function filterPath(string) {\n return string\n .replace(/^\\//,'')\n .replace(/(index|default).[a-zA-Z]{3,4}$/,'')\n .replace(/\\/$/,'');\n }", "function filterPath(string) {\n return string\n .replace(/^\\//,'')\n .replace(/(index|default).[a-zA-Z]{3,4}$/,'')\n .replace(/\\/$/,'');\n }", "function filterPath(string) {\n return string\n .replace(/^\\//,'')\n .replace(/(index|default).[a-zA-Z]{3,4}$/,'')\n .replace(/\\/$/,'');\n }", "function images() {\r\n\treturn gulp.src(SRC + '/assets/images/**/*')\r\n\t\t.pipe($.if(PRODUCTION, $.imagemin([\r\n\t\t\t$.imagemin.jpegtran({\r\n\t\t\t\tprogressive: true,\r\n\t\t\t}),\r\n\t\t\t$.imagemin.optipng({\r\n\t\t\t\toptimizationLevel: 5,\r\n\t\t\t}),\r\n\t\t\t$.imagemin.gifsicle({\r\n\t\t\t\tinterlaced: true,\r\n\t\t\t}),\r\n\t\t\t$.imagemin.svgo({\r\n\t\t\t\tplugins: [\r\n\t\t\t\t\t{ cleanupAttrs: true },\r\n\t\t\t\t\t{ removeComments: true },\r\n\t\t\t\t]\r\n\t\t\t})\r\n\t\t])))\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets/images'));\r\n}", "static imageSrcsetForRestaurant(restaurant) {\n const imageSrc = `/img/${(restaurant.photograph||restaurant.id)}`;\n return `${imageSrc}-small.jpg 240w,\n ${imageSrc}-medium.jpg 400w,\n ${imageSrc}-large.jpg 800w`;\n }", "function images() {\n return gulp.src('src/assets/img/**/*')\n .pipe($.if(PRODUCTION, $.imagemin([\n $.imagemin.jpegtran({ progressive: true }),\n ])))\n .pipe(gulp.dest(PATHS.dist + '/assets/img'));\n}", "function images() {\n return src('assets/fonts/**.*')\n .pipe(dest('dist/fonts'));\n}", "function addPathToImage() {\n $(ctrl.imageTags).each(function (index) {\n if (ctrl.imageTags[index].hasAttribute('id')) {\n var imageSrc = ctrl.imageTags[index].getAttribute('id');\n $(ctrl.imageTags[index]).attr('src', oDataPath + \"/Asset('\" + imageSrc + \"')/$value\");\n }\n });\n }", "function imagePath(type, name) {\n\t var img = \"/assets/file-types/file.png\";\n\t var fileType = type.split('/')[1];\n\t var fileTypes = 'after-effects.pngai.pngaudition.pngavi.pngbridge.pngcss.pngcsv.pngdbf.pngdoc.pngdreamweaver.pngdwg.pngexe.pngfile.pngfireworks.pngfla.pngflash.pnghtml.pngillustrator.pngindesign.pngiso.pngjavascript.pngjpg.pngjson-file.pngmp3.pngmp4.pngpdf.pngphotoshop.pngpng.pngppt.pngprelude.pngpremiere.pngpsd.pngrtf.pngsearch.pngsvg.pngtxt.pngxls.pngxml.pngzip-1.pngzip.pngfolder.pngjpeg.pngdocx.png';\n\t fileTypes = fileTypes.split('.png');\n\t if (fileTypes.indexOf(fileType) != -1) {\n\t img = '/assets/file-types/' + fileType + '.png';\n\t } else if (fileTypes.indexOf(name.split('.')[1]) != -1) {\n\t img = '/assets/file-types/' + name.split('.')[1] + '.png';\n\t }\n\t return img;\n\t}", "function images() {\n return gulp.src('src/assets/img/**/*')\n .pipe($.if(PRODUCTION, $.imagemin({\n progressive: true\n })))\n .pipe(gulp.dest(PATHS.dist + '/assets/img'));\n }", "function images() {\n return gulp.src('src/assets/img/**/*')\n .pipe($.imagemin())\n .pipe(gulp.dest('./images'));\n}", "function mixAssetsDir(query, cb) {\n \t(glob.sync('resources/' + query) || []).forEach(f => {\n \t\tf = f.replace(/[\\\\\\/]+/g, '/');\n \t\tcb(f, f.replace('resources', 'public'));\n \t});\n }", "function preprocess(images) {\n return images.map((image) => {\n const next = Object.assign({}, image);\n next.writePath = `images/${image.name}`;\n return next;\n });\n }", "function setFilter() {\n filter.style.filter = `blur(${blur}px) brightness(${brightness}%) contrast(${contrast}%) grayscale(${grayscale}%) hue-rotate(${huerotate}deg) invert(${invert}%) saturate(${saturate}%) sepia(${sepia}%)`;\n}", "function normalizeAssets(bundle_data, filter, chunk) {\n\n\tvar assets = chunk ? bundle_data.assetsByChunkName[chunk] : bundle_data.assetsByChunkName\n\n\tif (typeof assets === 'object') assets = Object.values(assets)\n\n\tassets = Array.isArray(assets) ? assets : [assets]\n\n\tvar filenames = []\n\tassets.forEach(asset => {\n\t\tif(Array.isArray(asset)) asset.forEach(asset => filenames.push(asset))\n\t\telse filenames.push(asset)\n\t})\n\n\tassets = filenames.map((filename) => path.resolve(bundle_data.outputPath, filename))\n\n\tif(filter) assets = assets.filter(filename => filename.endsWith(filter))\n\n\treturn assets\n}", "_unescapeImageURLs () {\n const images = document.querySelectorAll('img')\n for (const image of images) {\n const url = image.src\n if (!url || !url.endsWith('%3Fraw%3Dtrue')) {\n continue\n }\n \n image.src = url.replace(/%3Fraw%3Dtrue$/, '?raw=true')\n }\n }", "function filter(imagename,objectsrc){\n\tif (document.images){\n\t\tdocument.images[imagename].src=eval(objectsrc+\".src\");\n\t}\n}", "function images() {\n return gulp.src(PATHS.imageAssets)\n .pipe($.if(PRODUCTION, $.imagemin([\n $.imagemin.jpegtran({progressive: true}),\n ])))\n .pipe(gulp.dest(`${PATHS.dist}/assets/img`));\n}", "function getImgSrcPath(item) {\n splitPath = item.src.split(\"/\");\n spIndex = 0;\n path = \"\";\n \n for (i = 0; i < splitPath.length; i++) {\n if (splitPath[i] == \"img\") {\n spIndex = i;\n }\n }\n \n for (i = spIndex; i < (splitPath.length - 1); i++) {\n path = path + splitPath[i] + \"/\";\n }\n \n return path;\n}", "function image(relativePath) {\n return \"/static/editablegrid-2.0.1/images/\" + relativePath;\n}", "function getImageSources() {\n var ids = [\n '0001', '0002', '0003', '0004', '0005', '0006', '0007',\n '0008', '0009', '0010', '0011', '0012', '0013', '0014'\n ];\n return ids.map(function(name){\n return 'http://localhost:8000/images/' + name + '.JPG';\n })\n}", "function assetFinder(combatChoice) {\n return \"assets/\" + combatChoice + \".png\"\n }", "function createfilter() {\r\n var isBlocked = ($(\".selected\").hasClass(\"blocked\"));\r\n var urlfilter = '';\r\n if ($('#selectblockableurl #customurl').length != 0)\r\n urlfilter = (isBlocked ? '@@' : '') + $('#customurl').val();\r\n else\r\n urlfilter = $('#selectblockableurl input').val();\r\n if ((/^(\\@\\@)?\\/.*\\/$/).test(urlfilter))\r\n urlfilter += '*';\r\n\r\n var options = [];\r\n $(\"#chooseoptions > input:checked, #types > input:not(:checked)\").each(\r\n function() {\r\n if ($(this).val())\r\n options.push($(this).val());\r\n });\r\n\r\n return urlfilter + ((options.length != 0) ? '$' + options.join(',') : '');\r\n }", "function getImage(city) {\n\n let lowerCity = city.replace(/\\s/g, '').toLowerCase();\n return \"images/\" + lowerCity + \".jpg\";\n\n}", "function imageUrl(filename) {\n return \"url(\" + imagesPath() + filename + \")\";\n }", "function getImageMatchArray() {\n var arr = [];\n fileNames.map((img) => {\n if (img.split('.')[0]) {\n arr.push(RegExp(img.replace(/_/g, ' ').split('.')[0],'i'));\n }\n });\n return arr;\n}", "function mixAssetsDir(query, cb) {\n (glob.sync('resources/assets/' + query) || []).forEach(f => {\n f = f.replace(/[\\\\\\/]+/g, '/');\n cb(f, f.replace('resources/assets', 'public'));\n });\n}", "function AssetsFilterWebpackPlugin() {}", "function getImage(name) {\n for (const f of FILES) {\n if (name.indexOf(f.name) >= 0) {\n return f.path;\n }\n }\n}", "function imagesFull() {\n\tlet imageGlobs = ['/**/*.png', '/**/*.jpg', '/**/*.jpeg', '/**/*.gif', '/**/*.svg'];\n\tlet baseDir = config.client.media.srcDir;\n\tlet baseDirArray = [];\n\n\tfor (let ext of imageGlobs) {\n\t\tbaseDirArray.push(baseDir + ext);\n\t}\n\t\n \tlet stream = gulp.src(baseDirArray, {base: baseDir});\n \n return stream.pipe($.plumber({errorHandler: mapError}))\n .pipe($.duration('image processing'))\n // .pipe($.changed(config.client.media.outputDir, {hasChanged: $.changed.compareSha1Digest})) \n .pipe($.cache('images'))\n .pipe($.imagemin()) \n .pipe(gulp.dest(config.client.media.outputDir));\n}", "static bluredImageUrlForRestaurant(restaurant) {\r\n // for development we need to remove \"/mws-restaurant-stage-1\"\r\n const url = window.location.href;\r\n if(url.startsWith('https')) {\r\n return (`/mws-restaurant-stage-1/img/${restaurant.photograph}`);\r\n }\r\n return (`/img/${restaurant.photograph || 10}-800_lazy_load.jpg`); \r\n }", "function images() {\n return gulp.src('static/img/**/*')\n .pipe($.if(PRODUCTION, $.imagemin({\n progressive: true\n })))\n .pipe(gulp.dest(PATHS.dist + '/public/img'));\n}", "geBlurUrl(x){\n x = x.toString();\n x = x.replace('/upload/','/upload/e_blur:555/');\n return x;\n }", "buildImgURL(string){\n const value = string.toLowerCase().split(' ').join('-');\n return process.env.PUBLIC_URL+'/'+value;\n }", "function GetImageURL(imagePath) {\n// return URLUtility.VirtualPath + imagePath;\n return imagePath;\n}", "function svgSourceFiles() {\n var svgSourceFileNames = [\n 'Tank-Clean-Plain.svg'\n ];\n var globs = svgSourceFileNames.map(function(filename) {\n return 'assets/' + filename;\n });\n\n return globs;\n}", "function buttonFilters() {\n image(imgFilters, 600, 550);\n}", "function images_import() {\n let inputs = ['./build/images/**/*.*', '!./build/images/**/_*.*'],\n output = './public/images/';\n\n return gulp.src(inputs).pipe(imagemin()).pipe(gulp.dest(output));\n}", "function eraseLocalImages(){\n\tvar characterizedImagesPath = appDataPath + \"\\\\characterized-images\";\n\tvar relativeImageFilePaths = jetpack.find(characterizedImagesPath, {files: true, matching: \"*.png\" } );\n\t//Erase images one by one\n\trelativeImageFilePaths.forEach( (path) =>{\n\t\tjetpack.remove(path);\n\t});\n}", "function onLoadImagesFilters() {\n\n // Black and White\n var imageBlackWhite = new Image();\n imageBlackWhite.src = imageOrigin.src;\n\n imageBlackWhite.onload = function () {\n\n let w = imageBlackWhite.width;\n let h = imageBlackWhite.height;\n\n let sizer = scalePreserveAspectRatio(w, h, canvasFilterWidth, canvasFilterHeith);\n\n // Responsive canvas\n ctxBW.canvas.width = w * sizer;\n ctxBW.canvas.heith = h * sizer;\n\n ctxBW.drawImage(this, 0, 0, w, h, 0, 0, w * sizer, h * sizer);\n\n imageData = ctxBW.getImageData(0, 0, this.width, this.height);\n\n getFilterBlackWhite(imageData, 1);\n\n ctxBW.canvas.width = w * sizer;\n ctxBW.canvas.height = h * sizer;\n\n ctxBW.putImageData(imageData, 0, 0);\n }\n\n // Negative\n var imageNegative = new Image();\n imageNegative.src = imageOrigin.src;\n\n imageNegative.onload = function () {\n\n let w = imageNegative.width;\n let h = imageNegative.height;\n\n let sizer = scalePreserveAspectRatio(w, h, canvasFilterWidth, canvasFilterHeith);\n\n // Responsive canvas\n ctxNegative.canvas.width = w * sizer;\n ctxNegative.canvas.heith = h * sizer;\n\n ctxNegative.drawImage(this, 0, 0, w, h, 0, 0, w * sizer, h * sizer);\n\n imageData = ctxNegative.getImageData(0, 0, this.width, this.height);\n\n // Get filter by default 255 of level\n getFilterNegative(imageData, 255);\n\n ctxNegative.canvas.width = w * sizer;\n ctxNegative.canvas.height = h * sizer;\n\n ctxNegative.putImageData(imageData, 0, 0);\n }\n\n // Sepia\n var imageSepia = new Image();\n imageSepia.src = imageOrigin.src;\n\n imageSepia.onload = function () {\n\n let w = imageSepia.width;\n let h = imageSepia.height;\n\n let sizer = scalePreserveAspectRatio(w, h, canvasFilterWidth, canvasFilterHeith);\n\n // Responsive canvas\n ctxSepia.canvas.width = w * sizer;\n ctxSepia.canvas.heith = h * sizer;\n\n ctxSepia.drawImage(this, 0, 0, w, h, 0, 0, w * sizer, h * sizer);\n\n imageData = ctxSepia.getImageData(0, 0, this.width, this.height);\n\n // Get filter by default 0 of level\n getFilterSepia(imageData, 0);\n\n ctxSepia.canvas.width = w * sizer;\n ctxSepia.canvas.height = h * sizer;\n\n ctxSepia.putImageData(imageData, 0, 0);\n }\n\n\n // Binary\n var imageBinary = new Image();\n imageBinary.src = imageOrigin.src;\n\n imageBinary.onload = function () {\n\n let w = imageBinary.width;\n let h = imageBinary.height;\n\n let sizer = scalePreserveAspectRatio(w, h, canvasFilterWidth, canvasFilterHeith);\n\n ctxBinary.drawImage(this, 0, 0, w, h, 0, 0, w * sizer, h * sizer);\n\n imageData = ctxBinary.getImageData(0, 0, this.width, this.height);\n\n // Get filter by default 70 of level\n getFilterBinary(imageData, 70);\n\n ctxBinary.canvas.width = w * sizer;\n ctxBinary.canvas.height = h * sizer;\n\n ctxBinary.putImageData(imageData, 0, 0);\n }\n\n\n // Brightness\n var imageBrightness = new Image();\n imageBrightness.src = imageOrigin.src;\n\n imageBrightness.onload = function () {\n\n let w = imageBrightness.width;\n let h = imageBrightness.height;\n\n let sizer = scalePreserveAspectRatio(w, h, canvasFilterWidth, canvasFilterHeith);\n\n ctxBrightness.drawImage(this, 0, 0, w, h, 0, 0, w * sizer, h * sizer);\n\n imageData = ctxBrightness.getImageData(0, 0, this.width, this.height);\n\n // Get filter by default 100 of level\n getFilterBrightness(imageData, 100);\n\n ctxBrightness.canvas.width = w * sizer;\n ctxBrightness.canvas.height = h * sizer;\n\n ctxBrightness.putImageData(imageData, 0, 0);\n }\n\n // Saturation\n var imageSaturation = new Image();\n imageSaturation.src = imageOrigin.src;\n\n imageSaturation.onload = function () {\n\n let w = imageSaturation.width;\n let h = imageSaturation.height;\n\n let sizer = scalePreserveAspectRatio(w, h, canvasFilterWidth, canvasFilterHeith);\n\n ctxSaturation.drawImage(this, 0, 0, w, h, 0, 0, w * sizer, h * sizer);\n\n imageData = ctxSaturation.getImageData(0, 0, this.width, this.height);\n\n // Get filter by default 2 of level\n getFilterSaturation(imageData, 2);\n\n ctxSaturation.canvas.width = w * sizer;\n ctxSaturation.canvas.height = h * sizer;\n\n ctxSaturation.putImageData(imageData, 0, 0);\n }\n\n // Blur\n var imageBlur = new Image();\n imageBlur.src = imageOrigin.src;\n\n imageBlur.onload = function () {\n\n let w = imageBlur.width;\n let h = imageBlur.height;\n\n let sizer = scalePreserveAspectRatio(w, h, canvasFilterWidth, canvasFilterHeith);\n\n ctxBlur.drawImage(this, 0, 0, w, h, 0, 0, w * sizer, h * sizer);\n\n imageData = ctxBlur.getImageData(0, 0, this.width, this.height);\n\n // Get filter by default 2\n getFilterBlurBorder(imageData, 2, BLUR);\n\n ctxBlur.canvas.width = w * sizer;\n ctxBlur.canvas.height = h * sizer;\n\n ctxBlur.putImageData(imageData, 0, 0);\n }\n\n // Border\n var imageBorder = new Image();\n imageBorder.src = imageOrigin.src;\n\n imageBorder.onload = function () {\n\n let w = imageBorder.width;\n let h = imageBorder.height;\n\n let sizer = scalePreserveAspectRatio(w, h, canvasFilterWidth, canvasFilterHeith);\n\n ctxBorder.drawImage(this, 0, 0, w, h, 0, 0, w * sizer, h * sizer);\n\n imageData = ctxBorder.getImageData(0, 0, this.width, this.height);\n\n // Get filter by default 2\n getFilterBlurBorder(imageData, 2, BORDER);\n\n ctxBorder.canvas.width = w * sizer;\n ctxBorder.canvas.height = h * sizer;\n\n ctxBorder.putImageData(imageData, 0, 0);\n }\n\n}", "function imagecopy() {\r\n return gulp\r\n .src(\"./app/images/**/*\", { nodir: true })\r\n .pipe(newer(\"./dist/images/\"))\r\n .pipe(imagemin({\r\n progressive: true,\r\n svgoPlugins: [{ removeViewbox: false}, { removeUselessStrokeAndFill: false }]\r\n }))\r\n .pipe(gulp.dest(\"./dist/images/\"));\r\n\r\n}", "function addFilterOnPhoto(path) {\n\tfunction createIMG(src) {\n\t\tconst img = document.createElement('img');\n\t\timg.setAttribute('src', src);\n\t\timg.setAttribute('class', 'temp');\n\t\treturn img;\n\t}\n\tfunction dragAndDrop(img) {\n\t\tvar mousePosition;\n\t\tvar offset = [0,0];\n\t\tvar isDown = false;\n\n\t\timg.addEventListener('mousedown', function(e) {\n\t\t\tisDown = true;\n\t\t\toffset = [\n\t\t\t\t\t img.offsetLeft - e.clientX,\n\t\t\t\t\t img.offsetTop - e.clientY\n\t\t\t\t\t ];\n\t\t}, true);\n\n\t\tdocument.addEventListener('mouseup', function() {\n\t\t\tisDown = false;\n\t\t}, true);\n\n\t\tdocument.addEventListener('mousemove', function(event) {\n\t\t\tevent.preventDefault();\n\t\t\tif (isDown) {\n\t\t\t\tmousePosition = {\n\n\t\t\t\t\tx : event.clientX,\n\t\t\t\t\ty : event.clientY\n\n\t\t\t\t};\n\t\t\t\timg.style.left = (mousePosition.x + offset[0]) + 'px';\n\t\t\t\timg.style.top = (mousePosition.y + offset[1]) + 'px';\n\t\t\t}\n\t\t}, true);\n\t}\n\t/*\n\t** This script will work only if video stream is activated.\n\t** Create new img tag on page.\n\t** This img will make a preview of effects on video stream.\n\t*/\n\tif (video.style.display !== 'none' || document.querySelector('.uploaded')) {\n\t\tconst img_copy = createIMG(path);\n\t\tcameraDiv.appendChild(img_copy);\n\n\t\tsnapPhoto.removeAttribute('disabled');\n\t\tremoveLast.removeAttribute('disabled');\n\t\tsizeUpEffect.removeAttribute('disabled');\n\t\tsizeDownEffect.removeAttribute('disabled');\n\t\t/*\n\t\t** start drag and drop listener\n\t\t*/\n\t\tdragAndDrop(img_copy);\n\t}\n}", "getImageSource(){\n return `assets/images/cards/${this.rank}_of_${this.suit}.png`;\n }", "function cleanName(name) {\n\t\treturn name.replace(imgRegex, \"\").replace(\" \", \"_\");\n\t\t\n\t}", "function images() {\n return gulp.src('src/images/**/*')\n .pipe($.if(PRODUCTION, $.imagemin({\n progressive: true\n })))\n .pipe(gulp.dest(PATHS.dist + '/images'));\n}", "function images() {\n\treturn gulp.src(paths.src.images + '**/*')\n\t\t.pipe($.changed(paths.dist.images))\n\t\t.pipe($.if( production, $.imagemin(config.imagemin) ))\n\t\t.pipe(gulp.dest(paths.dist.images));\n}", "function removeProblematicParametersFilter(filter) {\n var rawFilter = filter.split('\\n')\n var filterFormatted = \"\"\n\n rawFilter.forEach(line => {\n if (!(line.includes(\"patterns_dir\") || (line.includes(\"patterns_files_glob \")))) {\n filterFormatted += line + \"\\n\"\n }\n });\n\n return filterFormatted\n}", "function fonts() {\n return src('assets/images/**.*')\n .pipe(dest('dist/images'));\n}", "function minifyImages() {\n return src('src/public/images/dist/**/*.{png,jpg,jpeg,webp}')\n // .pipe(changed('src/public/images/dist'))\n .pipe(debug({ title : 'Minify'}))\n .pipe(imagemin())\n .pipe(dest('src/public/images/dist'))\n}", "function images() {\n return gulp.src(PATHS.images)\n .pipe($.if(PRODUCTION, $.imagemin({\n progressive: true\n })))\n .pipe(gulp.dest(PATHS.dist + '/img'));\n}", "function img()\n{\n var streams = pathConfig.img.map( function( folder )\n {\n return gulp.src( getGlob( folder ) )\n .pipe( $.changed( folder.dist ) )\n .pipe( $.util.env.production ? $.imageMin( taskConfig.img.imageMin ) : $.util.noop() )\n .pipe( gulp.dest( folder.dist ) );\n } );\n\n return $.mergeStream( streams );\n}", "function imagesDist() {\n return gulp.src( 'src/assets/img/**/*' )\n .pipe( imagemin() )\n .pipe( gulp.dest( './dist/assets/img' ) );\n}", "function obtainExternalPhotos() {\n const random = Math.floor(Math.random() * (paths.length));\n const pathImage = path.join(__dirname, \"../images/\" + paths[random])\n return pathImage;\n}", "function images() {\r\n return gulp.src(files.imgPath)\r\n .pipe(newer(files.imgPath))\r\n .pipe(gulp.dest('./build/assets/img'));\r\n}", "function images() {\n notify('Copying image files...');\n return gulp.src('src/img/**/*.{jpg,png,gif,svg}')\n .pipe(plumber())\n .pipe(imagemin({ optimizationLevel: 5, progressive: true, interlaced: true }))\n .pipe(gulp.dest('assets/img/'));\n}", "function preload()\n{\n // Spiderman Mask Filter asset\n imgSpidermanMask = loadImage(\"https://i.ibb.co/gypwJCh/57910-preview.png\");\n billgate = loadImage(\"https://i.ibb.co/4M9Bk0N/bill-gates-microsoft-the-world-s-billionaires-bill-melinda-gates-foundation-technology-png-favpng-Ka.jpg\");\n\n pikachu = loadImage(\"https://i.ibb.co/XbRnSqQ/square-PNG19.png\");\n\n //Emotion Recognition\n happyFace = loadImage(\"https://i.ibb.co/jLJmj4q/1000584-copy-of-smiling-with-closed-eyes-emoji-free-download-ios-emojis-icon-download-free.png\");\n sadFace = loadImage(\"https://i.ibb.co/JrDdZvH/1000525-crying-sad-emoji-icon-file-hd.png\");\n\n // Dog Face Filter assets\n imgDogEarRight = loadImage(\"https://i.ibb.co/bFJf33z/dog-ear-right.png\");\n imgDogEarLeft = loadImage(\"https://i.ibb.co/dggwZ1q/dog-ear-left.png\");\n imgDogNose = loadImage(\"https://i.ibb.co/PWYGkw1/dog-nose.png\");\n}", "function imgMinify() {\n // return src('src/img/*')\n return src(files.imgPath)\n .pipe(imagemin([\n imagemin.gifsicle({ interlaced: true }),\n imagemin.jpegtran({ progressive: true }),\n imagemin.optipng({ optimizationLevel: 5 }),\n imagemin.svgo({\n plugins: [\n { removeViewBox: true },\n { cleanupIDs: false }\n ]\n })\n ], {\n verbose: true\n }))\n .pipe(dest(files.imgPubPath)) // place images in img-folder\n}", "function images() {\n gulp.src('./src/images/**')\n\t\t.pipe(imagemin())\n\t\t.pipe(gulp.dest('dist/images'))\n}", "function filterServerImageList(filterbox, fieldName) {\n\tvar selbox = document.getElementById('select_' + fieldName);\n\n\tvar obj = $(selbox)\n\tvar res = obj.data[\"storedOptions\"]\n\tvar opt = \"\"\n\tfor (var sc = 0; sc < res.length - 1; sc++) {\n\t\tvar imageFilename = res[sc]\n\t\tif (imageFilename.toLowerCase().indexOf(filterbox.value.toLowerCase()) != -1) {\n\t\t\topt += \"<option>\" + imageFilename + \"</option>\"\n\t\t}\n\t}\n\tobj.html(opt)\n}", "function buildFilterObjs(){\r\n filterObjs = [];\r\n $('.smilie').each(function(){\r\n var $smilie = $(this);\r\n var $img = $('img', $smilie);\r\n var str = [\r\n $('.text', $smilie).text(),\r\n $img.attr('src').replace(/http:\\/\\/f?i?|\\.somethingawful\\.com\\/|(forumsystem|smilies|images|emoticons)\\/?/g, ''),\r\n $img.attr('title')\r\n ].join(' ');\r\n filterObjs.push({\r\n el : $smilie,\r\n str : str\r\n });\r\n });\r\n }", "function makeSrcSet(imageSrc) {\n let markUp = [];\n let width = 400;\n\n for (let index = 0; index < 5; index++) {\n markUp[index] = imageSrc + \"-\" + width + \".jpg \" + width + \"w\";\n width += 400;\n }\n\n return markUp.join();\n}", "function images() {\n return gulp.src(PATHS.srcFilesImages)\n .pipe($.if(PRODUCTION, $.imagemin({\n progressive: true\n })))\n .pipe(gulp.dest(PATHS.distImages));\n}", "function _filterFiles (state) {\n // Hidden/Visible\n let files = state.files\n if (!state.options.get('hidden')) {\n files = files.filter(file =>\n !(file.name.indexOf('.') === 0))\n }\n\n // Filter\n let filter = state.options.get('filter')\n if (filter !== '') {\n files = files.filter(file =>\n (file.name.toLowerCase().indexOf(filter.toLowerCase()) !== -1))\n }\n return files\n}", "function image(relativePath) {\n\treturn \"img/core-img/\" + relativePath;\n}", "function populateFilter() {\n allPicture.forEach(imgObj => {\n if (!pictureKeysArray.includes(imgObj.keyword)) {\n pictureKeysArray.push(imgObj.keyword);\n }\n });\n\n}", "function formatImgSrc(imgURL) {\n\t\treturn 'resources/'+/[a-z_]*.gif/.exec(imgURL)[0];\n\t}", "function get_file_name(source) {\r\n var file_name = /[^/]*$/.exec(source)[0]; // regex from https://stackoverflow.com/questions/8376525/get-value-of-a-string-after-last-slash-in-javascript\r\n file_name = file_name.slice(0, -5) // removes the .png\r\n return file_name\r\n}", "function fortuneImages() {\n\tvar num = randNum(imgs.length);\n\tvar img = imgs[num];\n\timgs.splice(num, 1);\n\treturn \"url('imgs/\" + img + \".png')\";\n}", "function img() {\n return gulp.src(path.src.images)\n .pipe(imagemin([\n imagemin.gifsicle({interlaced: true}),\n imagemin.mozjpeg({quality: 75, progressive: true}),\n imagemin.optipng({optimizationLevel: 5}),\n imagemin.svgo({\n plugins: [\n {removeViewBox: true},\n {cleanupIDs: false}\n ]\n })\n ], {\n verbose: true\n }))\n .pipe(gulp.dest(path.build.images))\n}", "function initialisationOfImages() {\n var _blur_apply = new createjs.BlurFilter(12, 12, 12);\n getChild(\"focus_object\").filters = [_blur_apply]; \n getChild(\"focus_object\").cache(0, 0, getChild(\"focus_object\").image.width, getChild(\"focus_object\").image.height);\n stage.getChildByName(\"container_final\").visible = false;\n getChildFinal(\"Mercury\").alpha = 0;\n getChildFinal(\"Hydrogen\").alpha = 0;\n getChildFinal(\"Neon\").alpha = 0;\n getChildFinal(\"grating\").alpha = 0;\n getChildFinal(\"arrow_two_side\").alpha = 0;\n}", "adjustNameForPic(name) {\n return name.toLowerCase().replace(/ /g,\"_\"); \n }", "function pathSolver(src) {\n return 'resources/' + src;\n}", "function getAssetPath (category) {\n return process.env.WEBPACK_ENV === 'development' ?\n `${category}/[name].[ext]` :\n `${category}/[hash].[ext]`;\n}", "function buildImage (species) {\n return species.toLowerCase() + '.png'\n}", "function filterImage(url, filter, outputname) {\n Jimp.read(url, (err, image) => {\n console.log(\"getting image\");\n //console.log(image.bitmap.data);\n var width = image.bitmap.width;\n var height = image.bitmap.height;\n\n // filter for red, green and blue\n \n for (var x = 0; x < width; x++)\n for (var y = 0; y < height; y++)\n if (!(x == 0 || x == width - 1 || y == 0 || y == height - 1)) {\n var sums = [0, 0, 0];\n for (var i = 0; i < filter.length; i++)\n for (var j = 0; j < filter[i].length; j++) {\n var pixelcolor = image.getPixelColor(x + i - 1, y + j - 1);\n var rgba = Jimp.intToRGBA(pixelcolor);\n sums[0] += rgba.r * filter[i][j];\n sums[1] += rgba.g * filter[i][j];\n sums[2] += rgba.b * filter[i][j];\n }\n for (var i = 0; i < sums.length; i++) {\n if (sums[i] > 255)\n sums[i] = 255;\n if (sums[i] < 0)\n sums[i] = 0;\n }\n var hexval = Jimp.rgbaToInt(sums[0], sums[1], sums[2], 255);\n image.setPixelColor(hexval, x, y);\n }\n \n image.write(outputname + \".jpg\");\n console.log(\"finished.\");\n });\n}", "static importAllImages(r = require.context(\"./images\", false, /\\.(png|jpe?g|svg)$/)) {\n let images = {};\n r.keys().map((item) => { images[item.replace('./', '')] = r(item); });\n return images;\n }", "function build_path(path) {\r\n var paths = config.dir['base'] + \",\" + (config.dir[program.architec] || '') + ',' + (config.custum_dir.tpl[program.template] || '') + ',' + (config.custum_dir.css[program.css] || 'less');\r\n return paths.replace(/,+/g, ',').split(',');\r\n}", "function getImageFiles(elem) {\n\tvar pic_set = [];\t\n\tfor (var j = 1; j <= NUM_PICS; j++) {\n\t\tpic_set.push('final-images/' + elem.noun + '_' + elem.order[j-1] + '.png');\n\t\t\t}\n\t\n\n return pic_set;\n}", "function images() {\n gutil.log('updating images');\n return gulp.src('src/img/**/*')\n .pipe($.if(PRODUCTION, $.imagemin({\n progressive: true\n })))\n .pipe(gulp.dest(PATHS.dist + PATHS.distAssets + '/img'));\n}", "function removeImages(svg) {\r\n var startStr = '<image';\r\n var stopStr = '</image>';\r\n var stopStrAlt = '/>';\r\n var start = svg.indexOf(startStr);\r\n var match = '';\r\n\r\n // Recursion\r\n if ( start != -1 ) {\r\n var stop = svg.slice(start,start+1000).indexOf(stopStr);\r\n if ( stop != -1 ) {\r\n svg = removeImages(svg.slice(0,start) + svg.slice(start + stop + stopStr.length,svg.length));\r\n } else {\r\n stop = svg.slice(start,start+1000).indexOf(stopStrAlt);\r\n if ( stop != -1 ) {\r\n svg = removeImages(svg.slice(0,start) + svg.slice(start + stop + stopStr.length,svg.length));\r\n }\r\n }\r\n }\r\n return svg;\r\n }", "static imageRootUrl() {\r\n return (`/dist/img/`);\r\n }", "function cleanImages() {\n return del([\n 'src/public/images/dist'\n ])\n}" ]
[ "0.6730763", "0.6037273", "0.58344835", "0.5813276", "0.57666874", "0.5759075", "0.57370013", "0.5726617", "0.56767464", "0.56692827", "0.56686956", "0.5633601", "0.5627656", "0.5601868", "0.55855197", "0.5569785", "0.5566589", "0.55639243", "0.5550271", "0.5550271", "0.5550271", "0.5550271", "0.5520454", "0.5513134", "0.55080795", "0.5489515", "0.5467436", "0.5447593", "0.5445186", "0.54183507", "0.54150146", "0.54114455", "0.5402394", "0.53975004", "0.53946525", "0.5371216", "0.5361694", "0.5315736", "0.5294264", "0.5292968", "0.52817976", "0.5258572", "0.52422935", "0.5242135", "0.52417994", "0.52410746", "0.5236954", "0.52296346", "0.5222336", "0.5217569", "0.5207634", "0.5207492", "0.5197747", "0.51846164", "0.51737875", "0.51618934", "0.5158923", "0.5148219", "0.51474965", "0.5144918", "0.5135686", "0.5124726", "0.5100859", "0.5094438", "0.5086662", "0.50853354", "0.508236", "0.5077892", "0.5073672", "0.5073058", "0.50513005", "0.50473416", "0.50463724", "0.5044087", "0.5036562", "0.5035073", "0.5030934", "0.50227547", "0.5010223", "0.50079167", "0.5005509", "0.5005444", "0.4989516", "0.49882177", "0.49614257", "0.49595445", "0.49419075", "0.49381137", "0.49339852", "0.4929742", "0.4929586", "0.49251097", "0.49249548", "0.49247122", "0.49214873", "0.4919737", "0.49114054", "0.49113908", "0.4907424", "0.4904888", "0.49040708" ]
0.0
-1
Get an existing LicenseConfiguration resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
static get(name, id, state, opts) { return new LicenseConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get(name, id, state, opts) {\n return new OrganizationCustomRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new EndpointConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new BucketLifecycleConfiguration(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "async function configLookup(id) {\n const results = await makev2Request(`\n query {\n tierDetails: worldData { zone (id: ${id} ) {\n id, \n name, \n encounters {\n id, name\n },\n partitions {\n id, name, default\n }\n } }\n\n serverDetails: worldData {\n regions {\n id, compactName, name, servers { data { name } }\n }\n }\n }`\n )\n\n const tierData = results.tierDetails.zone;\n const regionData = results.serverDetails.regions;\n\n\n if (tierData || regionData) {\n\n return {\n tier: new Tier(tierData),\n\n regions: regionData.map(({compactName, name, servers}) => {\n return {\n compactName,\n name, \n servers: servers.data.map(server => server.name)\n }\n })\n }\n }\n\n return {};\n}", "function getOrgConf(org_id){\n console.log(org_id)\n Organization.getConfig(org_id)\n .then(function(response){\n self.activeOrgConfig = response.data;\n }).catch(function(error){\n\n })\n }", "static get(name, id, state, opts) {\n return new AppImageConfig(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new Certificate(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new Role(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new OrganizationAdminAccount(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state) {\n return new Certificate(name, state, { id });\n }", "static get(name, id, state, opts) {\n return new ResourceServer(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, opts) {\n return new Assessment(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new EventSourceMapping(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new Budget(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "getStateInternal(id) {\n var obj = id;\n if (! obj.startsWith(this.namespace + '.'))\n obj = this.namespace + '.' + id;\n return currentStateValues[obj];\n }", "static get(name, id, state, opts) {\n return new DataSource(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, opts) {\n return new AccessControlRecord(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new SshKey(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new Policy(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, opts) {\n return new P2sVpnServerConfiguration(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new Addon(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new DefaultNetworkAcl(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new DefaultNetworkAcl(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new LocalGatewayRouteTableVpcAssociation(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new RestApi(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "function Cache_Get_Resource(strId, listener, state)\n{\n\t//overload\n\treturn this.Get_Item(strId, __CACHE_TYPE_RESOURCE, listener, state);\n}", "function getConfig(configName)\n {\n if ( angular.isUndefined(fuseConfiguration[configName]) )\n {\n return false;\n }\n\n return fuseConfiguration[configName];\n }", "static get(name, id, opts) {\n return new ApplicationSecurityGroup(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new ClusterSnapshot(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, opts) {\n return new ApiRelease(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new DefaultSubnet(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "getById(id) {\n return RoleDefinition(this, `getById(${id})`);\n }", "static async getCrateByName(name) {\n let crates = await CrateDocManager.getCrates();\n if (crates[name]) {\n return crates[name];\n } else {\n let crate = Object.entries(crates).find(([_, { crateName }]) => crateName == name);\n if (crate) {\n return crate[1];\n } else {\n return null;\n }\n }\n }", "static get(name, id, state, opts) {\n return new Image(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, opts) {\n return new OpenIdConnectProvider(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new SigningProfile(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "getCarByLicense(license){\n // Since cars is a array object we can use Find.\n // Syntax for find is like below.\n return this.cars.find(function(car){\n return car.license === license;\n });\n }", "static get(name, id, state, opts) {\n return new CapacityProvider(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new ScalingPlan(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new SlotType(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new ApplicationSnapshot(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "getById(id) {\r\n return new RoleDefinition(this, `getById(${id})`);\r\n }", "static get(name, id, state, opts) {\n return new JobDefinition(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static getOptions(orgId) {\n return {\n isGlobal: true,\n isState: true,\n filename: `${orgId}.json`,\n orgId,\n };\n }", "function getResourceByIndustry(industryId) {\n // This is a bit of a hack, and assumes that the first N Resources represent the N Industries. This currently happens to be correct in every balance.json.\n industryId = industryId.toLowerCase();\n let industryIndex = getData().Industries.findIndex(i => i.Id == industryId);\n return getData().Resources[industryIndex];\n}", "static get(name, id, state, opts) {\n return new Authorizer(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "function config(name) {\n\t\treturn getProperty(CONFIG, name);\n\t}", "static get(name, id, state, opts) {\n return new Document(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new Deployment(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "getOne(stateName) {\n return axios.get('/api/states/' + stateName).then( response => {\n return response.data;\n });\n }", "static get(name, id, state, opts) {\n return new DeploymentGroup(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "async getResourceSelected(resource) {\r\n const api = this.d2.Api.getApi();\r\n let result = {};\r\n try {\r\n let res = await api.get(resource);\r\n //if (res.hasOwnProperty(resource)) {\r\n return res;\r\n //}\r\n }\r\n catch (e) {\r\n console.error('Could not access to API Resource');\r\n }\r\n return result; \r\n \r\n }", "getResource(internal_name) {\n if (IsString(internal_name, true)) {\n const resource = this.asset.resource.get(internal_name);\n return resource ? resource : {};\n }\n }", "function queryResourceById(id) {\n this.saveFormValue('diseaseId', id);\n if (validateDiseaseIdInput.call(this, id)) {\n // Make the OLS REST API call\n return this.getRestData(external_url_map['MondoApi'] + id.replace(':', '_')).then(response => {\n let termLabel = response['_embedded']['terms'][0]['label'];\n let termIri = response['_embedded']['terms'][0]['iri'];\n if (termLabel && termIri) {\n // Disease ID is found at OLS\n this.setState({\n queryResourceBusy: false,\n submitResourceDisabled: false,\n tempResource: response['_embedded']['terms'][0],\n resourceFetched: true\n });\n } else {\n // Disease ID not found at OLS\n this.setFormErrors('diseaseId', 'Requested ID not found at OLS.');\n this.setState({queryResourceBusy: false, resourceFetched: false});\n }\n }).catch(err => {\n // error handling for disease query\n this.setFormErrors('diseaseId', 'Unable to retrieve data from OLS.');\n this.setState({queryResourceBusy: false, resourceFetched: false});\n console.warn('OLS terminology fetch error :: %o', err);\n });\n } else {\n this.setState({queryResourceBusy: false});\n }\n}", "static get(name, id, state, opts) {\n return new DelegatedAdministrator(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "function read(id) {\n return wvy.api.read(id);\n }", "static get(name, id, state, opts) {\n return new StackSetInstance(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new Network(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new ProxyTarget(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "async getDriverConfig( name ) {\n const config = await this.getUserConfig()\n\n if ( typeof config[ name ] === 'undefined' ) {\n return {}\n }\n\n return config[ name ]\n }", "constructor(config, id) {\n super(config);\n this.setResourceKey('inventory_levels', [id]);\n }", "getOption(internal_name) {\n if (IsString(internal_name, true)) {\n const option = this.asset.option.get(internal_name);\n return option ? option : {};\n }\n }", "function get(name) {\n const value = config.get(name)\n console.assert(value != null && value != undefined, \"Missing config param \" + name)\n return value\n}", "function get(name) {\n const value = config.get(name)\n console.assert(value != null && value != undefined, \"Missing config param \" + name)\n return value\n}", "function lookup(config, orient) {\n const opt = config[orient] || {};\n return (key, d) => opt[key] != null ? opt[key]\n : config[key] != null ? config[key]\n : d;\n}", "loadResource() {\n // Load Selects\n this.loadSelect(this.vcn_id, 'virtual_cloud_network', false)\n this.loadSelect(this.drg_id, 'dynamic_routing_gateways', true)\n // Assign Values\n this.vcn_id.property('value', this.resource.vcn_id)\n this.drg_id.property('value', this.resource.drg_id)\n }", "function _getResource(ctx, resourceID) {\n /// <param name=\"ctx\" type=\"_Context\" />\n /// <param name=\"resourceID\" type=\"String\">The unique key or name of the resource</param>\n /// <returns type=\"Resource\" />\n var resource = _getResourceDirect(ctx, resourceID);\n if (resource == null) {\n resource = ctx.resources[resourceID] = new Resource(resourceID);\n\n if (ctx.automaticExternals && ___global.hasOwnProperty(resourceID)) {\n if (ctx.debug) console.log('Using existing global object for resource \\'' + resourceID + '\\'');\n resource.isDefined = true;\n resource.isLiteral = true;\n resource.isExternal = true;\n resource.isInferred = true;\n resource.isResolved = true;\n resource.value = resource.definition = ___global[resourceID];\n }\n }\n\n return resource;\n }", "function getState(stateId) {\n return $http({\n url: baseUrl + '/show/' + stateId,\n method: 'GET'\n }).then(function(res){\n return res;\n }).catch(function(err){\n throw err;\n });\n }", "readById(id, callback) {\n qualificationsModel.qualifications.find({ where: { id: id } }).then((qualification) => {\n callback(qualification);\n });\n }", "_getAccessory (params) {\n return this._accessories[params.id]\n }", "getById(id) {\r\n const ra = new RoleAssignment(this);\r\n ra.concat(`(${id})`);\r\n return ra;\r\n }", "getResource(name) {\n const normalizedName = normalizeName(name);\n let index = this.origins.length - 1;\n while (index >= 0) {\n const origin = this.origins[index--];\n if (origin.hasResource(normalizedName)) {\n return origin.getResource(normalizedName);\n }\n }\n throw new Error(Util.format(\"Cannot find resource `%s`.\", name));\n }", "function read(id) {\n if (id) {\n return service.datasource.get({ id : id });\n }\n\n service.requests = service.datasource.query();\n return service.requests;\n }", "getById(id) {\n return RoleAssignment(this).concat(`(${id})`);\n }", "static get(name, id, state, opts) {\n return new Pipeline(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "config(name) {\n var v = this.module.config(name);\n return v !== undefined\n ? v\n : this.proj && this.proj.config(name);\n }", "static async getResource(_idResource) {\n let resource = Project.resources[_idResource];\n if (!resource) {\n let serialization = Project.serialization[_idResource];\n if (!serialization) {\n FudgeCore.Debug.error(\"Resource not found\", _idResource);\n return null;\n }\n resource = await Project.deserializeResource(serialization);\n }\n return resource;\n }", "async function getResourceAcr(resource, options) {\n const acrUrl = await getAcrUrl(resource, options);\n if (acrUrl === null) {\n return null;\n }\n let acr;\n try {\n acr = await getSolidDataset(acrUrl, options);\n } catch (e) {\n return null;\n }\n return Object.assign(Object.assign({}, resource), {\n internal_acp: {\n acr: Object.assign(Object.assign({}, acr), {\n accessTo: getSourceUrl(resource)\n })\n }\n });\n}", "getState() {\n if (this.state) {\n return this.state;\n }\n\n if (this.options.getState instanceof Function) {\n return this.options.getState();\n }\n\n return {};\n }", "async readReservationById(stub, args, thisClass) {\n if (args.length != 1) {\n throw new Error('Incorrect number of arguments. Expecting id of the asset to query.')\n }\n let key = args[0]\n if (!key) {\n throw new Error(' Asset key must not be empty.')\n }\n\n let assetAsBytes = await stub.getState(key)\n if (!assetAsBytes.toString()) {\n let jsonResp = {}\n jsonResp.Error = 'Asset does not exist: ' + key\n throw new Error(JSON.stringify(jsonResp))\n }\n console.info('=======================================')\n console.log(assetAsBytes.toString())\n console.info('=======================================')\n return assetAsBytes\n }", "getConfig(internal_name, item) {\n return new Promise((resolve) => __awaiter(this, void 0, void 0, function* () {\n let config = yield this._getBaseConfig(internal_name);\n if (item && item.id) {\n config.id = item.id;\n config.param.id = item.id;\n config.preferences = yield this._getPreferences(config.param);\n const settingComponent = config.setting.component;\n config = DeepMerge(config, item);\n config.setting.component = settingComponent ? settingComponent : null;\n }\n yield this.getResources(config);\n return resolve(config);\n }));\n }", "function getSubscriptionById(req, res) {\n var id = req.swagger.params.id.value;\n Subscriptions.findOne({ _id: id }, 'name feature amount') .lean().exec(function(err, data) {\n if (err) {\n return res.json(Response(500, \"failed\", constantsObj.validationMessages.internalError, err));\n } else {\n return res.json({ 'code': 200, status: 'success', \"message\": constantsObj.messages.dataRetrievedSuccess, \"data\": data });\n }\n })\n }", "function updateState(id, state, library) {\n\n if (state === \"Leido\") {\n library[id].read = true;\n } else if (state === \"No leido\") {\n library[id].read = false\n }\n return library;\n}", "initAccessory() {\n return new Accessory(this.getName(), this.getUuid(), this.api.hap.Accessory.Categories.AIR_CONDITIONER);\n }", "async findById(id) {\r\n let params = {\r\n where: {\r\n id: id\r\n },\r\n include: this.getIncludes()\r\n };\r\n if (!_.isArray(this.getAttributes()) && this.getAttributes().length > 0) {\r\n params = _.assign(params, { attributes: this.getAttributes() });\r\n }\r\n let model = this.Models();\r\n if (this.getScopes().length > 0) {\r\n _.forEach(this.getScopes(), scope => {\r\n model = model.scope(scope);\r\n });\r\n }\r\n const result = await model.findOne(params);\r\n\r\n if (!result) {\r\n throw new NotFoundException('Resource');\r\n }\r\n return result;\r\n }", "fetchShop(gameId) {\n return Repository.get(`${gameId}${resource}`)\n }", "function find(id, callback) {\n core.api('GET', '/properties/' + id, {}, callback);\n }", "function getRegionFromCurrData(id) {\n\t// If the id is less than 1,000 then it's a state code. Convert to 5-digit FIPS\n\tid = (currData.resolution === \"state\") ? id * 1000: id;\n\treturn currData.regions[currData.regions_idx[id]];\n}", "static get(name, id, opts) {\n return new DatabaseAccount(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "static get(name, id, state, opts) {\n return new KinesisStreamingDestination(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "function getLicenseType() {\n return CONFIG.licenseType;\n}", "function getByStateCode(stateCode) {\n return StatePrefix\n .findOne({abbreviation: stateCode})\n .exec()\n .then(prefix => Promise.resolve(prefix))\n .catch(error => Promise.reject(error));\n}", "loadResource() {\n // Load Selects\n this.loadStorageTierSelect(this.storage_tier)\n this.loadPublicAccessTypeSelect(this.public_access_type)\n this.loadAutoTieringSelect(this.auto_tiering)\n this.loadVersioningSelect(this.versioning)\n this.loadSelect(this.kms_key_id, 'key', true, () => true, 'Oracle-managed keys')\n // Assign Values\n this.storage_tier.property('value', this.resource.storage_tier)\n this.public_access_type.property('value', this.resource.public_access_type)\n this.auto_tiering.property('value', this.resource.auto_tiering)\n this.versioning.property('value', this.resource.versioning)\n this.object_events_enabled.property('checked', this.resource.object_events_enabled)\n this.kms_key_id.property('value', this.resource.kms_key_id)\n // Pricing Estimates\n this.estimated_monthly_capacity_gbs.property('value', this.resource.estimated_monthly_capacity_gbs)\n this.estimated_monthly_requests.property('value', this.resource.estimated_monthly_requests)\n }", "function _getCourse(id) {\n for (var i = 0; i < _courses.length; i++) {\n if (_courses[i].id === id) {\n return _courses[i];\n }\n }\n}", "function fetchOrgSettingDefault(orgId, name) {\n var req = new Request(FETCH_ORG_SETTING, orgId, name);\n req.send(true);\n var res = req.result();\n return (res) ? res.value : null;\n}", "function getCrsInfo(name, catalog) {\n var dataset, source, info = {};\n if (/\\.prj$/i.test(name)) {\n dataset = importFile(name, {});\n if (dataset) {\n info.prj = dataset.info.prj;\n info.crs = parsePrj(info.prj);\n }\n return info;\n }\n if (catalog && (source = catalog.findSingleLayer(name))) {\n dataset = source.dataset;\n info.crs = getDatasetCRS(dataset);\n info.prj = dataset.info.prj; // may be undefined\n // defn = internal.crsToProj4(P);\n return info;\n }\n // assume name is a projection defn\n info.crs = getCRS(name);\n return info;\n }", "static get(name, id, state, opts) {\n return new NetworkInterface(name, state, Object.assign(Object.assign({}, opts), { id: id }));\n }", "function getState(srcpath) {\n var result = {};\n result.current = fs.readFileSync(path.join(srcpath, 'current.state'), 'utf8');\n result.desired = fs.readFileSync(path.join(srcpath, 'desired.state'), 'utf8');\n return result;\n}", "static get(name, id, opts) {\n return new StorageTarget(name, undefined, Object.assign(Object.assign({}, opts), { id: id }));\n }", "function getStateName(id){\n for(var i = 0; i < dataOfStates.length; i++){\n if(dataOfStates[i].id === id){\n stateName = dataOfStates[i].name;\n stateAbbr = dataOfStates[i].abbreviation;\n }\n } \n}" ]
[ "0.5462729", "0.5331217", "0.5175364", "0.49766272", "0.49317893", "0.49193063", "0.48327905", "0.48200026", "0.48028737", "0.47987625", "0.47682795", "0.4690875", "0.46703625", "0.4618402", "0.45837927", "0.45715383", "0.45570007", "0.45533463", "0.4515399", "0.44961601", "0.44929594", "0.4452162", "0.4452162", "0.44516742", "0.4438189", "0.44203183", "0.43706557", "0.4365716", "0.43634906", "0.43548816", "0.43519828", "0.43285695", "0.43274516", "0.43254068", "0.4324634", "0.4324279", "0.43220168", "0.43179566", "0.43149123", "0.42975557", "0.42801598", "0.42793903", "0.42755437", "0.42495763", "0.42413533", "0.41973263", "0.41849822", "0.4179876", "0.4177178", "0.41610083", "0.41534433", "0.41417652", "0.41387567", "0.41288427", "0.4119371", "0.41102436", "0.41084298", "0.4103599", "0.41018373", "0.40879568", "0.40866512", "0.4080802", "0.40793034", "0.40793034", "0.406559", "0.40546727", "0.40520003", "0.40489677", "0.40427494", "0.40419775", "0.4033792", "0.40320334", "0.4030105", "0.40285742", "0.40221903", "0.40123445", "0.40047938", "0.40046048", "0.39845973", "0.39831933", "0.3978294", "0.39775985", "0.39770743", "0.39754578", "0.3974926", "0.39743692", "0.39672506", "0.39668065", "0.39614326", "0.39548153", "0.39511403", "0.39416954", "0.3936073", "0.3933803", "0.39273745", "0.39253235", "0.39232334", "0.39200866", "0.39179716", "0.39175907" ]
0.72163385
0
Returns true if the given object is an instance of LicenseConfiguration. This is designed to work even when multiple copies of the Pulumi SDK have been loaded into the same process.
static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === LicenseConfiguration.__pulumiType; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === EndpointConfiguration.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Certificate.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === P2sVpnServerConfiguration.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === OrganizationCustomRule.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === CapacityProvider.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === BucketLifecycleConfiguration.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === OpenIdConnectProvider.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ScalingPlan.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ApiRelease.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Authorizer.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ApplicationSecurityGroup.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === OrganizationAdminAccount.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === VolumeContainer.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === AppImageConfig.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DefaultSubnet.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === AccessControlRecord.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DeploymentGroup.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DefaultNetworkAcl.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DefaultNetworkAcl.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Addon.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Assessment.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ClusterSnapshot.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Budget.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Policy.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ServerTrustGroup.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Deployment.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === StorageTarget.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === LocalGatewayRouteTableVpcAssociation.__pulumiType;\n }", "function isCreatedRheaConnectionOptions(obj) {\n return (obj && typeof obj.container === \"object\" && typeof obj.rheaConnection === \"object\");\n}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Endpoint.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === JobDefinition.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ResourceServer.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === SigningProfile.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === NetworkInterface.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === GatewayRoute.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Pipeline.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Network.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Rollout.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DataSource.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === RestApi.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === KinesisStreamingDestination.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Device.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Document.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === LoadBalancer.__pulumiType;\n }", "function getLicenseType() {\n return CONFIG.licenseType;\n}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === SlotType.__pulumiType;\n }", "isConfigurable () {\n return this.options && Object.keys(this.options).length > 0\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ApplicationSnapshot.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DatabaseAccount.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DelegatedAdministrator.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === VirtualMachineScaleSet.__pulumiType;\n }", "function isPromocodeJsonTypeAvailable(){\n\tvar paymentOptionTypes = JSON.parse(localStorage.getItem(\"fundingSourceTypes\"));\n\tfor ( var paymentOptionIndex = 0; paymentOptionIndex < paymentOptionTypes.length; paymentOptionIndex++) {\n\t\tvar paymentOptionSourcesJsonType = paymentOptionTypes[paymentOptionIndex].jsonType;\n\t\tif(paymentOptionSourcesJsonType === jsonTypeConstant.PROMOCREDIT){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === EventSourceMapping.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === WorkloadNetworkSegment.__pulumiType;\n }", "function isTypeValid(license, callback) {\n var valid = false;\n for (var i=0; i<TYPES.length; i++) {\n if (license === TYPES[i]) {\n valid = true;\n }\n }\n callback(valid);\n}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Role.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === DevEndpoint.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === VpcPeeringConnection.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === RecordSet.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === SshKey.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === PeeringService.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === StreamingJob.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ProxyTarget.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === PatchBaseline.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Image.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === MachineLearningCompute.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === StackSetInstance.__pulumiType;\n }", "static isInstance(obj) {\n return utils.isInstance(obj, \"__pulumiOutput\");\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === LogService.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Webhook.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === StaticIpAttachment.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Detector.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === UserProfile.__pulumiType;\n }", "function _isCollection(collectionObject_sPropertie) {\n\n // init\n var valid, validProperties, collection_sProperties;\n\n // Check if configuration object\n valid = typeof collectionObject_sPropertie === 'object';\n collection_sProperties = ['db', 'topology', 'dbName', 'options', 'namespace', 'serializeFunctions', 'name', 'promiseLibrary', 'readConcern'];\n\n validProperties = true;\n if (collectionObject_sPropertie) {\n collection_sProperties.forEach(function(_prop) {\n validProperties = validProperties && collectionObject_sPropertie.hasOwnProperty(_prop);\n });\n }\n\n valid = valid && validProperties;\n\n\n ////////\n return valid;\n}", "hasConfiguration() {\n const {integration, provider} = this.props;\n\n return (\n integration.configOrganization.length > 0 ||\n provider.features.filter((f) => CONFIGURABLE_FEATURES.includes(f)).length > 0\n );\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === Trigger.__pulumiType;\n }", "function isObject (o) { return o && typeof o === 'object' }", "function isObject (o) { return o && typeof o === 'object' }", "function objectIsComponent( candidate ) { // TODO: this was copied from vwf.js; find a way to share (use the log stage for incoming logging too?)\n\n var componentAttributes = [\n \"extends\",\n \"implements\",\n \"source\",\n \"type\",\n \"properties\",\n \"methods\",\n \"events\",\n \"children\",\n \"scripts\",\n ];\n\n var isComponent = false;\n\n if ( ( typeof candidate == \"object\" || candidate instanceof Object ) && candidate != null ) {\n\n componentAttributes.forEach( function( attributeName ) {\n isComponent = isComponent || Boolean( candidate[attributeName] );\n } );\n\n }\n \n return isComponent; \n }", "function is_object(object) {\n\t\treturn exists(object) && object !== null && object.constructor === object_constructor;\n\t}", "static _isLicenseFile(file) {\n return file.token && DefinitionService._isInCoreFacet(file) && (file.natures || []).includes('license')\n }", "function is_object(object) {\n\treturn exists(object) && object !== null && object.constructor === object_constructor;\n}", "function _isPlainObject(obj) {\n return (obj && obj.constructor.prototype === Object.prototype);\n}", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === VirtualRouter.__pulumiType;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === ApiIssue.__pulumiType;\n }", "function isRactiveInstance (obj) {\n return obj && obj.constructor &&\n typeof obj._guid === 'string' &&\n typeof obj.set === 'function' &&\n typeof obj.off === 'function' &&\n typeof obj.on === 'function' &&\n typeof obj.constructor.defaults === 'object';\n }", "function is(object, name) {\n var x = registry.registeredClasses[name];\n return x != null && object instanceof x;\n}", "function hasOptions(obj) {\n if (obj!=null && obj.options!=null) { return true; }\n return false;\n }", "function instanceOf (obj, Clss) {\n return Clss[Symbol.hasInstance](obj);\n}", "function isObject(o) { return typeof o === 'object'; }", "function isObject(o) { return typeof o === 'object'; }", "function isObject(o) { return typeof o === 'object'; }", "isPlannedRelease (releaseId) {\n let option = this;\n return CapacityPlanReleases.find({ releaseId: releaseId, optionId: option._id }).count() > 0\n }", "function IsObject(validationOptions) {\n return Object(_common_ValidateBy__WEBPACK_IMPORTED_MODULE_0__[\"ValidateBy\"])({\n name: IS_OBJECT,\n validator: {\n validate: (value, args) => isObject(value),\n defaultMessage: Object(_common_ValidateBy__WEBPACK_IMPORTED_MODULE_0__[\"buildMessage\"])(eachPrefix => eachPrefix + '$property must be an object', validationOptions),\n },\n }, validationOptions);\n}", "function isLicenseRequest(url) {\n return url === licenseAcquisitionURL || url === licenseUrlFromTicket;\n }", "static isInstance(obj) {\n if (obj === undefined || obj === null) {\n return false;\n }\n return obj['__pulumiType'] === LifecycleHook.__pulumiType;\n }", "function hasConstructor(obj) {\n if (typeof obj !== 'object' || obj === null) {\n return false;\n }\n\n return obj.constructor !== Object && obj.constructor !== Array;\n}", "function isObject(obj){\n return Object.prototype.toString.call(obj) == '[object Object]';\n }", "function isOptions(){\n for (var key in options)\n if (options.hasOwnProperty(key)) return true;\n return false;\n }", "function isInstance(object, targetTypeConstructor) {\n return (targetTypeConstructor && typeof targetTypeConstructor === 'function' && object instanceof targetTypeConstructor);\n}" ]
[ "0.5830645", "0.57363594", "0.5683929", "0.56581485", "0.56484395", "0.5611632", "0.5608325", "0.5596872", "0.5554613", "0.5515753", "0.5514106", "0.5498812", "0.5479654", "0.54355407", "0.543149", "0.5406607", "0.54058933", "0.53994495", "0.53994495", "0.53926283", "0.53531194", "0.53520185", "0.53487545", "0.5340441", "0.5336735", "0.53340167", "0.5295292", "0.5286916", "0.52850354", "0.5273947", "0.52703303", "0.526274", "0.5258244", "0.5255858", "0.52352726", "0.5234798", "0.52320397", "0.5228547", "0.52109563", "0.52087766", "0.5208325", "0.5201386", "0.5195251", "0.5186364", "0.5168574", "0.51679236", "0.5164671", "0.51582944", "0.5148205", "0.514316", "0.5135457", "0.5134698", "0.5131058", "0.5125759", "0.51022446", "0.5064349", "0.50642353", "0.5063397", "0.505475", "0.5046941", "0.50298977", "0.5004314", "0.49871713", "0.4983058", "0.4932299", "0.49124745", "0.4907268", "0.49068767", "0.49049088", "0.4901501", "0.488728", "0.4882073", "0.4866965", "0.4866532", "0.48662326", "0.48661488", "0.48560268", "0.48560268", "0.48282346", "0.48108974", "0.48056045", "0.48009092", "0.47938284", "0.4793196", "0.47741085", "0.47645327", "0.47644225", "0.4746092", "0.4745604", "0.47424617", "0.47424617", "0.47424617", "0.47394633", "0.47226617", "0.47090057", "0.4666235", "0.46490583", "0.46487898", "0.46450314", "0.4630759" ]
0.6906615
0
Input: array = [3, 5, 4, 8, 11, 1, 1, 6], targetSum = 10 Output: [1, 11] Time: O(n^2) Space: O(1)
function twoNumberSum(array, targetSum) { var result = []; for (var i = 0; i < array.length; i++) { for (var j = i+1; j < array.length; j++) { if (array[i] + array[j] === targetSum) { result.push(array[i], array[j]); break; } } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function targetSum(arr, sumTarget){\n \n}", "_sumToTarget(arr, target) { console.log(\"_sumToTarget reducing for target \", target);\r\n let sum = 0, x = 0, l = arr.length;\r\n while(x<l) {\r\n sum += arr[x++].value;\r\n if (sum >= target) {\r\n if (this.config.debug) console.log(\"_sumToTarget reduced \", l, \" to \", x);\r\n return x;\r\n }\r\n }\r\n return l;\r\n }", "function twoNumberSum(array, targetSum) {\n let hash = [];\n for (const element of array) {\n let targetVal = targetSum - element;\n if (hash.indexOf(targetVal) !== -1) {\n return [targetVal, element];\n } else {\n hash.push(element);\n }\n }\n\n return [];\n}", "function subsetSum(array, target) {\n\tvar sum;\n\tfor (let i = 0; i < array.length; i++) {\n\t\tsum = array[i];\n\n\t\tfor (let i = 0; i < array.length; i++) {\n\t\t\tif (array[i] < target) {\n\t\t\t\tif (sum + array[i] <= target) {\n\t\t\t\t\tsum += array[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function targetSum2(arr, value) {\n let firstIndex = 0;\n let lastIndex = arr.length - 1;\n\n while (firstIndex < lastIndex) {\n let sum = arr[firstIndex] + arr[lastIndex];\n\n if (value < sum) {\n lastIndex--;\n } else if (value > sum) {\n firstIndex++;\n } else {\n return [arr[firstIndex], arr[lastIndex]];\n }\n }\n\n return [];\n}", "function solution1(array, targetSum) {\n array.sort((a,b) => a - b);\n const result = [];\n for (let i = 0; i < array.length; i++) {\n const x = array[i];\n for (let j = i+1; j < array.length; j++) {\n const y = array[j];\n for (let k = j+1; k < array.length; k++) {\n const z = array[k];\n if (x + y + z === targetSum) {\n result.push([x, y, z]);\n }\n }\n }\n }\n return result;\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 findTargetSum(arr, target) {\n for (let i=0; i < arr.length - 1; i++) {\n // for every number in arr check to see if sum with any other number is the target\n for (let j=i; j < arr.length; j++) {\n if (arr[i] + arr[j] === target) {\n \t// return first solution found\n return [ arr[i], arr[j] ];\n }\n }\n }\n return 'No solution'\n}", "function sumToTarget(array, target){\n\tif(array.length === 0){\n\t\treturn false;\n\t}\n\t\n\tfor(let i = 0; i < array.length; i++){\n\t\tlet sum = array[i];\n\t\tlet j = i + 1;\n\t\t\n\t\twhile(sum < target && j < array.length){\n\t\t\tsum += array[j];\n\t\t\tif(sum === target){\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\tj ++;\n\t\t}\n\t\t\n\t\tif(j === array.length && sum < target){\n\t\t\treturn false;\n\t\t}\n\t\t\n\t}\n\treturn false;\n}", "function solution2(array, targetSum) {\n array.sort((a,b) => a -b );\n const result = [];\n for (let i = 0; i < array.length; i++) {\n let x = array[i];\n let leftPtr = i + 1;\n let rightPtr = array.length - 1;\n \n while (leftPtr < rightPtr) {\n let y = array[leftPtr];\n let z = array[rightPtr];\n let currentSum = x + y + z;\n if (currentSum === targetSum) {\n result.push([x, y , z]);\n leftPtr++;\n rightPtr = array.length - 1;\n } else if (currentSum < targetSum) {\n leftPtr++;\n } else if (currentSum > targetSum) {\n rightPtr--;\n }\n }\n }\n\n return result;\n }", "function pair_with_target_sum(arr, targetSum) {\n const nums = {}; // to store numbers and their indices\n for (let i = 0; i < arr.length; i++) {\n const num = arr[i];\n if (targetSum - num in nums) {\n return [nums[targetSum - num], i];\n }\n nums[arr[i]] = i;\n }\n return [-1, -1];\n}", "function twoSum(array, target){\n let temp = 0;\n let newArr = [];\n for(let i = 0; i < array.length; i ++){\n if(array[i] < target){\n newArr.push(array[i]);\n }\n }\n for(let i = 0; i < newArr.length; i ++){\n for(let j = 0; j < newArr.length; j ++){\n if(target == newArr[i] + newArr[j]){\n return [i, j];\n }\n }\n }\n}", "function findPairForSum(arr, target){\n // Create array for output\n var output = [];\n // Filter out numbers bigger than target sum\n var filteredArray = arr.filter(function(number){\n return number < target;\n });\n // Iterate through the array to find the first number\n for(var i = 0; i < filteredArray.length; i++){\n var firstNumber = filteredArray[i];\n for(var j = 0; j < filteredArray.length; j++){\n // Iterate through the filteredArrayay to find the second number\n if(firstNumber + filteredArray[j] === target){\n var secondNumber = filteredArray[j];\n // Push output to output array\n output.push(firstNumber, secondNumber);\n return output;\n }\n }\n }\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 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 twoNumberSum(array, targetSum) {\n // Write your code here.\n for(let i = 0; i < array.length - 1; i++){\n const firstNum = array[i]\n for(let j = i + 1; j < array.length; j++){\n const secondNum = array[j]\n if(firstNum + secondNum === targetSum){\n return [firstNum , secondNum]\n }\n }\n }\n return [];\n \n }", "function targetSum(arr, sum){\n\tlet result = [];\n\n\t/*we use nested loops to compare elements and search for a matching sum*/\n\n\tarr.find((elem, index) => { // use find for out loop\n\t\tfor(let i = 0; i < arr.length; i++){ // use for for inner loop\n\t\t\tif(index !== i && elem + arr[i] === sum){ // check if 2 differnt elems sum match arg\n\t\t\t\tresult.push(elem, arr[i]) // if we find a match put the elems in result\n\t\t\t\treturn true // stop searching\n\t\t\t}\n\t\t}\n\t})\n\treturn result\n}", "function twoNumberSum(array, targetSum) {\n // Write your code here.\n\tlet seenHash = {};\n\t\n\tfor(let i = 0; i < array.length; i++){\n\t\tlet value = array[i];\n\t\tlet target = targetSum - value;\n\t\t\n\t\tif(seenHash[target]){\n\t\t\treturn [target, value]\n\t\t} else {\n\t\t\tseenHash[value] = true;\n\t\t}\n\t}\n\treturn [];\n}", "function threeNumberSum(array, targetSum) {\n //O(n*log(n)) time\n array.sort((a, b) => a - b);\n\n const triplets = [];\n for (let i = 0; i < array.length - 2; i++) {\n let left = i + 1;\n let right = array.length - 1;\n while (left < right) {\n let curSum = array[i] + array[left] + array[right];\n if (curSum === targetSum) {\n triplets.push([array[i], array[left], array[right]]);\n left++;\n right--;\n } else if (curSum < targetSum) {\n left--;\n } else {\n right--;\n }\n }\n }\n\n return triplets;\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 get2NumSum(inputArr, targetSum) {\n var results = [],\n potentials = {};\n for (let num of inputArr) {\n var potentialMatch = targetSum - num;\n if (potentials[num]) {\n return [potentialMatch, num];\n } else {\n potentials[potentialMatch] = true;\n }\n }\n}", "function get2NumSum(inputArr, targetSum){\n\tinputArr.sort((a,b) => a-b)\nvar sum;\n\tvar left = 0, leftVal;\n\tvar right = inputArr.length -1, rightVal;\nwhile(left < right){\n\t\tleftVal = inputArr[left]\n\t\trightVal = inputArr[right]\n\t\tsum = leftVal + rightVal\n\t\tif(sum === targetSum){\n\t\t\treturn [leftVal, rightVal]\n\t\t}else if(sum < targetSum){\n\t\t\tleft++;\n\t\t}else if(sum > targetSum){\n\t\t\tright--;\n\t\t}\n\t}\n \n return [];\n}", "function twoNumberSum(array, targetSum) {\n\tlet answer = [];\n\tfor (let i = 0; i < array.length; i++) {\n for (let j = i + 1; j < array.length; j++) {\n if (array[i] + array[j] === targetSum) {\n answer.push(array[i], array[j]);\n } \n }\n }\n return answer;\n}", "function pair_with_target_sum(arr, targetSum) {\n\t// TODO:write code here\n\t// given sorted array, return the indices of the two numbers that sum up to the targetSum\n\t// use two pointers, one starting at index 0 and the other starting from last index\n\t// move left pointer of the sum is < targetSum, move right pointer of sum is > targetSum\n\t// keeping moving until we find targetSum or until the pointers meet\n\n\t//edge cases: if no sum was found, return empty array\n\t//\t\t\t\t\t\tif length if less than 2 return empty array (since we need a pair)\n\n\t//using hashmap, check if the map has the complement, if not continue\n\tlet map = new Map();\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tif (map.has(targetSum - arr[i])) {\n\t\t\treturn [ map.get(targetSum - arr[i]), i ];\n\t\t} else {\n\t\t\tmap.set(arr[i], i);\n\t\t}\n\t}\n\treturn [];\n}", "function findPairSum(arr, target) {\r\n var result = [];\r\n for (var i = 0; i < arr.length; i++) {\r\n for (var j = 1; j < arr.length; j++) {\r\n if (arr[i] + arr[j] === target) {\r\n result.push(i,j);\r\n }\r\n }\r\n }\r\n console.log(result)\r\n return result.slice(2,4);\r\n}", "function twoNumberSumIfArrayIsSorted(array, targetSum) {\n let i = 0, j = array.length - 1\n while (i < j) {\n const sum = array[i] + array[j]\n if (sum === targetSum) {\n return [i, j]\n }\n sum < targetSum ? i++ : j--\n }\n return []\n}", "function threeNumberSum(array, targetSum) {\n array.sort((a, b) => a - b);\n\n let result = [];\n let i = 0;\n let j = 1;\n let k = array.length - 1;\n\n while (i < array.length - 2) {\n const currentSum = array[i] + array[j] + array[k];\n\n if (currentSum === targetSum) {\n result.push([array[i], array[j], array[k]]);\n j += 1;\n k -= 1;\n }\n\n if (currentSum < targetSum) {\n j += 1;\n }\n\n if (currentSum > targetSum) {\n k -= 1;\n }\n\n if (j >= k) {\n i += 1;\n j = i + 1;\n k = array.length - 1;\n }\n }\n\n return result;\n}", "function sumOfTwo(array, target) {\r\n let answers = [];\r\n for (let i = 0; i < array.length; i++) {\r\n let firstNum = array[i];\r\n for (let j = 1; j < array.length; j++) {\r\n let secondNum = array[j];\r\n if (firstNum + secondNum === target && i != j) {\r\n answers.push(i, j);\r\n return answers;\r\n }\r\n }\r\n\r\n }\r\n}", "function threeSumAlt(array, target) {\n let results = [];\n if (!array.length) return results;\n\n array.sort((a, b) => {\n return a - b;\n });\n let current_sum = 0;\n\n // if we change the second constraint to current < array.length instead\n // of current < array.lenght - 2, on the last iteration, current = the\n // last element of the array, left will exceed the array bound, and right\n // right will still be the last element of the array\n for (let current = 0; current < array.length - 2; current++) {\n // since we only want to add unique magic triplets,\n if (current > 0 && array[current] === array[current - 1]) continue;\n\n let L = current + 1;\n let R = array.length - 1;\n\n while (L < R) {\n current_sum = array[L] + array[current] + array[R];\n\n if (current_sum === target) {\n results.push([array[L], array[current], array[R]]);\n L += 1;\n } else if (current_sum < target) {\n L += 1;\n }\n\n // current_sum > target -> biggest number is too big -> R -= 1\n else {\n R -= 1;\n }\n }\n }\n\n return results;\n}", "function threeNumberSum(array, targetSum){\n let result = [];\n array.sort((a,b)=> a - b);\n\n for (let i = 0; i < array.length - 2; i++) {\n let current = array[i];\n let left = i + 1;\n let right = array.length - 1\n while (left < right){\n let lPointer = array[left];\n let rPointer = array[right];\n let currentSum = current + lPointer + rPointer;\n\n if (currentSum === targetSum){\n result.push([current,lPointer,rPointer]);\n right--;\n left++;\n } else if (currentSum > targetSum){\n right--;\n } else if (currentSum < targetSum){\n left++;\n }\n }\n }\n return result;\n}", "function twoNumberSum(array, targetSum) {\n const numbers = {};\n\n for(let i = 0; i < array.length; i++) {\n const val = targetSum - array[i];\n if(numbers[array[i]]) {\n return [array[i], numbers[array[i]]];\n } else {\n numbers[val] = array[i];\n }\n }\n return [];\n}", "function twoSums (num, target) {\n output = [];\n for(i = 0; i < num.length -1; i++){\n for(j = i + 1; j < num.length; j++ ){\n if(num[i] + num[j] === target){\n output.push(i);\n output.push(j);\n return output;\n }\n }\n }\n}", "function hasTargetSumV2(arr,target){\n for(let first=0; first < arr.length; first++){\n let compliment = target - first;\n if (arr.indexOf(compliment) > -1){\n console.log('FOUND')\n}}}", "function twoNumberSum(array, targetSum) {\n const numsHashTable = {};\n for (let num of array) {\n const possibleMatch = targetSum - num;\n if (possibleMatch in numsHashTable) {\n return [possibleMatch, num]\n } else {\n numsHashTable[num] = true;\n }\n }\n return [];\n }", "function twoNumberSum(array, targetSum) {\n //essentially, setting up two \"pointers\", i and j\n //but for now i, and setting the - 1 because im going to start pointer j on the last integer\n\tfor (let i = 0; i < array.length - 1; i++) {\n //setting varialbe for wherever the pointer is at the given time\n const firstNum = array[i];\n //now for pointer j, which is always one ahead of pointer i\n\tfor (let j = i + 1; j < array.length; j++) {\n //setting varialbe for wherever the pointer is at the given time\n const secondNum = array[j];\n //if the firstnum and secondnum equal the target sum\n\tif (firstNum + secondNum === targetSum) {\n //return new array with the two numbers that equaled the target sum\n\t\treturn [firstNum, secondNum]\n\t\t\t}\n\t\t}\n }\n //return it!\n\treturn [];\n}", "function twoNumberSum(array, targetSum) {\n const numbers = {};\n for(const number of array){\n const potentialMatch = targetSum - number;\n if(potentialMatch in numbers){\n return [potentialMatch, number];\n } else {\n numbers[number] = true;\n }\n }\n\treturn [];\n}", "function twoSumSorted(numArray, target) {\n\n let leftIndex = 0;\n let rightIndex = numArray.length - 1;\n\n while (numArray[leftIndex] + numArray[rightIndex] !== target) {\n\n while (numArray[leftIndex] + numArray[rightIndex] < target) {\n leftIndex++;\n }\n\n while (numArray[leftIndex] + numArray[rightIndex] > target) {\n rightIndex--;\n }\n\n }\n\n return [leftIndex + 1, rightIndex + 1];\n\n // let leftIndex = 0;\n // let rightIndex = numArray.length - 1;\n // let left, right;\n //\n // do {\n //\n // left = numArray[leftIndex];\n // right = numArray[rightIndex];\n //\n // while (left + right < target) {\n // leftIndex++;\n // }\n //\n // while (left + right > target) {\n // rightIndex--;\n // }\n // } while (left + right !== target)\n //\n //\n // return [leftIndex + 1, rightIndex + 1];\n\n\n // while (numArray[numArray.length - 1] + numArray[0] > target) {\n // numArray.pop();\n // }\n //\n // let index = -1;\n //\n // do {\n // let number = numArray.shift();\n // let n = 0;\n // index++;\n //\n // while (n < numArray.length) {\n // if (numArray[n] + number === target) {\n // return [index + 1, index + 2 + n];\n // }\n // n++;\n // }\n // } while (true)\n\n\n // let n = 0;\n //\n // while (true) {\n //\n // let i = n + 1;\n //\n // while (i < numArray.length && numArray[i] < target) {\n // if (numArray[n] + numArray[i] === target) {\n // return [n, i];\n // }\n // i++;\n // }\n // n++;\n // }\n}", "function twoSum(numArray, target) {\n\n for (let i in numArray) {\n let number = numArray[i];\n let supplementIndex = numArray.indexOf(target - number);\n\n if (supplementIndex !== -1 && supplementIndex !== parseInt(i)) {\n return [parseInt(i), supplementIndex];\n }\n }\n}", "function bestSum(targetSum, numbers, memoize = {}) {\n if (targetSum in memoize) return memoize[targetSum];\n if (targetSum == 0) return [];\n if (targetSum < 0) return null;\n\n let bestResult = null;\n for (const num of numbers) {\n const remainder = targetSum - num;\n const result = bestSum(remainder, numbers, memoize);\n if (result !== null) {\n const updatedResult = result.slice();\n updatedResult.push(num);\n if (bestResult === null || updatedResult.length < bestResult.length) {\n bestResult = updatedResult;\n }\n }\n }\n\n memoize[targetSum] = bestResult;\n return bestResult;\n}", "function threeNumberSum(array, targetSum){\n array.sort((a,b) => a-b);\n const triplets = [];\n for (let i = 0; i <array.length -2; i++){\n let left = i + 1;\n let right = array.length - 1;\n while (left < right) {\n const currentSum = array[i] + array[left] + array[right];\n if (currentSum === targetSum){\n triplets.push([array[i], array[left], array[right]]);\n left++;\n right--;\n } else if (currentSum < targetSum) {\n left++;\n } else if (currentSum > targetSum) {\n right --;\n }\n }\n\n }\n return triplets;\n}", "function twoNumSum(array, targetSum){\n const nums = {};\n \n for(const num of array){\n const potentialMatch = targetSum - num;\n if(potentialMatch in nums){\n return [potentialMatch, num];\n } else {\n nums[num] = true\n }\n }\n return []\n}", "function hasTargetSum(arr, target){\n // takes an array and a target, and for all pairs of numbers\n // that equal that target, console log 'FOUND'\n for(let first=0; first < arr.length; first++){\n for(let second=0; second < arr.length; second++){\n console.log('looking at', first, second)\n if(first + second === target){\n console.log('FOUND')\n}}}}", "function possibleSums(arr, max) {\n var sums = [];\n for (var i = 0; i < arr.length; i++) {\n var num1 = arr[i];\n for (var j = i; j < arr.length; j++) {\n if (num1 + arr[j] >= max) {\n continue;\n }\n sums.push(num1 + arr[j]);\n\n }\n }\n return sums;\n}", "function bestSum(targetSum, numbers) {\n const table = Array(targetSum + 1).fill(null);\n table[0] = [];\n\n for (let i = 0; i <= targetSum; i++) {\n if (table[i] !== null) {\n for (let num of numbers) {\n const combination = [...table[i], num];\n // we should store the combination only if it is shorter than already existing\n if (!table[i + num] || table[i + num].length > combination.length) {\n table[i + num] = combination;\n }\n }\n }\n }\n return table[targetSum];\n}", "function lowestSumIndices(array, target) {\n let hash = {};\n\n let indexCounter = 0;\n array.forEach((number) => {\n let hashNumber = array[indexCounter];\n hash[hashNumber] = indexCounter;\n indexCounter ++;\n });\n\n let counter = 0;\n let answer;\n array.forEach((number) => {\n let difference = target - array[counter];\n if(hash.hasOwnProperty(difference) && hash[difference] !== counter) {\n answer = [counter, hash[difference]];\n sortedAnswer = answer.sort();\n }\n counter ++;\n });\n return sortedAnswer;\n}", "function fourSum(nums, target) {\n const result = [];\n\n nums.sort((a, b) => a - b);\n\n const findThreeSum = (firstIndex) => {\n const firstNumber = nums[firstIndex];\n for (let i = firstIndex + 1; i < nums.length - 2; i++) {\n const secondNumber = nums[i];\n const prevSecondNumber = nums[i - 1];\n\n if (i - 1 !== firstIndex && prevSecondNumber === secondNumber) continue;\n if (target > 0 && firstNumber > target) continue;\n if (target < 0 && firstNumber > 0) continue;\n\n let leftPointer = i + 1;\n let rightPointer = nums.length - 1;\n\n while (leftPointer < rightPointer) {\n const thirdNumber = nums[leftPointer];\n const prevThirdNumber = nums[leftPointer - 1];\n\n if (leftPointer - 1 !== i && prevThirdNumber === thirdNumber) {\n leftPointer++;\n continue;\n }\n\n const fourthNumber = nums[rightPointer];\n const sum = firstNumber + secondNumber + thirdNumber + fourthNumber;\n\n if (sum < target) leftPointer++;\n else if (sum > target) rightPointer--;\n else {\n leftPointer++;\n rightPointer--;\n result.push([firstNumber, secondNumber, thirdNumber, fourthNumber]);\n }\n }\n }\n };\n\n for (let i = 0; i < nums.length - 3; i++) {\n const firstNumber = nums[i];\n const prevFirstNumber = nums[i - 1];\n\n if (prevFirstNumber != null && prevFirstNumber === firstNumber) continue;\n findThreeSum(i);\n }\n\n return result;\n}", "function twoNumberSum(array, targetSum) {\n\tvar obj = {};\n\tvar result = [];\n\tfor (var i = 0; i < array.length; i++) {\n\t\tif (obj[array[i]]) {\n\t\t\tresult.push(array[i], obj[array[i]]);\n\t\t\tbreak;\n\t\t} else {\n\t\t\tobj[targetSum - array[i]] = array[i];\n\t\t}\n\t}\n\treturn result;\n}", "function twoSum(arr=[1,2,3], target = 4){\n // loop through arr\n // second loop to iterate through arr again\n // get the first loop incremental index value and sum that to the second loop incremental index value\n for(let i = 0; i < arr.length-1; i++){\n for(let j = i+1; j < arr.length; j++){\n let sum = arr[i] + arr[j];\n if(sum == target){\n return [i,j]\n } \n }\n }\n}", "function search_triplets(arr) {\n\t// TODO: Write your code here\n\t// given unsorted array, find all triplets that add up to zero, return array with all triplets that sum up to zero\n\t// sort the array first\n\t// start from both ends of the array\n\t//\n\ttriplets = [];\n\n\tlet sumTarget = 0;\n\n\tif (arr.length < 3) {\n\t\treturn triplets;\n\t}\n\n\tarr.sort((a, b) => a - b);\n\tfor (let i = 0; i < arr.length - 2; i++) {\n\t\tif (arr[i] === arr[i - 1]) continue;\n\t\tif (arr[i] > sumTarget) {\n\t\t\t//if the first target is already greater than zero and since it's increasing, there's no way to add up to zero\n\t\t\treturn triplets;\n\t\t}\n\t\tlet leftPointer = i + 1;\n\t\tlet rightPointer = arr.length - 1;\n\n\t\twhile (leftPointer < rightPointer) {\n\t\t\tif (arr[leftPointer] + arr[rightPointer] + arr[i] === sumTarget) {\n\t\t\t\ttriplets.push([ arr[leftPointer], arr[rightPointer], arr[i] ]);\n\t\t\t\twhile (arr[leftPointer] === arr[leftPointer + 1]) leftPointer++;\n\t\t\t\twhile (arr[rightPointer] === arr[rightPointer - 1]) rightPointer--;\n\t\t\t\tleftPointer++;\n\t\t\t\trightPointer--;\n\t\t\t} else if (arr[leftPointer] + arr[rightPointer] + arr[i] < sumTarget) {\n\t\t\t\tleftPointer++;\n\t\t\t} else {\n\t\t\t\trightPointer--;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn triplets;\n}", "function findSumPair(numberList, targetSum) {\n const newArray = [];\n for (let index = 0; index < numberList.length; index++) {\n if (numberList.includes(targetSum - numberList[index])) {\n newArray.push(\n numberList[index],\n numberList[numberList.indexOf(targetSum - numberList[index])]\n );\n break;\n }\n }\n return newArray.sort((a, b) => a - b);\n}", "function threeNumberSum(array, targetSum){\n let result = [];\n array.sort((a,b)=> a - b);\n \n for (let i = 0; i < array.length-2; i++) {\n for (let j = i+1; j < array.length-1; j++) {\n for (let k = j+1; k < array.length; k++) {\n let first = array[i];\n let second = array[j];\n let third = array[k];\n let sum = first + second + third;\n if (sum === targetSum && i !== j && j !== k){\n result.push([first,second,third])\n }\n }\n }\n }\n return result;\n}", "function findConsqSums(nums, targetSum) {\n // code here\n}", "function combinationSum(candidates, target) {\n let dp=[...Array(candidates.length+1)].map(d=>[...Array(target+1)].map(d=>[]))\n // dp[i][sum]= #ways to reach sum with the first i items\n\n dp[0][0]=[[]]// we can reach sum 0 with 0 items in 1 way\n for (let i = 1; i <= candidates.length; i++) {\n let ele=candidates[i-1]\n for (let s = 0; s <=target; s++) {\n if(ele<=s)\n dp[i][s-ele].forEach(d=> dp[i][s].push( [...d.concat([ele])]))\n dp[i-1][s].forEach(d=>dp[i][s].push([...d]))\n } \n }\n return dp[candidates.length][target]\n}", "function sumArray(array) {\n var highestSum = array[0];\n\n function traverseSubsetsAtIndexN (startIndex) {\n var current = array[startIndex];\n\n //single element \n if (current > highestSum) {\n highestSum = current;\n }\n\n //continguous elements\n for (var i = startIndex+1; i < array.length; i++) {\n current = current + array[i];\n if (current > highestSum) {\n highestSum = current;\n }\n }\n }\n\n for (var i = 0; i < array.length; i++) {\n traverseSubsetsAtIndexN(i);\n }\n\n return highestSum;\n}", "function Xsum() {\n\tvar collection = [1, 2, 3, 4, 5, 6, 7, 8, 9, -2, -3, -5];\n\tvar solutions = [];\n\tvar searchTemp = [];\n\tvar target = 10;\n\tcollection.sort();\n\n\tfunction xSum(collections, index) {\n\t\tif (sum(searchTemp) === target) {\n\t\t\tsolutions.push(collection.filter((item, index) => {\n\t\t\t\treturn searchTemp[index] === 1;\n\t\t\t}));\n\t\t\treturn;\n\t\t}\n\t\tif (index > collections.length - 1) {\n\t\t\treturn;\n\t\t}\n\t\tfor (let i = 0; i < 2; i++) {\n\t\t\tsearchTemp[index] = i;\n\t\t\txSum(collections, index + 1);\n\t\t}\n\t}\n\n\tfunction sum(temp) {\n\t\tif (temp.length > 0) {\n\t\t\treturn collection.filter((item, index) => {\n\t\t\t\treturn temp[index] === 1;\n\t\t\t}).reduce((acc, val) => {\n\t\t\t\treturn acc + val;\n\t\t\t}, 0);\n\t\t}\n\t\treturn undefined;\n\t}\n\n\txSum(collection, 0);\n\tconsole.log(solutions);\n}", "function bestSum(target, nums, memo={}){\n if (target in memo) return memo[target]\n if (target === 0) return []\n if (target < 0) return null\n\n let minWays = null\n\n for (let num of nums){\n const remainder = target - num,\n remainderResult = bestSum(remainder, nums, memo)\n\n if (remainderResult){\n const combination = [...remainderResult, num]\n if (!minWays || combination.length < minWays.length){\n minWays = combination\n }\n } \n }\n memo[target] = minWays\n return minWays\n}", "function findPair1(arr, target) {\n let result = [];\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] + arr[i+1] === target) {\n result.push(i, i+1)\n break;\n }\n }\n return result.join()\n}", "function twoSum(arr, target) {\n for (let outerIdx = 0; outerIdx < arr.length; outerIdx += 1) {\n for (let innerIdx = outerIdx + 1; innerIdx < arr.length; innerIdx += 1) {\n if (arr[outerIdx] + arr[innerIdx] === target) return [outerIdx, innerIdx];\n }\n }\n \n return undefined;\n}", "function minSubarrayLen(nums, target) {\n let startIndex = 0;\n let endIndex = 0;\n let sum = 0;\n let len = 0;\n\n for (let i = 0; i < nums.length; i++) {\n sum += nums[i];\n if (sum >= target) {\n endIndex = i;\n len = endIndex + 1;\n break;\n }\n }\n\n if (sum < target) {\n return 0;\n }\n\n while (endIndex < nums.length) {\n sum = sum - nums[startIndex];\n if (sum >= target) {\n startIndex++;\n len = Math.min(len, endIndex - startIndex + 1);\n } else {\n sum = sum + nums[startIndex] + nums[endIndex + 1];\n endIndex++;\n }\n }\n return len;\n}", "function threeNumberSum(array, targetSum) {\n array.sort((a,b)=>a-b); //0 (nlog n)\n //3rd+2nd=targetSum-1st\n //b+c=t-a\n let answerArray=[]\n let possibleCombos=[]\n\n \n\n for(let i=0;i<array.length-2;i++){\n let firstValue=array[i],secondValue=i+1,thirdValue=array.length-1\n \n while(secondValue<thirdValue){\n possibleCombos.push([firstValue,array[secondValue],array[thirdValue]])\n if(targetSum===firstValue+array[secondValue]+array[thirdValue]){\n answerArray.push([firstValue,array[secondValue],array[thirdValue]])\n secondValue++\n thirdValue--\n } \n else if(firstValue+array[secondValue]+array[thirdValue]>targetSum){\n thirdValue--\n }else{\n secondValue++\n }\n }\n // possibleCombos.push('done',i)\n }\n console.log(possibleCombos)\n return answerArray;\n }", "function twoSum(nums, target) {\n let visited = new Map();\n\n for (let i = 0; i < nums.length; i++) {\n let remaining = target - nums[i];\n\n if (visited.has(remaining)) {\n return [visited.get(remaining), i];\n }\n\n visited.set(nums[i], i);\n }\n}", "function largestSubarraySum(array){\n\n let target = 0;\n let reversedArray = [...array].reverse();\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n\n\tfor (let i = 0; i < array.length - 1; i++){\n const slicedArray = array.slice(i);\n const slicedReversedArray = reversedArray.slice(i);\n\n const arr1Sum = slicedArray.reduce(reducer);\n const arr2Sum = slicedReversedArray.reduce(reducer);\n\n const arr3Sum = slicedArray.slice(0, -1).reduce(reducer);\n const arr4Sum = slicedReversedArray.slice(0, -1).reduce(reducer);\n\n target < arr1Sum ? target = arr1Sum : undefined;\n target < arr2Sum ? target = arr2Sum : undefined;\n\n target < arr3Sum ? target = arr3Sum : undefined;\n target < arr4Sum ? target = arr4Sum : undefined;\n\n }\n return target;\n}", "function twoSum(numbers, target) {\r\n\tlet result = [];\r\n\tfor (let i = 0; i < numbers.length - 1; i++) {\r\n\t\tfor (let j = i + 1; j < numbers.length; j++) {\r\n\t\t\tif (numbers[i] + numbers[j] === target) {\r\n\t\t\t\tresult.push(i, j);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn result;\r\n}", "function twoSum(nums, target) {\n var result = [];\n\n for (var i = 0; i < nums.length; i++) {\n for (var j = i + 1; j < nums.length; j++) {\n if (nums[i] + nums[j] === target) {\n result.push(i);\n result.push(j);\n }\n }\n }\n return result;\n}", "function twoSum(arr = [], target = 0) {\n if (!Array.isArray(arr) || typeof target !== \"number\") {\n return undefined\n }\n\n for (let i = 0; i < arr.length; i++) {\n if (sumCheck(i, arr, target)){\n return sumCheck(i, arr, target)\n }\n }\n}", "function twoSumInSortedArr(arr, target, start, end) {\n var forward = start\n var reverse = end\n var output = {}\n \n while (forward < reverse) {\n sum = arr[forward] + arr[reverse]\n if (sum == target) {\n storeOutput(output, [arr[forward], arr[reverse]])\n //Optimizations if the current and the next num are same just skip them\n while(arr[forward] == arr[forward + 1]) forward++\n while(arr[reverse] == arr[reverse - 1]) reverse--\n forward++\n reverse--\n }\n else if (sum < target){\n forward++\n }\n else {\n reverse--\n }\n }\n \n return Object.values(output)\n}", "function findConsqSums(arr, desiredSum) {\n const sums = [];\n \n for (let i = 0; i < arr.length; ++i) {\n const consecNums = [];\n let sum = 0;\n let j = i;\n \n while (sum <= desiredSum && j < arr.length - 1) {\n if (sum + arr[j] <= desiredSum) {\n sum += arr[j];\n consecNums.push(arr[j++]);\n \n if (sum === desiredSum) {\n // without slice, future additions to consecNums\n // will be added to the already pushed consecNums via reference\n sums.push(consecNums.slice());\n }\n } else {\n break;\n }\n }\n }\n return sums;\n }", "function findSum(arr,value){\n let map = {}\n for (var i=0; i < arr.length; i++) {\n let target = value - arr[i]\n if (map[target]) {\n return [target, arr[i]]\n }\n map[arr[i]] = true\n }\n return false\n}", "function solve(startIndex, currentSum, targetSum, inputArray, trackArray, callback){\n if (currentSum === targetSum && isFunction(callback)) {\n callback(selectTrackedItems(inputArray, trackArray));\n }\n if (currentSum === Infinity) {\n currentSum = 0;\n }\n for (var i = startIndex; i < inputArray.length; i++) {\n var currentItem = inputArray[i];\n var prevItem = inputArray[i-1];\n if (currentSum + currentItem > targetSum) {\n continue;\n }\n if (i > 0 && currentItem === prevItem && ! trackArray[i-1]) {\n continue; \n }\n trackArray[i] = true;\n solve(i + 1, currentSum + currentItem, targetSum, inputArray, trackArray, callback);\n trackArray[i] = false;\n } \n }", "function twoSum(nums, target) {\n // 0.\n let hash = {};\n\n // 1.\n for (let i = 0; i < nums.length; i++) {\n hash[nums[i]] = i;\n }\n\n // 2.\n for (let i = 0; i < nums.length; i++) {\n var n = target - nums[i];\n // 3.\n if (hash[n] !== undefined && hash[n] != i) {\n return [hash[n], i];\n }\n }\n return [];\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 bestSum(targetSum, numbers, memo = {}) {\n // Time complexity O(m^2*n)\n // Space complexity O(m^2)\n if (targetSum in memo) return memo[targetSum];\n if (targetSum === 0) return [];\n if (targetSum < 0) return null;\n let shortestCombination = null;\n\n for (const num of numbers) {\n const remainder = targetSum - num;\n const remainderResult = bestSum(remainder, numbers, memo);\n if (remainderResult !== null) {\n const combination = [...remainderResult, num];\n if (\n shortestCombination === null ||\n combination.length < shortestCombination.length\n )\n shortestCombination = combination;\n }\n }\n return (memo[targetSum] = shortestCombination && shortestCombination);\n}", "function sumOfSums(arr) {\n var reducer = (sum, currentEl) => sum + currentEl;\n var newArrSum = 0;\n for (var i = 0; i < arr.length; i++) {\n var currentArr = arr.slice(0, i+1);\n newArrSum += currentArr.reduce(reducer);\n };\n return newArrSum;\n}", "function canSum(targetSum, numbers) {\n const table = new Array(targetSum + 1).fill(false);\n table[0] = true; \n\n for (let i = 0; i <= targetSum; i++) {\n if (table[i] === true) {\n for (let num of numbers) {\n table[i + num] = true;\n // console.log('i', i, table)\n }\n }\n }\n return table[targetSum];\n}", "function canSumTeachers(targetSum, numArry) {\n\n const targetSumArr = Array(targetSum + 1).fill(false);\n targetSumArr[0] = true;\n\n // making the value of the targetSumArr true if that exists in numArr\n for(let i = 1; i <= targetSumArr.length; i++) {\n for(let j = 0; j < numArry.length; j++) {\n if(numArry[j] === i) {\n targetSumArr[i] = true; \n break; \n } \n }\n }\n \n for(let i = 0; i < targetSumArr.length; i++) {\n if(targetSumArr[i] === true) {\n for(let j = 0; j < numArry.length; j++) {\n if(targetSumArr[i + numArry[j]] !== undefined) {\n targetSumArr[i + numArry[j]] = true; \n }\n }\n } \n }\n\n return targetSumArr[targetSumArr.length - 1];\n}", "function twoSum(nums, target) {\n const myArray = new Array(nums.length);\n for (let i = 0; i <= nums.length; i++) {\n let num = nums[i];\n if (myArray[num] !== undefined) {\n return [myArray[num], i];\n } else {\n myArray[target - num] = i;\n }\n }\n}", "function bestSum(targetSum, numbers, memo = {}) {\n if (targetSum in memo) return memo[targetSum];\n if (targetSum === 0) return [];\n if (targetSum < 0) return null;\n let shortest = null;\n\n for (let num of numbers) {\n const remainder = targetSum - num;\n let remainderResult = bestSum(remainder, numbers, memo);\n if (remainderResult !== null) {\n let combination = [...remainderResult, num];\n if (shortest === null || combination.length < shortest.length) {\n shortest = combination;\n }\n }\n }\n memo[targetSum] = shortest;\n return memo[targetSum];\n}", "function twoSum(nums, target) {\n // add each num to a map with its index\n // for each one determine if its counterpart exists\n // ifso return those two numbers\n\n const numMap = new Map();\n\n for (index in nums) {\n const value = nums[index];\n const inverseNumber = target - value;\n\n if (numMap.has(value)) {\n numMap.set(value, numMap.get(value).concat(index));\n } else {\n numMap.set(value, [index]);\n }\n\n if (numMap.has(inverseNumber)) {\n if (\n (inverseNumber == value && numMap.get(value).length >= 2) ||\n inverseNumber != value\n ) {\n return [numMap.get(inverseNumber)[0], index];\n }\n }\n }\n}", "function twoSum(nums, target) {\n let arr = [];\n for(let i = 0; i < nums.length; i++){\n for(let j = i + 1; j < nums.length; j++){\n if(nums[i] + nums[j] === target){\n arr.push(i, j);\n }\n }\n }\n return arr;\n}", "function findSum(array){\n var l = array.length;\n var sum = 0\n //initialize to negative number for first condition of sum > bestSum to always hold true\n var bestSum = -1;\n var length = 0;\n var bestLength = 0;\n\n for (i=0; i<l; i++){\n //only store as bestsum if sum + new element >= 0\n if (sum + array[i] >= 0) {\n sum += array[i]\n length++;\n } else {\n length = 1;\n sum = array[i]\n }\n if (sum > bestSum){\n //initially bestSum = 0 & bestLength = 0\n bestSum = sum;\n bestLength = length;\n } else {\n length = 0;\n sum = 0;\n }\n }\n console.log(bestSum + \" of array length \" + bestLength);\n}", "function indicesArray(arr, target) {\n let indices = [-1,-1];\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === target) {\n indices[0]=i;\n indices[1]=j;\n return indices;\n }\n }\n }\n return indices;\n}", "function findPairsWiithMatchingSum(array, sum) {\n let start = 0;\n let end = array.length - 1;\n while (start < end) {\n let currentSum = array[start] + array[end];\n // console.log(`currentSum = ${currentSum}, start = ${start}, end = ${end}`);\n if (currentSum === sum) {\n return true;\n } else if ( currentSum < sum ) {\n start++;\n } else {\n end--;\n }\n }\n return false;\n}", "function sum(array){\n let max = 0;\n \n for(let i=0; i < array.length; i++){\n let total =array[i];\n for(let j=i+1; j<array.length; j++){\n total += array[j];\n if (total>max){\n max =total;\n }\n \n }\n \n }\n return max;\n}", "function combinationSum(candidates, target) {\n let dp=[...Array(candidates.length+1)].map(d=>[...Array(target+1)].map(d=>0))\n // dp[sum][i]= #ways to reach sum with the first i items\n\n dp[0][0]=1// we can reach sum 0 with 0 items in 1 way\n for (let i = 1; i <= candidates.length; i++) {\n let ele=candidates[i-1]\n for (let s = 0; s <=target; s++) {\n if(ele<=s){\n dp[i][s]+=dp[i][s-ele] //this line allows repetition,\n // if it was +=dp[i-1][s-ele], it would mean that i m only picking an element once\n }\n dp[i][s]+=dp[i-1][s]\n \n } \n }\n\n dp.forEach(d=>console.log(d+''))\n let result=[...Array(dp[candidates.length][target])].map(d=>[])\n //reconstruction ezpz only through dp table\n let recursion=(i,j,left)=>{\n if(i<=0||j<=0||dp[i][j]==0)return\n let num=dp[i][j]-dp[i-1][j]\n if(num>0){\n for (let ii = left; ii <left+num; ii++) \n result[ii].push(candidates[i-1]) \n recursion(i,j-candidates[i-1],left)\n }\n recursion(i-1,j,left+num)\n }\n recursion(candidates.length,target,0)\n return result\n}", "function sumArr(nums) {\n // algorithm here\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 howSum(targetSum, numbers, memo = {}) {\n\tif (targetSum in memo) return memo[targetSum]\n\tif (targetSum === 0) return []\n\tif (targetSum < 0) return null\n\n\tfor (let num of numbers) {\n\t\tconst remainder = targetSum - num\n\t\tconst remainderResult = howSum(remainder, numbers, memo)\n\t\tif (remainderResult !== null) {\n\t\t\tmemo[targetSum] = [...remainderResult, num]\n\t\t\treturn memo[targetSum]\n\t\t}\n\t}\n\n\tmemo[targetSum] = null\n\treturn null\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 s(numbers, target) {\n let l = 0;\n let r = numbers.length - 1;\n while (l < r) {\n if (numbers[l] + numbers[r] === target) {\n return [l + 1, r + 1];\n } else if (numbers[l] + numbers[r] > target) {\n r--;\n } else {\n l++;\n }\n }\n\n // const map = {};\n // for (let i = 0; i < numbers.length; i++) {\n // const complement = target - numbers[i];\n // if (complement in map) return [i, map[complement]];\n // map[numbers[i]] = i;\n // }\n // return null;\n\n // for (let i = 0; i < numbers.length; i++) {\n // for (let j = i + 1; j < numbers.length; j++) {\n // if (numbers[i] + numbers[j] === target) return [i, j];\n // }\n // }\n}", "function maxSum(arr){\n if (arr.length === 1){\n return arr[0];\n }\n let sum = 0;\n let tempArr = arr;\n for (let j =0; j< arr.length; j++){\n let temp = 0;\n for (let i=0;i<tempArr.length;i++){\n temp += tempArr[i];\n if (temp > sum){\n sum = temp;\n }\n }\n tempArr.shift();\n }\n return sum;\n}", "function twoSum(numsArr, target) {\n // more basic code\n\n // for (let i = 0; i < numsArr.length; i++) {\n\n // for (let j = 0; j < numsArr.length; j++) {\n // if(i != j){\n // if (numsArr[i] + numsArr[j] == target) {\n // return [i, j];\n // }\n // }\n // }\n // }\n\n // faster code\n var sumPartners = {};\n for(var i = 0; i < nums.length; i++) {\n sumPartners[target - nums[i]] = i;\n if (sumPartners[nums[i]] && sumPartners[nums[i]] !== i) {\n return [sumPartners[nums[i]], i];\n }\n }\n \n for(var j = 0; j < nums.length; j++) {\n if (sumPartners[nums[j]] && sumPartners[nums[j]] !== j) {\n return [j, sumPartners[nums[j]]];\n }\n }\n}", "function bestSum(targetSum, numbers, memo = {}) {\n if (targetSum in memo) return memo[targetSum];\n\n if (targetSum === 0) return [];\n if (targetSum < 0) return null;\n\n let shortestCombination = null;\n\n for (let num of numbers) {\n const remainder = targetSum - num;\n const remainderCombination = bestSum(remainder, numbers, memo);\n if (remainderCombination !== null) {\n const combination = [...remainderCombination, num];\n if (shortestCombination === null || combination.length < shortestCombination.length) {\n shortestCombination = combination;\n }\n }\n }\n memo[targetSum] = shortestCombination;\n return shortestCombination;\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 twoSumm(numbers, target) {\n const myHash = {};\n let output = []\n for (i = 0; i < numbers.length; i++) {\n const control = target - numbers[i];\n if (myHash.hasOwnProperty(numbers[i])) {\n myHash[numbers[i]].push(i);\n } else {\n myHash[numbers[i]] = [i];\n }\n if (myHash.hasOwnProperty(control) && i != myHash[control][0]) {\n output = [myHash[control][0], i];\n return output\n }\n }\n return [];\n}", "function three(nums, target) {\n // store count of how many times a triplet sum is less than target number\n // sort array\n // iterate through array stopping 2 numbers before end\n}", "function sumArray (array) {\n let maxSum = array[0]\n let currentSum = 0\n array.forEach((x) => {\n currentSum += x\n maxSum = Math.max(currentSum, maxSum)\n if (currentSum < 0) {\n currentSum = 0\n }\n })\n return maxSum\n}", "function findPairForSum(integers, target) {\n var pair;\n for (let i = 0; i < integers.length; i++) { // create one loop that counts through the nums\n for (let j = 0; j < integers.length; j++) { // create another \"inner\" loop that counts through the nums at the same time\n var num1 = integers[i]; // for each num we assign in the outer loop, we assign all the nums for the inner\n var num2 = integers[j];\n if (num1 !== num2 && num1 + num2 === target) { // check to see that they're not the same num, and that they add up to sum\n pair = [num1, num2]; // assign the sum to the pair array; note: this will only return the last pair\n }\n }\n }\n return pair;\n}", "function TwoSum(arr) {\n var target = arr[0];\n var temp = [];\n var result = [];\n for (var i = 1; i < arr.length; i++) {\n for (var j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === target) {\n temp.push(arr[i], arr[j]);\n }\n }\n result.push(temp);\n temp = [];\n }\n var final = result.filter(function(el) {\n return el.length !== 0;\n });\n return final.length === 0 ? -1 : final.join(\" \");\n}", "function maxSum(arr) {\n let highestSum = 0;\n let currentSum = 0;\n for (let startIndex = 0; startIndex < arr.length; startIndex++) {\n currentSum = 0;\n for (let i = startIndex; i < arr.length; i++) {\n currentSum = currentSum + arr[i];\n if (currentSum > highestSum) {\n highestSum = currentSum;\n }\n }\n //console.log(`current highest sum is ${highestSum}`);\n }\n return highestSum;\n}", "function smaller(nums, target) {\n let count = 0;\n // sort array\n nums.sort((a, b) => a - b);\n if (nums.length === 3) {\n let sum = nums[0] + nums[1] + nums[2];\n return sum < target ? 1 : 0;\n }\n\n // loop over sorted array with 2 other pointers\n // two pointers on opposite end of array move accordingly if it's less than or more\n for (let i = 0; i < nums.length - 3; i++) {\n let left = i + 1;\n let right = nums.length - 1;\n while (left < right) {\n let sum = nums[i] + nums[left] + nums[right];\n if (sum < target) {\n count++;\n right--;\n } else left++;\n }\n }\n return count;\n}" ]
[ "0.78843", "0.7630242", "0.75881845", "0.75753736", "0.7533976", "0.7524009", "0.7515013", "0.7473134", "0.7455652", "0.74376756", "0.740176", "0.7380903", "0.73694026", "0.73657644", "0.732809", "0.72773683", "0.727665", "0.7271092", "0.7263421", "0.72571373", "0.722507", "0.72224784", "0.7215049", "0.72114235", "0.7188313", "0.7167289", "0.7144784", "0.71352327", "0.7100126", "0.7099443", "0.7079647", "0.70658183", "0.7063718", "0.7063642", "0.7059067", "0.7038298", "0.69970596", "0.69901353", "0.69860524", "0.6985604", "0.6982186", "0.69803953", "0.69799036", "0.6972938", "0.69175035", "0.69087815", "0.68675196", "0.6824304", "0.6808886", "0.68050873", "0.6799401", "0.6791355", "0.67896414", "0.6779757", "0.67793775", "0.6762101", "0.6762016", "0.6757517", "0.6755859", "0.67527485", "0.674048", "0.67401665", "0.67238027", "0.67166966", "0.66874164", "0.6676796", "0.6669123", "0.666902", "0.66669124", "0.66566926", "0.66559225", "0.66518563", "0.66260463", "0.6618847", "0.66167665", "0.6607055", "0.66038257", "0.65995836", "0.65941083", "0.6593248", "0.6586698", "0.6586526", "0.65801156", "0.65757847", "0.65688485", "0.6558104", "0.6556058", "0.6552932", "0.6544583", "0.6529425", "0.6519314", "0.6496976", "0.64941686", "0.6463032", "0.6457027", "0.6443396", "0.6443173", "0.643726", "0.6423889", "0.64195144" ]
0.72779304
15
Time: O(n) Space: O(n)
function twoNumberSum(array, targetSum) { var obj = {}; var result = []; for (var i = 0; i < array.length; i++) { if (obj[array[i]]) { result.push(array[i], obj[array[i]]); break; } else { obj[targetSum - array[i]] = array[i]; } } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findUniqueValues(arr){ //O(n) // You wrote this\r\n let uniqueVal = []; \r\n let left = 0; \r\n let right = arr.length - 1;\r\n while(left < right){ // O(n)\r\n if(!(uniqueVal.includes(arr[left]))){\r\n uniqueVal.push(arr[left]);\r\n left++;\r\n } else if(!(uniqueVal.includes(arr[right]))){\r\n uniqueVal.push(arr[right]);\r\n right--;\r\n } else if(uniqueVal.includes(arr[left])){\r\n left++;\r\n } else {\r\n right--;\r\n }\r\n }\r\n return uniqueVal.length\r\n}", "function boooo(n) {\n for (let i = 0; i < n; i++) { // O(1)\n console.log('booooo');\n }\n}", "function compressBoxes(input){\n for(var i = 0; i<=100; i++){\n console.log('hi'); // O(100)\n }\n\n input.forEach(function(box){\n console.log(box); // O(n)\n })\n\n input.forEach(function(box){\n console.log(box); //O(n)\n })\n }", "function naiveSumZero(arr){ // O(n^2)\r\n for(let i = 0; i < arr.length; i++){ // O(n)\r\n for(let j = i + 1; j < arr.length; j++){ // nested O(n)\r\n if(arr[i] + arr[j] === 0){\r\n return [arr[i], arr[j]];\r\n }\r\n }\r\n }\r\n}", "function example2(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function fastPermutatedNeedle(needle, haystack) {\n let result = []\n let length = needle.length\n let needleObject = hashTableString(needle)\n for (let i = 0; i < haystack.length - length + 1; i++) {\n if (!needleObject[haystack[i]]) {\n continue\n }\n let needleObjectCopy = shallowCopyObject(needleObject)\n let count = length\n for (let j = i; j < i + needle.length; j++) {\n if (!needleObjectCopy[haystack[j]] || needleObjectCopy[haystack[j] < 1]) {\n break\n }\n needleObjectCopy[haystack[j]]--\n count--\n }\n if (count === 0) {\n result.push(i)\n }\n }\n return result\n}", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n)\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n)\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function funChallenge(input) {\n let a = 10; // O(1)\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) {\n // O(n)\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1)\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) a.a = aAa;N\n a a (aAa) a.a = a.a == a ? a : a.a + a;N\n }N\n }", "function solution(A) {\n // write your code in JavaScript (Node.js 6.4.0)\n \n N = 100001\n var bitmap = Array(N).fill(false);\n for (var i = 0; i < A.length; i ++) {\n if (A[i] > 0 && A[i] <= N) {\n bitmap[A[i]] = true;\n }\n }\n \n for(var j = 1; j <= N; j++) {\n if (!bitmap[j]) {\n return j;\n }\n }\n \n return N + 1;\n}", "function naiveSame(arr1, arr2){ // O(n^2)\r\n if(arr1.length !== arr2.length){\r\n return false;\r\n }\r\n for(let i = 0; i < arr1.length; i++){ // O(n)\r\n let correctIdx = arr2.indexOf(arr1[i] ** 2) // nested O(n)\r\n if(correctIdx === -1){\r\n return false;\r\n }\r\n arr2.splice(correctIdx, 1)\r\n }\r\n return true;\r\n}", "function funChallenge(input) {\n let a = 10; // O(1)\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) {\n // O(n) --> number of inputs\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1)\n}", "function anotherFunChallenge(input) {\n let a = 5; // O(1)\n let b = 10; // O(1)\n let c = 50; // O(1)\n for (let i = 0; i < input; i++) {\n // O(n) --> numbers of inputs\n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n }\n for (let j = 0; j < input; j++) {\n // O(n) --> numbers of inputs\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; // O(1)\n}", "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function n(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function anotherFunChallenge(input) {\n let a = 5; //O(1)\n let b = 10; //O(1)\n let c = 50; //O(1)\n for (let i = 0; i < input; i++) { //* \n let x = i + 1; // O(n)\n let y = i + 2; // O(n)\n let z = i + 3; // O(n)\n\n }\n for (let j = 0; j < input; j++) { //*\n let p = j * 2; // O(n)\n let q = j * 2; // O(n)\n }\n let whoAmI = \"I don't know\"; //O(1)\n}", "function twoSum(arr, n) {\n const cache = new Set();\n for (let i = 0; i < arr.length; i++) {\n if (cache.has(n - arr[i])) {\n return true;\n }\n cache.add(arr[i]);\n }\n return false;\n}", "function findDuplicate(arr) {\n \n \n}", "function countInverse(array) {\n\n split(0, array.length - 1);\n // console.log(\"Result:\" + array);\n //console.log(count);\n //console.log(perf + ' ' + array.length * Math.log(array.length));\n\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 }\n\n function merge(left, middle, right) {\n //console.log(\"Merge\" + left + ',' + middle + ',' + right);\n var leftArr = array.slice(left, middle + 1);\n var rightArr = array.slice(middle + 1, right + 1);\n // console.log(leftArr);\n // console.log(rightArr);\n while (leftArr.length > 0 && rightArr.length > 0) {\n perf++;\n if (leftArr[0] < rightArr[0]) {\n array[left++] = leftArr.shift();\n } else {\n count = (count+leftArr.length);\n array[left++] = rightArr.shift();\n }\n }\n leftArr.concat(rightArr);\n while (leftArr.length > 0) {\n array[left++] = leftArr.shift();\n }\n }\n return count;\n }", "function arrayManipulation(n, queries) {\n const acc = {};\n for (const [a, b, k] of queries) {\n acc[a] = (acc[a] || 0) + k;\n acc[b+1] = (acc[b+1] || 0) - k;\n } \n let last = 0\n let m = 0\n for (let i=0; i<n+1; i++) {\n const curr = acc[i] || 0;\n last = last + curr;\n if (last > m) {\n m = last;\n }\n }\n return m\n}", "function funChallenge(input) {\n let a = 10; // O(1) Some people don't count assignments\n a = 50 + 3; // O(1)\n\n for (let i = 0; i < input.length; i++) { // O(n) --> n is the input\n anotherFunction(); // O(n)\n let stranger = true; // O(n)\n a++; // O(n)\n }\n return a; // O(1) another thing some people don't count\n}", "function solution(a) { // O(N)\n let max1; // O(1)\n let max2; // O(1)\n\n for (let value of a) { // O(N)\n if (!max1) { // O(1)\n max1 = value; // O(1)\n } else if (value > max1) { // O(1)\n max2 = max1; // O(1)\n max1 = value; // O(1)\n } else if (value < max1) { // O(1)\n if (!max2) { // O(1)\n max2 = value; // O(1)\n } else if (value > max2) { // O(1)\n max2 = value; // O(1)\n }\n }\n }\n\n return max2; // O(1)\n}", "function version2(array){ // O(n)\n let map = {}\n for(let i=0; i< array.length; i++){\n if(map[array[i]] !== undefined ){ // if(0) gives undefined due to type coercion \n return array[i]\n }else{\n map[array[i]] = i\n }\n }\n console.log(map)\n return undefined\n}", "a (a a = 0; a < a.a; ++a) {N\n a a = a[a];N\n a (a.a != a) a.a += a;N\n a (a.a == a) {N\n a a = aAaAaAa(a, a.a);N\n a (!a) {N\n a.a = a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n } a {N\n a.a += a;N\n a (aAa) (a || (a = [])).a(a);N\n }N\n }", "function insertion_sort(arr) {\r\n var start_time = performance.now();\r\n sorted = arr;\r\n\r\n for(var i = 1;i<sorted.length;i++){\r\n for(var y = 0; y<i; y++){\r\n if(sorted[i] < sorted[y]){\r\n temp = sorted[y];\r\n sorted[y] = arr[i];\r\n arr[i] = temp;\r\n }\r\n }\r\n }\r\n var finish_time = performance.now();\r\n var execution_time = finish_time - start_time;\r\n document.getElementById(\"time_spent\").innerHTML = execution_time;\r\n return sorted;\r\n}", "function solve(input) {\n let elves = [];\n for (let i = 0; i < input; i++) {\n elves.push(i + 1);\n }\n\n function getNextIndex(index) {\n let next = (elves.length / 2) + index;\n if (next >= elves.length) {\n next -= elves.length\n }\n if (!_.isInteger(next)) {\n next = _.floor(next);\n }\n return next;\n }\n\n let current = elves[0];\n // let currentTime = new Date().getTime();\n while (elves.length > 1) {\n let index = _.indexOf(elves, current);\n let nextIndex = getNextIndex(index);\n // if (index % 100 === 0) {\n // let newTime = new Date().getTime();\n // console.log(index, elves[index], elves[nextIndex], elves.length, newTime - currentTime);\n // currentTime = newTime;\n // }\n elves[nextIndex] = 0;\n elves = _.compact(elves);\n let nextCurrent = _.indexOf(elves, current) + 1;\n if (nextCurrent >= elves.length) {\n nextCurrent = 0;\n }\n current = elves[nextCurrent];\n }\n console.log(input, elves[0]);\n}", "function A(n,t){for(;t+1<n.length;t++)n[t]=n[t+1];n.pop()}", "function insertSort(arr) {\n console.time('insertSort');\n for(let i = 1; i < arr.length; i++) {\n let temp = arr[i];\n\n let j = i;\n for(j = i; j > 0; j--) {\n if(arr[j - 1] < temp) {\n break;\n } else {\n arr[j] = arr[j - 1];\n }\n }\n arr[j] = temp;\n \n\n // while ( (j > 0) && (arr[j - 1] > temp) ) {\n // arr[j] = arr[j - 1];\n // j--;\n // c++;\n //\n // }\n\n // arr[j] = temp;\n\n }\n\n console.timeEnd('insertSort');\n return arr;\n}", "function printFirstItemThenFirstHalfThenSayHi100Times(items) {\n console.log(items[0]); // O(1)\n\n let middleIndex = Math.floor(items.length / 2); // O(1)\n let index = 0; // O(1)\n while (index < middleIndex) {\n console.log(items[index]); // O(n/2)\n index++; // O(n/2)\n }\n\n for (let i = 0; i < 100; i++) {\n // O(100)\n console.log('Hi'); // O(100)\n }\n}", "function solution(a) {\r\n // write your code in JavaScript (Node.js 0.12)\r\n var i, l=a.length-1;\r\n var arr=[];\r\n do{ \r\n arr[a[l]-1] = a[l];\r\n \r\n l--; \r\n if(l===0)\r\n for(j=0;j<arr.length;j++)\r\n if(!arr[j])\r\n return j+1;\r\n \r\n }while(l>=0)\r\n}", "_hash(key) { //O(1)\n let hash = 0;\n for (let i = 0; i < key.length; i++) {//grab the length of 'grapes' (key)\n hash = (hash + key.charCodeAt(i) * i) % this.data.length;\n //charCodeAt(): returns an integer between 0 & 65535 \n //this.data.length: ensures the size stays between 0-50 (memory space for hash table)\n console.log(hash); // 0 14 8 44 48 23\n }\n return hash;\n }", "function compressItems(items) {\n console.log(items[0]); // O(1) --> Constant time\n}", "function O(t, e, n) {\n return t.length === e.length && t.every((function(t, r) {\n return n(t, e[r]);\n }));\n}", "function reoccurring(arr){\n\tfor(let i = 0; i < arr.length; i++){\n\t\tfor(j = i+1; j < arr.length; j++){\n\t\t\tif(arr[i] === arr[j]){\n\t\t\t\treturn arr[i]\n\t\t\t}\n\t\t}\n\t}\n\treturn undefined\n} // O(n^2)", "function StairCase(n, arr) {\n\tvar cache = [1];\n\tfor (let i=1; i< n+1; i++) {\n\t\tlet ans = getSumOfPossiblities(i, arr, cache);\n\t\tcache[i] = ans;\n\t}\n\t\n\treturn cache[n];\n}", "function removeDuplicatesInPlace(arr, n)\n{\n if (n===0 || n===1)\n {\n return n\n }\n\n let temp = new Array(n)\n\n let j = 0\n\n for (let i = 0; i < n - 1; i++)\n {\n if (arr[i] !== arr[i+1]) {\n temp[j++] = arr[i]\n }\n\n }\n temp[j++] = arr[n-1];\n\n for(let k = 0; k < j; k++)\n {\n arr[k] = temp[k]\n }\n\n return j\n}", "function same(arr1, arr2) {\n if (arr1.length !== arr2.length) return false; // O(1)\n\n for (let i = 0; i < arr1.length; i++) { // O(N)\n let correctIdx = arr2.indexOf(arr1[i] ** 2); // O(N)\n if (correctIdx === -1) return false; // O(1)\n arr2.splice(correctIdx, 1); // O(N)\n }\n return true;\n }", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "function n(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}", "lookupAndMarkFound() {\n let m=0;\n for (let n=1; n<=N; n++) {\n for (let i=0;i<N; i++) {\n let fr = this.findInRow(n,i);\n if (fr.length == 1) {\n this.markAndRemove(n,fr[0].i, fr[0].j);\n m++;\n }\n let fc = this.findInColumn(n,i);\n if (fc.length == 1) {\n this.markAndRemove(n,fc[0].i, fc[0].j);\n m++;\n }\n let fb = this.findInBlock(n,i);\n if (fb.length == 1) {\n this.markAndRemove(n,fb[0].i, fb[0].j);\n m++;\n }\n }\n }\n return m;\n }", "function find_quad (ary, s) {\n\n\tif(ary.length < 4) {\n\n\t\treturn null;\n\t}\n\telse if(ary.length === 4) {\n\n\t\tif(ary[0] + ary[1] + ary[2] + ary[3] === s) return ary;\n\t}\n\n\tvar hashTable = {}; //declare a hashtable \n\tvar tempSum = 0;\n\n\tfor(var i = 0; i < ary.length; i++) {\n\n\t\tfor(var j = i + 1; j < ary.length; j++) {\n\n\t\t\ttempSum = ary[i] + ary[j];\n\t\t\tif(!hashTable[tempSum]) {\n\t\t\t\thashTable[tempSum] = [];\n\t\t\t}\n\t\t\thashTable[tempSum].push([i , j]);\n\t\t}\n\t}\n\n\tconsole.log(hashTable);\n\n\tvar arrayA = [];\n\tvar arrayB = [];\n\tvar result = [];\n\n\tfor(key in hashTable) {\n\n\t\tif(hashTable[s - key]) {\n\n\t\t\tarrayA = hashTable[key];\n\t\t\tarrayB = hashTable[s - key];\n\t\t\tresult = checkUniqueness(arrayA, arrayB);\n\t\t\tif(result) {\n\n\t\t\t\treturn result;\n\t\t\t}\n\n\t\t}\n\t}\n\n\treturn null;\n}", "function uniq_fast(a) {\n\tlet seen = {};\n\tlet out = [];\n\tlet len = a.length;\n\tlet j = 0;\n\tfor(let i = 0; i < len; i++) {\n\t\tlet item = a[i];\n\t\tif(seen[item] !== 1) {\n\t\tseen[item] = 1;\n\t\tout[j++] = item;\n\t\t}\n\t}\n\treturn out;\n}", "function aVeryBigSum(ar) {\n \n}", "function sumZeroForMethod(arr) {\n let i = 0;\n for (let j = 0; j < arr.length; j++) {\n if (arr[i] !== arr[j]) {\n i++;\n arr[i] = arr[j];\n }\n }\n\n return i + 1;\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n // [1,0] . [0,1]\n let f = A[0];\n let count = 0;\n let getOCount = getCount(A, 1);\n let getZCount = getCount(A, 0);\n console.log(getOCount + \" \" + getZCount);\n if (getOCount >= getZCount) {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i] === 1) {\n A[i + 1] = 0;\n } else {\n A[i + 1] = 1;\n }\n count++;\n }\n }\n } else {\n for (let i = 0; i < A.length - 1; ++i) {\n if (A[i] === A[i + 1]) {\n if (A[i + 1] === 1) {\n A[i] = 0;\n } else {\n A[i] = 1;\n }\n count++;\n }\n }\n }\n return count;\n}", "function n(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}", "function performantSmallest(arr, n) {\n let res =[]\n do{\n let x = Math.min(...arr)\n res.push([x,arr.indexOf(x)])\n arr.splice(arr.indexOf(x),1)\n }\n while (res.length < n)\n res.sort((a,b)=>a[1]-b[1])\n return res.map(e=>e[0])\n }", "function $cf838c15c8b009ba$export$2f3eb4d6eb4663c9(key) {\n const getKey = typeof key === \"string\" ? (value)=>value && typeof value === \"object\" && value[key] !== undefined ? value[key] : value : null;\n const create = (iterating)=>{\n let i = 0, j, len, nOthers, args, result, memory;\n return function() {\n if (!args) {\n args = [].sort.call(arguments, (a, b)=>a.length - b.length);\n nOthers = args.length - 1;\n result = [];\n memory = new Map();\n i = 0;\n j = 0;\n }\n for(; i <= nOthers; i++){\n //j = j===-1 ? arguments[i].length : j;\n const len = args[i].length;\n while(j < len){\n const elem = args[i][j], key = getKey ? getKey(elem) : elem;\n if (memory.get(key) === i - 1) {\n if (i === nOthers) {\n result[result.length] = elem;\n memory.set(key, 0);\n if (iterating) {\n j++;\n return {\n value: elem\n };\n }\n } else memory.set(key, i);\n } else if (i === 0) memory.set(key, 0);\n j++;\n }\n j = 0;\n }\n args = null;\n return iterating ? {\n done: true\n } : result;\n };\n };\n const intersect = create();\n intersect.iterable = function(...args) {\n const intersect = create(true);\n let started;\n return {\n next () {\n if (started) return intersect();\n started = true;\n return intersect(...args);\n },\n [Symbol.iterator] () {\n return this;\n }\n };\n };\n return intersect;\n}", "function searchNaive(arr, n){ // O(n) Linear Search\r\n for(let i = 0; i < arr.length; i++){\r\n if(arr[i] === n){\r\n return i;\r\n } \r\n }\r\n return -1;\r\n}", "function ps(t) {\n var e = O(t);\n return O(O(e.bh).persistence).Uo();\n}", "function countUniqueValues2(arr){\n if(arr.length < 2){\n return arr.length;\n }\n let i=0\n for(let j=1; j<arr.length; j++){\n if(arr[i]!==arr[j]){\n arr[++i] = arr[j]\n }\n }\n return i+1;\n}", "function slow_solution(arr){\n let resultsArr = []\n for(let i=0; i<arr.length;i++){\n resultsArr[i] = 0;\n for(let j=0; j<arr.length; j++){\n if(arr[i] % arr[j] !== 0){\n resultsArr[i] +=1;\n // console.log('|i:', i, '| j:', j,'| arr:', arr[i], '| res:',resultsArr[i])\n }\n }\n }\n return resultsArr\n}", "function O(t, n) {\n return void 0 !== t ? t : n;\n}", "function countUniqueValues2(arr) {\n var i = 0; \n for (var j = 1; j < arr.length; j++){\n if(arr[i] !== arr[j]) {\n i++; \n arr[i] = arr[j]\n }\n console.log(i,j); \n }\n\n}", "function runningTime(arr) {\n let arrLen = arr.length;\n if (arrLen === 1) {\n return 0;\n }\n let numShift = 0;\n for (let x = 1; x < arrLen; x++) {\n let originIndex = x;\n let targetIndex = x;\n let currShift = 0;\n for (let y = x; y >= 0; y--) {\n if (arr[y] > arr[originIndex]) {\n targetIndex = y;\n currShift = originIndex - targetIndex;\n }\n }\n // if targeted index moved\n if (originIndex != targetIndex) {\n numShift += currShift;\n // remove value from array\n let valToInsert = arr.splice(originIndex, 1)[0];\n arr.splice(targetIndex, 0, valToInsert);\n }\n // console.log(arr.join(' '));\n }\n return numShift;\n}", "function solution(A) {\n // write your code in JavaScript (ECMA-262, 5th edition)\n function compareNumbers(a, b)\n {\n return a - b;\n }\n var rad = [], sorted = A.splice(0).sort(compareNumbers);\n for(var i=0; i<A.length; A++){\n \n }\n \n return 11 > 10000000 ? -1 : 11;\n}", "function o(e,t){if(e===t)return 0\nfor(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i]\nbreak}return r<n?-1:n<r?1:0}", "function e(t,n){for(;n+1<t.length;n++)t[n]=t[n+1];t.pop()}", "function firstRecurringCharacter(input) {\n for (let i = 0; i < input.length; i++) {\n for (let j = i + 1; j < input.length; j++) {\n if(input[i] === input[j]) {\n return input[i];\n }\n }\n }\n return undefined\n}//O(n^2) with Space Complexicity O(1)", "insertionSort(arr){\n \n var starttime = process.hrtime();\n\n for (let i = 1; i < arr.length; i++) {\n var key = arr[i];\n var j = i-1;\n while(j>=0 && arr[j]>key){\n arr[j+1] = arr[j];\n j--;\n }\n arr[j+1]= key;\n }\n var endtime = process.hrtime();\n var et = this.elapsedTime(starttime, endtime);\n console.log('Elapsed time for Insertion sort is : '+et, 'milisecod');\n return arr;\n }", "function a(e,t){if(e===t){return 0}var r=e.length;var i=t.length;for(var n=0,a=Math.min(r,i);n<a;++n){if(e[n]!==t[n]){r=e[n];i=t[n];break}}if(r<i){return-1}if(i<r){return 1}return 0}", "function a(e,t){if(e===t){return 0}var r=e.length;var i=t.length;for(var n=0,a=Math.min(r,i);n<a;++n){if(e[n]!==t[n]){r=e[n];i=t[n];break}}if(r<i){return-1}if(i<r){return 1}return 0}", "function uniqueValuesNoBuffer(sList) {\n let current = sList.head;\n if (current === null) {return null}\n let sieve; // the process of checking all subsequent nodes and sieving needs to be done n-1 times in the worst case (when all nodes are already unique). I'd love to write this recursively, since the repetitive checking lends itself naturally to that type of approach, but the prompt hints that we may be short on memory or at the very least we prize it highly, so I'll stay iterative to avoid inflating the stack frame.\n let runner; // so, now current is effectively a placeholder, sieve iterates the list from current, and runner optimizes deletions, then current advances one node and the process repeats until the list is exhausted.\n while (current) { // despite the appearance (2 nested loops), this is still only n^2; sieve and runner work together so each node is touched only once - sieve and runner just enable deleting contiguous blocks rather than breaking and forging links within a block that will ultimately be deleted.\n sieve = current;\n while (sieve) { // rather than checking for multiples of a prime, sieve is just matching a value, but it still could reduce the remaining nodes in the iteration, which is where much of the efficiency potential comes from.\n if (sieve.next && (sieve.next.value === current.value)) {\n runner = sieve.next.next;\n while (runner) { // runner helps group contiguous nodes for deletion where possible, which also provides some efficiency.\n if (runner.value === current.value) {\n runner = runner.next;\n } else {\n break;\n }\n }\n sieve.next = runner;\n }\n sieve = sieve.next;\n }\n current = current.next;\n }\n return sList;\n}", "function Gn(e,t){var a=e[t];e.sort(function(e,t){return P(e.from(),t.from())}),t=d(e,a);for(var n=1;n<e.length;n++){var r=e[n],f=e[n-1];if(P(f.to(),r.from())>=0){var o=G(f.from(),r.from()),i=U(f.to(),r.to()),s=f.empty()?r.from()==r.head:f.from()==f.head;n<=t&&--t,e.splice(--n,2,new Di(s?i:o,s?o:i))}}return new Oi(e,t)}", "function fusion(liste)\r\n{\r\n var tempArray = liste.slice(); // Copie temporaire du tableau (liste)\r\n for(var k=0; k<size; k++)\r\n {\r\n if(tempArray[k] != null)\r\n {\r\n var l = k+1;\r\n\r\n while(tempArray[l]==null && l<=size)\r\n {\r\n l++;\r\n }\r\n\r\n if(tempArray[l] == tempArray[k])\r\n {\r\n tempArray[k] = tempArray[k]*2;\r\n tempArray[l] = null;\r\n moved = true;\r\n caseBoitesRemplies--;\r\n }\r\n\r\n k = l-1;\r\n }\r\n }\r\n\r\n var l = 0;\r\n\r\n for(var k=0; k<size; k++)\r\n {\r\n if(tempArray[k] != null)\r\n {\r\n if(l == k)\r\n l++;\r\n else\r\n {\r\n tempArray[l] = tempArray[k];\r\n tempArray[k] = null;\r\n l++;\r\n moved = true;\r\n }\r\n }\r\n }\r\n return tempArray;\r\n}", "function r(e,t){var n=i.length?i.pop():[],r=s.length?s.pop():[],a=o(e,t,n,r);return n.length=0,r.length=0,i.push(n),s.push(r),a}", "function n(e,t){var n=o.length?o.pop():[],a=i.length?i.pop():[],u=r(e,t,n,a);return n.length=0,a.length=0,o.push(n),i.push(a),u}", "function solution(A) {\n let map = []\n let index = 1;\n for(let i = 0; i < A.length + 1; i++) {\n map[A[i]] = true;\n }\n\n while( index < A.length + 1) {\n if(!map[index]) break;\n index++;\n }\n\n return index;\n}", "function fL(a){var i,l,ret=[]\n for(i=0,l=a.length;i<l;){\n ret.push(a[i])\n while(a[i]+1 == a[++i] && i<l);\n if(a[i-1]!==0x10ffff)ret.push(a[i-1]+1)}\n return ret}", "function findUniqueValues(arr) {\n var i = 0;\n console.log(`Array length: ${arr.length}`);\n for(var j = 1; j < arr.length; j++) {\n // console.log(arr);\n // console.log(`i is ${i} : j is ${j}`);\n // console.log(`test: ${arr[i]} : ${arr[j]}`);\n if(arr[i] !== arr[j]) {\n // console.log(\"Incrementing i\");\n i++;\n // console.log(`Left is ${i}`);\n arr[i] = arr[j];\n }\n // console.log(\"incrementing index j\");\n }\n console.log(`Count: ${i + 1}`);\n return i + 1;\n}", "function ex_2(myA){\n return myA.filter(x => x % 2 == 0) // O(myA.length)\n .map(a => a * a) // O(myA.length)\n .reduce((acc, x) => acc + x, 0); // O(myA.length)\n}", "function solution(A) {\r\n // write your code in JavaScript (Node.js 8.9.4)\r\n \r\n let sorted = A.sort();\r\n let storage = {};\r\n \r\n // Store sorted Array in a json using the value as the key\r\n for (let i = 0; i < sorted.length; i++) {\r\n storage[sorted[i]] = sorted[i];\r\n }\r\n \r\n // If the storage does not contain the key from the loop below, return the key\r\n for (let i = 1; i < 1000001; i++) {\r\n if (!storage[i]) return i; \r\n }\r\n \r\n return 1;\r\n}", "function f(n) {\n return [0].indexOf(n - n + 0);\n}", "function timSort(){\n console.log(\"WORK IN PROGRESS\");\n let run = 32;\n\n for(let i = 0; i < values.length; i += run) {\n insertionSort(i, Math.min((i+31), (values.length-1)));\n }\n\n for(let size = run; size < values.length; size = 2 * size) {\n for(let left = 0; left < values.length; left += 2 * size) {\n let mid = left + size -1;\n let right = Math.min((left + 2 * size - 1), (values.length - 1));\n merge(values, left, mid, right)\n }\n }\n}", "function solution(arr){\n\n}", "function mystery(n) {\n let r = 0;\n for (let i = 0; i < n; i++) {\n for (let j = i + 1; j <= n; j++) {\n for (let k = 1; k < j; k++) {\n r++;\n }\n }\n }\n return r;\n}", "function findVariations(input){ //Time: O(2^n) n = num x's Space: O(1)\n // accepts string, returns str variations\n\n if(!checkInput) return 'Check input, please!';\n\n let index = input.indexOf('X'); //Time: O(n)\n if(index<0){\n console.log(input);\n return input;\n }\n findVariations(input.slice(0,index) + '0' + input.slice(index+1)); //Time: O(n)\n findVariations(input.slice(0,index) + '1' + input.slice(index+1)); //Time: O(n)\n}", "function i(n){let e=0,t=0;const r=n.length;let i,o=n[t];for(t=0;t<r-1;t++)i=n[t+1],e+=(i[0]-o[0])*(i[1]+o[1]),o=i;return e>=0}", "function linearTime(n) {\n let cmdCounter = 0;\n let tempArr = [];\n\n\n for(let i = 0; i < n; i ++) {\n // cmdCounter++;\n tempArr.push(i);\n }\n\n console.log(cmdCounter);\n return tempArr\n}", "function findDuplicate(nums) {\n if (nums.length > 1) {\n let slow = nums[0], fast = nums[nums[0]];\n\n while (slow !== fast) {\n slow = nums[slow];\n fast = nums[nums[fast]];\n }\n\n fast = 0;\n\n while (fast !== slow) {\n slow = nums[slow];\n fast = nums[fast];\n }\n\n return slow;\n }\n\treturn -1;\n}", "function mutateTheArray(n, a) {\n if (n === 1) {\n return a;\n }\n var result = new Array(n);\n \n for (let i = 0; i < n; i++) {\n let left = a[i-1] ? a[i-1] : 0;\n let curr = a[i]\n let right = a[i+1] ? a[i+1] : 0;\n \n result[i] = (left+curr+right)\n } \n return result; \n \n}", "function o$h(n,o,t){for(let r=0;r<t;++r)o[2*r]=n[r],o[2*r+1]=n[r]-o[2*r];}", "function prune(arr){\r\n//\tGM_log(\"arr.length : \"+arr.length);\r\n\tvar i = 0;\r\n\tfor(j in arr){\r\n\t\ti = j;\r\n\t\t// excluding i where i-1 or i+1 doesn't exist\r\n\t\tif(i > 0 && i < (arr.length -1)){\r\n\t\t\tvar test = Math.abs(arr[i*1+1] - arr[i-1]);\r\n\t\t//\tGM_log(\"test : \"+test+\" = arr[\"+i+\"+1] : \"+arr[i+1]+\" - arr[\"+i+\"-1] : \"+arr[i-1]);\r\n\t\t//\tGM_log(\"All [i] - i : \"+i+\" -> test : \"+test);\r\n\t\t\tif(test < smallest){\r\n\t\t//\t\tGM_log(\"i : \"+i+\" -> test : \"+test);\r\n\t\t\t\tsmallest = test;\r\n\t\t\t\trememberI = i;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n//\tGM_log(\"rememberI : \"+rememberI);\r\n\treturn rememberI;\r\n}", "function o(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function o(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function firstDuplicateValue(array) {\n\tconst visited = new Set();\n \tfor (i = 0; i<array.length;i++) {\n\t\tif (visited.has(array[i])) {\n\t\t\treturn array[i];\n\t\t} else visited.add(array[i]);\n\t\tconsole.log(visited)\n\t}\n\treturn -1;\n}", "function problem2(){\n var numArr = [1,2];\n while(numArr[numArr.length-1]<4000000){\n numArr.push( numArr[numArr.length - 2] + numArr[numArr.length - 1] );\n }\n numArr = numArr.filter(function(a){ return a%2===0});\n return numArr.reduce(function(a,b){ return a+b; });\n}", "function CountUniqueValue4(arr){\n\tlet i = 0;\n let j = 1;\n\twhile(j<arr.length){\n\tif(arr[i] !== arr[j]){\n\t\ti++\n\t\tarr[i] = arr[j]\n\t}\n\telse{\n\t\tj++\n }\n \n\t}\n\tconsole.log(i+1);\n\t\n}", "function countUniqueValues(array) {\n let p1 = 0\n let p2 = 1\n \n for (p2; p2< array.length; p2++){\n if(array[p1] !== array[p2]){\n p1 ++\n array[p1] = array[p2]\n }\n else {\n console.log(\"undefined\")\n }\n \n }\n return p1 + 1\n }", "function a(t,i){for(;i+1<t.length;i++)t[i]=t[i+1];t.pop()}", "function findNUniqueIntegersSumUpToZero(n) {\n let result = n % 2 === 0 ? [n, -n] : [0]\n for (let index = 1; index < n / 2; index++) {\n result.push(index, -index)\n }\n return result\n}", "function sift(a, i, n, lo) {\n\t var d = a[--lo + i],\n\t x = f(d),\n\t child;\n\t while ((child = i << 1) <= n) {\n\t if (child < n && f(a[lo + child]) > f(a[lo + child + 1])) child++;\n\t if (x <= f(a[lo + child])) break;\n\t a[lo + i] = a[lo + child];\n\t i = child;\n\t }\n\t a[lo + i] = d;\n\t }", "function h(n,t){var r,u,i,f;if(n===t)return 0;for(r=n.length,u=t.length,i=0,f=Math.min(r,u);i<f;++i)if(n[i]!==t[i]){r=n[i];u=t[i];break}return r<u?-1:u<r?1:0}", "function findUnique3(numbers) {\n\n // Initialize histogram\n var histogramSize = (numbers.length + 1) / 2;\n var histogram = [];\n for (var i = 0; i < histogramSize; i += 1) {\n histogram[i] = 0;\n }\n\n // Initialize mapping to reduce value range to histogramSize\n var mapping = {};\n var inverseMapping = new Array(histogramSize);\n var index = 0;\n for (var i in numbers) {\n if (!(mapping[numbers[i]] >= 0)) {\n mapping[numbers[i]] = index;\n inverseMapping[index] = numbers[i];\n index += 1;\n }\n }\n\n // Sort values into histogram\n for (var i in numbers) {\n histogram[mapping[numbers[i]]] += 1;\n }\n\n // Find only single element in histogram and return\n for (var i in histogram) {\n if (histogram[i] < 2) {\n return inverseMapping[i];\n }\n }\n\n // Given correct input, this line will not be executed\n return false;\n}", "function CountUniqueValue5(arr){\n if (arr.length == 0) {return 0;};\n\tlet i = 0;\n\tfor(let j=1; j<arr.length; j++){\n\tif(arr[i] !== arr[j]){\n\t\ti++;\n\t\tarr[i] = arr[j];\n\t }\n\t}\n\tconsole.log(i+1);\n}", "function a(e,t){var n=i.length?i.pop():[],a=o.length?o.pop():[],s=r(e,t,n,a);return n.length=0,a.length=0,i.push(n),o.push(a),s}", "function n(t, a) {\n return t[0] = a[0], t[1] = a[1], t[2] = a[2], t[3] = a[3], t[4] = a[4], t[5] = a[5], t[6] = a[6], t[7] = a[7], t[8] = a[8], t[9] = a[9], t[10] = a[10], t[11] = a[11], t[12] = a[12], t[13] = a[13], t[14] = a[14], t[15] = a[15], t;\n }", "function countUniqueValues(A){\n let a = 0,\n b = 1;\n for(let i = 0; i < A.length; i++){\n \n if(A[a] == A[b]){\n b++\n }else if(A[a] != A[b]){\n A[a+1] = A[b];\n a++\n b++\n }\n }\n return A.slice(0,a).length\n \n}", "function firstDuplicateValue(array) {\n // Since all of the values are between 1 and N. \n for(let i = 0; i < array.length; i++) {\n\t\tlet map_index = Math.abs(array[i]) - 1; \n\t\tif(array[map_index] < 0) return map_index + 1;\n\t\telse array[map_index] *= -1; \n\t}\n\treturn -1; \n}" ]
[ "0.6217154", "0.60882884", "0.6038923", "0.59644866", "0.59581846", "0.58900684", "0.58017", "0.57941055", "0.57906604", "0.5735336", "0.5717701", "0.56998587", "0.567274", "0.56725353", "0.56725353", "0.5671861", "0.56398463", "0.5604066", "0.5593462", "0.5549539", "0.5543456", "0.5543198", "0.55428123", "0.554203", "0.553875", "0.5529616", "0.55288535", "0.55285597", "0.5515958", "0.5507227", "0.5486461", "0.5479167", "0.54780096", "0.5475593", "0.5471565", "0.5468746", "0.54660666", "0.5464568", "0.5464568", "0.5464568", "0.5464568", "0.54622805", "0.5442233", "0.54351896", "0.54304355", "0.542649", "0.5422778", "0.5384882", "0.53714544", "0.5362472", "0.5358484", "0.53577065", "0.53576684", "0.5355022", "0.53442276", "0.5342613", "0.5334244", "0.5324383", "0.5316757", "0.5315001", "0.53118235", "0.53101045", "0.5308489", "0.5308489", "0.5304556", "0.5304285", "0.52941334", "0.5293521", "0.52899545", "0.5288397", "0.52857715", "0.52814156", "0.52737427", "0.5270742", "0.52699155", "0.52633816", "0.52450985", "0.5244589", "0.5243821", "0.5242448", "0.52423364", "0.5236367", "0.5233159", "0.5230626", "0.52271104", "0.52253634", "0.52253634", "0.52237606", "0.52227604", "0.52200633", "0.5216454", "0.5210308", "0.5202883", "0.52011454", "0.519692", "0.5196264", "0.5180856", "0.51723194", "0.5164544", "0.51636493", "0.5159613" ]
0.0
-1
this runs as soon as App is loaded, once
componentDidMount() { this.interval = setInterval( () => { let totalSeconds = this.state.stopWatchOn ? this.state.totalElapsedTime + 1 - this.state.startTime : this.state.sessionElapsedTime; let hours = parseInt(totalSeconds / 3600); let minutes = parseInt((totalSeconds-(hours*3600)) / 60); let seconds = parseInt((totalSeconds-(hours*3600)-(minutes*60))); this.setState({ totalElapsedTime: this.state.totalElapsedTime + 1, sessionElapsedTime: totalSeconds, hours:hours, minutes:minutes, seconds:seconds }); } , 1000) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n // Action to execute on load of the app\n }", "function onInit() {}", "function alwaysRunOnload () {\n\t\t// Placeholder/Future use.\n\t}", "function onPreappinit() {\n kony.print(\"LOG : onPreappinit - START\");\n gAppData = new initAppData();\n}", "onInit() {}", "onReady() {}", "function alwaysRunOnload () {\n\t\n\t}", "onInitialize() {}", "function applicationLoaded() {\n initiateController();\n }", "function resumeInitApp() {\n // this needs the db to exist\n setLoadMessage('Initializing Handlers');\n initGlobalUIHandlers();\n\n // sections\n setLoadMessage('Loading Sections');\n loadSections();\n $('.app-version-number').text(app.getVersion());\n\n // populate some menus\n setLoadMessage('Populating Menus');\n globalDBUpdate();\n\n removeLoader();\n}", "_init() {\r\n app.whenReady().then(() => {\r\n this.setLoadingWindow();\r\n this.setWindowMain();\r\n });\r\n this.beforeCloseFunctions();\r\n }", "function onReady () {\n restoreTime()\n }", "function onDeviceReady() {\n \n }", "function onLoaded()\n\t{\n\t\twindow.initExhibitorsList();\n\t\twindow.initFloorPlans();\n\t\twindow.initConciege();\n\t\twindow.initAmenities();\n\t\twindow.initVisas();\n\t}", "_ready() {\n this.tabs = new Tabs(this.app)\n }", "onPageReady () {}", "static ready() { }", "function initApp() {\n\tinitSounds();\n\tinitSensors();\n\tshowWelcome();\n}", "function onAppReady() {\n var deferredStore = new _.Deferred();\n\n // kiosk mode is handled in index for store password\n if (!isKioskMode()) {\n logger.info('onAppReady calling checkStorePasswordWarning');\n deferredStore = storePasswordHelpers.checkStorePasswordWarning();\n } else {\n deferredStore.resolve();\n }\n // even though we have a failure we still want the app to continue\n deferredStore.always(function() {\n if (Alloy.CFG.devices.payment_terminal_module != 'webDevice' && (Alloy.CFG.devices.verify_payment_terminal_connection_at_login || Alloy.CFG.devices.check_device_dialog_interval > 0)) {\n addPaymentDeviceTimer = true;\n checkPaymentDevice();\n }\n $.header.initNotifications();\n });\n}", "function initApp() {\r\n var startUpInfo;\r\n MemoryMatch.setPlatform();\r\n startUpInfo = \"Loading \" + MemoryMatch.getAppInfo();\r\n if (MemoryMatch.debugMode) {\r\n MemoryMatch.debugLog(startUpInfo);\r\n } else {\r\n console.log(startUpInfo);\r\n }\r\n\r\n // Listeners for all possible cache events\r\n\r\n var cache = window.applicationCache;\r\n if (cache != null) {\r\n cache.addEventListener('cached', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('checking', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('downloading', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('error', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('noupdate', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('obsolete', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('progress', MemoryMatch.logCacheEvent, false);\r\n cache.addEventListener('updateready', MemoryMatch.logCacheEvent, false);\r\n }\r\n if (document.getElementById(MemoryMatch.loaderElement) != null) {\r\n // show canvas under loader so we can implement a loadbar until we get everything setup for EaselJS to take over\r\n document.getElementById(MemoryMatch.loaderElement).style.display = \"block\";\r\n document.getElementById(MemoryMatch.stageCanvasElement).style.display = \"block\";\r\n }\r\n\r\n // Determine canvas size, it will determine which assets need to be loaded\r\n MemoryMatch.isDesiredOrientationWhenLoadStarted = MemoryMatch.isDesiredOrientation();\r\n MemoryMatch.setCanvasSize(null);\r\n MemoryMatch.loadAllAssets(false);\r\n\r\n //runTests(); // run unit tests\r\n}", "function startApp() {\n //first calls, default dataset? \n }", "onload() {\n this.init();\n }", "function appLoad(){\n console.log('*App Loaded*')\n watchForm();\n}", "function loadApp() {\n console.log(\"loadApp\");\n displayHomePage();\n}", "ready() {\n super.ready();\n\n const that = this;\n\n //a flag used to avoid animations on startup\n that._isInitializing = true;\n\n that._createLayout();\n that._setFocusable();\n\n delete that._isInitializing;\n }", "onReady() {\n\n }", "static init() {\n console.log(\"App is Initialize...\");\n }", "function onReady() {\n\t// TODO\n}", "function runApp() {\n\n // your app starts here\n \n onDeviceReady();\n \n}", "didInit() { }", "appReady_() {\n const {notificationsFeature, userProfile: {signedIn}} = getStore();\n const href = window.location.href;\n\n document.querySelector(\n cssSelector.FOOTER).classList.remove(cssClass.HIDDEN);\n document.querySelector(\n cssSelector.HEADER).classList.remove(cssClass.HIDDEN);\n\n if (signedIn) {\n const tubeLineSubEls = this.querySelectorAll(cssSelector.SUB_ICON);\n\n tubeLineSubEls.forEach((el) => el.classList.remove(cssClass.HIDDEN));\n document.querySelector(\n cssSelector.SUBSCRRIPTIONS).classList.remove(cssClass.HIDDEN);\n }\n\n if (!notificationsFeature) {\n this.noteMessageEl.textContent = copy.NOTE_PUSH_API;\n this.noteEl.classList.remove(cssClass.HIDDEN);\n }\n\n document.dispatchEvent(new CustomEvent(customEvents.READY));\n\n if (href.includes(\"privacy\")) {\n document.dispatchEvent(new CustomEvent(customEvents.PRIVACY_POLICY));\n } else if (href.includes(\"pwa-installed\")) {\n document.querySelector(cssSelector.AUTHENTICATION).click();\n }\n\n this.classList.remove(cssClass.HIDDEN);\n }", "function initApp() {\n var urlParams, configManager, layoutManager;\n console.log('jimu.js init...');\n urlParams = getUrlParams();\n\n DataManager.getInstance();\n\n html.setStyle(jimuConfig.loadingId, 'display', 'none');\n html.setStyle(jimuConfig.mainPageId, 'display', 'block');\n\n layoutManager = LayoutManager.getInstance({\n mapId: jimuConfig.mapId\n }, jimuConfig.layoutId);\n configManager = ConfigManager.getInstance(urlParams);\n\n layoutManager.startup();\n configManager.loadConfig();\n }", "async loadApp(){\n\n //Pick the fonts from the project '\"root\"/assets/fonts/' folder and assign the names 'cabin' and 'confortaa' that can be used in 'fontFamily' style props:\n await Expo.Font.loadAsync({\n cabin: require('../../assets/fonts/Cabin-Regular.ttf'),\n comfortaa: require('../../assets/fonts/Comfortaa-Bold.ttf'),\n PlantIO_Icons: require('../../assets/icons/pio-ui-icons.ttf')\n })\n\n //Check if user is logged in:\n checkSession()\n .then((r)=>{let s = this.state; s.signed = r; this.setState(s);})\n .catch((error)=>alert(error));\n\n //Fetch Modules List from the Plant IO API and stores in AsyncStorage to be used all over the app:\n await fetchDataFromPlantIOAPI();\n await fetchDataFromClimatempoAPI();\n\n //When everything is loaded, set isReady to true, thus, redirecting the app to the main routes:\n let s = this.state;\n s.isReady = true\n this.setState(s);\n }", "onStartApplication() {\n this.switchDrawJoints = true;\n this.animationFrame();\n }", "ready() {\r\n\t\t// Override this\r\n\t\tthis.updateTitle();\r\n\t}", "function onPageLoaded() {\n}", "function startup() {\n // Set initial UI data for our app and Vue\n // App data will be populated after updateUI is called in onMessage EVENT_BRIDGE_OPEN_MESSAGE \n dynamicData = deepCopy(CONFIG.INITIAL_DYNAMIC_DATA);\n defaultMaterialProperties = {\n shadeless: deepCopy(CONFIG.INITIAL_DYNAMIC_DATA[STRING_MATERIAL].shadeless),\n pbr: deepCopy(CONFIG.INITIAL_DYNAMIC_DATA[STRING_MATERIAL].pbr)\n };\n \n // Create the tablet app\n ui = new AppUi({\n buttonName: CONFIG.BUTTON_NAME,\n home: URL,\n onMessage: onMessage, // UI event listener \n // Icons are located in graphicsDirectory\n // AppUI is looking for icons named with the BUTTON_NAME \"avatar-101\" \n // For example: avatar-101-a.svg for active button icon, avatar-101-i.svg for inactive button icon\n graphicsDirectory: Script.resolvePath(\"./resources/icons/\"), \n onOpened: onOpened,\n onClosed: onClosed\n });\n\n // Connect unload function to the script ending\n Script.scriptEnding.connect(unload);\n // Connect function callback to model url changed signal\n MyAvatar.skeletonModelURLChanged.connect(onAvatarModelURLChanged);\n }", "static async load()\n {\n await RPM.settings.read();\n await RPM.datasGame.read();\n RPM.gameStack.pushTitleScreen();\n RPM.datasGame.loaded = true;\n RPM.requestPaintHUD = true;\n }", "function startApp() {\n Backbone.history.start({\n pushState: false\n });\n\n var isFirstLoad = localStorage.getItem('firstLoad') === null;\n\n if (isFirstLoad) {\n var onboardView = new OnboardView();\n\n $('body').append(onboardView.render().el);\n localStorage.setItem('firstLoad', 1);\n }\n}", "function appLoaded() {\n var lang = fetchLanguage(),\n data = fetchData();\n\n $.when(lang, data).then(startApp, appStartError);\n}", "function onReady() {\n ns.brd = new Board();\n ns.client = new clientLib.Client(ns);\n ns.client.addAppBar();\n\n // App Bar can move elements on the screen\n ns.brd.resizeWindow();\n\n ns.client.poll();\n }", "function eventWindowLoaded() {\n\tcanvasApp();\t\n}", "start() {\n //DO BEFORE START APP CONFIGURATION/INITIALIZATION\n super.start();\n }", "async function init() {\n\n registerScreens(store, Provider);\n Navigation.startSingleScreenApp({\n screen: {\n screen: 'MAIN',\n title: ' ',\n navigatorStyle: {\n statusBarColor: 'black',\n statusBarTextColorScheme: 'light',\n navBarBackgroundColor: 'black',\n navBarTextColor: 'white',\n navBarButtonColor: 'white',\n tabBarButtonColor: 'red',\n tabBarSelectedButtonColor: 'red',\n tabBarBackgroundColor: 'white',\n backButtonHidden: true,\n },\n },\n animationType: 'slide-down', // optional, add transition animation to root change: 'none', 'slide-down', 'fade'\n });\n}", "function mainComplete() {\n console.log('it is all loaded up');\n MyGame.game.initialize();\n\n }", "onInit()\n {\n // \n }", "function main() {\n _readyInterval = window.setInterval(widgetReady, 500);\n }", "onReady() {\n SmartCrawlerMenu.set();\n this.createWindow();\n }", "ready() {\n super.ready();\n\n\n }", "onDeviceReady() {\n /**\n * initialize all different stuff here:\n * e.g.\n * - sentry\n * - firebase\n * - adjust\n * - push notifications\n * - fabric\n * - custom url schema\n * - facebook\n * - universal links\n * - google analytics\n * - ...\n *\n * context to \"app\" is avaialble, but beware only the app scope of a plugin (which means if any other plugin\n * extends the app scope, it could be that it is not available yet)\n */ \n try {\n this.initStatusBar()\n } catch (err) {\n // console.error('status bar failed', err)\n }\n \n try {\n this.initWKWebView()\n } catch (err) {\n // console.error('init WKWebView failed', err)\n }\n \n try {\n this.initCustomUrlScheme()\n } catch (err) {}\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "ready() {\n super.ready();\n }", "onAdd() {\n this.setReady_(true);\n }", "function initialize_app() {\n // We are downloading solutions.min.js in parallel, so we show the\n // activity icon here, to inform the user that a \"background download\"\n // is happening (the users at least sees that 'somethnig is going on')\n // TODO is this really necessary? Downloading a 400k file should take\n // far less time than the time it takes the user to start the first\n // calcuation process. Besides, I should already do check for the\n // existence of solutions_db (i.e. \"solutions_db !== null\") before I\n // try to use it anyway...\n show_activity_icon();\n mainEl = document.querySelector('main');\n custom_stamps = new UserStamps();\n small_screen = document.documentElement.clientWidth < 450;\n\n if (small_screen) {\n document.getElementById('forward_btn').textContent = 'Neste';\n document.querySelector('.dropdown-activator').addEventListener('click',\n show_menu);\n }\n document.getElementById('back_btn').addEventListener('click', go_back);\n document.getElementById('forward_btn').addEventListener('click', go_forward);\n document.querySelector('nav > h1').addEventListener('click', reset_site);\n}", "function onDeviceReady() {}", "ready() {\r\n\t\tsuper.ready();\r\n\t}", "onStateChange() {\n\t\t// brute force update entire UI on store change to keep demo app simple\n\t\tthis.forceUpdate();\n\t}", "function onDeviceReady() {\n $('#logList').append('<li>Startup');\n document.addEventListener(\"backbutton\", function (e) {\n e.preventDefault(); \n navigator.notification.confirm(\"Are you sure want to exit?\", onConfirmExit, \"Confirmation\", ['Yes','No']);\n }, false );\n document.addEventListener(\"offline\", toggleOnline, false);\n document.addEventListener(\"online\", toggleOnline, false);\n\n $('#logList').append('<li>After Load Status=' + isOnline);\n $('#logList').append('<li>Refreshing news data 1st time');\n loadNewsAtStart();\n $('#logList').append('<li>Refreshing sermon data 1st time');\n loadSermonAtStart();\n\t\n navigator.splashscreen.hide();\n $('#logList').append('<li>App load completed');\n\twindow.plugin.toast.showShortBottom('Loading complete');\n\n \n}", "async function window_OnLoad() {\n await initialLoad();\n}", "function oncePreloaded() {\n\t\t\tself.afterLoaded(); //callback\n\t\t\tif(self.settings.hideFramesUntilPreloaded && self.settings.preloader !== undefined && self.settings.preloader !== false) {\n\t\t\t\tself.frames.show();\n\t\t\t}\n\t\t\tif(self.settings.preloader !== undefined && self.settings.preloader !== false){\n\t\t\t\tif(self.settings.hidePreloaderUsingCSS && self.transitionsSupported) {\n\t\t\t\t\tself.prependPreloadingCompleteTo = (self.settings.prependPreloadingComplete === true) ? self.settings.preloader : $(self.settings.prependPreloadingComplete);\n\t\t\t\t\tself.prependPreloadingCompleteTo.addClass(\"preloading-complete\");\n\t\t\t\t\tsetTimeout(init, self.settings.hidePreloaderDelay);\n\t\t\t\t}else{\n\t\t\t\t\tself.settings.preloader.fadeOut(self.settings.hidePreloaderDelay, function() {\n\t\t\t\t\t\tclearInterval(self.defaultPreloader);\n\t\t\t\t\t\tinit();\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tinit();\n\t\t\t}\n\t\t}", "function initApp() {\n // Listening for auth state changes.\n // [START authstatelistener]\n firebase.auth().onAuthStateChanged(function(user) {\n showHomePage();\n if (user) {\n // User is signed in.\n /** This section of code builds up the pages only the provider is allowed to see **/\n provider = {};\n provider.displayName = user.displayName;\n provider.email = user.email;\n /** build more provider properties here **/\n\n listenOnDateBase();\n\n $(\"li[name=signedInMenu]\").show(); // show what you can to create a \"working\" feeling\n $(\"li[name=signedOutMenu]\").hide(); // hide what's not relevant\n\n } else {\n // User is signed out.\n provider = null;\n $(\"li[name=signedOutMenu]\").show(); // show what you can to create a \"working\" feeling\n $(\"li[name=signedInMenu]\").hide(); // hide the user's data to create a feeling that it's gone\n tearDownUserPages(); // remove database listenrs and destory all the pages to prevent private info from leeking\n }\n });\n}", "function initApp () {\n loadThemes();\n}", "ready() {\n this.isReady = true;\n if (this.onLoad) {\n this.onLoad.call();\n }\n }", "onCreate() {\n // console.log('onCreate');\n }", "function loadApplication() {\n console.log(\"Application loaded\");\n // Load directly to the main menu\n configureUI(displayMainMenu());\n\n}", "function eventWindowLoaded() {\n canvasApp();\n}", "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "ready() {\n super.ready();\n\n afterNextRender(this, function() {});\n }", "function application_post_init(){\n \tappscore.print.start();\n \tmenuVisibility = false;\n //\tgoogleAnalytics = new ganalytics.GAnalyticsLib(\"dsfhjdfhsdhskh\"); //UA-80818309-1 for MyPower\n\tkony.application.setApplicationCallbacks(callbacksObj);\n\tif(loginManager.getLogin() != null){\n\t\t// Validate token\n\t\tvar token = loginManager.getLogin().token;\n\t\t// If token is valid then navigate to FormMenu\n\t\t// invokeAppService(\"Login\", {\"token\":token}, function(){status, resultTable});\n\t\t// else navigate to FormLogin\n\t\treturn frmSplash;\n\t}\n \tappscore.print.stop(); \n}", "function eventWindowLoaded () {\n canvasApp();\n}", "function loaded() {\n\taddElements();\n\tosScroll();\n\t// initiate tabs\n\t$('#tabs').tab();\n\t// set event listeners\n\tsetOneTimeEventListeners();\n\t//updateChecked();\n}", "_reflow() {\n this._init();\n }", "function onDeviceReady() {\n\t\n\tupdateDisplay();\n\t \n\n }", "function initialize_meal_planner_app() {\n var app_title_pixel_height = 60;\n var pixel_height = (window.innerHeight - app_title_pixel_height) + \"px\";\n document.getElementById(\"calendar_panel\").style.height = pixel_height;\n document.getElementById(\"side_panel\").style.height = pixel_height;\n\n // Setup app butons and other controls\n setup_app_controls();\n\n // Set the user's meals from the database.\n firebase_database.ref(\"Users_Meals/\" + user.uid).once(\"value\", initialize_user_meals_from_db_snapshot);\n\n is_app_initialized = true;\n}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function initializeApp() {\n registerButtonHandlers();\n\n // check if the user is logged in/out, and disable inappropriate button\n if (liff.isLoggedIn()) {\n liff.getProfile().then(function (profile) {\n document.getElementById('customerName').textContent = profile.displayName;\n profileName = profile.displayName;\n const profilePictureDiv = document.getElementById('profilePictureDiv');\n const img = document.createElement('img');\n img.src = profile.pictureUrl;\n img.alt = 'Profile Picture';\n img.setAttribute('class', 'img-fluid rounded-circle');\n profilePictureDiv.appendChild(img);\n\n }).catch(function (error) {\n window.alert('Error getting profile: ' + error);\n });\n displayIsInClientInfo();\n document.getElementById('liffLoginButton').classList.add('hidden');\n document.getElementById('pesanLoggedIn').classList.remove('hidden');\n } else {\n document.getElementById('intro').setAttribute('class', 'col-md-12 col-12');\n\n document.getElementById('pesanLoggedOut').classList.remove('hidden');\n document.getElementById(\"liffAppContent\").classList.add('hidden');\n }\n}", "setAsReady() {\n this.logger.debug('Page is ready to use');\n this.controller.store();\n }", "function mainComplete() {\n\t\tconsole.log('it is all loaded up');\n\t\t//Demo.main.initialize();\n\t}", "function onStart() {\n checkInput();\n onLoadTodos();\n}", "function initializeApp () {\n makeQuiz();\n eventHandlers();\n}", "function initializeApp() {\n displayIsInClientInfo();\n registerButtonHandlers();\n\n // check if the user is logged in/out, and disable inappropriate button\n if (liff.isLoggedIn()) {\n $.blockUI({ message: \"<h3>Please wait...</h3>\" });\n document.getElementById('liffLoginButton').disabled = true;\n liff.getProfile().then(function(profile) {\n setValue('USER_ID', profile.userId);\n\n const idToken = liff.getIDToken();\n setValue('ID_TOKEN',idToken);\n\n updateMappingTable();\n }).catch(function(error) {\n\n });\n } else {\n document.getElementById('liffLogoutButton').disabled = true;\n }\n}", "async onInitialized(settings, userData) {}", "function startApp() {\n inputDataChannels.forEach(function (dataChannel) {\n if (dataChannel) {\n dataChannel.removeEventListener(divId);\n dataChannel.addEventListener('add', newValue, divId);\n }\n });\n\n minionObject.div.appendChild(minionObject.headline);\n minionObject.config.data = d34.range(minionObject.n).map(function() {\n return 0\n });\n minionObject.headline.appendChild(minionObject.headlineText);\n\n }", "function onDeviceReady() {\n // refers to event listener at the top of document \n\t\talert(\"device ready\");\n // when user hits resume/pause the opposite command will be changed to false \n\t\tdocument.addEventListener(\"resume\", onResume, false);\n\t\tdocument.addEventListener(\"pause\", onPause, false);\n\t\t\n\t\tlaunched_count++;\n\t\tupdateDisplay();\n }", "function init() {\n\t\t\t// Mount all riot tags\n\t\t\triot.mount('loadingscreen');\n\t\t\triot.mount('applauncher');\n\n\t\t\t//window.wm.mode = 'exposeHack';\n //window.wm.mode = 'default';\n\t\t}", "function init() {\n\t\t//console.log(\"app.init()\");\n\t\tif(initDone) {\n\t\t\t//console.log(\"init already done.\");\n\t\t\treturn;\n\t\t} else {\n\t\t\tinitDone = true;\n\t\t}\n\n\t\t// Init HTML layout and from there the GUI/UI with interaction.\n\t\tlayout.init();\n\t\tscene.init();\n\t\t//ui.init();\n\t\t// Proceed directly to startup of the loop.\n\t\t//start();\n\t}", "function loadApp() {\n setTimeout(function () {\n document.getElementById(\"loading\").style.display= 'none';\n document.getElementById(\"whiteboard\").style.visibility= 'visible';\n }, 1500);\n initApp();\n}", "function onDeviceReady() {\n\t\talert(\"device ready\");\n \n\t\tdocument.addEventListener(\"resume\", onResume, false);\n\t\tdocument.addEventListener(\"pause\", onPause, false);\n\t\t\n\t\tlaunched_count++;\n\t\tupdateDisplay();\n }", "function init()\n {\n $(document).on(\"loaded:everything\", runAll);\n }", "function loadApp() {\n firebaseUtils.listenToAuthStatus(logIn, logOut);\n}" ]
[ "0.69864327", "0.689511", "0.6877751", "0.68767834", "0.6875059", "0.6828623", "0.68220377", "0.6821662", "0.67836714", "0.6782671", "0.67372614", "0.6724256", "0.67047405", "0.6696758", "0.6679615", "0.6673208", "0.6667785", "0.66432136", "0.65653366", "0.6565152", "0.65558136", "0.6525766", "0.6511091", "0.6486035", "0.6472673", "0.646649", "0.645985", "0.6457268", "0.6434612", "0.641798", "0.6415878", "0.64151055", "0.64148664", "0.64126045", "0.64068496", "0.64002955", "0.6396149", "0.6392705", "0.6365427", "0.6355969", "0.63458806", "0.6317265", "0.6316147", "0.63099873", "0.6297679", "0.6284014", "0.62792635", "0.62670636", "0.62621784", "0.62592095", "0.6255956", "0.6255956", "0.6255956", "0.6255956", "0.6255956", "0.6255956", "0.6255956", "0.6255956", "0.6255956", "0.6255956", "0.6255956", "0.6255956", "0.62463033", "0.62453973", "0.6245194", "0.6236221", "0.6227261", "0.6217631", "0.62111235", "0.6209951", "0.6207575", "0.6194212", "0.61911994", "0.6182343", "0.6181095", "0.6180792", "0.61635137", "0.61635137", "0.61635137", "0.61612934", "0.6155581", "0.6154753", "0.61519045", "0.6150696", "0.6148436", "0.61358476", "0.6131281", "0.6126563", "0.6118255", "0.6110123", "0.6109158", "0.61051255", "0.61040205", "0.6098953", "0.6093852", "0.6092983", "0.60908496", "0.6090745", "0.60850155", "0.60712814", "0.60710853" ]
0.0
-1
i added this just to keep the memory clean...but we don't ever unmount this...
componentWillUnmount() { clearInterval(this.interval); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function memoryCleanUp(){\n /*to be implemented*/\n}", "function _clearMemory () {\n memory = 0;\n }", "function flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}", "function flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}", "function flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}", "function flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}", "function flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}", "function flushMounts() {\n\tvar c;\n\twhile (c = mounts.pop()) {\n\t\tif (options.afterMount) options.afterMount(c);\n\t\tif (c.componentDidMount) c.componentDidMount();\n\t}\n}", "cleanMemory(pid) {\n\t\tlet self=this;\n\t\tfor(let i in window.memory) {\n\t\t\tif(window.memory[i].pid===pid&&window.memory[i].mode===self.DEFINE.MEMORY_GARBAGE) {\n\t\t\t\twindow.memory[i]={};\n\t\t\t\tdelete window.memory[i];\n\t\t\t}\n\t\t}\n\n\t}", "function dispose() {\n this.unmount();\n }", "componentWillUnmount() {}", "componentWillUnmount() {}", "componentWillUnmount() {}", "componentWillUnmount() {}", "componentWillUnmount() {}", "componentWillUnmount() {}", "componentWillUnmount() {}", "componentWillUnmount() {}", "componentWillUnmount () {}", "componentWillUnmount() {\n this.props.cleanup();\n }", "componentWillUnmount(){\n this.mounted = false;\n }", "componentWillUnmount(){\n this.mounted = false;\n }", "componentWillUnmount() {\n this.hotInstance.destroy();\n }", "function onunmount () {\n\t removeNativeElement()\n\t currentElement = null\n\t }", "componentWillUnmount() {\n this.exit()\n }", "function commitUnmount(current$$1){onCommitUnmount(current$$1);switch(current$$1.tag){case FunctionComponent:case ForwardRef:case MemoComponent:case SimpleMemoComponent:{var updateQueue=current$$1.updateQueue;if(updateQueue!==null){var lastEffect=updateQueue.lastEffect;if(lastEffect!==null){var firstEffect=lastEffect.next;var effect=firstEffect;do{var destroy=effect.destroy;if(destroy!==undefined){safelyCallDestroy(current$$1,destroy);}effect=effect.next;}while(effect!==firstEffect);}}break;}case ClassComponent:{safelyDetachRef(current$$1);var instance=current$$1.stateNode;if(typeof instance.componentWillUnmount==='function'){safelyCallComponentWillUnmount(current$$1,instance);}return;}case HostComponent:{safelyDetachRef(current$$1);return;}case HostPortal:{// TODO: this is recursive.\n// We are also not using this parent because\n// the portal will get pushed immediately.\nif(supportsMutation){unmountHostComponents(current$$1);}else if(supportsPersistence){emptyPortalContainer(current$$1);}return;}}}", "function commitUnmount(current$$1){onCommitUnmount(current$$1);switch(current$$1.tag){case FunctionComponent:case ForwardRef:case MemoComponent:case SimpleMemoComponent:{var updateQueue=current$$1.updateQueue;if(updateQueue!==null){var lastEffect=updateQueue.lastEffect;if(lastEffect!==null){var firstEffect=lastEffect.next;var effect=firstEffect;do{var destroy=effect.destroy;if(destroy!==undefined){safelyCallDestroy(current$$1,destroy);}effect=effect.next;}while(effect!==firstEffect);}}break;}case ClassComponent:{safelyDetachRef(current$$1);var instance=current$$1.stateNode;if(typeof instance.componentWillUnmount==='function'){safelyCallComponentWillUnmount(current$$1,instance);}return;}case HostComponent:{safelyDetachRef(current$$1);return;}case HostPortal:{// TODO: this is recursive.\n// We are also not using this parent because\n// the portal will get pushed immediately.\nif(supportsMutation){unmountHostComponents(current$$1);}else if(supportsPersistence){emptyPortalContainer(current$$1);}return;}}}", "function commitUnmount(current$$1){onCommitUnmount(current$$1);switch(current$$1.tag){case FunctionComponent:case ForwardRef:case MemoComponent:case SimpleMemoComponent:{var updateQueue=current$$1.updateQueue;if(updateQueue!==null){var lastEffect=updateQueue.lastEffect;if(lastEffect!==null){var firstEffect=lastEffect.next;var effect=firstEffect;do{var destroy=effect.destroy;if(destroy!==undefined){safelyCallDestroy(current$$1,destroy);}effect=effect.next;}while(effect!==firstEffect);}}break;}case ClassComponent:{safelyDetachRef(current$$1);var instance=current$$1.stateNode;if(typeof instance.componentWillUnmount==='function'){safelyCallComponentWillUnmount(current$$1,instance);}return;}case HostComponent:{safelyDetachRef(current$$1);return;}case HostPortal:{// TODO: this is recursive.\n// We are also not using this parent because\n// the portal will get pushed immediately.\nif(supportsMutation){unmountHostComponents(current$$1);}else if(supportsPersistence){emptyPortalContainer(current$$1);}return;}}}", "componentWillUnmount() {\n this._isMounted = false;\n }", "wipeUnusedSpace() {\n // Mark internal only to be true so that the render doesn't treat it like\n // a new file, all existing data is kept\n this.onDataChange(undefined, false, true);\n }", "componentWillUnmount() {\n this.mounted = false;\n }", "componentWillUnmount() {\n this.mounted = false;\n }", "componentWillUnmount() {\n this.mounted = false;\n }", "componentWillUnmount() {\n this.mounted = false;\n }", "componentWillUnmount() {\n this._isMounted = false\n }", "componentWillUnmount() {\n this._isMounted = false\n }", "componentWillUnmount() {\n\t\t\n\t}", "_cleanup() {\n this.readable = false;\n delete this._current;\n delete this._waiting;\n this._openQueue.die();\n\n this._queue.forEach((data) => {\n data.cleanup();\n });\n this._queue = [];\n }", "simulateUnmount() {\n this.volumeUnmountListener(this.volumeInfo_.volumeId);\n }", "static unMount() {\n if (this.rootComponentMounted) {\n// Fire componentWillUnmount event, then remove component...\n Events.fire('componentWillUnmount', this.rootComponent)\n this.rootComponent.remove()\n\n// Reset componentMounted flag...\n this.rootComponentMounted = false\n } else {\n try {\n throw this.Errors.UnmountError\n }\n catch (err) {\n console.error(err.message)\n }\n }\n }", "componentWillUnmount() {\n this._isMounted = false;\n }", "cleanMemory() {\n if (this.state.files.length > 0) {\n this.state.files.map(file => URL.revokeObjectURL(file.preview));\n }\n }", "onUnmountDisk(){\n console.log(\"unmount\");\n let current = this.state.current;\n this.state.disks.map((e,index) => {\n if(current.name == e.name && current.kind == \"disk\"){\n this.state.disks.splice(index, 1);\n }\n });\n\n console.log('pos slice .............');\n console.log(this.state.disks);\n\n this.setState({\n disks : this.state.disks,\n current : {dir : []},\n mode : this.state.mode,\n selected : this.state.selected\n })\n\n }", "componentWillUnmount() {\n this.mounted = false;\n }", "componentWillUnmount() {\n this.mounted = false;\n }", "__$destroy() {\n if (this.isResFree()) {\n //console.log(\"MeshBase::__$destroy()... this.m_attachCount: \"+this.m_attachCount);\n this.m_ivs = null;\n this.m_bufDataList = null;\n this.m_bufDataStepList = null;\n this.m_bufStatusList = null;\n this.trisNumber = 0;\n this.m_transMatrix = null;\n }\n }", "detach() {\n _commons__WEBPACK_IMPORTED_MODULE_0__[\"finalizeResources\"].call(this);\n }", "componentWillUnmount() {\n\t\tthis.nodeRefs = {};\n\t}", "componentWillUnmount(){\n this.linksTracker.stop();\n //saves resources.\n }", "function onunmount () {\n removeNativeElement()\n currentElement = null\n }", "detach() {}", "componentWillUnmount() {\n\t\tthis._isMounted = false;\n\t}", "componentWillUnmount() {\n\t\tthis._isMounted = false;\n\t}", "function clearMemory() {\n Ti.API.info(\"Inside Clear Memory\");\n\n\n}", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "componentWillUnmount(){\n // cleanup methods \n console.log(\"componentWillUnmount called\")\n }", "function commitUnmount(current){if(typeof onCommitUnmount==='function'){onCommitUnmount(current);}switch(current.tag){case ClassComponent:{safelyDetachRef(current);var instance=current.stateNode;if(typeof instance.componentWillUnmount==='function'){safelyCallComponentWillUnmount(current,instance);}return;}case HostComponent:{safelyDetachRef(current);return;}case CallComponent:{commitNestedUnmounts(current.stateNode);return;}case HostPortal:{// TODO: this is recursive.\n// We are also not using this parent because\n// the portal will get pushed immediately.\nif(enableMutatingReconciler&&mutation){unmountHostComponents(current);}else if(enablePersistentReconciler&&persistence){emptyPortalContainer(current);}return;}}}", "function commitUnmount(current){if(typeof onCommitUnmount==='function'){onCommitUnmount(current);}switch(current.tag){case ClassComponent:{safelyDetachRef(current);var instance=current.stateNode;if(typeof instance.componentWillUnmount==='function'){safelyCallComponentWillUnmount(current,instance);}return;}case HostComponent:{safelyDetachRef(current);return;}case CallComponent:{commitNestedUnmounts(current.stateNode);return;}case HostPortal:{// TODO: this is recursive.\n// We are also not using this parent because\n// the portal will get pushed immediately.\nif(enableMutatingReconciler&&mutation){unmountHostComponents(current);}else if(enablePersistentReconciler&&persistence){emptyPortalContainer(current);}return;}}}", "componentWillUnmount() {\r\n this.unsub();\r\n }", "_destroy() {}", "componentWillUnmount(){\n\n }", "static deregister() {\n delete __WEBPACK_IMPORTED_MODULE_0__common_plugin__[\"a\" /* PLUGINS */][\"MemoryStorage\"];\n }", "function resetMemory(){\n\tRawMemory.set('{}');\n\tMemory.creeps = {};\n\tMemory.rooms = {};\n\tMemory.flags = {};\n\tMemory.spawns = {};\n}", "componentWillUnmount () {\n this.canvas = null\n }", "function delete_storage(){\n\tsimact.Algebrite.run(\"clearall\");\n\tfilloutputarea();\n}", "componentWillUnmount() {\n console.log(\"within componentWillUnmount \");\n console.log(\"Any clean up code \");\n }", "componentWillUnmount() {\n for (let i = 0; i < this.stores.length; i += 1) {\n this.stores[i].unRegister(this);\n }\n }", "componentWillUnmount() {\n this._isMounted = false;\n clearTimeout(this.intervalID);\n\t}", "function commitUnmount(current){if(typeof onCommitUnmount==='function'){onCommitUnmount(current);}switch(current.tag){case ClassComponent:{safelyDetachRef(current);var instance=current.stateNode;if(typeof instance.componentWillUnmount==='function'){safelyCallComponentWillUnmount(current,instance);}return;}case HostComponent:{safelyDetachRef(current);return;}case CallComponent:{commitNestedUnmounts(current.stateNode);return;}case HostPortal:{// TODO: this is recursive.\n\t// We are also not using this parent because\n\t// the portal will get pushed immediately.\n\tif(enableMutatingReconciler&&mutation){unmountHostComponents(current);}else if(enablePersistentReconciler&&persistence){emptyPortalContainer(current);}return;}}}", "unmount() {\n let me = this;\n\n Neo.currentWorker.promiseMessage('main', {\n action : 'updateDom',\n appName: me.appName,\n deltas : [{\n action: 'removeNode',\n id : me.vdom.id\n }]\n }).then(() => {\n me.mounted = false;\n }).catch(err => {\n console.log('Error attempting to unmount component', err, me);\n });\n }", "componentWillUnmount() {\n\n }", "componentWillUnmount() {\n\n }", "purgeCache() {\n this._bufferCache = {};\n }", "onDestroy() {}", "componentWillUnmount() {\n this.browseMounted = false\n clearInterval(this.sliderInterval)\n clearInterval(this.updateInterval)\n clearInterval(this.scrollInterval)\n }", "componentWillUnmount() {\r\n\r\n }", "componentWillUnmount() {\n\n }", "componentWillUnmount() {\n\n }", "componentWillUnmount() {\n\n }", "componentWillUnmount() {\n\n }", "_destroy() {\n this._root.unmount();\n this._container.off('open', this._render, this);\n this._container.off('destroy', this._destroy, this);\n }", "onDestroy() {\n STATE.aqueducts--;\n }", "componentWillUnmount()\n{\n console.log(\"[Perosn js] componentWillUnmount\")\n}", "_clearResources() {\n }", "function seekAndDestroy() {}", "componentWillUnmount(){\n // console.log('Goodd By Cruel World')\n }", "componentWillUnmount() {\n }", "componentWillUnmount() {\n }", "function freeMemory(){\n\t//kill all tweenmax tweens\n\tTweenMax.killTweensOf(\"*\");\n\n\t//kill all timers\n\tfor(var i=0; i<timer.length; i++){\n\t\tclearTimeout(timer[i]);\n\t}\n}", "function commitUnmount(current){if(typeof onCommitUnmount==='function'){onCommitUnmount(current);}switch(current.tag){case ClassComponent:{safelyDetachRef(current);var instance=current.stateNode;if(typeof instance.componentWillUnmount==='function'){safelyCallComponentWillUnmount(current,instance);}return;}case HostComponent:{safelyDetachRef(current);return;}case HostPortal:{// TODO: this is recursive.\n// We are also not using this parent because\n// the portal will get pushed immediately.\nif(supportsMutation){unmountHostComponents(current);}else if(supportsPersistence){emptyPortalContainer(current);}return;}}}", "function commitUnmount(current){if(typeof onCommitUnmount==='function'){onCommitUnmount(current);}switch(current.tag){case ClassComponent:{safelyDetachRef(current);var instance=current.stateNode;if(typeof instance.componentWillUnmount==='function'){safelyCallComponentWillUnmount(current,instance);}return;}case HostComponent:{safelyDetachRef(current);return;}case HostPortal:{// TODO: this is recursive.\n// We are also not using this parent because\n// the portal will get pushed immediately.\nif(supportsMutation){unmountHostComponents(current);}else if(supportsPersistence){emptyPortalContainer(current);}return;}}}", "componentWillUnmount() {\n this.isMounted_ = false;\n this.disposePlayer();\n }", "componentWillUnmount() {\n this.engine.dispose();\n }", "function reset() {\n delete require.cache[\n require.resolve('../../../app/scripts/persistence/file-system')\n ];\n fileSystem = require('../../../app/scripts/persistence/file-system');\n}", "componentWillUnmount(){\n this.props.clear();\n }", "componentWillUnmount() {\n }", "componentWillUnmount() {\n }", "static async purgestorage() {\n if (StorageManager._storage) {\n for (let key in StorageManager._storage) {\n await StorageManager._internalClearStorageData(key)\n .then((response) => {\n if (!response) {\n throw response;\n }\n })\n .catch((error) => {\n throw error;\n })\n }\n }\n await StorageManager.initialize(StorageManager._mapping);\n return true;\n }", "componentWillUnmount() {\n // console.log(\"=========================> componentWillUnmount\");\n }", "cleanup() {\n\n\t}", "async cleanUpStorage() {\n if(!this.storageAutoCleanSize) {\n return;\n }\n\n const storageInfoData = { tempUsed: false, tempFree: false };\n const storage = await this.getStorageInfo(storageInfoData);\n const needSize = this.storageAutoCleanSize - storage.free;\n\n if(needSize <= 0) {\n return;\n }\n\n this.logger.info(`It is necessary to clean ${needSize} byte(s)`);\n const tree = await this.getStorageCleaningUpTree();\n let node = tree.minNode();\n\n while(node) {\n const obj = node.data;\n\n try {\n await this.removeFileFromStorage(path.basename(obj.path));\n\n if((await this.getStorageInfo(storageInfoData)).free >= this.storageAutoCleanSize) {\n break;\n }\n }\n catch(err) {\n this.logger.warn(err.stack);\n }\n\n node = tree.next(node);\n }\n\n if((await this.getStorageInfo(storageInfoData)).free < this.storageAutoCleanSize) {\n this.logger.warn('Unable to free up space on the disk completely');\n }\n }" ]
[ "0.6672292", "0.6343759", "0.6338927", "0.6338927", "0.6338927", "0.6338927", "0.6338927", "0.6338927", "0.6337327", "0.61775225", "0.61758065", "0.61758065", "0.61758065", "0.61758065", "0.61758065", "0.61758065", "0.61758065", "0.61758065", "0.61554027", "0.61039567", "0.60492676", "0.60492676", "0.6046426", "0.60437703", "0.60355365", "0.60177165", "0.60177165", "0.60177165", "0.5994438", "0.5963904", "0.596171", "0.596171", "0.596171", "0.596171", "0.5957422", "0.5957422", "0.59567326", "0.5954761", "0.59539497", "0.59422183", "0.59415156", "0.5934691", "0.5928391", "0.59231687", "0.59231687", "0.59114784", "0.58997667", "0.58931184", "0.5893085", "0.5885801", "0.5885734", "0.5879957", "0.5879957", "0.5877532", "0.5876849", "0.5864652", "0.58637875", "0.58637875", "0.5852851", "0.582485", "0.5817386", "0.5809759", "0.5805136", "0.5799365", "0.5799012", "0.5783761", "0.5776702", "0.577567", "0.5772187", "0.57621586", "0.5758488", "0.5758488", "0.5756156", "0.57555735", "0.5752796", "0.5752629", "0.57482344", "0.57482344", "0.57482344", "0.57482344", "0.57459867", "0.5744231", "0.57417476", "0.5740285", "0.57398695", "0.57385707", "0.57199675", "0.57199675", "0.57126063", "0.5710175", "0.5710175", "0.57076085", "0.5704622", "0.56984437", "0.56859416", "0.56778204", "0.56778204", "0.56709146", "0.5667443", "0.5663583", "0.56630516" ]
0.0
-1
Tests the node and sets up a test UI for a contract (voting contract in this case);
function testNode() { // Retrieve the ABI from the local json file fetch("./contracts/voting.sol").then(response => { return response.text(); }).then((code) => { $.ajax({ type: "POST", url: "http://localhost:8080/toAbi", dataType: "json", contentType: "application/json", data: code, success: (abi) => { if (abi.error) { console.log(abi.error); } else { nodeUrl = $(".node-url").val(); console.log("Node url: " + nodeUrl); // Instantiate the web3 object if (typeof web3 !== 'undefined') { web3 = new Web3(web3.currentProvider); } else { web3 = new Web3(new Web3.providers.HttpProvider(nodeUrl)); // web3.setProvider(new Web3.providers.WebsocketProvider('ws://localhost:8545')); } // Get the available accounts web3.eth.getAccounts().then(accounts => { // Create a voting contract instance var votingInstance = new web3.eth.Contract(abi.abiDefinition); $(".compat-contract-abi").html(syntaxHighlight(JSON.stringify(abi.abiDefinition, null, 4))); $(".compat-contract-code").html(code); // Just take the first one web3.eth.defaultAccount = accounts[0]; // Same as the default account votingInstance.options.from = web3.eth.defaultAccount; if (web3.utils.isAddress(address)) { web3.eth.getCode(address).then(data => { if (data === "0x0") { $(".compat-deploy-new").text("true"); deployContract(votingInstance, abi, accounts, nodeUrl); } else { $(".compat-deploy-new").text("false"); votingInstance.options.address = address; $(".compat-deploy-address").text(address); setupExampleUI(votingInstance); testRpcCalls(abi.abiDefinition, accounts, abi.byteCode, votingInstance); $(".contract-address").html("(" + nodeUrl + ")"); $(".spinner").hide(); $(".compat-content").show(); } }); } else { $(".compat-deploy-new").text("true"); deployContract(votingInstance, abi, accounts, nodeUrl); } }).catch(data => { console.error(data); $(".contract-address").html("(" + nodeUrl + ")"); $(".no-ganache-cli-info").show(); $(".spinner").hide(); }); } } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setUIBasedOnNodeType(){\n // Unlock Account - Check the node type\n\n if(nodeType === 'metamask' || nodeType == 'testrpc'){\n setData('lock_unlock_result','Unlock / lock ( ) not supported for '+nodeType,true);\n } else {\n setData('lock_unlock_result','--',false);\n }\n // Compiler options\n if(nodeType === 'geth' || nodeType === 'metamask'){\n // Not supported for geth & metamask\n setData('list_of_compilers','getCompilers ( ) & compileSolidity ( ) not supported for '+nodeType,true);\n\n // Disable the compile butto\n document.getElementById('button_do_compile').disabled = true;\n //document.getElementById(\"sourcecode\").value=\"Compile sample contract in Remix | Wallet | solc . Copy & Paste the Bytecode | ABIDefinition for deployment.\";\n document.getElementById('sourcecode').disabled=true;\n } else {\n setData('list_of_compilers','--',false);\n document.getElementById('button_do_compile').disabled = false;\n document.getElementById('sourcecode').disabled=false;\n }\n\n // This simply creates the JSON for default transaction object\n generateTransactionJSON();\n copyBytecodeInterfaceToUI();\n}", "activateContract(evt) {\n\n let currentContract = document.querySelector('div.current-contract .assignment');\n\n if (currentContract == undefined)\n {\n gameApp.gameView.addToDom(evt.target.parentElement, '.current-contract');\n\n } else {\n gameApp.gameView.addToDom(currentContract, '.accepted-contract');\n gameApp.gameView.addToDom(evt.target.parentElement, '.current-contract');\n }\n\n }", "async connectToContract(){\n\n await this.auctionContract.connect( App.provider.getSigner(), this.auctionContract.contractAddress);\n this.auctionContract.registerToEvents(sellerUI);\n }", "function main()\n{\n \n \n //-----declarations------\n source(findFile(\"scripts\",\"functions.js\"));\n \n //---login Application--------\n loginAppl(\"CONFIGURE\"); \n \n snooze(10);\n // ------ Base Currency setting ------ \n try{\n waitForObjectItem(\":List Currencies._curr_XTreeWidget\", \"USD\");\n clickItem(\":List Currencies._curr_XTreeWidget\", \"USD\", 16, 6, 0, Qt.LeftButton);\n clickButton(waitForObject(\":List Items.Edit_QPushButton_2\"));\n waitForObject(\":Currency.Base Currency_QCheckBox\")\n if(!findObject(\":Currency.Base Currency_QCheckBox\").checked)\n clickButton(\":Currency.Base Currency_QCheckBox\");\n clickButton(waitForObject(\":List Departments.Save_QPushButton\"));\n clickButton(waitForObject(\":Registration Key.Yes_QPushButton\"));\n clickButton(waitForObject(\":Tax Assignment.Close_QPushButton\"));\n test.log(\"Base Currency is successfully set\");\n }\n catch(e)\n {\n test.fail(\"Error in Base Currency setting\"+e);\n }\n //-----Editing the preferences----\n \n if(OS.name==\"Darwin\")\n {\n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Products\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Products\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Products_QMenu\",\"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Products_QMenu\", \"Setup...\");\n } \n else\n {\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Preferences...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Preferences...\");\n }\n \n \n waitForObject(\":Interface Options.Show windows inside workspace_QRadioButton\");\n snooze(1);\n if(!findObject(\":Interface Options.Show windows inside workspace_QRadioButton\").checked)\n clickButton(\":Interface Options.Show windows inside workspace_QRadioButton\");\n snooze(1);\n if(object.exists(\":Notice.Remind me about this again._QCheckBox\"))\n { \n waitForObject(\":Notice.Remind me about this again._QCheckBox\");\n if(findObject(\":Notice.Remind me about this again._QCheckBox\").checked)\n clickButton(\":Notice.Remind me about this again._QCheckBox\");\n snooze(0.1);\n waitForObject(\":Notice.OK_QPushButton\");\n clickButton(\":Notice.OK_QPushButton\");\n }\n waitForObject(\":xTuple ERP: *_QPushButton\");\n clickButton(\":xTuple ERP: *_QPushButton\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Rescan Privileges\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Rescan Privileges\");\n \n //----------Define Encryption (metric)------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n snooze(2);\n \n if(OS.name==\"Darwin\")\n {\n if(object.exists(\":Cancel_QMessageBox\"))\n {\n waitForObject(\":OK_QPushButton\");\n clickButton(\":OK_QPushButton\"); \n }\n snooze(1);\n if(object.exists(\":Cancel_QMessageBox\"))\n {\n waitForObject(\":OK_QPushButton\");\n clickButton(\":OK_QPushButton\"); \n }\n }\n else\n {\n if(object.exists(\":Cannot Read Configuration_QMessageBox\"))\n {\n waitForObject(\":OK_QPushButton\");\n clickButton(\":OK_QPushButton\");\n }\n if(object.exists(\":Cannot Read Configuration_QMessageBox\"))\n {\n waitForObject(\":OK_QPushButton\");\n clickButton(\":OK_QPushButton\");\n }\n }\n snooze(2);\n if(findObject(\":Setup._tree_XTreeWidget\").itemsExpandable==true)\n {\n waitForObject(\":Configure.Encryption_QModelIndex\");\n mouseClick(\":Configure.Encryption_QModelIndex\", 35, 9, 0, Qt.LeftButton); \n }\n else\n {\n waitForObject(\":_tree.Configure_QModelIndex\");\n mouseClick(\":_tree.Configure_QModelIndex\", -11, 6, 0, Qt.LeftButton);\n waitForObject(\":Configure.Encryption_QModelIndex\");\n mouseClick(\":Configure.Encryption_QModelIndex\", 35, 9, 0, Qt.LeftButton); \n }\n snooze(1);\n if(object.exists(\":OK_QPushButton\"))\n {\n clickButton(\":OK_QPushButton\");\n }\n waitForObject(\":_ccEncKeyName_QLineEdit\");\n if(findObject(\":_ccEncKeyName_QLineEdit\").text!=\"xTuple.key\")\n {\n type(\":_ccEncKeyName_QLineEdit\", \"<Right>\");\n type(\":_ccEncKeyName_QLineEdit\", \"<Ctrl+Backspace>\");\n type(\":_ccEncKeyName_QLineEdit\", \"xTuple.key\");\n test.log(\"Encryption: key name changed\");\n }\n if(findObject(\":Encryption Configuration_FileLineEdit\").text!=\"c:\\\\crypto\")\n {\n type(\":Encryption Configuration_FileLineEdit\", \"<Right>\");\n type(\":Encryption Configuration_FileLineEdit\", \"<Ctrl+Backspace>\");\n type(\":Encryption Configuration_FileLineEdit\", \"c:\\\\crypto\");\n test.log(\"Encryption: Windows location changed\");\n }\n if(findObject(\":Encryption Configuration_FileLineEdit_2\").text!=\"//home//crypto\")\n {\n type(\":Encryption Configuration_FileLineEdit_2\", \"<Right>\");\n type(\":Encryption Configuration_FileLineEdit_2\", \"<Ctrl+Backspace>\");\n type(\":Encryption Configuration_FileLineEdit_2\", \"//home//administrator//crypto\");\n test.log(\"Encryption: Linux location changed\");\n }\n if(findObject(\":Encryption Configuration_FileLineEdit_3\").text!=\"/Users/crypto\")\n {\n type(\":Encryption Configuration_FileLineEdit_3\", \"<Right>\");\n type(\":Encryption Configuration_FileLineEdit_3\", \"<Ctrl+Backspace>\");\n type(\":Encryption Configuration_FileLineEdit_3\", \"/Users/crypto\");\n test.log(\"Encryption: Mac location changed\");\n }\n waitForObject(\":xTuple ERP: *_QPushButton\");\n clickButton(\":xTuple ERP: *_QPushButton\");\n test.log(\"Encryption defined\");\n }catch(e){test.fail(\"Exception in defining Encryption:\"+e);}\n \n \n //---Restarting Application--\n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Exit xTuple ERP...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Exit xTuple ERP...\");\n \n snooze(4);\n if(OS.name==\"Linux\")\n startApplication(\"xtuple.bin\");\n \n else\n startApplication(\"xtuple\");\n \n snooze(2);\n \n loginAppl(\"CONFIGURE\"); \n \n\nvar appEdition = findApplicationEdition(); \n\n\n //-----create Entities-------\n createDept(\"MFG\",\"Manufacturing\");\n assignAllPrivileges(\"CONFIGURE\");\n \n var appEdition = findApplicationEdition();\n if(appEdition==\"Manufacturing\")\n createShift(\"1ST\",\"First\");\n else if(appEdition==\"PostBooks\" || appEdition==\"xTupleERP\")\n {\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n \n if(object.exists(\"{column='0' container=':_tree.Master Information_QModelIndex' text='Shifts' type='QModelIndex'}\"))\n test.fail(\"shifts menu found in \"+appEdition);\n else\n test.pass(\" shifts menu not found in \"+appEdition);\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\"); \n \n }\n catch(e){test.fail(\"Exception in verifying Shifts Menu\");}\n \n }\n //-------------Enabling Tab view----------------\n try{\n activateItem(waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Products\"));\n activateItem(waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Products_QMenu\", \"Item\"));\n activateItem(waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Item_QMenu\", \"List...\"));\n \n snooze(.5);\n if(object.exists(\":Tax Authorities.Close_QToolButton\"))\n {\n test.log(\"item screen opened\");\n activateItem(waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Window\"));\n snooze(.5);\n if(waitForObjectItem(\":xTuple ERP: *.Window_QMenu\", \"Tab View\"))\n {\n activateItem(waitForObjectItem(\":xTuple ERP: *.Window_QMenu\", \"Tab View\"));\n }\n clickButton(waitForObject(\":Tax Authorities.Close_QToolButton\"));\n }\n }\n catch(e)\n {\n test.fail(\"exception in changing to Tab view mode\" + e);\n if(object.exists(\":Tax Authorities.Close_QToolButton\"))\n clickButton(waitForObject(\":Tax Authorities.Close_QToolButton\"));\n }\n \n //---Restarting Application--\n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Exit xTuple ERP...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Exit xTuple ERP...\");\n \n snooze(4);\n if(OS.name==\"Linux\")\n startApplication(\"xtuple.bin\");\n \n else\n startApplication(\"xtuple\");\n \n snooze(2);\n \n loginAppl(\"CONFIGURE\"); \n\n \n var appEdition = findApplicationEdition(); \n createLocale(\"MYLOCALE\",\"My Locale For Class\");\n createRole(\"SUPER\",\"Super User Group\");\n \n //-------------Configure: Accounting Module----------------\n try{ \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\", \"Accounting\",10, 10, 0, Qt.LeftButton);\n \n snooze(0.5);\n if(findObject(\":_mainSize_QSpinBox\").currentText!=\"4\")\n {\n findObject(\":_mainSize_QSpinBox\").clear();\n type(\":_mainSize_QSpinBox\", \"4\");\n }\n \n snooze(0.2);\n \n waitForObject(\":_gl.Use Company Segment_QCheckBox\");\n if(!findObject(\":_gl.Use Company Segment_QCheckBox\").checked)\n clickButton(\":_gl.Use Company Segment_QCheckBox\");\n snooze(0.2);\n if(findObject(\":_companySegmentSize_QSpinBox_3\").currentText!=\"2\")\n {\n findObject(\":_companySegmentSize_QSpinBox_3\").clear();\n type(\":_companySegmentSize_QSpinBox_3\", \"2\");\n }\n snooze(0.2);\n if(findObject(\":_subaccountSize_QSpinBox_3\").currentText!=\"2\")\n {\n findObject(\":_subaccountSize_QSpinBox_3\").clear(); \n type(\":_subaccountSize_QSpinBox_3\", \"2\");\n }\n snooze(0.2);\n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n {\n waitForObject(\":_useCompanySegmentGroup.Enable External Company Consolidation_QCheckBox\");\n if(!findObject(\":_useCompanySegmentGroup.Enable External Company Consolidation_QCheckBox\").checked)\n clickButton(\":_useCompanySegmentGroup.Enable External Company Consolidation_QCheckBox\");\n }\n else if(appEdition==\"PostBooks\")\n {\n snooze(0.5);\n test.xverify(object.exists(\":_useCompanySegmentGroup.Enable External Company Consolidation_QCheckBox\"), \"External Company - checkbox not visible\");\n }\n snooze(0.5);\n waitForObject(\":_gl.Use Profit Centers_QCheckBox\");\n if(!findObject(\":_gl.Use Profit Centers_QCheckBox\").checked)\n type(\":_gl.Use Profit Centers_QCheckBox\",\" \");\n snooze(0.5);\n waitForObject(\":_useProfitCentersGroup.Allow Free-Form Profit Centers_QCheckBox\");\n if(!findObject(\":_useProfitCentersGroup.Allow Free-Form Profit Centers_QCheckBox\").checked)\n clickButton(\":_useProfitCentersGroup.Allow Free-Form Profit Centers_QCheckBox\");\n snooze(0.5);\n waitForObject(\":_gl.Use Subaccounts_QCheckBox\");\n if(!findObject(\":_gl.Use Subaccounts_QCheckBox\").checked)\n type(\":_gl.Use Subaccounts_QCheckBox\",\" \");\n waitForObject(\":_useSubaccountsGroup.Allow Free-Form Subaccounts_QCheckBox\");\n if(findObject(\":_useSubaccountsGroup.Allow Free-Form Subaccounts_QCheckBox\").checked)\n clickButton(\":_useSubaccountsGroup.Allow Free-Form Subaccounts_QCheckBox\");\n snooze(0.2);\n if(findObject(\":_profitCenterSize_QSpinBox_3\").currentText!=\"2\")\n {\n waitForObject(\":_profitCenterSize_QSpinBox_3\");\n findObject(\":_profitCenterSize_QSpinBox_3\").clear();\n type(\":_profitCenterSize_QSpinBox_3\", \"2\");\n }\n snooze(0.5);\n waitForObject(\":_miscGroup.Mandatory notes for Manual Journal Entries_QCheckBox\");\n if(!findObject(\":_miscGroup.Mandatory notes for Manual Journal Entries_QCheckBox\").checked)\n clickButton(\":_miscGroup.Mandatory notes for Manual Journal Entries_QCheckBox\");\n snooze(1);\n waitForObject(\":Accounting Configuration.qt_tabwidget_tabbar_QTabBar\");\n clickTab(\":Accounting Configuration.qt_tabwidget_tabbar_QTabBar\", \"Global\");\n \n waitForObject(\":Meaning of Currency Exchange Rates:.Foreign × Exchange Rate = Base_QRadioButton_2\");\n clickButton(\":Meaning of Currency Exchange Rates:.Foreign × Exchange Rate = Base_QRadioButton_2\");\n waitForObject(\":List Departments.Save_QPushButton\");\n clickButton(\":List Departments.Save_QPushButton\");\n snooze(0.5);\n if(object.exists(\":Company ID Correct?.Yes_QPushButton\"))\n clickButton(\":Company ID Correct?.Yes_QPushButton\");\n test.log(\"Acconting Module Configured\");\n }\n catch(e){test.fail(\"Exception in configuring Accounting:\"+e);}\n \n //-------Create Company: Prodiem---------\n createCompany(\"01\",\"Prodiem\");\n \n //--------------Create Currencies------------------------ \n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Master Information.Currencies_QModelIndex\");\n mouseClick(\":Master Information.Currencies_QModelIndex\", 34, 2, 0, Qt.LeftButton);\n \n \n //----------Create Foreign currency - EUR------------\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":_stack._currName_QLineEdit\");\n type(\":_stack._currName_QLineEdit\", \"Euros\");\n waitForObject(\":_stack._currSymbol_QLineEdit\");\n type(\":_stack._currSymbol_QLineEdit\", \"EUR\");\n waitForObject(\":_stack._currAbbr_QLineEdit\");\n type(\":_stack._currAbbr_QLineEdit\", \"EUR\"); \n waitForObject(\":List Departments.Save_QPushButton\");\n clickButton(\":List Departments.Save_QPushButton\"); \n snooze(2);\n \n waitForObject(\":_stack._curr_XTreeWidget\");\n if(object.exists(\":_curr.US Dollars_QModelIndex\"))\n test.pass(\"Currency: USD created\");\n else test.fail(\"Currency: USD not created\");\n \n if(object.exists(\"{column='3' container=':_stack._curr_XTreeWidget' text='EUR' type='QModelIndex'}\"))\n test.pass(\"Currency: EUR created\");\n else test.fail(\"Currency: EUR not created\");\n \n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n test.log(\"Currencies are created\");\n }\n catch(e){test.fail(\"Exception caught in creating Currencies\");\n }\n \n \n //----------Create Exchange Rates-------------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Master Information.Exchange Rates_QModelIndex\");\n mouseClick(\":Master Information.Exchange Rates_QModelIndex\", 55, 11, 0, Qt.LeftButton);\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n type(\":_stack._rate_XLineEdit\", \"1.36\");\n type(\":_stack.XDateEdit_XDateEdit\", \"-30\");\n type(\":_stack.XDateEdit_XDateEdit\", \"<Tab>\");\n waitForObject(\":_stack.XDateEdit_XDateEdit_2\");\n type(\":_stack.XDateEdit_XDateEdit_2\", \"+365\");\n type(\":_stack.XDateEdit_XDateEdit_2\", \"<Tab>\");\n waitForObject(\":_stack.Save_QPushButton\");\n clickButton(\":_stack.Save_QPushButton\");\n waitForObject(\":_frame._conversionRates_XTreeWidget\");\n if(findObject(\":_conversionRates.EUR - EUR_QModelIndex\").text== \"EUR - EUR\")\n test.pass(\"Exchange Rate of EUR created\");\n else test.fail(\"Exchange Rate of EUR not created\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n test.log(\"Exchange Rate for the currency is created\");\n }\n catch(e){test.fail(\"Exception in creating Exchange Rates:\"+e);\n }\n \n \n //-------------Accounting-Profit Center Number---------------------\n try{ \n \n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Profit Center Numbers...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Profit Center Numbers...\");\n \n waitForObject(\":List Profit Centers.New_QPushButton\");\n clickButton(\":List Profit Centers.New_QPushButton\");\n waitForObject(\":List Profit Centers._number_XLineEdit\");\n type(\":List Profit Centers._number_XLineEdit\", \"01\");\n type(\":List Profit Centers._descrip_QTextEdit\", \"Profit Center 01\");\n waitForObject(\":List Profit Centers.Save_QPushButton\");\n clickButton(\":List Profit Centers.Save_QPushButton\");\n \n waitForObject(\":List Profit Centers._prftcntr_XTreeWidget\");\n if(object.exists(\":_prftcntr.01_QModelIndex\"))\n test.pass(\"Profit Center Number: 01 created\");\n else\n test.fail(\"Profit Center Number: 01 not created\");\n waitForObject(\":List Profit Centers.Close_QPushButton\");\n clickButton(\":List Profit Centers.Close_QPushButton\");\n test.log(\"Profit Center is created\");\n }\n catch(e){test.fail(\"Exception in defining Profit Centers:\"+e);}\n \n //--------------Accounting-Account-SubAccount Numbers-----------------\n try{\n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Subaccount Numbers...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Subaccount Numbers...\");\n waitForObject(\":List Subaccounts.New_QPushButton\");\n clickButton(\":List Subaccounts.New_QPushButton\");\n waitForObject(\":List Subaccounts._number_XLineEdit\");\n type(\":List Subaccounts._number_XLineEdit\", \"01\");\n type(\":List Subaccounts._descrip_QTextEdit\", \"Subaccount 01 - General\");\n \n waitForObject(\":List Subaccounts.Save_QPushButton\");\n clickButton(\":List Subaccounts.Save_QPushButton\");\n snooze(2);\n if(object.exists(\":_subaccnt.Subaccount 01 - General_QModelIndex\")) \n test.pass(\"Profit Center Number: 01 created\");\n else\n test.fail(\"Profit Center Number: 01 not created\");\n waitForObject(\":List Subaccounts.Close_QPushButton\");\n clickButton(\":List Subaccounts.Close_QPushButton\");\n test.log(\"Sub Account Number is created\");\n }\n catch(e){test.fail(\"Exception in defining Subaccount Numbers\"+e);}\n \n \n \n \n //------------Account-Account-SubAccount Types-----------------\n try{\n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Subaccount Types...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Subaccount Types...\");\n \n \n //--SubAccount Types: SO-Revenue-Other Revenue--\n \n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"SO\");\n clickItem(\":Subaccount Type._type_XComboBox\", \"Revenue\", 0, 0, 1, Qt.LeftButton);\n type(\":Work Center._description_XLineEdit\", \"Other Revenue\");\n waitForObject(\":Work Center.Save_QPushButton\");\n clickButton(\":Work Center.Save_QPushButton\");\n test.log(\"SubAccount: SO-Revenue-Other Revenue created\");\n \n //--SubAccount Types: DXP-Expenses-Depreciation Expense--\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"DXP\");\n clickItem(\":Subaccount Type._type_XComboBox\", \"Expense\", 0, 0, 1, Qt.LeftButton);\n type(\":Work Center._description_XLineEdit\", \"Depreciation Expense\");\n waitForObject(\":Work Center.Save_QPushButton\");\n clickButton(\":Work Center.Save_QPushButton\");\n \n \n //--SubAccount Types: OI-Revenue-Other Income--\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"OI\");\n clickItem(\":Subaccount Type._type_XComboBox\", \"Revenue\", 0, 0, 1, Qt.LeftButton);\n type(\":Work Center._description_XLineEdit\", \"Other Income\");\n waitForObject(\":Work Center.Save_QPushButton\");\n clickButton(\":Work Center.Save_QPushButton\");\n \n snooze(1);\n waitForObject(\":List G/L Subaccount Types.Close_QPushButton\");\n \n if(object.exists(\":_subaccnttypes.SO_QModelIndex\"))\n test.pass(\"SubAccountL:SO Revenue created\");\n else \n test.fail(\"SubAccountL:SO Revenue not created\");\n \n if(object.exists(\":_subaccnttypes.DXP_QModelIndex_2\"))\n test.pass(\"SubAccount: DXP Expense created\");\n else\n test.fail(\"SubAccount: DXP Expense not created\");\n \n if(object.exists(\":_subaccnttypes.OI_QModelIndex_2\"))\n test.pass(\"SubAccount: OI Expense created\");\n else\n test.fail(\"SubAccount: OI Expense not created\");\n snooze(0.1);\n \n waitForObject(\":List Work Centers.Close_QPushButton\");\n clickButton(\":List Work Centers.Close_QPushButton\");\n }\n catch(e){test.fail(\"Exception in creating Subaccounts:\"+e);}\n \n \n \n \n \n \n //-----------Create Chart Of Accounts-------------------------------\n try{ \n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Chart of Accounts...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Chart of Accounts...\");\n waitForObject(\":_account_XTreeWidget\");\n \n COA(\"01\",\"01\",\"1950\",\"01\",\"Unassigned Inv Transactions\",\"Asset\",\"IN\");\n \n COA(\"01\",\"01\",\"3030\",\"01\",\"Retained Earnings\",\"Equity\",\"EC\");\n \n COA(\"01\",\"01\",\"3040\",\"01\",\"Stock Class B\",\"Equity\",\"EDC\");\n \n COA(\"01\",\"01\",\"8990\",\"01\",\"Currency Gain / Loss\",\"Expense\",\"EXP\");\n \n COA(\"01\",\"01\",\"8995\",\"01\",\"G/L Series Discrepancy\",\"Expense\",\"EXP\"); \n \n waitForObject(\":Chart of Accounts.Close_QPushButton\");\n clickButton(\":Chart of Accounts.Close_QPushButton\");\n \n }catch(e){test.fail(\"Exception caught in creating Chart of Accounts:\"+e);}\n \n \n \n //-----------------Configure: Products Module--------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\", \"Products\",10, 10, 0, Qt.LeftButton);\n waitForObject(\":Configure.Products_QModelIndex\");\n mouseClick(\":Configure.Products_QModelIndex\", 37, 4, 0, Qt.LeftButton);\n waitForObject(\":Products Configuration.Post Item Changes to the Change Log_QCheckBox\");\n if(appEdition==\"Manufacturing\")\n {\n if(!findObject(\":Products Configuration.Enable Work Center Routings_QGroupBox\").checked)\n type(\":Products Configuration.Enable Work Center Routings_QGroupBox\",\" \");\n if(!findObject(\":Track Machine Overhead.as Machine Overhead_QRadioButton\").checked)\n clickButton(\":Track Machine Overhead.as Machine Overhead_QRadioButton\");\n if(!findObject(\":Products Configuration.Enable Breeder Bills of Materials_QCheckBox\").checked)\n clickButton(\":Products Configuration.Enable Breeder Bills of Materials_QCheckBox\");\n if(!findObject(\":Products Configuration.Enable Transforms_QCheckBox\").checked)\n clickButton(\":Products Configuration.Enable Transforms_QCheckBox\");\n if(!findObject(\":Products Configuration.Enable Revision Control_QCheckBox\").checked)\n clickButton(\":Products Configuration.Enable Revision Control_QCheckBox\");\n }\n else if(appEdition==\"Standard\"||appEdition==\"PostBooks\")\n {\n test.xverify(object.exists(\":Products Configuration.Enable Work Center Routings_QGroupBox\"), \"Enable Work Center - groupbox not visible\");\n test.xverify(object.exists(\":Track Machine Overhead.as Machine Overhead_QRadioButton\"), \"Machine Overhead - RadioButton not visible\"); \n test.xverify(object.exists(\":Products Configuration.Enable Breeder Bills of Materials_QCheckBox\"), \"Enable Breeder Bills of Materials - not visible\"); \n \n }\n \n if(!findObject(\":Products Configuration.Post Item Changes to the Change Log_QCheckBox\").checked)\n findObject(\":Products Configuration.Post Item Changes to the Change Log_QCheckBox\").checked= true;\n if(findObject(\":Products Configuration.Allow Inactive Items to be Added to BOMs_QCheckBox\").checked)\n findObject(\":Products Configuration.Allow Inactive Items to be Added to BOMs_QCheckBox\").checked=false; \n if(findObject(\":Defaults.Set Sold Items as Exclusive_QCheckBox\").checked)\n findObject(\":Defaults.Set Sold Items as Exclusive_QCheckBox\").checked=false;\n type(\":_issueMethod_QComboBox\", \"Mixed\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n if(appEdition==\"Manufacturing\")\n {\n waitForObject(\":Registration Key.Yes_QPushButton\");\n clickButton(\":Registration Key.Yes_QPushButton\");\n }\n else if(appEdition==\"Standard\"||appEdition==\"PostBooks\")\n test.xverify(object.exists(\":Registration Key.Yes_QPushButton\"), \"Cancel Yes Button - not visible\"); \n \n test.log(\"Product Module Configured\");\n }catch(e){test.fail(\"Exception in configuring Products Module\");}\n \n \n \n //----------Create Incident Category-----------\n try{ \n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\",\"CRM\",10, 10, 0, Qt.LeftButton);\n waitForObject(\":Master Information.Incident Categories_QModelIndex\");\n mouseClick(\":Master Information.Incident Categories_QModelIndex\", 73, 4, 0, Qt.LeftButton);\n waitForObject(\":List Incident Categories.New_QPushButton\");\n clickButton(\":List Incident Categories.New_QPushButton\");\n waitForObject(\":_name_XLineEdit_14\");\n type(\":_name_XLineEdit_14\", \"DUNNING\");\n waitForObject(\":Incident Category._order_QSpinBox\");\n findObject(\":Incident Category._order_QSpinBox\").clear();\n snooze(0.1);\n type(\":Incident Category._order_QSpinBox\", \"90\");\n type(\":Incident Category._descrip_QTextEdit\", \"Dunning Incident\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\"); \n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"Incident Category is created\");\n }catch(e)\n {\n test.fail(\"Exception in creating Incident Categories\"+e);\n }\n \n //----------Configure Accounts Receivable-------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Setup...\");\n waitForObject(\":Accounting Configuration.qt_tabwidget_tabbar_QTabBar\");\n clickTab(\":Accounting Configuration.qt_tabwidget_tabbar_QTabBar\",\"Accounts Receivable\");\n waitForObject(\":_ar._nextARMemoNumber_XLineEdit\");\n findObject(\":_ar._nextARMemoNumber_XLineEdit\").clear();\n snooze(0.5);\n type(\":_ar._nextARMemoNumber_XLineEdit\",\"20000\");\n waitForObject(\":_ar._nextCashRcptNumber_XLineEdit\");\n findObject(\":_ar._nextCashRcptNumber_XLineEdit\").clear();\n snooze(0.5);\n type(\":_ar._nextCashRcptNumber_XLineEdit\",\"10000\");\n waitForObject(\":Remit-To Address._name_XLineEdit\");\n findObject(\":Remit-To Address._name_XLineEdit\").clear();\n type(\":Remit-To Address._name_XLineEdit\", \"ProDium Toys\");\n waitForObject(\":Maintain Item Costs.XLineEdit_XLineEdit\");\n findObject(\":Maintain Item Costs.XLineEdit_XLineEdit\").clear();\n type(\":Maintain Item Costs.XLineEdit_XLineEdit\", \"Accounts Receivable\");\n waitForObject(\":Remit-To Address.XLineEdit_XLineEdit\");\n findObject(\":Remit-To Address.XLineEdit_XLineEdit\").clear();\n type(\":Remit-To Address.XLineEdit_XLineEdit\", \"12100 Playland Way\");\n waitForObject(\":Remit-To Address.XLineEdit_XLineEdit_2\");\n findObject(\":Remit-To Address.XLineEdit_XLineEdit_2\").clear();\n waitForObject(\":Remit-To Address.XLineEdit_XLineEdit_3\");\n findObject(\":Remit-To Address.XLineEdit_XLineEdit_3\").clear();\n type(\":Remit-To Address.XLineEdit_XLineEdit_3\", \"Norfolk\");\n waitForObject(\":Remit-To Address._state_XComboBox\");\n \n \n while(findObject(\":Remit-To Address._country_XComboBox\").currentText!=\"United States\")\n type(\":Remit-To Address._country_XComboBox\",\"<Down>\");\n snooze(1);\n waitForObject(\":Remit-To Address._phone_XLineEdit\");\n findObject(\":Remit-To Address._phone_XLineEdit\").clear();\n snooze(0.5);\n type(\":Remit-To Address._phone_XLineEdit\", \"757-461-3022\");\n \n if(!findObject(\":_ar.Credit Warn Customers when Late_QGroupBox\").checked)\n type(\":_ar.Credit Warn Customers when Late_QGroupBox\",\" \");\n waitForObject(\":Credit Warn Customers when Late._graceDays_QSpinBox\");\n findObject(\":Credit Warn Customers when Late._graceDays_QSpinBox\").clear();\n snooze(0.5);\n type(\":Credit Warn Customers when Late._graceDays_QSpinBox\", \"15\");\n snooze(1);\n waitForObject(\":_ar._incdtCategory_XComboBox_2\");\n clickItem(\":_ar._incdtCategory_XComboBox_2\",\"DUNNING\",10,10,0, Qt.LeftButton);\n if(!findObject(\":_ar.Auto Close Incidents when Invoice Paid_QCheckBox\").checked)\n clickButton(\":_ar.Auto Close Incidents when Invoice Paid_QCheckBox\");\n snooze(1);\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"Accounting Module is configured\");\n }\n catch(e){\n test.fail(\"Exception in configuring Accounting module:\"+e);\n }\n \n //------------Configure Manufacture Module----------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Manufacture\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Manufacture\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Manufacture_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Manufacture_QMenu\", \"Setup...\");\n \n waitForObject(\":Configure.Manufacture_QModelIndex\");\n mouseClick(\":Configure.Manufacture_QModelIndex\", 45, 2, 0, Qt.LeftButton);\n \n waitForObject(\":Manufacture Configuration._nextWoNumber_XLineEdit\");\n findObject(\":Manufacture Configuration._nextWoNumber_XLineEdit\").clear();\n type(\":Manufacture Configuration._nextWoNumber_XLineEdit\", \"10000\");\n \n if(object.exists(\":Manufacture Configuration.Auto Fill Post Operation Qty. to Balance_QCheckBox\"))\n {\n if(!findObject(\":Manufacture Configuration.Auto Fill Post Operation Qty. to Balance_QCheckBox\").checked)\n mouseClick(\":Manufacture Configuration.Auto Fill Post Operation Qty. to Balance_QCheckBox\",73, 4, 0, Qt.LeftButton);\n }\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"Manufacture Module is configured\");\n \n }\n catch(e){\n test.fail(\"Exception in configuring Manufacture module:\"+e);\n }\n \n \n //------------Configure CRM Module----------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"CRM\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"CRM\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.CRM_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.CRM_QMenu\", \"Setup...\");\n \n waitForObject(\":Configure.CRM_QModelIndex\");\n mouseClick(\":Configure.CRM_QModelIndex\", 45, 2, 0, Qt.LeftButton);\n \n waitForObject(\":CRM Configuration._nextInNumber_XLineEdit\");\n findObject(\":CRM Configuration._nextInNumber_XLineEdit\").clear();\n type(\":CRM Configuration._nextInNumber_XLineEdit\", \"15000\");\n \n if(!findObject(\":CRM Configuration.Use Projects_QCheckBox\").checked)\n mouseClick(\":CRM Configuration.Use Projects_QCheckBox\", 35, 10, 0, Qt.LeftButton);\n \n if(!findObject(\":_stack.Post Opportunity Changes to the Change Log_QCheckBox\").checked)\n clickButton(\":_stack.Post Opportunity Changes to the Change Log_QCheckBox\");\n \n waitForObject(\":_country_XComboBox_3\");\n while(findObject(\":_country_XComboBox_3\").currentText!=\"United States\")\n type(\":_country_XComboBox_3\",\"<Down>\");\n snooze(1);\n \n if(findObject(\":_stack.Enforce Valid Country Names_XCheckBox\").active)\n {\n if(!findObject(\":_stack.Enforce Valid Country Names_XCheckBox\").checked)\n clickButton(\":_stack.Enforce Valid Country Names_XCheckBox\");\n }\n \n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"CRM Module is configured\");\n }\n catch(e){\n test.fail(\"Exception in configuring CRM module:\"+e);\n }\n \n //-----------create new calendar---------------\n try{\n \n var i,j;\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Master Information.Calendars_QModelIndex\");\n mouseClick(\":Master Information.Calendars_QModelIndex\", 34, 4, 0, Qt.LeftButton);\n snooze(0.5);\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":_stack.Relative_QPushButton\");\n clickButton(\":_stack.Relative_QPushButton\"); \n waitForObject(\":_stack._name_XLineEdit\");\n type(\":_stack._name_XLineEdit\", \"8WRELDAYFW\");\n waitForObject(\":_stack._descrip_XLineEdit\");\n type(\":_stack._descrip_XLineEdit\", \"8 Weeks Forward From Today\");\n snooze(0.5);\n while(findObject(\":Calendar Type:._origin_QComboBox\").currentText!=\"Current Day\")\n type(\":Calendar Type:._origin_QComboBox\",\"<Down>\");\n \n for(i=0;i<8;i++)\n {\n waitForObject(\":_stack.New_QPushButton_2\");\n clickButton(\":_stack.New_QPushButton_2\");\n j=i+1;\n waitForObject(\":_stack._name_XLineEdit_2\");\n type(\":_stack._name_XLineEdit_2\", \"WEEK\"+j);\n findObject(\":_stack._offsetCount_QSpinBox\").clear();\n type(\":_stack._offsetCount_QSpinBox\",i);\n waitForObject(\":_stack._offsetType_QComboBox\");\n clickItem(\":_stack._offsetType_QComboBox\",\"Weeks\",10,10,0, Qt.LeftButton);\n snooze(1);\n waitForObject(\":Work Center.Save_QPushButton\");\n clickButton(\":Work Center.Save_QPushButton\");\n }\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"New Calendar is created\");\n }\n catch(e){\n test.fail(\"Exception in creating new calendar:\"+e);\n }\n \n if(appEdition==\"Manufacturing\"|| appEdition==\"Standard\")\n {\n //----------Configure Schedule module--------------\n try{\n \n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Schedule\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Schedule\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Schedule_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Schedule_QMenu\", \"Setup...\"); \n waitForObject(\":Configure.Schedule_QModelIndex\");\n mouseClick(\":Configure.Schedule_QModelIndex\", 11, 4, 0, Qt.LeftButton);\n snooze(0.5);\n findObject(\":Schedule Configuration._nextPlanNumber_XLineEdit\").clear();\n type(\":Schedule Configuration._nextPlanNumber_XLineEdit\", \"90000\");\n \n waitForObject(\":Schedule Configuration._calendar_CalendarComboBox\");\n clickItem(\":Schedule Configuration._calendar_CalendarComboBox\",\"8WRELDAYFW\",10,10,0, Qt.LeftButton);\n snooze(1);\n \n if(object.exists(\":Schedule Configuration.Enable Constraint Management_QCheckBox\"))\n {\n if(!findObject(\":Schedule Configuration.Enable Constraint Management_QCheckBox\").checked)\n clickButton(\":Schedule Configuration.Enable Constraint Management_QCheckBox\");\n }\n \n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n test.log(\"Schedule Module is configured\");\n \n }\n catch(e){\n test.fail(\"Exception in configuring Schedule module:\"+e);\n }\n \n }\n \n //----------Create new Title--------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\",\"CRM\",10, 10, 0, Qt.LeftButton);\n waitForObject(\":Master Information.Titles_QModelIndex\");\n mouseClick(\":Master Information.Titles_QModelIndex\", 12, 9, 0, Qt.LeftButton);\n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"Master\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n snooze(1);\n if(object.exists(\":_honorifics.Master_QModelIndex_2\"))\n test.pass(\"Title: Master created\");\n else test.fail(\"Title: Master not created\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n test.log(\"New Title is created\");\n }catch(e){test.fail(\"Exception in defining Title:\"+e);}\n \n \n //-------------Create Site Types------------------\n try{\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\",\"Inventory\",10,10, 0, Qt.LeftButton);\n waitForObject(\":Master Information.Site Types_QModelIndex\");\n mouseClick(\":Master Information.Site Types_QModelIndex\", 42, 4, 0, Qt.LeftButton);\n \n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"INTRAN\");\n waitForObject(\":Work Center._description_XLineEdit\");\n type(\":Work Center._description_XLineEdit\",\"Intransit Site\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n snooze(1);\n if(object.exists(\"{column='0' container=':_stack._sitetype_XTreeWidget' text='INTRAN' type='QModelIndex'}\"))\n test.pass(\"Site Type: INTRAN created\");\n \n waitForObject(\":List Work Centers.New_QPushButton\");\n clickButton(\":List Work Centers.New_QPushButton\");\n waitForObject(\":Work Center._code_XLineEdit\");\n type(\":Work Center._code_XLineEdit\", \"STORAGE\");\n waitForObject(\":Work Center._description_XLineEdit\");\n type(\":Work Center._description_XLineEdit\",\"Storage Site\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\"); \n if(object.exists(\"{column='0' container=':_stack._sitetype_XTreeWidget' text='STORAGE' type='QModelIndex'}\"))\n test.pass(\"Site Type: STORAGE created\"); \n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n \n }\n catch(e)\n {test.fail(\"Exception in Creating Site Type:\"+e);\n }\n \n //---find Application Edition---\n var appEdition = findApplicationEdition();\n \n //-------------------Assigning Accounts to Company-------------------\n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n {\n try\n {\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Companies...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Companies...\");\n waitForObject(\":List Companies._company_XTreeWidget\");\n doubleClickItem(\":List Companies._company_XTreeWidget\",\"01\", 10, 10,0,Qt.LeftButton);\n \n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit\",\"01-01-3030-01\");\n nativeType(\"<Tab>\");\n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_2\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_2\",\"01-01-8990-01\");\n nativeType(\"<Tab>\");\n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_3\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_3\",\"01-01-8995-01\");\n nativeType(\"<Tab>\");\n snooze(0.5);\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n waitForObject(\":List Companies.Close_QPushButton\");\n clickButton(\":List Companies.Close_QPushButton\");\n test.log(\"Accounts Assigned to the company\");\n }\n catch(e)\n {\n test.fail(\"Error in assigning accounts to the company\"+ e);\n }\n }\n else\n {\n try \n {\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Accounting\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Accounting_QMenu\", \"Account\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Companies...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Account_QMenu\", \"Companies...\");\n waitForObject(\":List Companies._company_XTreeWidget\");\n doubleClickItem(\":List Companies._company_XTreeWidget\",\"01\", 10, 10,0,Qt.LeftButton);\n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_3\",\"01-01-3030-01\");\n nativeType(\"<Tab>\");\n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit\",\"01-01-8990-01\");\n nativeType(\"<Tab>\");\n waitForObject(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_2\");\n type(\":List Companies.VirtualClusterLineEdit_GLClusterLineEdit_2\",\"01-01-8995-01\");\n nativeType(\"<Tab>\");\n snooze(0.5);\n waitForObject(\":List Employees.Save_QPushButton_2\");\n clickButton(\":List Employees.Save_QPushButton_2\");\n waitForObject(\":List Companies.Close_QPushButton\");\n clickButton(\":List Companies.Close_QPushButton\");\n test.log(\"Accounts Assigned to the company\");\n }\n catch(e)\n {\n test.fail(\"Error in assigning accounts to the company\"+ e);\n }\n }\n \n \n \n //-----------Create Inventory Site: WH1-----------------\n try{\n if(appEdition==\"Manufacturing\"|| appEdition==\"Standard\")\n {\n \n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Inventory\"); \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Inventory_QMenu\", \"Site\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Inventory_QMenu\", \"Site\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Site_QMenu\", \"List...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Site_QMenu\", \"List...\");\n waitForObject(\":List Sites.New_QPushButton\");\n clickButton(\":List Sites.New_QPushButton\");\n \n waitForObject(\":_code_XLineEdit_3\");\n type(\":_code_XLineEdit_3\", \"WH1\");\n type(\":_description_XLineEdit_5\", \"Prodiem Toys Site1\");\n if(findObject(\":_sitetype_XComboBox\").currentText!= \"WHSE\")\n clickItem(\":_sitetype_XComboBox\", \"WHSE\", 0, 0, 1, Qt.LeftButton);\n type(\":_addressGroup.XLineEdit_XLineEdit\", \"street addr line1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_2\", \"street addr line2\");\n type(\":_addressGroup.XLineEdit_XLineEdit_3\", \"street addr line3\");\n type(\":_addressGroup.XLineEdit_XLineEdit_4\", \"city1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_5\", \"23234324\");\n clickItem(\":_addressGroup._country_XComboBox_2\", \"United States\", 0, 0, 1, Qt.LeftButton);\n snooze(1);\n waitForObject(\":_addressGroup._state_XComboBox_4\");\n clickItem(\":_addressGroup._state_XComboBox_4\",\"VA\",0, 0, 1, Qt.LeftButton);\n snooze(1);\n \n waitForObject(\":_accountGroup.VirtualClusterLineEdit_GLClusterLineEdit\");\n waitForObject(\":_accountGroup_QLabel\");\n sendEvent(\"QMouseEvent\", \":_accountGroup_QLabel\", QEvent.MouseButtonPress, 0, 0, Qt.LeftButton, 0);\n waitForObjectItem(\":_QMenu\", \"List...\");\n activateItem(\":_QMenu\", \"List...\");\n waitForObject(\":_listTab_XTreeWidget_9\");\n doubleClickItem(\":_listTab_XTreeWidget_9\",\"1950\", 10, 8, 0, Qt.LeftButton);\n \n clickTab(\":List Sites.qt_tabwidget_tabbar_QTabBar\",\"General\");\n waitForObject(\":_generalTab.Inventory Site_QRadioButton\");\n clickButton(\":_generalTab.Inventory Site_QRadioButton\");\n waitForObject(\":_whsTypeStack._bolNumber_XLineEdit\");\n type(\":_whsTypeStack._bolNumber_XLineEdit\", \"10000\");\n type(\":_whsTypeStack._countTagNumber_XLineEdit\", \"20000\");\n clickButton(\":_whsTypeStack.Shipping Site_QCheckBox\");\n clickButton(\":_whsTypeStack.Force the use of Count Slips_QCheckBox\");\n clickButton(\":_whsTypeStack.Enforce the use of Zones_QCheckBox\");\n type(\":_whsTypeStack._shipcomm_XLineEdit\", \"0.00\");\n \n clickTab(\":List Sites.qt_tabwidget_tabbar_QTabBar\", \"Site Locations\");\n waitForObject(\":_locationsTab.Enforce ARBL Naming Convention_QGroupBox\"); \n type(\":_locationsTab.Enforce ARBL Naming Convention_QGroupBox\",\"Space>\");\n findObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox\").clear();\n type(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox\");\n findObject(\":Enforce ARBL Naming Convention._rackSize_QSpinBox\").clear();\n type(\":Enforce ARBL Naming Convention._rackSize_QSpinBox\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_2\");\n findObject(\":Enforce ARBL Naming Convention._binSize_QSpinBox\").clear();\n type(\":Enforce ARBL Naming Convention._binSize_QSpinBox\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_3\");\n findObject(\":Enforce ARBL Naming Convention._locationSize_QSpinBox\");\n type(\":Enforce ARBL Naming Convention._locationSize_QSpinBox\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_4\");\n clickTab(\":List Sites.qt_tabwidget_tabbar_QTabBar\", \"Site Zones\");\n snooze(1);\n \n waitForObject(\":List Calendars.New_QPushButton_2\");\n clickButton(\":List Calendars.New_QPushButton_2\");\n waitForObject(\":_name_XLineEdit_32\");\n type(\":_name_XLineEdit_32\", \"FG1\");\n type(\":_description_XLineEdit_43\", \"Finished Goods Zone1\");\n clickButton(\":List Sites.Save_QPushButton\");\n snooze(1);\n clickButton(\":List Calendars.New_QPushButton_2\");\n waitForObject(\":_name_XLineEdit_32\");\n type(\":_name_XLineEdit_32\", \"RM1\");\n type(\":_description_XLineEdit_43\", \"Raw Materials Zone1\");\n clickButton(\":List Sites.Save_QPushButton\");\n waitForObject(\":Save_QPushButton\");\n clickButton(\":Save_QPushButton\");\n waitForObject(\":List Sites._warehouse_XTreeWidget\");\n if(object.exists(\"{column='0' container=':List Sites._warehouse_XTreeWidget' text='WH1' type='QModelIndex'}\"))\n test.pass(\"Site: Prodiem Toys Site1 created \");\n else test.fail(\"Site: Prodiem Toys Site1 not created \");\n \n \n }\n else if(appEdition==\"PostBooks\")\n {\n waitForObject(\":xTuple ERP: OpenMFG Edition_QMenuBar\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Inventory\"); \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Inventory_QMenu\", \"Site\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Inventory_QMenu\", \"Site\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Site_QMenu\", \"Maintain...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Site_QMenu\", \"Maintain...\");\n waitForObject(\":_code_XLineEdit_14\");\n type(\":_code_XLineEdit_14\", \"WH1\");\n type(\":_sitetype_XComboBox_2\", \"WHSE\");\n type(\":_description_XLineEdit_26\", \"Prodiem Toys Site1\");\n type(\":_addressGroup.XLineEdit_XLineEdit\", \"street addr line1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_2\", \"street addr line2\");\n type(\":_addressGroup.XLineEdit_XLineEdit_3\", \"street addr line3\");\n type(\":_addressGroup.XLineEdit_XLineEdit_4\", \"city1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_5\", \"23234324\");\n clickItem(\":_addressGroup._country_XComboBox_2\", \"United States\", 0, 0, 1, Qt.LeftButton);\n snooze(1);\n waitForObject(\":_addressGroup._state_XComboBox_4\");\n clickItem(\":_addressGroup._state_XComboBox_4\",\"VA\",0, 0, 1, Qt.LeftButton);\n snooze(1); \n \n waitForObject(\":_accountGroup.VirtualClusterLineEdit_GLClusterLineEdit\");\n waitForObject(\":_accountGroup_QLabel\");\n sendEvent(\"QMouseEvent\", \":_accountGroup_QLabel\", QEvent.MouseButtonPress, 0, 0, Qt.LeftButton, 0);\n waitForObjectItem(\":_QMenu\", \"List...\");\n activateItem(\":_QMenu\", \"List...\");\n waitForObject(\":_listTab_XTreeWidget_9\");\n doubleClickItem(\":_listTab_XTreeWidget_9\",\"1950\", 10, 8, 0, Qt.LeftButton);\n \n snooze(0.1);\n clickTab(\":Site.qt_tabwidget_tabbar_QTabBar\", \"Site Locations\");\n waitForObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\");\n findObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_5\");\n findObject(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\",\"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_6\");\n findObject(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\",\"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_7\");\n findObject(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\",\"2\");\n waitForObject(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_8\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_8\");\n snooze(1);\n clickTab(\":Site.qt_tabwidget_tabbar_QTabBar\", \"Site Zones\");\n snooze(1);\n \n waitForObject(\":_zonesTab.New_QPushButton\");\n clickButton(\":_zonesTab.New_QPushButton\");\n waitForObject(\":_name_XLineEdit_32\");\n type(\":_name_XLineEdit_32\", \"FG1\");\n type(\":_description_XLineEdit_43\", \"Finished Goods Zone1\");\n clickButton(\":List Sites.Save_QPushButton\");\n \n snooze(1);\n clickButton(\":_zonesTab.New_QPushButton\");\n waitForObject(\":_name_XLineEdit_32\");\n \n type(\":_name_XLineEdit_32\", \"RM1\");\n type(\":_description_XLineEdit_43\", \"Raw Materials Zone1\");\n clickButton(\":List Sites.Save_QPushButton\");\n \n waitForObject(\":Save_QPushButton_2\");\n clickButton(\":Save_QPushButton_2\");\n test.log(\"site created:WH1\");\n \n }\n \n \n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n {\n \n //-------Create Inventory Site: WH2-----------------\n waitForObject(\":List Sites.New_QPushButton\");\n clickButton(\":List Sites.New_QPushButton\");\n waitForObject(\":_code_XLineEdit_3\");\n type(\":_code_XLineEdit_3\", \"WH2\");\n type(\":_description_XLineEdit_5\", \"Prodiem Toys Site2\");\n if(findObject(\":_sitetype_XComboBox\").currentText!= \"WHSE\")\n type(\":_sitetype_XComboBox\",\"WHSE\");\n type(\":_addressGroup.XLineEdit_XLineEdit\", \"street addr line1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_2\", \"street addr line2\");\n type(\":_addressGroup.XLineEdit_XLineEdit_3\", \"street addr line3\");\n type(\":_addressGroup.XLineEdit_XLineEdit_4\", \"city1\");\n type(\":_addressGroup.XLineEdit_XLineEdit_5\", \"23234324\");\n clickItem(\":_addressGroup._country_XComboBox_2\", \"United States\", 0, 0, 1, Qt.LeftButton);\n snooze(1);\n waitForObject(\":_addressGroup._state_XComboBox_4\");\n clickItem(\":_addressGroup._state_XComboBox_4\",\"VA\",0, 0, 1, Qt.LeftButton);\n snooze(1);\n \n waitForObject(\":_accountGroup.VirtualClusterLineEdit_GLClusterLineEdit\");\n waitForObject(\":_accountGroup_QLabel\");\n sendEvent(\"QMouseEvent\", \":_accountGroup_QLabel\", QEvent.MouseButtonPress, 0, 0, Qt.LeftButton, 0);\n waitForObjectItem(\":_QMenu\", \"List...\");\n activateItem(\":_QMenu\", \"List...\");\n waitForObject(\":_listTab_XTreeWidget_9\");\n doubleClickItem(\":_listTab_XTreeWidget_9\",\"1950\", 10, 8, 0, Qt.LeftButton);\n snooze(0.1);\n clickTab(\":Site.qt_tabwidget_tabbar_QTabBar\", \"Site Locations\");\n waitForObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\");\n findObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._aisleSize_QSpinBox_2\", \"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_5\");\n findObject(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._rackSize_QSpinBox_2\",\"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_6\");\n findObject(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._binSize_QSpinBox_2\",\"2\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_7\");\n findObject(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\").clear();\n waitForObject(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\");\n type(\":Enforce ARBL Naming Convention._locationSize_QSpinBox_2\",\"2\");\n waitForObject(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_8\");\n clickButton(\":Enforce ARBL Naming Convention.Allow Alpha Characters_QCheckBox_8\");\n snooze(1);\n clickTab(\":Site.qt_tabwidget_tabbar_QTabBar\", \"Site Zones\");\n snooze(1);\n \n waitForObject(\":List Calendars.New_QPushButton_2\");\n clickButton(\":List Calendars.New_QPushButton_2\");\n waitForObject(\":_name_XLineEdit_31\");\n type(\":_name_XLineEdit_31\", \"FG11\");\n type(\":_description_XLineEdit_43\", \"Finished Goods Zone1\");\n clickButton(\":Site Zone.Save_QPushButton\");\n \n snooze(1);\n clickButton(\":List Calendars.New_QPushButton_2\");\n waitForObject(\":_name_XLineEdit_31\");\n \n type(\":_name_XLineEdit_31\", \"RM11\");\n type(\":_description_XLineEdit_43\", \"Raw Materials Zone1\");\n clickButton(\":Site Zone.Save_QPushButton\");\n \n \n clickTab(\":List Sites.qt_tabwidget_tabbar_QTabBar\",\"General\");\n waitForObject(\":_generalTab.Inventory Site_QRadioButton\");\n clickButton(\":_generalTab.Inventory Site_QRadioButton\");\n waitForObject(\":_numberGroup._bolNumber_XLineEdit\");\n findObject(\":_numberGroup._bolNumber_XLineEdit\").clear();\n type(\":_numberGroup._bolNumber_XLineEdit\", \"WH2\");\n findObject(\":_countTagPrefix_XLineEdit_2\").clear();\n type(\":_countTagPrefix_XLineEdit_2\", \"WH2\");\n type(\":_whsTypeStack._bolNumber_XLineEdit\", \"10000\");\n type(\":_whsTypeStack._countTagNumber_XLineEdit\", \"20000\");\n clickButton(\":_whsTypeStack.Shipping Site_QCheckBox\");\n clickButton(\":_whsTypeStack.Force the use of Count Slips_QCheckBox\");\n clickButton(\":_whsTypeStack.Enforce the use of Zones_QCheckBox\");\n type(\":_whsTypeStack._shipcomm_XLineEdit\", \"0.00\");\n \n waitForObject(\":Save_QPushButton_2\");\n clickButton(\":Save_QPushButton_2\");\n waitForObject(\":List Sites._warehouse_XTreeWidget\");\n if(object.exists(\"{column='0' container=':List Sites._warehouse_XTreeWidget' text='WH2' type='QModelIndex'}\"))\n test.pass(\"Site: Prodiem Toys Site2 created\");\n else test.fail(\"Site: Prodiem Toys Site2 not created\");\n \n waitForObject(\":List Sites.Close_QPushButton\");\n clickButton(\":List Sites.Close_QPushButton\");\n \n \n }\n \n } catch(e){test.fail(\"Exception in Creating Site\"+ e );}\n \n \n \n //----------Configure: Inventory Module-----------------\n try{\n \n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Setup...\");\n waitForObject(\":Setup._modules_QComboBox\");\n clickItem(\":Setup._modules_QComboBox\",\"Inventory\",10,10, 0, Qt.LeftButton);\n waitForObject(\":Configure.Inventory_QModelIndex\");\n mouseClick(\":Configure.Inventory_QModelIndex\", 30, 3, 0, Qt.LeftButton);\n waitForObject(\":_eventFence_QSpinBox\");\n type(\":_eventFence_QSpinBox\", \"<Ctrl+A>\");\n type(\":_eventFence_QSpinBox\", \"<Del>\");\n type(\":_eventFence_QSpinBox\", \"30\");\n if(!findObject(\":_inventory.Post Item Site Changes to the Change Log_QCheckBox\").checked)\n clickButton(\":_inventory.Post Item Site Changes to the Change Log_QCheckBox\");\n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n {\n if(!findObject(\":Multiple Sites.Enable Shipping Interface from Transfer Order screen_QCheckBox\").checked)\n clickButton(\":Multiple Sites.Enable Shipping Interface from Transfer Order screen_QCheckBox\");\n if(!findObject(\":Multiple Sites.Post Transfer Order Changes to the Change Log_QCheckBox\").checked)\n clickButton(\":Multiple Sites.Post Transfer Order Changes to the Change Log_QCheckBox\");\n while(findObject(\":_toNumGeneration_QComboBox\").currentText!=\"Automatic\")\n type(\":_toNumGeneration_QComboBox\",\"<Down>\");\n waitForObject(\":_toNextNum_XLineEdit\");\n findObject(\":_toNextNum_XLineEdit\").clear();\n waitForObject(\":_toNextNum_XLineEdit\");\n type(\":_toNextNum_XLineEdit\", \"90000\");\n if(!findObject(\":_inventory.Enable Lot/Serial Control_QCheckBox\").checked)\n clickButton(\":_inventory.Enable Lot/Serial Control_QCheckBox\");\n }\n else if(appEdition==\"PostBooks\")\n {\n test.xverify(object.exists(\":Multiple Sites.Enable Shipping Interface from Transfer Order screen_QCheckBox\"),\"Enable Shipping Interface - not visible\");\n test.xverify(object.exists(\":Multiple Sites.Post Transfer Order Changes to the Change Log_QCheckBox\"),\"Post Transfer Order Changes - not visible\");\n test.xverify(object.exists(\":_toNumGeneration_QComboBox\"),\"To Number Generation combobox - not visible\");\n test.xverify(object.exists(\":_toNextNum_XLineEdit\"),\"To Next number - not visible\");\n test.xverify(object.exists(\":_inventory.Enable Lot/Serial Control_QCheckBox\"),\"Enable Lot/Serial Control - not visible\"); \n \n }\n if(!findObject(\":Costing Methods Allowed.Average_QCheckBox\").checked)\n clickButton(\":Costing Methods Allowed.Average_QCheckBox\");\n if(!findObject(\":When Count Tag Qty. exceeds Slip Qty..Do Not Post Count Tag_QRadioButton\").checked)\n clickButton(\":When Count Tag Qty. exceeds Slip Qty..Do Not Post Count Tag_QRadioButton\");\n if(!findObject(\":Count Slip # Auditing.Allow Duplications_QRadioButton\").checked)\n clickButton(\":Count Slip # Auditing.Allow Duplications_QRadioButton\");\n waitForObject(\":Setup.Save_QPushButton\");\n clickButton(\":Setup.Save_QPushButton\");\n test.log(\"Inventory Module Configured\");\n }catch(e){test.fail(\"Exception in configuring Inventory module\"+ e);}\n \n \n \n //---Create User by Role--\n createUserByRole(\"RUNREGISTER\");\n \n try{\n //----Read Username based on Role------\n var set = testData.dataset(\"login.tsv\");\n var username;\n for (var records in set)\n {\n username=testData.field(set[records],\"USERNAME\");\n role=testData.field(set[records],\"ROLE\");\n if(role==\"RUNREGISTER\") break;\n \n }\n }catch(e){test.fail(\"Exception caught in reading login.tsv\");}\n \n snooze(2);\n \n //-------------User Preferences------------------------\n try{\n \n if(OS.name==\"Darwin\")\n {\n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Products\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"Products\");\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.Products_QMenu\",\"Setup...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.Products_QMenu\", \"Setup...\");\n } \n else\n {\n waitForObjectItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n activateItem(\":xTuple ERP: OpenMFG Edition_QMenuBar\", \"System\");\n \n waitForObjectItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Preferences...\");\n activateItem(\":xTuple ERP: OpenMFG Edition.System_QMenu\", \"Preferences...\");\n }\n \n waitForObject(\":_userGroup.Selected User:_QRadioButton\");\n clickButton(\":_userGroup.Selected User:_QRadioButton\");\n waitForObject(\":_userGroup._user_XComboBox\");\n clickItem(\":_userGroup._user_XComboBox\", username, 0, 0, 1, Qt.LeftButton);\n waitForObject(\":Interface Options.Show windows inside workspace_QRadioButton\");\n snooze(0.5);\n if(!findObject(\":Interface Options.Show windows inside workspace_QRadioButton\").checked)\n clickButton(\":Interface Options.Show windows inside workspace_QRadioButton\");\n snooze(1);\n if(object.exists(\":Notice.Remind me about this again._QCheckBox\"))\n {\n waitForObject(\":Notice.Remind me about this again._QCheckBox\");\n if(findObject(\":Notice.Remind me about this again._QCheckBox\").checked)\n clickButton(\":Notice.Remind me about this again._QCheckBox\");\n snooze(0.1);\n waitForObject(\":Notice.OK_QPushButton\");\n clickButton(\":Notice.OK_QPushButton\");\n }\n snooze(1);\n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n {\n snooze(1);\n waitForObject(\":Background Image.Image:_QRadioButton\");\n clickButton(\":Background Image.Image:_QRadioButton\");\n while(findObject(\":Background Image.Image:_QRadioButton\").checked!=true)\n snooze(0.1);\n while(findObject(\":Background Image...._QPushButton\").enabled!=true)\n snooze(0.1);\n waitForObject(\":Background Image...._QPushButton\");\n clickButton(\":Background Image...._QPushButton\"); \n waitForObject(\":Image List._image_XTreeWidget\");\n doubleClickItem(\":Image List._image_XTreeWidget\",\"BACKGROUND\",0,0,1,Qt.LeftButton);\n }\n \n snooze(1);\n findObject(\":_idleTimeout_QSpinBox\").clear();\n snooze(2);\n if(!findObject(\":Interface Options.Ignore Missing Translations_QCheckBox\").checked)\n clickButton(\":Interface Options.Ignore Missing Translations_QCheckBox\");\n snooze(1);\n if(appEdition==\"Manufacturing\"||appEdition==\"Standard\")\n clickButton(\":Preferred Site:.Site:_QRadioButton\");\n else if(appEdition==\"PostBooks\")\n test.xverify(object.exists(\":Preferred Site:.Site:_QRadioButton\"),\"Preferred Site - not visible\");\n waitForObject(\":User Preferences.qt_tabwidget_tabbar_QTabBar\");\n clickTab(\":User Preferences.qt_tabwidget_tabbar_QTabBar\", \"Menu\");\n waitForObject(\":_menu.Show Inventory Menu_QCheckBox\");\n clickButton(\":_menu.Show Inventory Menu_QCheckBox\");\n waitForObject(\":_menu.Show Inventory Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Inventory Toolbar_QCheckBox\");\n waitForObject(\":_menu.Show Products Menu_QCheckBox\");\n clickButton(\":_menu.Show Products Menu_QCheckBox\");\n waitForObject(\":_menu.Show Products Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Products Toolbar_QCheckBox\");\n if(appEdition==\"Manufacturing\" || appEdition==\"Standard\")\n {\n waitForObject(\":_menu.Show Schedule Menu_QCheckBox\");\n clickButton(\":_menu.Show Schedule Menu_QCheckBox\");\n waitForObject(\":_menu.Show Schedule Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Schedule Toolbar_QCheckBox\");\n }\n else if(appEdition==\"PostBooks\")\n {\n test.xverify(object.exists(\":_menu.Show Schedule Menu_QCheckBox\"),\"Show Schedule Menu_QCheckBox - not visible\");\n test.xverify(object.exists(\":_menu.Show Schedule Toolbar_QCheckBox\"),\"Show Schedule Toolbar - not visible\");\n }\n waitForObject(\":_menu.Show Purchase Menu_QCheckBox\");\n clickButton(\":_menu.Show Purchase Menu_QCheckBox\");\n waitForObject(\":_menu.Show Purchase Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Purchase Toolbar_QCheckBox\");\n waitForObject(\":_menu.Show Manufacture Menu_QCheckBox\");\n clickButton(\":_menu.Show Manufacture Menu_QCheckBox\");\n waitForObject(\":_menu.Show Manufacture Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Manufacture Toolbar_QCheckBox\");\n waitForObject(\":_menu.Show CRM Menu_QCheckBox\");\n clickButton(\":_menu.Show CRM Menu_QCheckBox\");\n waitForObject(\":_menu.Show CRM Toolbar_QCheckBox\");\n clickButton(\":_menu.Show CRM Toolbar_QCheckBox\");\n waitForObject(\":_menu.Show Sales Menu_QCheckBox\");\n clickButton(\":_menu.Show Sales Menu_QCheckBox\");\n waitForObject(\":_menu.Show Sales Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Sales Toolbar_QCheckBox\");\n waitForObject(\":_menu.Show Accounting Menu_QCheckBox\");\n clickButton(\":_menu.Show Accounting Menu_QCheckBox\");\n waitForObject(\":_menu.Show Accounting Toolbar_QCheckBox\");\n clickButton(\":_menu.Show Accounting Toolbar_QCheckBox\");\n snooze(1);\n waitForObject(\":User Preferences.qt_tabwidget_tabbar_QTabBar\");\n snooze(1);\n if(appEdition==\"Manufacturing\")\n {\n clickTab(\":User Preferences.qt_tabwidget_tabbar_QTabBar\", \"Events\");\n snooze(1);\n var sWidgetTreeControl = \":_events._event_XTreeWidget\";\n waitForObject(sWidgetTreeControl);\n var obj_TreeWidget = findObject(sWidgetTreeControl);\n obj_TreeWidget = cast(obj_TreeWidget, QTreeWidget);\n var obj_TreeRootItem=obj_TreeWidget.invisibleRootItem();\n var iNumberOfRootItems = obj_TreeRootItem.childCount();\n type(sWidgetTreeControl,\"<Space>\");\n var obj_TreeTopLevelItem = obj_TreeRootItem.child(0);\n var sNameOfRootItem = obj_TreeTopLevelItem.text(0);\n for(i=0; i<=iNumberOfRootItems ;i++)\n {\n clickItem(\":_events._warehouses_XTreeWidget\", \"WH1\", 5, 5, 1, Qt.LeftButton);\n type(sWidgetTreeControl,\"<Down>\"); \n }\n clickItem(\":_events._warehouses_XTreeWidget\", \"WH1\", 5, 5, 1, Qt.LeftButton); \n }\n snooze(2);\n waitForObject(\":User Preferences.qt_tabwidget_tabbar_QTabBar\");\n clickTab(\":User Preferences.qt_tabwidget_tabbar_QTabBar\",\"Alarms\");\n snooze(1);\n waitForObject(\":Default Actions.Event_XCheckBox\");\n clickButton(\":Default Actions.Event_XCheckBox\");\n clickButton(\":Default Actions.System Message_XCheckBox\");\n \n waitForObject(\":List Departments.Save_QPushButton\");\n clickButton(\":List Departments.Save_QPushButton\");\n snooze(1);\n test.log(\"User Preferences of \"+username +\":saved\");\n }catch(e){test.fail(\"Exception in defining User Preferences:\"+e);}\n \n}", "function initializeContract(){\n\tmyContractInstance = Maintenance.deployed();\n\n\t//registerMachine();\n\t//myContractInstance.methods.getMachineDetails.call().then('Testing->'+console.log);\n\n\tconsole.log('myContractInstance->'+myContractInstance);\n\n\tconsole.log('myContractInstance.address->'+myContractInstance.creator);\n\tconsole.log('myContractInstance.address@@@@@@@@@@@->'+myContractInstance);\n\t$('#cf_address').html(myContractInstance.address);\n\t//$('#cf_address').html(myContractInstance.address);\n\t//console.log('myContractInstance.address->'+myContractInstance.address);\n\t$('#cf_address').html(account);\n\tconsole.log('account.address->'+account);\n//\t$('#cf_machines').html(myContractInstance.numMachines);\n//\tconsole.log('cf_machines->'+myContractInstance.numMachines);\n\n\tmyContractInstance.numMachines.call().then(\n\t\t\tfunction(numMachines){\n\t\t\t\t$('#cf_machines').html(numMachines.toNumber());\n\t\t\t\treturn myContractInstance.numServiceRequests.call();\n\n\t}).then(\n\t\t\tfunction(numServiceRequests){\n\t\t\t\t$('#cf_servicerequests').html(numServiceRequests.toNumber());\n\t\t\t\tgetServiceRequests();\n\t});\n}", "function testHomePage() {\n // Just enter LE Page\n var activeAuctionsList,\n activeAuction,\n loginDialog,\n dialogButtons,\n cancelLoginButton,\n regButton,\n regCloseButton;\n\n controller.open(PAGE_SOURCE);\n controller.waitForPageLoad();\n controller.sleep(15000);\n\n // Check active auctions panel on home page\n activeAuctionsList = controller.tabs.activeTab.querySelectorAll(\".trip-item-wrapper\");\n\n // Transform a node into an element\n activeAuction = new elementslib.Elem(activeAuctionsList[0]);\n\n controller.click(activeAuction);\n\n dialogButtons = controller.tabs.activeTab.querySelectorAll(\".x-btn-center\");\n cancelLoginButton = new elementslib.Elem(dialogButtons[14]);\n\n controller.waitForElement(cancelLoginButton, 5000);\n controller.click(cancelLoginButton);\n\n regButton = new elementslib.Selector(controller.tabs.activeTab,\n\t \".registration-button-center\");\n controller.click(regButton);\n controller.waitForPageLoad();\n\n regCloseButton = new elementslib.Selector(controller.tabs.activeTab, \".x-tool-close\");\n controller.click(regCloseButton);\n}", "async actionsTestAddClient() {\n try {\n await this.actionsPage.navigateToActionsPage()\n await this.actionsPage.addClient(\"israel\", \"israeli\", \"israel\", \"test\", \"[email protected]\")\n this.logger.info(\"bububub\")\n } catch (error) {\n console.error(`Error with ${this.actionsTestAddClient} function`)\n }\n }", "async instantiate(ctx){\n console.log('Pharmanet Contract instantiated')\n }", "voteNumber(number, cb) {\n // Grab Aion Bet\n let voteCallObject;\n let bet = (this.refs['aion-bet'].value).toString();\n console.log('bet =', bet);\n if (!aiwaInjected) { // Check AIWA is enabled\n alert(\"You will need to have AIWA enabled to place a vote\");\n\n } else if (!bet || parseFloat(bet) < this.state.minimumBet) {\n alert('You must bet more than the minimum')\n cb()\n\n } else {\n // Create TX Object\n voteCallObject = {\n from: this.state.accounts,\n to: contractAddress,\n gas: 2000000,\n value: web3.utils.toNAmp(bet),\n data: myContract.methods.bet(number).encodeABI()\n }\n\n // Pop up AIWA\n aiwa.eth.sendTransaction(\n voteCallObject\n ).then(function(txHash){\n console.log('txHash:', txHash);\n if (window.confirm('Click \"OK\" to see transaction hash.')) {\n window.open(\n 'https://mastery.aion.network/#/transaction/'+ txHash,\n '_blank' // <- This is what makes it open in a new window.\n );\n };\n cb()\n });\n }\n }", "async function dashboardTest(){\r\n \r\n ///////////// SIGN-IN /////////////////////\r\n //Here I will use a variety of methods for getting elements, just to show how to use them,\r\n //but in practice I would largely stick with xpath for its flexibility amid complex pages.\r\n //If tests are slow for some reason, it could potentially be worth using IDs instead of xpaths.\r\n\r\n //Open website, sign in with above-defined user/pass\r\n let driver = await new Builder().forBrowser(\"chrome\").build();\r\n\r\n await driver.get(\"https://wmxrwq14uc.execute-api.us-east-1.amazonaws.com/Prod/Account/LogIn\");\r\n \r\n await driver.findElement(By.name(\"Username\")).sendKeys(USERNAME,Key.RETURN);\r\n await driver.findElement(By.name(\"Password\")).sendKeys(PASSWORD,Key.RETURN);\r\n\r\n //Make sure we're in the right place, check the page title\r\n var title = await driver.getTitle();\r\n if(title===\"Employees - Paylocity Benefits Dashboard\"){\r\n console.log(\"PASS, Page title is correct:\", title)\r\n } else {\r\n console.log(\"FAIL, Page title is incorrect:\", title)\r\n };\r\n\r\n //////////// ADD ////////////////////////\r\n //Check the Add button\r\n var btnName = await driver.findElement(By.id(\"add\")).getText();\r\n if(btnName===\"Add Employee\"){\r\n console.log(\"PASS, Add button name is correct:\", btnName)\r\n } else {\r\n console.log(\"FAIL, Add button name is incorrect:\", btnName)\r\n };\r\n\r\n //Check the Add button/modal\r\n //I use switchTo here, which is \"blind\" in the same way a user would be. If I get the wrong active \r\n //element (we'll check the modal's title) then there is likely an issue with the Add button script.\r\n //But, switchTo may not be appropriate in a more complex environment, in which case I'd use the expected ID/name/xpath \r\n await driver.findElement(By.id(\"add\")).click();\r\n driver.switchTo().activeElement();\r\n var title = await driver.findElement(By.xpath('//*[@id=\"employeeModal\"]/div/div/div[1]/h5')).getText();\r\n if(title===\"Add Employee\"){\r\n console.log(\"PASS, Modal opened:\", title)\r\n } else {\r\n console.log(\"FAIL, Modal did not open or has the wrong title:\", title)\r\n };\r\n \r\n //Check Add modal's X button\r\n //There is probably a better way to check the modal is closed _O.o_\r\n await driver.findElement(By.xpath('//*[@id=\"employeeModal\"]/div/div/div[1]/button')).click();\r\n var title = await driver.findElement(By.xpath('//*[@id=\"employeeModal\"]/div/div/div[1]/h5')).getText();\r\n if(title===\"Add Employee\"){\r\n console.log(\"FAIL, The modal did not close\")\r\n } else {\r\n console.log(\"PASS, The modal closed\")\r\n };\r\n\r\n //Check Add modal's Cancel button\r\n //---> the same as we did for x button\r\n\r\n //Check Add modal closes by clicking outside it\r\n //---> the same as we did for x button\r\n\r\n //Check the modal's Add button\r\n //We previously closed the modal, so we need to open it again\r\n await driver.findElement(By.id(\"add\")).click();\r\n\r\n //Our negative case, no data should be added if fields are blank, so the modal should stay up.\r\n //Rather than depend on the fields being blank, we'll set them here to be sure\r\n await driver.findElement(By.xpath('//*[@id=\"firstName\"]')).sendKeys(\"\");\r\n await driver.findElement(By.xpath('//*[@id=\"lastName\"]')).sendKeys(\"\");\r\n await driver.findElement(By.xpath('//*[@id=\"dependants\"]')).sendKeys(\"\");\r\n await driver.findElement(By.xpath('//*[@id=\"addEmployee\"]')).click();\r\n //And make sure the modal stays up\r\n var title = await driver.findElement(By.xpath('//*[@id=\"employeeModal\"]/div/div/div[1]/h5')).getText();\r\n if(title===\"Add Employee\"){\r\n console.log(\"PASS, The modal stayed open with no data\")\r\n } else {\r\n console.log(\"FAIL, The modal has closed without adding data\")\r\n };\r\n\r\n //Check that data is commited via Add button\r\n await driver.findElement(By.xpath('//*[@id=\"firstName\"]')).sendKeys(\"Bluejay\");\r\n await driver.findElement(By.xpath('//*[@id=\"lastName\"]')).sendKeys(\"Blackburn\");\r\n await driver.findElement(By.xpath('//*[@id=\"dependants\"]')).sendKeys(\"1\");\r\n await driver.findElement(By.xpath('//*[@id=\"addEmployee\"]')).click();\r\n \r\n //Problem area\r\n //Seems to be a timing issue for checking the table, which is causing the tests to fail even though it works\r\n //\r\n // Check the modal closed as expected\r\n var title = await driver.findElement(By.xpath('//*[@id=\"employeeModal\"]/div/div/div[1]/h5')).getText();\r\n if(title===\"Add Employee\"){\r\n console.log(\"FAIL, The modal stayed open after adding data\")\r\n } else {\r\n console.log(\"PASS, The modal closed after adding data\")\r\n };\r\n\r\n //Check for newly added data in the grid\r\n var newdata = driver.findElement(By.xpath('//div[1]/table/tbody/tr/td[contains(.,\"Bluejay\")]'));\r\n if (newdata.getText() === \"Bluejay\") {\r\n console.log(\"PASS, The data was added to the grid\")\r\n } else {\r\n console.log(\"FAIL, The data was not added to the grid\")\r\n };\r\n\r\n // Other tests to do here would include:\r\n // - check calculated values\r\n // - min max field lengths/values & validation messages\r\n // - special characters & validation messages\r\n // - duplicate data and/or adding repeat data after deleting it\r\n\r\n\r\n //////////// EDIT ////////////////////////\r\n //The same as we did for Add\r\n \r\n\r\n //////////// DELETE //////////////////////\r\n //Check row is removed from grid\r\n \r\n //await driver.quit();\r\n}", "function onRunTestClicked(e) {\n e.preventDefault();\n executableModuleMessageChannel.send('ui_backend', {'command': 'run_test'});\n}", "goToTestClient() {\n return this\n .waitForElementVisible('@testclient', 2000)\n .click('@testclient')\n }", "function NodePrompt() {\n\t\t// create interface and obscure everything else\n\t this.render = function(value, is, fs, lab) {\n\t var winW = window.innerWidth;\n\t var winH = window.innerHeight;\n\t var dialogueoverlay = document.getElementById('dialogueoverlay');\n\t var dialoguebox = document.getElementById('dialoguebox');\n\t dialogueoverlay.style.display = \"block\";\n\t dialogueoverlay.style.height = winH+\"px\";\n\t dialoguebox.style.left = (winW/2) - (300/2)+\"px\";\n\t dialoguebox.style.top = '30%';\n\t dialoguebox.style.display = \"block\";\n\t document.getElementById('dialogueboxhead').innerHTML = \"Edit Node <b>\" + value + \":</b>\";\n\t document.getElementById('dialogueboxbody').innerHTML = 'Initial State:<input type=\"checkbox\" id=\"initial_state\">';\n\t document.getElementById('dialogueboxbody').innerHTML += '<br>Final State:<input type=\"checkbox\" id=\"final_state\">';\n\t document.getElementById('dialogueboxbody').innerHTML += '<br>Label: <input id=\"label\">';\n\t document.getElementById('dialogueboxfoot').innerHTML = '<button onclick=\"ok()\">OK</button> <button onclick=\"terminate()\">Cancel</button>';\n\t if (is) {\n\t document.getElementById('initial_state').checked = true;\n\t }\n\t if (fs) {\n\t document.getElementById('final_state').checked = true;\n\t }\n\t if (lab) {\n\t document.getElementById('label').value = lab;\n\t }\n\t document.getElementById('label').focus();\n\t };\n\t // close the prompt (by hiding it)\n\t terminate = function() {\n\t document.getElementById('dialoguebox').style.display = \"none\";\n\t document.getElementById('dialogueoverlay').style.display = \"none\";\n\t };\n\t // make the appropriate changes to the TM node\n\t ok = function() {\n\t var initial_state = document.getElementById('initial_state').checked;\n\t var final_state = document.getElementById('final_state').checked;\n\t var node_label = document.getElementById('label').value;\n\t if (initial_state) {\n\t\t\t\tvar nodes = g.nodes();\n\t\t\t\tfor (var next = nodes.next(); next; next = nodes.next()) {\n\t\t\t\t\tg.removeInitial(next);\n\t\t\t\t}\n\t\t\t\tg.makeInitial(first);\n\t\t\t} else{\n\t\t\t\tg.removeInitial(first);\n\t\t\t}\n\t\t\tif (final_state) {\n\t\t\t\tfirst.addClass('final');\n\t\t\t} else {\n\t\t\t\tfirst.removeClass('final');\n\t\t\t}\n\t\t\t//adds labels to states\n\t\t\tif (node_label) {\n\t\t\t\tfirst.stateLabel(node_label);\n\t\t\t\tfirst.stateLabelPositionUpdate();\n\t\t\t}\n\t document.getElementById('dialoguebox').style.display = \"none\";\n\t document.getElementById('dialogueoverlay').style.display = \"none\";\n\t };\n\t}", "function namestatus() {\n //alert('hi')\n web3 = new Web3(new Web3.providers.HttpProvider(\"http://localhost:8545\"));\n web3.eth.defaultAccount = web3.eth.accounts[];\n\n function namehash(name) {\n var node = '0x0000000000000000000000000000000000000000000000000000000000000000';\n if (name !== '') {\n var labels = name.split(\".\");\n for(var i = labels.length - 1; i >= 0; i--) {\n node = web3.sha3(node + web3.sha3(labels[i]).slice(2), {encoding: 'hex'});\n }\n }\n return node.toString();\n}\n\n\n///START OF ENSUTILS-TEST.JS Script////////////////////////////////////////\nvar ensContract = web3.eth.contract([\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"resolver\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"owner\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"label\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setSubnodeOwner\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"ttl\",\n \"type\": \"uint64\"\n }\n ],\n \"name\": \"setTTL\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"ttl\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint64\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"resolver\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setResolver\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setOwner\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"Transfer\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"label\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"NewOwner\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"resolver\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"NewResolver\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"ttl\",\n \"type\": \"uint64\"\n }\n ],\n \"name\": \"NewTTL\",\n \"type\": \"event\"\n }\n]);\nvar ens = ensContract.at('0x112234455c3a32fd11230c42e7bccd4a84e02010');\n\nvar auctionRegistrarContract = web3.eth.contract([\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"releaseDeed\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"getAllowedTime\",\n \"outputs\": [\n {\n \"name\": \"timestamp\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"unhashedName\",\n \"type\": \"string\"\n }\n ],\n \"name\": \"invalidateName\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"name\": \"value\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"salt\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"shaBid\",\n \"outputs\": [\n {\n \"name\": \"sealedBid\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"bidder\",\n \"type\": \"address\"\n },\n {\n \"name\": \"seal\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"cancelBid\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"entries\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint8\"\n },\n {\n \"name\": \"\",\n \"type\": \"address\"\n },\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"ens\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"_value\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"_salt\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"unsealBid\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"transferRegistrars\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n },\n {\n \"name\": \"\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"sealedBids\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"state\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint8\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"newOwner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"transfer\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"_timestamp\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"isAllowed\",\n \"outputs\": [\n {\n \"name\": \"allowed\",\n \"type\": \"bool\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"finalizeAuction\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"registryStarted\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"sealedBid\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"newBid\",\n \"outputs\": [],\n \"payable\": true,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"labels\",\n \"type\": \"bytes32[]\"\n }\n ],\n \"name\": \"eraseNode\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hashes\",\n \"type\": \"bytes32[]\"\n }\n ],\n \"name\": \"startAuctions\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"deed\",\n \"type\": \"address\"\n },\n {\n \"name\": \"registrationDate\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"acceptRegistrarTransfer\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"_hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"startAuction\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"rootNode\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"hashes\",\n \"type\": \"bytes32[]\"\n },\n {\n \"name\": \"sealedBid\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"startAuctionsAndBid\",\n \"outputs\": [],\n \"payable\": true,\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"name\": \"_ens\",\n \"type\": \"address\"\n },\n {\n \"name\": \"_rootNode\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"_startDate\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"constructor\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"registrationDate\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"AuctionStarted\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"bidder\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"name\": \"deposit\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"NewBid\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"name\": \"value\",\n \"type\": \"uint256\"\n },\n {\n \"indexed\": false,\n \"name\": \"status\",\n \"type\": \"uint8\"\n }\n ],\n \"name\": \"BidRevealed\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"name\": \"value\",\n \"type\": \"uint256\"\n },\n {\n \"indexed\": false,\n \"name\": \"registrationDate\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"HashRegistered\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"HashReleased\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"name\",\n \"type\": \"string\"\n },\n {\n \"indexed\": false,\n \"name\": \"value\",\n \"type\": \"uint256\"\n },\n {\n \"indexed\": false,\n \"name\": \"registrationDate\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"HashInvalidated\",\n \"type\": \"event\"\n }\n]);\nvar ethRegistrar = auctionRegistrarContract.at(ens.owner(namehash('eth')));\n\nvar deedContract = web3.eth.contract([\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"creationDate\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [],\n \"name\": \"destroyDeed\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"newOwner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setOwner\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"registrar\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"value\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"previousOwner\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"owner\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"newValue\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"throwOnFailure\",\n \"type\": \"bool\"\n }\n ],\n \"name\": \"setBalance\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"refundRatio\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"closeDeed\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"newRegistrar\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setRegistrar\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"name\": \"_owner\",\n \"type\": \"address\"\n }\n ],\n \"payable\": true,\n \"type\": \"constructor\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": false,\n \"name\": \"newOwner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"OwnerChanged\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [],\n \"name\": \"DeedClosed\",\n \"type\": \"event\"\n }\n]);\n\nvar fifsRegistrarContract = web3.eth.contract([\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"ens\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"expiryTimes\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"subnode\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"register\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"rootNode\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"name\": \"ensAddr\",\n \"type\": \"address\"\n },\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"type\": \"constructor\"\n }\n]);\nvar testRegistrar = fifsRegistrarContract.at(ens.owner(namehash('test')));\n\nvar resolverContract = web3.eth.contract([\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"interfaceID\",\n \"type\": \"bytes4\"\n }\n ],\n \"name\": \"supportsInterface\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"contentTypes\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"ABI\",\n \"outputs\": [\n {\n \"name\": \"contentType\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"data\",\n \"type\": \"bytes\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"x\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"y\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"setPubkey\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"content\",\n \"outputs\": [\n {\n \"name\": \"ret\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"addr\",\n \"outputs\": [\n {\n \"name\": \"ret\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"contentType\",\n \"type\": \"uint256\"\n },\n {\n \"name\": \"data\",\n \"type\": \"bytes\"\n }\n ],\n \"name\": \"setABI\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"name\",\n \"outputs\": [\n {\n \"name\": \"ret\",\n \"type\": \"string\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"name\",\n \"type\": \"string\"\n }\n ],\n \"name\": \"setName\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"setContent\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"pubkey\",\n \"outputs\": [\n {\n \"name\": \"x\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"y\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"name\": \"addr\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"setAddr\",\n \"outputs\": [],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"name\": \"ensAddr\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"constructor\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"a\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"AddrChanged\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"hash\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"ContentChanged\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"name\",\n \"type\": \"string\"\n }\n ],\n \"name\": \"NameChanged\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": true,\n \"name\": \"contentType\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"ABIChanged\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"name\": \"node\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"x\",\n \"type\": \"bytes32\"\n },\n {\n \"indexed\": false,\n \"name\": \"y\",\n \"type\": \"bytes32\"\n }\n ],\n \"name\": \"PubkeyChanged\",\n \"type\": \"event\"\n }\n]);\nvar publicResolver = resolverContract.at('0x4c641fb9bad9b60ef180c31f56051ce826d21a9a');\n\n\nvar reverseRegistrarContract = web3.eth.contract([\n {\n \"constant\": false,\n \"inputs\": [\n {\n \"name\": \"owner\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"claim\",\n \"outputs\": [\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"ens\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"address\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [\n {\n \"name\": \"addr\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"node\",\n \"outputs\": [\n {\n \"name\": \"ret\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"constant\": true,\n \"inputs\": [],\n \"name\": \"rootNode\",\n \"outputs\": [\n {\n \"name\": \"\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"name\": \"ensAddr\",\n \"type\": \"address\"\n },\n {\n \"name\": \"node\",\n \"type\": \"bytes32\"\n }\n ],\n \"payable\": false,\n \"type\": \"constructor\"\n }\n]);\nvar reverseRegistrar = reverseRegistrarContract.at(ens.owner(namehash('addr.reverse')));\n\nfunction getAddr(name) {\n var node = namehash(name)\n var resolverAddress = ens.resolver(node);\n if (resolverAddress === '0x0000000000000000000000000000000000000000') {\n return resolverAddress;\n }\n return resolverContract.at(resolverAddress).addr(node);\n}\n\nfunction getContent(name) {\n var node = namehash(name)\n var resolverAddress = ens.resolver(node);\n if (resolverAddress === '0x0000000000000000000000000000000000000000') {\n return \"0x0000000000000000000000000000000000000000000000000000000000000000\";\n }\n return resolverContract.at(resolverAddress).content(node);\n}\n\n\n///////////////////END OF ENSUTILS-TEST.js SCRIPT////////////////////\n\n alert(\"default Account:\" + web3.eth.defaultAccount)\n //alert(ethRegistrar.entries(web3.sha3('name'))[0])\n alert(ethRegistrar.entries(web3.sha3(name)))\n\n\n\n\n 'use strict';\n var name = document.getElementById (\"namesrch\");\n var x = ensutils.ethRegistrar.entries(web3.sha3(name))[0]; output = \"\";\n //x = ENSresponse;\n// ENS registrar returns status as an integer between 0 and 5\n \nfunction namestatus(){}\n if (x === 0) {\n output = \"Name is available and the auction hasn’t started!\";\n } else if (x === 1) {\n output = \" Name is available and the auction has been started\";\n } else if (x === 2) {\n output = \"Name is taken and currently owned by someone\";\n } else if (x === 3) {\n output = \"Name is forbidden\";\n } else if (x === 4) {\n output = \"Name is currently in the ‘reveal’ stage of the auction\";\n } else if (x === 5) {\n output = \"Name is not yet available due to the ‘soft launch’ of names.\";\n } else {\n output = \"unknown status\";\n }\n document.getElementById(\"namestatus\").innerHTML = \"<h3><b>\" + output + \"</b></h3>\";\n}", "function waitForTransactionEditView(mode) {\n\t\tbrowser.wait(transactionEditView.isPresent.bind(transactionEditView), 3000, \"Timeout waiting for view to render\");\n\t\ttransactionEditView.heading().should.eventually.equal(`${mode} Transaction`);\n\t}", "assertAppearsCorrectly() {\n expect(this.selectors.ratingTitle).to.be.displayed();\n expect(this.selectors.ratings.hate).to.be.displayed();\n expect(this.selectors.ratings.dislike).to.be.displayed();\n expect(this.selectors.ratings.neutral).to.be.displayed();\n expect(this.selectors.ratings.like).to.be.displayed();\n expect(this.selectors.ratings.love).to.be.displayed();\n expect(this.selectors.feedbackTitle).to.be.displayed();\n expect(this.selectors.textArea).to.be.displayed();\n expect(this.selectors.buttonDisabled).to.be.displayed();\n\n $(this.selectors.ratings.love).click();\n expect(this.selectors.buttonEnabled).to.be.displayed();\n }", "async function main() {\n const contractName = \"UniLion\";\n const [ deployer ] = await hre.ethers.getSigners();\n const network = await hre.ethers.provider.getNetwork() // needs to be this router address for testnet in order for swapbnb to work\n const routerAddress = (network.name == \"bnb\") ? \"0x10ED43C718714eb63d5aA57B78B54704E256024E\" : \"0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3\" // or testnet: 0x9Ac64Cc6e4415144C455BD8E4837Fea55603e5c3, 0xD99D1c33F9fC3444f8101754aBC46c52416550D1\n const balance = await deployer.getBalance();\n console.log(`Deploying on network: ${network.name}, using router address ${routerAddress}`)\n console.log(`Deploying Contract with Account: ${deployer.address}`) \n console.log(`Account Balance: ${balance.toString()}`) \n const contract = await hre.ethers.getContractFactory(contractName);\n const unilion = await contract.deploy(routerAddress, snipers.addresses);\n await unilion.deployed();\n console.log(\"UniLion Contract Deployed:\", unilion.address);\n if (network.name != 'unknown') {\n let blockchainHost = (network.name != 'bnbt') ? \"bscscan.com\" : \"testnet.bscscan.com\"\n console.log(`Contract URL: https://${blockchainHost}/address/${unilion.address}`)\n }\n console.log(`Console Script: const token = await (await ethers.getContractFactory(\"${contractName}\")).attach(\"${unilion.address}\")`)\n}", "function test_candu_collection_tab() {}", "function startTest(){\n currentState = 1;\n // Displaying needed dom elements\n setupDom.style.display = \"none\";\n testDom.style.display = \"flex\";\n if(rootCheck.checked){\n rootDiv.style.display = \"block\";\n }else{\n rootDiv.style.display = \"none\";\n }\n if(relativeCheck.checked){\n relativeDiv.style.display = \"block\";\n // Displaying the right question for the current relative root according to current slected scale\n if (scaleName != \"custom\"){\n relativeLab.innerHTML = \"Relative \" + scaleSel.options[scaleSel.selectedIndex].innerHTML.toLowerCase() + \" ?\";\n }else{\n relativeLab.innerHTML = \"Relative mode 0 ?\";\n }\n }else{\n relativeDiv.style.display = \"none\";\n }\n updateModeSel();\n newTest();\n}", "async instantiate(ctx) {\n console.log(\"Smart Contract Instantiated\");\n }", "async submitHandler() {\n const inputsAreValid = (this.state.newTitle !== \"\") && (this.state.newOffset !== \"\") && (parseFloat(this.state.amount) >= 0.001);\n if (inputsAreValid) {\n this.setState({bodyLoading: true});\n\n const accounts = await window.web3.eth.getAccounts();\n const sender = accounts[0];\n const vote = this.props.contract;\n\n const weiAmount = web3.utils.toWei(this.state.amount.toString(), \"ether\");\n\n // submit proposal\n try {\n await vote.methods.create(this.state.newTitle, this.state.newOffset).send({from: sender, value: weiAmount})\n .on(\"transactionHash\", (hash) => {\n this.setState({newTitle: \"\"});\n this.setState({newOffset: \"\"});\n this.setState({amount: \"0.001\"});\n this.setState({componentState: \"home\"});\n this.props.refresh();\n window.alert(\"Your Proposal Has Been Successfully Created.\");\n })\n .on(\"error\", (error) => {\n this.setState({transactionFailed: true});\n console.error(\"Transaction failed (Preston)\", error);\n });\n } catch (error) {\n this.setState({transactionFailed: true});\n console.error(\"Rejection hurts (Preston)\", error);\n }\n\n this.setState({bodyLoading: false});\n }\n }", "configureView() {\n // Store various UI elements\n this.loadingContainer = document.getElementById('loading');\n this.signedInContainer = document.getElementById('signed-in');\n this.signedOutContainer = document.getElementById('signed-out');\n this.walletAddressContainer = document.getElementById('wallet-address');\n this.errorContainer = document.getElementById('error');\n // Set up connect button\n const connectElement = document.getElementById('connect-button');\n this.connectButton = this.bitski.getConnectButton(connectElement);\n this.connectButton.callback = (error, user) => {\n if (error) {\n this.setError(error);\n }\n this.validateUser(user);\n }\n // Set up log out button\n this.logOutButton = document.getElementById('log-out');\n this.logOutButton.addEventListener('click', (event) => {\n event.preventDefault();\n this.signOut();\n });\n\n // Set up send test button\n this.sendTestButton = document.getElementById('send-test');\n this.sendTestButton.addEventListener('click', (event) => {\n event.preventDefault();\n this.testSend();\n });\n\n // Set up list-items\n this.listItemsElement = document.getElementById('list-items');\n this.cabinetElement = document.getElementById('cabinet');\n this.listItemsElement.addEventListener('click', (event) => {\n event.preventDefault();\n this.showItems();\n });\n }", "function createNew() {\n testLog.logStart(\"TrainDialog: Click Create New\");\n cy.server()\n cy.route('POST', '/app/*/teach').as('postTeach')\n cy.route('POST', 'directline/conversations').as('postConv')\n cy.route('PUT', '/state/conversationId?username=ConversationLearnerDeveloper&id=*').as('putConv')\n\n cy.get('[data-testid=\"button-new-train-dialog\"]')\n .then(function (response) {\n testLog.logStep(\"Click on New Train Dialog button\")\n })\n .click()\n .wait('@postTeach')\n .wait('@postConv')\n .wait('@putConv')\n testLog.logEnd();\n}", "async function setUp() {\n await showCatFilter();\n await showAreaFilter();\n show($home);\n // drawMealPlanTable();\n // generateMealPlanFormOptions();\n }", "async function main() {\n // This is just a convenience check\n if (network.name === \"hardhat\") {\n console.warn(\n \"You are trying to deploy a contract to the Hardhat Network, which\" +\n \"gets automatically created and destroyed every time. Use the Hardhat\" +\n \" option '--network localhost'\"\n );\n }\n\n // ethers is avaialble in the global scope\n const [deployer] = await ethers.getSigners();\n console.log(\n \"Deploying the contracts with the account:\",\n await deployer.getAddress()\n );\n\n console.log(\"Account balance:\", (await deployer.getBalance()).toString());\n const Ante_alUSDSupplyTest = await ethers.getContractFactory(\"Ante_alUSDSupplyTest\");\n const ante_alUSDSupplyTest = await Ante_alUSDSupplyTest.deploy();\n await ante_alUSDSupplyTest.deployed();\n console.log(\"Ante_alUSDSupplyTest address:\", ante_alUSDSupplyTest.address);\n const a = await ante_alUSDSupplyTest.CheckTransmuterVL();\n console.log(a.toString());\n const b = await ante_alUSDSupplyTest.CheckAlchemistVL();\n console.log(b.toString());\n const c = await ante_alUSDSupplyTest.CheckTransmuterBVL();\n console.log(c.toString());\n const d = await ante_alUSDSupplyTest.CheckAlchemistYVAVL();\n console.log(d.toString());\n const e = await ante_alUSDSupplyTest.CheckTransmuterBYVAVL();\n console.log(e.toString());\n const USDbalance = await ante_alUSDSupplyTest.checkBalance();\n console.log(\"Ante_alUSDSupplyTest balance:\", USDbalance.toString());\n const USDcirculating = await ante_alUSDSupplyTest.checkCirculating();\n console.log(\"Ante_alUSDSupplyTest supply:\", USDcirculating.toString());\n const USDresult = await ante_alUSDSupplyTest.checkTestPasses();\n console.log(\"Ante_alUSDSupplyTest result:\", USDresult);\n\n const Ante_alETHSupplyTest = await ethers.getContractFactory(\"Ante_alETHSupplyTest\");\n const ante_alETHSupplyTest = await Ante_alETHSupplyTest.deploy();\n await ante_alETHSupplyTest.deployed();\n console.log(\"Ante_alETHSupplyTest address:\", ante_alETHSupplyTest.address);\n const f = await ante_alETHSupplyTest.CheckTransmuterVL();\n console.log(f.toString());\n const g = await ante_alETHSupplyTest.CheckAlchemistVL();\n console.log(g.toString());\n const h = await ante_alETHSupplyTest.CheckAlchemistYVAVL();\n console.log(h.toString());\n const i = await ante_alETHSupplyTest.CheckTransmuterBYVAVL();\n console.log(i.toString());\n const ETHbalance = await ante_alETHSupplyTest.checkBalance();\n console.log(\"Ante_alETHSupplyTest balance:\", ETHbalance.toString());\n const ETHcirculating = await ante_alETHSupplyTest.checkCirculating();\n console.log(\"Ante_alETHSupplyTest supply:\", ETHcirculating.toString());\n const ETHresult = await ante_alETHSupplyTest.checkTestPasses();\n console.log(\"Ante_alETHSupplyTest result:\", ETHresult);\n \n}", "function currentState() {\n\n openLogin();\n\n // Make sure user has unlocked an Ethereum account...\n if(!signedIn) {\n return;\n }\n\n checkDeadlines();\n\n state = anonymousvotingAddr.state();\n whatIsQuestion();\n\n if(state == 0) { // SETUP\n\t \n\t\n\t//V2 : createSetUpTextBox();\n createEligibleTextBox();\n controlTransition(\"#pb_setup\")\n } else if(state == 1) { // SIGNUP\n createFinishRegistration();\n controlTransition(\"#pb_register\")\n // Ensure pickers are destroyed\n destorypickers();\n } else if(state == 2) { // VOTE\n createVote();\n controlTransition(\"#pb_cast\")\n // Ensure pickers are destroyed\n destorypickers();\n\n } else if(state == 3) { // TALLY\n createTally();\n controlTransition(\"#pb_tally\")\n\n //Keep track of the number of voters who have received their refund.\n alldone = true;\n // Ensure pickers are destroyed\n destorypickers();\n } else {\n document.getElementById('state').innerHTML = \"Undocumented Phase...\";\n }\n}", "async submitVoteHandler() {\n const vote = this.props.contract;\n const accounts = await window.web3.eth.getAccounts();\n const sender = accounts[0];\n\n const weiBal = await window.web3.eth.getBalance(sender);\n const ethBal = window.web3.utils.fromWei(weiBal, \"ether\");\n\n const inputAmount = this.state.ethDeposited;\n const inputInWei = window.web3.utils.toWei(inputAmount.toString(), \"ether\");\n const voteIsValid = !(this.state.yaySelected && this.state.naySelected) && (this.state.yaySelected || this.state.naySelected);\n const votesYay = this.state.yaySelected && !this.state.naySelected;\n\n if (voteIsValid) {\n // verify input amount before initiating transaction.\n if (inputAmount == 0) {\n window.alert(\"Deposit amount can not be zero.\");\n }\n else if (inputAmount > this.state.proposal.max_deposit) {\n window.alert(\"Deposit amount exceeded allowance.\");\n }\n else if (inputAmount > parseFloat(ethBal)) {\n window.alert(\"Your balance is insufficient.\");\n }\n else {\n this.setState({isLoading: true});\n // vote\n try {\n await vote.methods.vote(this.state.proposal.id, votesYay).send({from: sender, value: inputInWei})\n .on(\"transactionHash\", (hash) => {\n window.alert(\"Vote casted successfully.\");\n this.setState({voteCasted: true});\n })\n .on(\"error\", (error) => {\n this.setState({isLoading: false});\n this.props.err();\n console.error(\"Transaction failed (Preston)\", error);\n });\n } catch (error) {\n this.setState({isLoading: false});\n this.props.err();\n console.error(\"Rejection hurts (Preston)\", error);\n }\n }\n }\n else {\n window.alert(\"Vote or die.\"); // South Park Reference.\n }\n }", "async listPage(testController) {\n // This is first test to be run. Wait 10 seconds to avoid timeouts with GitHub Actions.\n await testController.click('#addNewHobby');\n await testController.typeText('#signin-form-email', username);\n\n\n }", "function describe_ui(suffix, extra_options, f) {\n describe('Candidate UI' + suffix, function() {\n beforeEach(function() {\n // Recover initial HTML. Done before, not after the test,\n // to observer effect of failures.\n if (PAGE_HTML === undefined)\n PAGE_HTML = $('#page').html();\n else\n $('#page').html(PAGE_HTML);\n\n // mock time (AJAX will be mocked by test server)\n this.clock = sinon.useFakeTimers();\n\n this.server = TestServer();\n this.server.init();\n\n var my_ui_options = $.extend(true, {}, this.server.ui_options, extra_options);\n this.ui = window.ui = CandidateUi(my_ui_options);\n this.ui.init();\n\n this.exit_url = null;\n this.ui.exit = $.proxy(function(url) { this.exit_url = url; }, this);\n });\n\n afterEach(function() {\n this.ui.shutdown();\n this.clock.restore();\n this.server.shutdown();\n\n // remove the modal overlay for convenience\n $('.jqmOverlay').hide();\n });\n\n f.apply(this);\n });\n}", "function tally() {\n\n // Ethereum Account needs to be unlocked.\n if(!addressChosen) {\n alert(\"Please unlock your Ethereum address\");\n return;\n }\n\n // Make sure we are in the correct phase.\n if(state != 2) {\n alert(\"Please wait until VOTE Phase\");\n return;\n }\n var reg = anonymousvotingAddr.totalregistered();\n var voted = anonymousvotingAddr.totalvoted();\n\n // Make sure everyone has voted!\n if(!reg.equals(voted)) {\n alert(\"Please wait for everyone to vote\");\n return;\n }\n\n //TODO: Check that all votes have been cast..\n // Can do this by checking the public 'votecast' mapping...\n web3.personal.unlockAccount(web3.eth.accounts[accountindex],password);\n var res = anonymousvotingAddr.computeTally.sendTransaction({from:web3.eth.accounts[accountindex], gas: 4200000});\n document.getElementById(\"tallybutton\").innerHTML = \"Waiting for Ethereum to confirm tally\";\n txlist(\"Compute Tally: \" + res);\n}", "function clickedTest()\n{\n\tvar selectedObj = dw.databasePalette.getSelectedNode();\n\tif (selectedObj && selectedObj.objectType==\"Connection\")\n\t{\n\t\tvar connRec = MMDB.getConnection(selectedObj.name);\n\t\tif (connRec)\n\t\t{\n\t\t\tMMDB.testConnection(connRec);\n\t\t}\n\t}\n}", "enterTest(ctx) {\n\t}", "async createClub(testController) {\n await testController.typeText('#create-clubs-form-clubName', 'Test Club');\n await testController.typeText('#create-clubs-form-image', 'https://churchonthesound.org/wp-content/uploads/2020/03/This-is-a-test.jpg');\n await testController.typeText('#create-clubs-form-email', '[email protected]');\n await testController.typeText('#create-clubs-form-website', 'https://youtube.com');\n await testController.typeText('#create-clubs-form-description', 'This is just a test club and it is going to be deleted soon.');\n await testController.click('#create-clubs-form-submit');\n }", "async loadBlockchainData() {\n const Web3 = require('web3')\n const web3Extension = require('@energi/web3-ext');\n const web3 = new Web3(Web3.givenProvider || \"https://nodeapi.test3.energi.network\")\n\n web3Extension.extend(web3);\n\n// instantiate the contract and the Metamask app\n\n const election = await new web3.eth.Contract(election_ABI, election_address)\n\n this.setState({Contract: election})\n\n const accounts = await web3.eth.getAccounts()\n\n this.setState({account: accounts[0]})\n\n\n// instantiate the methods of the contract\n\n const getCandidate = await election.methods.candidateName().call()\n this.setState({candidateName: getCandidate})\n\n\n}", "async instantiate(ctx){\n console.log('************ Pharnet Transporter Smart Contract Instantiated *************');\n\t}", "clickOnClaim(){\n // wait for page load is before click ?? Failing at this step- disabled it - Monica\n //browser.waitForPageToLoadAndCheckPartialHeaderText(eval(ticketDetailPageObject.ticketSubmissionHeader),ticketsJson.ticketSubmissionHeader);\n console.log(\" **** Claiming Ticket ****\");\n browser.click(eval(ticketDetailPageObject.topNav.btn_claimTicket));\n //console.log(\" **** Assert button mark as complete is visible after claiming ticket ****\");\n //assert.assertElementIsVisible(eval(ticketDetailPageObject.topNav.btn_markAsComplete))\n\n}", "initTestReviewPopup() {\n let self = this;\n $(\"#tests-table\").on(\"click\", \".end-test-review\", (event) => {\n self.resetTestReviewPopup(event);\n $(\"#popUpReview\").show();\n })\n\n $(\"#submit-review\").on(\"click\", () => {\n self.submitReview();\n });\n\n $(\"#close-review\").on(\"click\", () => {\n $(\"#popUpReview\").hide();\n });\n }", "createNewContractDom(object) {\n const container = document.createElement('div');\n const text = document.createElement('p');\n const button = document.createElement('i');\n container.className = 'available-tasks';\n\n text.innerHTML = `${object.assignment} <br><br>\n Scale: ${object.codeSize} LoC <br>\n Reward: ${object.earnings}$`;\n button.setAttribute('class', 'fas fa-check accept-contract-button accept-button')\n\n container.append(text, button);\n\n return container;\n }", "validateReviewComponent() {\n return this\n .waitForElementVisible('@reviewComponent', 10000, () => {}, '[STEP] - Product Card should have review component')\n .assert.visible('@reviewComponent');\n }", "function init() {\n\n inquirer.prompt([\n {\n type: \"list\",\n name: \"teamRole\",\n message: \"What what member would you like to add?\",\n choices: [\"Manager\", \"Engineer\", \"Intern\", \"I am done building my team.\"]\n\n },\n\n ]).then(function (response) {\n switch (response.teamRole) {\n case \"Manager\":\n createManager()\n break;\n case \"Engineer\":\n createEngineer()\n break;\n case \"Intern\":\n createIntern()\n break;\n case \"I am done building my team.\":\n buildMyTeam()\n break;\n default:\n break;\n }\n\n\n\n \n \n })\n}", "async actionsTestUpdateClient() {\n try {\n await this.actionsPage.navigateToActionsPage()\n await this.actionsPage.updateClient(\"Lorena Joseph\", \"Jhon\", \"\", \"Send\")\n } catch (error) {\n console.error(`Error with ${this.actionsTestUpdateClient} function`)\n }\n }", "function init_testing_setup(){\r\n window._svc = {};\r\n _svc.sysInfo = { platform : function(a){\r\n console.log(\"Called _svc system callback in test\");\r\n for(i=0;i<2000;i++){console.log(\"loop\");}\r\n TerminalApp.terminal_id =123123;\r\n }}\r\n // _svc.sysInfo.platform(); // Get terminal id\r\n TerminalApp.url = \"ws://localhost:8090\"\r\n TerminalApp.switchToBrowser = function(){\r\n console.log(\"called switchToBrowser\");\r\n }\r\n TerminalApp.switchToPayment = function(){\r\n console.log(\"called switchToPayment\");\r\n }\r\n}", "function initialize_contract() {\n if (web3.utils.isAddress(document.getElementById(\"initialize_contract_input\").value)) {\n console.log(\"Using the address provided, please wait ...\");\n newContract.setAddress(document.getElementById(\"initialize_contract_input\").value);\n } else {\n console.log(\"Initializing existing contract at \" + newContract.getAddress());\n }\n var multiswapContractInstance = new web3.eth.Contract(abi, newContract.getAddress());\n newContract.setContractInstanceObject(multiswapContractInstance);\n}", "goToRecipeBox() {\n if (this.recipeBox.waitForExist()) {\n this.recipeBox.click();\n }\n }", "function inspectNodeClick() {\n //Output the node, name of the node, connnections, all info that is known.\n if (buttonChecked == button_options.INSPECT) {\n //Clear colours\n buttonChecked = button_options.NONE;\n }\n else {\n //Clear button method, change to selected\n buttonChecked = button_options.INSPECT;\n }\n consoleAdd(\"Button Selected: \" + buttonChecked);\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}", "async clickTransaction() {\n await I.waitForElement(this.buttons.transactionBtn, 20);\n I.click(this.buttons.transactionBtn);\n\n }", "async function init () {\n // get info for ganache or hardhat testnet\n const provider = await new ethers.providers.JsonRpcProvider();\n //console.log(\"\\n\\nprovider\\n\\n\", provider);\n\n // the following 2 lines are used if contract is on rinkeby instead of ganache or hardhat testnet\n //let provider;\n //window.ethereum.enable().then(provider = new ethers.providers.Web3Provider(window.ethereum));\n\n const signer = await provider.getSigner()\n //console.log(\"\\n\\nsigner\\n\\n\", signer);\n const userAddress = await signer.getAddress();\n //console.log(\"\\n\\nuser address\\n\\n\", userAddress);\n\n // initialize shadow contract\n\n let AppInstance = null;\n // get the contract address from deployment to test network. Make sure it is the applicaton contract, not the oracle.\n const abi = AppContractJSON.abi;\n\n // Make sure you set this correctly after deployment or nothing will work!!!\n AppInstance = new ethers.Contract('0x5FbDB2315678afecb367f032d93F642f64180aa3', abi, signer);\n\n // listen for events\n filterEvents(AppInstance);\n\n return { AppInstance, signer }\n}", "async initLedger(ctx){\n await ctx.stub.putState(\"Init\", \"Fasten Network Project\");\n return \"success\";\n }", "async initContracts() {\n this.contract = new ethers.Contract(\n this.evn.SUPPORT_ADDRESS,\n this.evn.SUPPORT_ABI,\n this.wallet\n );\n this.contract.provider.polling = false;\n }", "function doContract() {\r\n\tallElements = document.getElementById('contentRow').children[1];\r\n\t//head\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Contracts/,\"Szerződések\");\r\n\tallElements = allElements.children[1];\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Contract/,\"Szerződés\");\r\n\ttmp = allElements.children[6];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Contract status: /,\"Szerződés állapota: \");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Accepted/,\"Elfogadva\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Rejected by (.*)/,\"$1 vissza utasította \");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Failed/,\"Elutasítva\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Template/,\"Sablon\");\r\n\t\r\n\t//list\r\n\tallElements = allElements.children[8].children[0].children[0];\r\n\ttmp = allElements;\r\n\treplaceContractComm(tmp.children[0],1);\r\n\tallElements.innerHTML.match(\"Dummy citizen\") ? isDummy=true : isDummy=false;\r\n\treplaceContractComm(tmp.children[2],isDummy?2:3);\r\n\t\r\n\tif (isDummy) {\r\n\t\t//add\r\n\t\tallElements = document.getElementById('contentRow').children[1].children[3];\r\n\t\ttmp = allElements.children[0];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Add new element to the contract/,\"Új elem hozzáadása a szerződéshez \");\r\n\t\t\r\n\t\tallElements = document.getElementById('contractsForm');\r\n\t\ttmp = allElements.children[3];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Side/,\"Oldal\");\r\n\t\ttmp = allElements.children[7];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Item type/,\"Típus\");\r\n\t\t\r\n\t\tallElements = document.getElementById('offererSide');\r\n\t\ttmp = allElements.children[1];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Dummy citizen/,\"Dummy polgár\");\r\n\t\t\r\n\t\t//money\r\n\t\tallElements = document.getElementById('itemTypeList');\r\n\t\treplaceOptionTxt(allElements, {\r\n\t\t\t\"Money\":[\"Money\",\"Pénz\"],\r\n\t\t\t\"Product\":[\"Product\",\"Termék\"],\r\n\t\t\t\"Debt\":[\"Debt\",\"Adósság\"]\r\n\t\t});\r\n\t\t\r\n\t\tallElements = document.getElementById('MONEYParameters');\r\n\t\ttmp = allElements.children[0].childNodes[0];\r\n\t\ttmp.nodeValue=tmp.nodeValue.replace(/Money \\(in /,\"Péznnem : ( \");\r\n\t\t\r\n\t\t//Product\r\n\t\tallElements = document.getElementById('PRODUCTParameters');\r\n\t\ttmp = allElements.children[0];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Product quantity:/,\"Termék mennyisége:\");\r\n\t\ttmp = allElements.children[2];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Product type:/,\"Termék típusa:\");\r\n\t\ttmp = allElements.children[5];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Product quality:/,\"Termék mínősége:\");\r\n\t\t\r\n\t\tallElements = document.getElementById('resource');\r\n\t\treplaceOptionTxt(allElements, {\r\n\t\t\t\"Iron\":[\"Iron\",\"\\Vas\"],\r\n\t\t\t\"Grain\":[\"Grain\",\"Búza\"],\r\n\t\t\t\"Oil\":[\"Oil\",\"Olaj\"],\r\n\t\t\t\"Stone\":[\"Stone\",\"Kő\"],\r\n\t\t\t\"Wood\":[\"Wood\",\"Fa\"],\r\n\t\t\t\"Diamonds\":[\"Diamonds\",\"Gyémánt\"],\r\n\t\t\t\"Weapon\":[\"Weapon\",\"FEgyver\"],\r\n\t\t\t\"House\":[\"House\",\"Ház\"],\r\n\t\t\t\"Gift\":[\"Gift\",\"Ajándék\"],\r\n\t\t\t\"Food\":[\"Food\",\"Kaja\"],\r\n\t\t\t\"Ticket\":[\"Ticket\",\"Jegy\"],\r\n\t\t\t\"Defense System\":[\"Defense System\",\"Védelmi rendszer\"],\r\n\t\t\t\"Hospital\":[\"Hospital\",\"Kórház\"]\r\n\t\t});\r\n\t\t\r\n\t\t//Debt\r\n\t\tallElements = document.getElementById('DEBTParameters');\r\n\t\ttmp = allElements.children[1];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Debt/,\"Adóság\");\r\n\t\ttmp = allElements.children[3].childNodes[0];\r\n\t\ttmp.nodeValue=tmp.nodeValue.replace(/Money \\(in /,\"Pénznem: ( \");\r\n\t\ttmp = allElements.children[5];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Payback time:/,\"Visszafizetési határidő:\");\r\n\t\ttmp = allElements.children[5];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Product quality:/,\"Termék mínősége:\");\r\n\t\t\r\n\t\t//propose\r\n\t\tallElements = document.getElementById('contentRow').children[1].children[5];\r\n\t\ttmp = allElements.children[0];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Propose contract/,\"Szerződés javasolása\");\r\n\t\ttmp = allElements.children[2].children[3];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Propose to/,\"Neki\");\r\n\t\ttmp = allElements.children[5];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Note:/,\"Megjegyzés:\");\r\n\t\ttmp = allElements.childNodes[12];\r\n\t\ttmp.nodeValue=tmp.nodeValue.replace(/you can only propose contract to your friend/,\"Csak a barátaiddal köthetsz szerződést\");\r\n\t}\r\n\t\r\n\treplaceLinkByHref({\r\n\t\t\"profile.html?id=0\":[\"Dummy citizen\",\"Dummy polgár\"],\r\n\t\t\"contracts.html\":[\"Go back to contract list\",\"Vissza a szerződésekhez\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Delete\":[\"Delete\",\"Törlés\"],\r\n\t\t\"Propose\":[\"Propose\",\"Ajánlás\"],\r\n\t\t\"Add item\":[\"Add item\",\"Elem hozzáadása\"]\r\n\t});\r\n\t//cancel contract\r\n\tcheck = getElements(document, \"//b[@class='biggerFont']\");\r\n check = check.snapshotItem(1)\r\n\tif (check.innerHTML.match(\"Cancel proposal\")) {\r\n\t check.innerHTML = check.innerHTML.replace(/Cancel proposal/,\"Javaslat visszavonása\")\r\n\t replaceInputByValue({\"Cancel proposition\":[\"Cancel proposition\",\"Ajánlat visszavonása\"]});\r\n\t } \r\n}", "function setupBot(name, selector) {\n $( selector ).click( function activator() {\n console.log( \"Activating: \" + name );\n } );\n}", "function voteForCandidate() {\n candidateName = $(\"#candidate\").val();\n contractInstance.IncrementVote(candidateName, {from: web3.eth.accounts[0]}, function() {\n let div_id = candidates[candidateName];\n $(\"#\" + div_id).html(contractInstance.NumVotes.call(candidateName).toString());\n });\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 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 onSetupContract() {\n var address = $(\"#setup-contract-address\").val();\n if(!address) {\n window.alert(\"Please enter contract address\");\n return;\n }\n setupContract(address);\n }", "setTestnet() {\n this.lisk.api().setTestnet(true);\n }", "createNodeAndListeners() {\n // Create button node\n this.createNode();\n // Remove text node from div prior to set up of arrows and body\n this.node.textContent = '';\n // Create arrows and svg text\n this.createLeftArrow();\n this.node.appendChild(this.leftArrow.node);\n this.createBody();\n this.node.appendChild(this.buttonBody);\n this.createRightArrow();\n this.node.appendChild(this.rightArrow.node);\n // Button values set externally from spec (e.g. on switch to page)\n if (this.text === false) {\n // Remove text node\n this.text = '';\n this.values = [];\n // Button values set internally from spec (e.g. list of set values)\n } else {\n this.setValues(this.values);\n }\n }", "function createTest(title, options) {\n it(title, function () {\n var tag = options.tag;\n var props = options.props;\n var checkProperty = getCheckProperty(props);\n var expected = getExpectedValue(props);\n\n function handleChangeLocal() {\n // If checkbox is toggled manually, this will throw.\n assert.strictEqual(node[checkProperty], expected);\n changes += 1;\n }\n\n props.ref = getReference;\n props.onChange = handleChangeLocal;\n render(createElement(tag, props), container);\n triggerAndCheck();\n assert.strictEqual(node[checkProperty], expected);\n });\n }", "toMatchBetToBalanceEvent () {\n this.getInst('ControlDesktopViewHandler').toMatchBetToBalanceShow();\n }", "function doContract() {\r\n\tallElements = document.getElementById('contentRow').children[1];\r\n\t//head\r\n\ttmp = allElements.children[0];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Contracts/,\"S\\u00f6zle\\u015fme\");\r\n\tallElements = allElements.children[1];\r\n\ttmp = allElements.children[4];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Contract/,\"S\\u00f6zle\\u015fme\");\r\n\ttmp = allElements.children[6];\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Contract status: /,\"S\\u00f6zle\\u015fme durumu: \");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Accepted/,\"Kabul edildi\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Rejected by (.*)/,\"$1 taraf\\u0131ndan reddedildi\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Failed/,\"Ba\\u015fr\\u0131s\\u0131z\");\r\n\ttmp.innerHTML=tmp.innerHTML.replace(/Template/,\"\\u015fablon\");\r\n\t\r\n\t//list\r\n\tallElements = allElements.children[8].children[0].children[0];\r\n\ttmp = allElements;\r\n\treplaceContractComm(tmp.children[0],1);\r\n\tallElements.innerHTML.match(\"Dummy citizen\") ? isDummy=true : isDummy=false;\r\n\treplaceContractComm(tmp.children[2],isDummy?2:3);\r\n\t\r\n\tif (isDummy) {\r\n\t\t//add\r\n\t\tallElements = document.getElementById('contentRow').children[1].children[3];\r\n\t\ttmp = allElements.children[0];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Add new element to the contract/,\"S\\u00f6zle\\u015fmeye yeni bir \\u00f6ge ekle\");\r\n\t\t\r\n\t\tallElements = document.getElementById('contractsForm');\r\n\t\ttmp = allElements.children[3];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Side/,\"Taraf\");\r\n\t\ttmp = allElements.children[7];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Item type/,\"\\u0130tem tipi\");\r\n\t\t\r\n\t\tallElements = document.getElementById('offererSide');\r\n\t\ttmp = allElements.children[1];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Dummy citizen/,\"Kar\\u015f\\u0131 taraf\");\r\n\t\t\r\n\t\t//money\r\n\t\tallElements = document.getElementById('itemTypeList');\r\n\t\treplaceOptionTxt(allElements, {\r\n\t\t\t\"Money\":[\"Money\",\"Para\"],\r\n\t\t\t\"Product\":[\"Product\",\"\\u00dcr\\u00fcn\"],\r\n\t\t\t\"Debt\":[\"Debt\",\"Bor\\u00e7\"]\r\n\t\t});\r\n\t\t\r\n\t\tallElements = document.getElementById('MONEYParameters');\r\n\t\ttmp = allElements.children[0].childNodes[0];\r\n\t\ttmp.nodeValue=tmp.nodeValue.replace(/Money \\(in /,\"Para ( \");\r\n\t\t\r\n\t\t//Product\r\n\t\tallElements = document.getElementById('PRODUCTParameters');\r\n\t\ttmp = allElements.children[0];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Product quantity:/,\"\\u00dcr\\u00fcn adedi:\");\r\n\t\ttmp = allElements.children[2];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Product type:/,\"\\u00dcr\\u00fcn:\");\r\n\t\ttmp = allElements.children[5];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Product quality:/,\"\\u00dcr\\u00fcn kalitesi:\");\r\n\t\t\r\n\t\tallElements = document.getElementById('resource');\r\n\t\treplaceOptionTxt(allElements, {\r\n\t\t\t\"Iron\":[\"Iron\",\"Demir\"],\r\n\t\t\t\"Grain\":[\"Grain\",\"Tah\\u0131l\"],\r\n\t\t\t\"Oil\":[\"Oil\",\"Petrol\"],\r\n\t\t\t\"Stone\":[\"Stone\",\"Ta\\u015f\"],\r\n\t\t\t\"Wood\":[\"Wood\",\"Kereste\"],\r\n\t\t\t\"Diamonds\":[\"Diamonds\",\"Elmas\"],\r\n\t\t\t\"Weapon\":[\"Weapon\",\"Silah\"],\r\n\t\t\t\"House\":[\"House\",\"Ev\"],\r\n\t\t\t\"Gift\":[\"Gift\",\"Hediye\"],\r\n\t\t\t\"Food\":[\"Food\",\"Ekmek\"],\r\n\t\t\t\"Ticket\":[\"Ticket\",\"Bilet\"],\r\n\t\t\t\"Defense System\":[\"Defense System\",\"Savunma sistemi\"],\r\n\t\t\t\"Hospital\":[\"Hospital\",\"Hastane\"],\r\n\t\t\t\"Estate\":[\"Estate\",\"Konak\"]\r\n\t\t});\r\n\t\t\r\n\t\t//Debt\r\n\t\tallElements = document.getElementById('DEBTParameters');\r\n\t\ttmp = allElements.children[1];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Debt/,\"Bor\\u00e7\");\r\n\t\ttmp = allElements.children[3].childNodes[0];\r\n\t\ttmp.nodeValue=tmp.nodeValue.replace(/Money \\(in /,\"Para ( \");\r\n\t\ttmp = allElements.children[5];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Payback time:/,\"\\u00d6deme zaman\\u0131:\");\r\n\t\ttmp = allElements.children[5];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Product quality:/,\"\\u00dcr\\u00fcn kalitesi:\");\r\n\t\t\r\n\t\t//propose\r\n\t\tallElements = document.getElementById('contentRow').children[1].children[5];\r\n\t\ttmp = allElements.children[0];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Propose contract/,\"S\\u00f6zle\\u015fme teklif et\");\r\n\t\ttmp = allElements.children[2].children[3];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Propose to/,\"Teklif edilecek ki\\u015fi\");\r\n\t\ttmp = allElements.children[5];\r\n\t\ttmp.innerHTML=tmp.innerHTML.replace(/Note:/,\"Not:\");\r\n\t\ttmp = allElements.childNodes[12];\r\n\t\ttmp.nodeValue=tmp.nodeValue.replace(/you can only propose contract to your friend/,\"Sadece arkada\\u015flar\\u0131na s\\u00f6zle\\u015fme teklif edebilirsin\");\r\n\t}\r\n\t\r\n\treplaceLinkByHref({\r\n\t\t\"profile.html?id=0\":[\"Dummy citizen\",\"Kar\\u015f taraf\"],\r\n\t\t\"contracts.html\":[\"Go back to contract list\",\"S\\u00f6zle\\u015fme listesine geri d\\u00f6n\"]\r\n\t});\r\n\treplaceInputByValue({\r\n\t\t\"Delete\":[\"Delete\",\"Sil\"],\r\n\t\t\"Propose\":[\"Propose\",\"Teklif et\"],\r\n\t\t\"Add item\":[\"Add item\",\"\\u0130tem ekle\"]\r\n\t});\r\n\t//cancel contract\r\n\tcheck = getElements(document, \"//b[@class='biggerFont']\");\r\n check = check.snapshotItem(1)\r\n\tif (check.innerHTML.match(\"Cancel proposal\")) {\r\n\t check.innerHTML = check.innerHTML.replace(/Cancel proposal/,\"S\\u00f6zle\\u015fmeyi iptal et\")\r\n\t replaceInputByValue({\"Cancel proposition\":[\"Cancel proposition\",\"\\u0130tal teklifi\"]});\r\n\t } \r\n}", "function voting_start() {\n jQuery(\"#vote-page\").show();\n jQuery.getJSON(command_url(\"game_status\"), function(data) {\n\tgame_id=data.id;\n\tjQuery(\".action-butt\").each(function (n) {\n\t this.innerHTML = data.choices[n];\n\t});\n });\n}", "function setupUI() {\n\n var address = window.localStorage.getItem(\"contractAddress\");\n\n $(\"#contract-manipulation input, #contract-manipulation button, #contract-manipulation textarea\").prop(\"disabled\", true);\n\n $(\"#setup-contract-address\").val(address);\n\n }", "TestAddExperience(experience_place_input, experience_date_input, experience_center_input, experience_add_action) {\n // set a default value to the experience place input\n experience_place_input.value = \"test\";\n // set a default value to the experience date input\n experience_date_input.value = \"test\";\n // set a default value to the experience center input\n experience_center_input.value = \"test\";\n // invoke the event from the adding experience button\n experience_add_action.dispatchEvent(new Event(\"click\"));\n // print on the console that the test is completed\n console.log(\"Testing add experience method completed\");\n // add the state of was the experience of the client instance had the default values or not\n this._errors_exists = (this._main_store.client.experiences[0].place != \"test\" &&\n this._main_store.client.experiences[0].date != \"test\" &&\n this._main_store.client.experiences[0].center != \"test\");\n }", "validatePreOrder() {\n return this\n .waitForElementVisible('@preOrderBtn', 10000, () => {}, '[STEP] - \"Pre-order\" button should be displayed')\n .assert.containsText('@preOrderBtn', 'Pre-order');\n }", "function setupContract(address) {\n if(!abis) {\n window.alert(\"ABI data not loaded\");\n return;\n }\n\n // Load contract ABI data\n var EInvoicingRegistry = web3.eth.contract(abis.EInvoicingRegistry.abi);\n\n // Instiate proxy object\n contract = EInvoicingRegistry.at(address);\n\n try {\n var ver = contract.version();\n } catch(e) {\n window.alert(\"Error communicating with the contract:\" + e);\n return;\n }\n\n if(!ver) {\n window.alert(\"Contract seems to be invalid\");\n return;\n }\n\n $(\"#active-address\").text(address);\n $(\"#active-version\").text(ver);\n $(\"#alert-contract-success\").show();\n\n $(\"#contract-manipulation input, #contract-manipulation button, #contract-manipulation textarea\").removeAttr(\"disabled\");\n\n window.localStorage.setItem(\"contractAddress\", address);\n window.contract = contract;\n }", "enterOr_test(ctx) {\n\t}", "contributePiggy (playerContribution, minContribution) {\r\n let self = this\r\n\r\n self.contributionStatus = 'contributing'\r\n\r\n // Format contribution\r\n playerContribution = playerContribution.replace(/,/g, '.')\r\n playerContribution = playerContribution.replace(/^\\./g, '0.')\r\n\r\n // Check user contribution\r\n if (playerContribution === '') {\r\n self.contributionError = this.$t('lang.ethereummixin.contributionNotValid')\r\n return false\r\n } else if (playerContribution < minContribution) {\r\n self.contributionError = this.$t('lang.ethereummixin.contributionTooLow') + ' (' + minContribution + ')'\r\n return false\r\n }\r\n\r\n // Dial node\r\n self.dialJs()\r\n\r\n // Contribute\r\n self.web3js.eth.getAccounts()\r\n .then(function (accounts) {\r\n console.log(accounts)\r\n let currentAddress = accounts[0]\r\n\r\n if (self.abi && self.contractAddress) {\r\n // Get contract\r\n var contract = new self.web3js.eth.Contract(self.abi, self.contractAddress)\r\n // Send contribution\r\n contract.methods.contribute().send({value: Units.convert(playerContribution, 'eth', 'wei'), from: currentAddress})\r\n .on('transactionHash', function (hash) {\r\n console.log('as contributed', hash)\r\n self.contributionStatus = 'contributed'\r\n self.$store.state.ethLoading.contribution = true\r\n self.$store.state.ethPendingTx = hash\r\n self.dialog = true\r\n })\r\n .on('receipt', function (receipt) {\r\n console.log('Contribution receipt:', receipt)\r\n self.$store.state.ethLoading.contribution = false\r\n self.getEthGameData()\r\n self.notify(self.$t('lang.ethereummixin.notification.contribute.title'), self.$t('lang.ethereummixin.notification.contribute.text'))\r\n })\r\n .on('confirmation', function (confirmationNumber, receipt) {\r\n // console.log('confirmation:', confirmationNumber, receipt)\r\n })\r\n .on('error', function (error) {\r\n console.log('error:', error)\r\n })\r\n }\r\n })\r\n }", "function test_generic_object_button_execute_playbook() {}", "login (username, password) {\n this.inputUsername.setValue(username);\n this.inputPassword.setValue(password);\n this.btnSubmit.click(); \n const homepage= $('#inventory_container');\n expect(homepage).toBeDisplayed();\n \n \n }", "static async ensureSignedIn(context) {\n const suite = new UITestSuite();\n suite.mochaContext = context;\n const signedIn = await suite.checkForStatusBarTitle(suite.hostWindow, suite.testAccount.email);\n if (!signedIn) {\n const userCode = await web.signIn(suite.serviceUri, 'microsoft', suite.testAccount.email, suite.testAccount.password, false);\n assert(userCode, 'Should have gotten a user code from browser sign-in.');\n await suite.runLiveShareCommand(suite.hostWorkbench, 'liveshare.signin.token');\n await suite.hostWorkbench.quickinput.waitForQuickInputOpened();\n await suite.hostWindow.waitForSetValue(quickinput_1.QuickInput.QUICK_INPUT_INPUT, userCode);\n await suite.hostWindow.dispatchKeybinding('enter');\n await suite.waitForStatusBarTitle(suite.hostWindow, suite.testAccount.email);\n }\n }", "function setup() {\n console.log(\"I have linked Javascript!\");\n $(\"#intake\").click(handleRespones);\n $('#signup').click(signUp);\n}", "function eosRequest(method, elementID) {\n console.log(method, elementID);\n switch (method) {\n case 'pull':\n switch (elementID) {\n case 'hat-hotspot':\n break;\n\n case 'claim-notifications':\n break;\n\n }\n break;\n\n case 'push':\n switch (elementID) {\n case 'want-button':\n $('#purchase-response').hide();\n $('#want-response').show();\n break;\n\n case 'purchase-button':\n eos.contract('promoteit')\n .then((contract) => {\n console.log(\"CONTRACT INIT\");\n contract.buyitem( {\n \"serialnum\": \"0\",\n \"buyername\": \"james\"\n }, {authorization: EOS_CONFIG.contractSender} ) \n .then((res) => {\n console.log(\"POST CALL\");\n console.log(res);\n $('#purchase-response').show();\n $('#want-response').hide();\n $('#hidden-hat').show();\n }).catch((err) => { console.log(err) })\n }).catch((err) => { console.log(err) })\n break;\n\n case 'add-item-button':\n $('#add-item-button').hide();\n $('#add-item-response').show();\n setTimeout(function() {$('#claim-notifications').show()}, 3000);\n break;\n\n case 'receive-reward-button':\n $('#receive-reward-button').hide();\n $('#receive-reward-response').show();\n $('#claim-notifications').hide();\n $('#token-balance-amount').html('3.45');\n break;\n }\n break;\n }\n}", "async init() {\n try {\n const [contractInstance, accounts] = await Promise.all([\n this\n .facilitatorContract\n .deployed(),\n this\n .web3\n .eth\n .getAccounts(),\n this\n .ipfs\n .isOnline()\n ? this.waitFor('ipfs-ready')\n : 0\n ]);\n\n this.accountAddress = accounts[0];\n\n this.contractInstance = contractInstance;\n\n this.emit('ready')\n } catch (error) {\n this.emit('error', error)\n }\n }", "async function start_braintree(change_plan) {\n const module = await import('../../../../../../../../js/cmp/payment.js');\n let braintree = module.braintree;\n fetchWithAuth(\"subscription.openhabx.com/clienttoken\")\n .then(response => response.json())\n .then(json => {\n if (!json.client_token)\n throw new Error(\"Response does not contain a client token!\");\n const opts = {\n authorization: json.client_token,\n container: braintree_container,\n paypal: {\n flow: \"vault\"\n },\n preselectVaultedPaymentMethod: true\n };\n braintree.create(opts, (err, dropinInstance) => {\n if (err) {\n $$invalidate('error_message_braintree', error_message_braintree = err.message);\n console.error(err);\n return;\n }\n payment_instance = dropinInstance;\n });\n })\n .catch(err => {\n console.warn(\"Failed to request client token!\", err);\n $$invalidate('error_message_braintree', error_message_braintree =\n \"Failed to request client token! \" + err.message);\n });\n\n return {\n destroy() {}\n };\n }", "async function createTestWidget() {\n await setup()\n\n const childOptions = {\n cwd: testDirPath,\n silent: true,\n stdio: ['pipe', 'pipe', 'pipe', 'ipc'],\n }\n const child = fork(path.join(__dirname, '../..'), [], childOptions)\n child.stderr.on('data', data => console.error('stderr: ', data.toString()))\n\n const nameMatcher = /name of widget/i\n const descMatcher = /description/i\n const authorMatcher = /author/i\n const successMatcher = /widget \"test.widget\" created/i\n\n const cliMatchers = [nameMatcher, descMatcher, authorMatcher, successMatcher]\n\n const makeResponder = promisify((matcher, response, callback) => {\n const responder = function(data) {\n const logMessage = data.toString()\n if (logMessage.match(matcher)) {\n if (response) {\n child.stdin.write(`${response}\\n`)\n }\n\n child.stdout.removeListener('data', this)\n callback()\n } else if (!cliMatchers.some(rx => logMessage.match(rx))) {\n // Fail meaningfully (not by tap timeout) if a message matches nothing\n const rxList = cliMatchers.map(rx => rx.toString()).join(', ')\n callback(\n new Error(\n `CLI message \"${logMessage}\" does not match any of ${rxList}`\n )\n )\n }\n }\n\n child.stdout.on('data', data => responder.call(responder, data))\n })\n\n await Promise.all([\n makeResponder(nameMatcher, 'Test Widget'),\n makeResponder(descMatcher, 'Test description'),\n makeResponder(authorMatcher, 'Test Name <[email protected]>'),\n makeResponder(successMatcher, null),\n ])\n\n child.kill(1)\n}", "function testBox (options, callback) {\n options = objectAssign({}, TEST_OPTIONS, options);\n return pwbox(message, password, options, callback);\n }", "async Init(stub) {\n console.info('=========== Instantiated smart_review chaincode ===========');\n return shim.success();\n }", "function signedInFlow() {\n document.querySelector('#signed-in-flow').style.display = 'block';\n\n document.querySelectorAll('[data-behavior=account-id]').forEach((el) => {\n el.innerText = window.accountId;\n });\n\n // populate links in the notification box\n const accountLink = document.querySelector('[data-behavior=notification] a:nth-of-type(1)');\n accountLink.href = accountLink.href + window.accountId;\n accountLink.innerText = '@' + window.accountId;\n const contractLink = document.querySelector('[data-behavior=notification] a:nth-of-type(2)');\n contractLink.href = contractLink.href + window.contract.contractId;\n contractLink.innerText = '@' + window.contract.contractId;\n\n // update with selected networkId\n accountLink.href = accountLink.href.replace('testnet', networkId);\n contractLink.href = contractLink.href.replace('testnet', networkId);\n\n fetchGreeting();\n}", "enterAnd_test(ctx) {\n\t}", "function newMember() {\n inquirer.prompt([\n {\n type: 'list',\n message: 'What is the role of your new member? Or are you finished?',\n choices: ['Engineer', 'Intern', 'All done'],\n name: 'newHire'\n }\n ])\n// switch case for each selection\n .then(function (data) {\n switch (data.newHire) {\n case 'Engineer':\n newEngineer()\n break;\n case 'Intern':\n newIntern()\n break;\n case 'All done':\n writeHtml()\n break;\n }\n })\n}", "function SetUp()\n{\n APIToken = GetDataFromBrowserLocalStorage(\"jobbz_member_api_token\");\n JobzzMember = JSON.parse(GetDataFromBrowserLocalStorage(\"jobzz_member\"));\n\n GetContractorBillingInfo(JobzzMember.MemberId, APIToken);\n}", "async function main() {\n\n let frequency = 1;\n let price = ethers.utils.parseEther(\"1\");\n let fee = ethers.utils.parseEther(\"0.03\");\n let name = \"Roam Fantom Lottery\";\n let recipient = '0x19FF17645bd4930745e632284422555466675e44';\n let modulus = 2;\n\n // This is just a convenience check\n if (network.name === \"hardhat\") {\n console.warn(\n \"You are trying to deploy a contract to the Hardhat Network, which\" +\n \"gets automatically created and destroyed each time. Use the Hardhat\" +\n \" option '--network localhost'\"\n );\n }\n\n // ethers is avaialble in the global scope\n const [deployer] = await ethers.getSigners();\n console.log(\n \"Deploying the contracts with the account:\",\n await deployer.getAddress()\n );\n\n console.log(\"Account Balance:\", (await deployer.getBalance()).toString());\n\n const Lotto = await ethers.getContractFactory(\"FantomLottery\");\n const lottery = await Lotto.deploy(name, frequency, ethers.utils.parseEther(\"1\"), modulus, ethers.utils.parseEther(\"0.03\"), recipient);\n\n await lottery.deployed();\n\n console.log(\"Lotto Address:\", lottery.address);\n\n // We also save the contract's artifacts and address in the frontend directory\n saveFrontendFiles(lottery);\n}", "function testOnRender() {\n var miniCartEl = document.getElementById(miniCartId);\n \n test('onRender', function() {\n ok(!miniCartEl, 'Cart DOM element not present');\n });\n }", "static describe () {\n\t\treturn {\n\t\t\ttag: 'confirm',\n\t\t\tsummary: 'Confirms a user\\'s registration',\n\t\t\taccess: 'No authorization needed, though the correct confirmation code must be correct',\n\t\t\tdescription: 'Confirms a user\\'s registration with confirmation code',\n\t\t\tinput: {\n\t\t\t\tsummary: 'Specify attributes in the body; email and confirmation code must be provided',\n\t\t\t\tlooksLike: {\n\t\t\t\t\t'email*': '<User\\'s email>',\n\t\t\t\t\t'confirmationCode*': '<Confirmation code (sent via email to the user\\'s email after initial registration)>',\n\t\t\t\t\t'password': '<Can optionally set the user\\'s password here>',\n\t\t\t\t\t'username': '<Can optionally set the user\\'s username here>'\n\t\t\t\t}\n\t\t\t},\n\t\t\treturns: {\n\t\t\t\tsummary: 'Returns an updated user object, plus access token and PubNub subscription key, and teams the user is on as well as repos owned by those teams',\n\t\t\t\tlooksLike: {\n\t\t\t\t\tuser: '<@@#user object#user@@>',\n\t\t\t\t\taccessToken: '<user\\'s access token, to be used in future requests>',\n\t\t\t\t\tpubnubKey: '<subscribe key to use for connecting to PubNub>',\n\t\t\t\t\tpubnubToken: '<user\\'s token for subscribing to PubNub channels>',\n\t\t\t\t\tproviders: '<info structures with available third-party providers>',\n\t\t\t\t\tbroadcasterToken: '<user\\'s token for subscribing to real-time messaging channels>',\n\t\t\t\t\tteams: [\n\t\t\t\t\t\t'<@@#team object#team@@>',\n\t\t\t\t\t\t'...'\n\t\t\t\t\t],\n\t\t\t\t\trepos: [\n\t\t\t\t\t\t'<@@#repo object#repo@@>',\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\tpublishes: {\n\t\t\t\tsummary: 'Publishes the updated user object on the team channel for each team the user is on.',\n\t\t\t\tlooksLike: {\n\t\t\t\t\tuser: '<@@#user object#user@@>'\n\t\t\t\t}\n\t\t\t},\n\t\t\terrors: [\n\t\t\t\t'parameterRequired',\n\t\t\t\t'notFound',\n\t\t\t\t'alreadyRegistered',\n\t\t\t\t'emailMismatch',\n\t\t\t\t'tooManyConfirmAttempts',\n\t\t\t\t'confirmCodeExpired',\n\t\t\t\t'confirmCodeMismatch'\n\t\t\t]\n\t\t};\n\t}", "async function main() {\n try {\n // load the network configuration\n const ccpPath = path.resolve(__dirname, '..', '..', 'test-network', 'organizations', 'peerOrganizations', 'org1.example.com', 'connection-org1.json');\n let ccp = JSON.parse(fs.readFileSync(ccpPath, 'utf8'));\n\n // Create a new file system based wallet for managing identities.\n const walletPath = path.join(process.cwd(), 'wallet');\n const wallet = await Wallets.newFileSystemWallet(walletPath);\n console.log(`Wallet path: ${walletPath}`);\n\n // Check to see if we've already enrolled the user.\n const identity = await wallet.get('appUser');\n if (!identity) {\n console.log('An identity for the user \"appUser\" does not exist in the wallet');\n console.log('Run the registerUser.js application before retrying');\n return;\n }\n\n // Create a new gateway for connecting to our peer node.\n const gateway = new Gateway();\n await gateway.connect(ccp, { wallet, identity: 'appUser', discovery: { enabled: true, asLocalhost: true } });\n\n // Get the network (channel) our contract is deployed to.\n const network = await gateway.getNetwork('mychannel');\n\n // Get the contract from the network.\n const contract = network.getContract('fabcar');\n\n // Submit the specified transaction.\n // createCar transaction - requires 5 argument, ex: ('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom')\n // changeCarOwner transaction - requires 2 args , ex: ('changeCarOwner', 'CAR12', 'Dave')\n // await contract.submitTransaction('createCar', 'CAR12', 'Honda', 'Accord', 'Black', 'Tom');\n //await contract.submitTransaction('registerUser', '[email protected]', '[email protected]', 'sherlocked123', 'sherlocked');\n \n //console.log(uniqid());\n const today = new Date();\n const productID = today.getFullYear()+\"\"+(today.getMonth()+1)+\"\"+today.getDate()+\"\"+today.getHours()+\"\"+today.getMinutes()+\"\"+today.getMilliseconds();\n //await contract.submitTransaction('createProducts', productID, 'RICE', '10 KG', 'Isaaq');\n //await contract.submitTransaction('registerUser', '[email protected]', '[email protected]', 'a12', 'yoyo');\n\n //await contract.submitTransaction('registerUser', '[email protected]', '[email protected]', 'a012', 'A012','producer', 'A company');\n //createProductsOfProducer(ctx, productID, name, quantity, org, unit='KG')\n //await contract.submitTransaction('createProductsOfProducer', productID, '[email protected]','RICE', '100', 'KG');\n // console.log(p);\n //await contract.submitTransaction('registerUser', '[email protected]', '[email protected]', 'b012', 'B012', 'retailer', 'B company');\n //await contract.submitTransaction('registerUser', '[email protected]', '[email protected]', 'b123', 'B123', 'consumer', 'consumer');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '2021424734204', '[email protected]', '100');\n //await contract.submitTransaction('requestOwnerShipOfProduct', '20214262211609', '[email protected]', '100');\n // console.log(p);\n //const p = await contract.submitTransaction('updateProductsOfRetailer', '2021424210667', '10');\n //console.log(p.toString());\n //await contract.submitTransaction('changeOwnerShipOfProduct', '2021424139376');\n // console.log(p);\n //const p = await contract.submitTransaction('queryProduct', '2021424139376');\n //console.log(p.toString());\n //updateProductsOfRetailer(ctx, productID, quantity)\n //queryProduct(ctx, productID)\n //changeOwnerShipOfProduct(ctx, productId);\n //requestOwnerShipOfProduct(ctx, productID, newOwnerId, quantity)\n //createProductsOfProducer(ctx, productID, userID, name, quantity, unit)\n //registerUser(ctx, userId, email, password, name, role, org)\n console.log('Transaction has been submitted');\n\n // Disconnect from the gateway.\n await gateway.disconnect();\n\n } catch (error) {\n console.error(`Failed to submit transaction: ${error}`);\n process.exit(1);\n }\n}", "updateUI(state, progress, answerValue = undefined, node = undefined) {\n // change background color of answer selection button\n if (node !== undefined) {\n let styleQuery = document.querySelector(`[data-key='${node}']`).style;\n if (answerValue === 'true') {\n styleQuery.backgroundColor = 'hsl(140, 100%, 30%)'; // red\n styleQuery.color = 'white';\n } else {\n styleQuery.backgroundColor = 'hsl(0, 100%, 55%)'; // green\n styleQuery.color = 'white';\n }\n }\n // this.validateUI(node);\n setTimeout(() => {\n this.header(progress);\n if (state === 'end') {\n this.end(progress);\n } else {\n this.main();\n }\n }, (answerValue === undefined) ? 100 : 2000)\n }", "function Editer(_contract) {\n\n var my_name = \"Editer\";\n var options = _get_contract(my_name, _contract);\n\n var _Parent = $(options.parent) || $(\"body\");\n // begin.\n\n var options_map =\n {\n font: true,\n theme: true,\n linenum: true\n }\n\n /* fox is sly */\n var foxes =\n {\n onsave: [],\n oncreate: [],\n onchange: []\n }\n // var\n var _this;\n var Status = new Object(); // robot information...\n\n var _editers = new Array(); // save editer\n var _editer_nodes = new Array();\n var _editer_count = 0; // count\n var _editer_name_counter = 0;\n var _editer_i = 0;\n var hot_editer = null;\n\n var editer_options = new Array(); // options\n var editer_status = new Array();\n\n var cur_status, cur_options;\n // node\n\n var _Parent, save_dlg;\n var save_btn, option_btn, new_btn, inspect_btn;\n\n var editer_box;\n var ck_lineNumber, sel_theme, sel_font;\n\n var switcher, ul_editer;\n\n /* initial dom */\n _create_this();\n _init_dom();\n\n loop(_create_editer, options.editer_count);\n\n _connectToPage();\n _install();\n\n if(options.init_code) {\n\n var injectNode = $(\"<div></div>\").html(options.init_code);\n injectNode.appendTo($(\"body\"));\n\n //\n _this.inject(injectNode);\n }\n\n return _this;\n\n /* name: _create_this */\n\n function _create_this() {\n\n _this =\n {\n new_editer: _create_editer,\n del_editer: _delete_editer,\n\n /* name: inject */\n inject: function(src, index, options) {\n\n if(_u(index) || index == -1) {\n\n // opt\n var opt =\n {\n source:src,\n sourceType: \"NODE\",\n }\n\n copy(options, opt);\n _create_editer(opt);\n }\n else {\n _inject_code(src, index);\n }\n\n },\n /* name: get_code */\n get_code: function(index) {\n return _get_editer(index).getValue();\n },\n\n /* name: set_code */\n set_code: function(val, index) {\n var _e = _get_editer(index);\n\n var re = _get_editer(index).setValue(val);\n _e.refresh();\n\n return re;\n },\n\n /* name: get_editer */\n get_editer: function(index) {\n return _get_editer(index);\n },\n\n /* getDOM */\n getDOM: function() {\n return _Parent;\n },\n /*\n name: switch_editer\n */\n\n switch_editer: function(index) {\n\n if(_u(index)) {\n index = 0;\n }\n\n _switch_editer(index);\n //switcher.children()[index].click();\n\n ul_editer.tabs(\"option\", \"active\", index);\n },\n /*\n name: set_options\n */\n set_option: function(option_name, option_val, index) {\n\n if(_u(index)) {\n index = _editer_i;\n }\n\n // may be theme, font, linenum\n if(options_map[option_name]) {\n editer_options[index][option_name] = option_val;\n\n _init_editer(index);\n }\n else {\n _editers[index].setOption(option_name, option_val);\n }\n },\n get_option: function(option_name, index) {\n\n var re;\n\n if(_u(index)) {\n index = _editer_i;\n }\n\n if(options_map[option_name]) {\n re = editer_options[index][option_name];\n }\n else {\n re = _editers[index].getOption(option_name);\n }\n\n return re;\n }\n ,\n delete_all: function() {\n\n // delete all editers\n\n var iEditer = 0;\n\n for(;iEditer < _editer_count; iEditer++) {\n\n _delete_editer(iEditer);\n }\n }\n ,\n /* name: ambush */\n\n ambush: function(callback, type) {\n\n type = type || \"onsave\";\n\n foxes[type].push(callback);\n },\n\n /* show: show */\n show: function() {\n _Parent.dialog(\"open\");\n _refresh_editer();\n },\n\n /* hide */\n hide: function() {\n _Parent.dialog(\"close\");\n },\n\n /* toggle */\n toggle: function() {\n\n if(_Parent.dialog(\"isOpen\")) {\n _this.hide();\n }\n else {\n _this.show();\n }\n }\n }\n }\n /*\n name: _init_dom\n */\n\n function _init_dom() {\n _Parent = _Parent;\n\n option_btn = _Parent.find(\".Option-Btn\");\n save_btn = _Parent.find(\".Save-Btn\");\n new_btn = _Parent.find(\".New-Btn\");\n inspect_btn = _Parent.find(\".Inspect-Btn\");\n\n save_dlg = _Parent.find(\".Save-Code-Dialog\");\n\n // editer option\n editer_box = _Parent.find(\".Editer-Option-Box\");\n\n ck_lineNumber = _Parent.find(\"input[name='line-number']\");\n sel_theme = _Parent.find(\"select.Editer-Theme\");\n sel_font = _Parent.find(\"select.Editer-Font\");\n\n // get switcher\n ul_editer = _Parent.find(\"#editor-tab\");\n\n ul_editer.tabs({\n activate: function() {\n\n if(hot_editer) {\n hot_editer.refresh();\n }\n }\n });\n\n switcher = ul_editer.find(\"ul\");\n\n _Parent.dialog({\n poarsition: options.position,\n autoOpen: options.autoShow,\n show: options.effect,\n hide: options.effect\n });\n editer_box.hide();\n save_dlg.hide();\n\n switcher.hide();\n\n //\n ul_editer.on(\"tabsactivate\", function(event, ui) {\n\n if(hot_editer)\n hot_editer.refresh();\n })\n }\n\n /*\n name: create_editer\n */\n\n function _create_editer(_e_options) {\n\n var e_options =\n {\n mode: options.default_mode,\n theme: options.default_theme,\n font: options.default_font,\n linenum: options.default_linenum,\n\n source: \"\",\n sourceType: \"HTML\",\n\n auto_focus: true\n }\n\n copy(_e_options, e_options);\n\n _editer_count++;\n _editer_i = _editer_count - 1;\n\n var opts = new Object();\n editer_options[_editer_i] = opts;\n\n var status = new Object();\n editer_status[_editer_i] = status;\n // get code\n\n var _code = \"\";\n var _source = e_options.source;\n var node;\n\n var editer_name;\n var extend_class;\n var _2node; // to node branch\n switch(e_options.sourceType) {\n\n case \"HTML\":\n {\n _code = _source;\n editer_name = \"untitle\" + _editer_name_counter;\n _editer_name_counter++;\n }\n break;\n\n case \"NODE\":\n {\n _2node = true;\n extend_class = \"Injected\";\n editer_name = $(_source)[0].tagName + _editer_name_counter;\n _editer_name_counter++;\n }\n break;\n\n case \"Pit\":\n {\n editer_name = _source;\n extend_class = \"From-Pit\";\n _code = Pit.get(_source);\n }\n }\n // start.\n var _c_active = \"uk-active\";\n\n // if count < 2, hide switcher\n if(_editer_count < 2) {\n switcher.hide();\n }\n else {\n switcher.show();\n }\n\n var li_switcher = $(\"<li class=''><a href='#\" + editer_name +\"'>\" + editer_name + \"</a></li>\");\n li_switcher.addClass(extend_class);\n\n var a_close = $(\"<a href='#' class='Close-Btn'>X</a>\");\n\n //switcher.find(\".\" + _c_active).removeClass(_c_active);\n\n // create textarea\n var nTextarea = $(\"<textarea></textarea>\");\n\n nTextarea.className = \"Strong-Code-Editer\";\n\n var li_textarea = $(\"<div></div>\");\n li_textarea[0].id = editer_name;\n\n ul_editer.append(li_textarea);\n\n li_textarea.append(nTextarea);\n\n switcher.append(li_switcher);\n a_close.click(_close_onclick);\n li_switcher.append(a_close);\n\n //li_switcher.click(); // triger mouse event\n\n var editer = CodeMirror.fromTextArea(nTextarea[0], {\n value: _code,\n mode: e_options.mode,\n styleActiveLine: true,\n matchBrackets: true,\n extraKeys:\n {\n \"F11\": function(cm) {\n cm.setOption(\"fullScreen\", !cm.getOption(\"fullScreen\"));\n }\n ,\n \"Esc\": function(cm) {\n if(cm.getOption(\"fullScreen\")) {\n cm.setOption(\"fullScreen\", false);\n }\n }\n }\n })\n\n _editers.push(editer);\n // get node\n var editerNode = nTextarea.next();\n _editer_nodes.push(editerNode);\n\n hot_editer = editer;\n\n opts[\"font\"] = e_options.font;\n opts[\"theme\"] = e_options.theme;\n opts[\"linenum\"] = e_options.linenum;\n\n status[\"title\"] = editer_name;\n\n // _2node\n if(_2node) {\n _inject_code(_source, _editer_i);\n }\n // refresh\n ul_editer.tabs(\"refresh\");\n\n _init_editer();\n\n if(e_options.auto_focus) {\n _this.switch_editer(_editer_i);\n }\n }\n\n /*\n name: _connectToPage\n */\n\n function _connectToPage() {\n\n // bind key\n if(options.key) {\n keys(options.key, _this.toggle);\n }\n\n if(options.saveKey) {\n keys(options.saveKey, _save_code, \"keydown\",\n {\n prevent: true,\n stop_: true\n });\n }\n\n // show: switch editer\n switcher[0].addEventListener(\"click\", function() {\n\n var _t = event.target;\n\n if(_t.tagName !== \"A\" || $(_t).hasClass(\"Class-Btn\")) {\n return;\n }\n var index = $(_t).parent().index();\n\n _this.switch_editer(index);\n }, true)\n\n // dblclick: refresh\n switcher[0].addEventListener(\"dblclick\", function() {\n\n var _t = event.target;\n\n if(_t.tagName !== \"A\" || $(_t).hasClass(\"Class-Btn\")) {\n return;\n }\n\n var index = $(_t).parent().index();\n // repeat upon\n\n var _status = editer_status[index];\n if(_status[\"injectMode\"]) {\n\n // reload code\n _this.set_code(_status[\"node\"].html(), index);\n }\n })\n // click: new\n new_btn.click(function() {\n\n _create_editer();\n })\n\n // mouse: inspect\n inspect_btn.click(function() {\n\n // inspect\n if(ID_Inspector) {\n\n // if him not air\n\n if(! Status.inspector_connected) {\n _Inspector.connect(when_inspect, \"eat\");\n\n Status.inspector_connected = true;\n }\n\n _Inspector.start();\n _Parent.dialog(\"close\");\n\n _Inspector.pause_awhile();\n }\n })\n // click: save\n save_btn.click(function() {\n\n _save_code();\n })\n\n // click: options\n option_btn.click(function() {\n\n editer_box.toggle(\"fadeIn\");\n })\n\n // check: linenumber\n ck_lineNumber.bind(\"change\", function() {\n _this.set_option(\"linenum\", this.checked);\n setEditerLineNumber();\n })\n\n // change: theme\n sel_theme.bind(\"change\", function() {\n _this.set_option(\"theme\", this.value);\n setEditerTheme();\n })\n\n // change: font\n sel_font.bind(\"change\", function() {\n _this.set_option(\"font\", this.value);\n setEditerFont();\n })\n }\n\n /*\n name: _install\n */\n function _install() {\n\n if(options.autoInspect) {\n\n _Inspector.connect(when_inspect, \"eat\");\n\n Status.inspector_connected = true;\n }\n }\n /*\n name: setEditerTheme\n */\n\n function setEditerTheme(index) {\n _get_editer(index).setOption(\"theme\", _this.get_option(\"theme\", index));\n }\n\n /*\n name: setEditerFont\n */\n function setEditerFont(index) {\n _get_editer(index, true).css(\"fontSize\", _this.get_option(\"font\", index));\n }\n\n /*\n name: setEditerLineNumber\n */\n function setEditerLineNumber(index) {\n _get_editer(index).setOption(\"lineNumbers\", _this.get_option(\"linenum\", index));\n }\n\n /*\n name: _get_editer\n desc: return editer with index\n */\n\n function _get_editer(index, isNode) {\n var my_obj;\n\n // if index not number, return hot editer\n if(! _n(index)) {\n index = _editer_i;\n }\n\n if(isNode) {\n my_obj = _editer_nodes[index];\n }\n else {\n my_obj = _editers[index];\n }\n\n return my_obj;\n }\n\n /*\n name: _delete_editer\n */\n function _delete_editer(index) {\n\n _editer_count--;\n switcher.children()[index].remove();\n ul_editer.children()[index+1].remove();\n ul_editer.tabs(\"refresh\");\n\n\n if(! _move_forward()) {\n _no_move();\n }\n\n if(_editer_count > 0) {\n //switcher.children()[_editer_i].click();\n _switch_editer(_editer_i);\n _init_title();\n }\n else {\n _init_title(null, \"...\");\n }\n\n /*\n name: _move_forward\n */\n\n function _move_forward() {\n\n // +\n if(_editers[index + 1]) {\n\n _del_editer();\n //\n if(_editer_i > index) {\n _editer_i--;\n }\n else if(_editer_i <= index) {\n // no action\n }\n\n return true;\n }\n\n return false;\n }\n\n /*\n name: _no_move\n */\n function _no_move() {\n\n if(! _editers[index + 1]) {\n\n _del_editer();\n\n if(_editers[index -1 ]) {\n\n if(_editer_i == index) {\n _editer_i --;\n }\n }\n }\n }\n\n /*\n name: _del_editer\n */\n function _del_editer() {\n _editers.splice(index, 1);\n _editer_nodes.splice(index, 1);\n editer_options.splice(index, 1);\n editer_status.splice(index, 1);\n }\n }\n\n// /* name: _get_option */\n//\n// function _get_option(option_name,index) {\n//\n// if(_u(index)) {\n// index = _editer_i;\n// }\n//\n// return editer_options[index][option_name];\n// }\n\n /*\n /*\n name: _init_editer\n */\n function _init_editer(index) {\n\n setEditerTheme(index);\n setEditerLineNumber(index);\n setEditerFont(index);\n }\n\n /* name: _init_options_box */\n function _init_options_box() {\n\n ck_lineNumber[0].checked = _this.get_option(\"linenum\");\n sel_theme[0].value = _this.get_option(\"theme\");\n sel_font[0].value = _this.get_option(\"font\");\n }\n\n /* name: _switch_editer */\n function _switch_editer(index) {\n _editer_i = index;\n hot_editer = _editers[index];\n\n cur_options = editer_options[index];\n cur_status = editer_status[index];\n\n _init_options_box();\n _init_title(index);\n\n ul_editer.tabs(\"option\", \"active\", index);\n _refresh_editer();\n }\n\n /* name: _inject_code */\n function _inject_code(src, index) {\n\n if(_u(index)) {\n index = _editer_i;\n }\n\n var selector, dom;\n\n dom = $(src);\n selector = dom.selector || dom[0].tagName;\n // v: status\n var _status;\n _status = editer_status[index];\n _status[\"injectMode\"] = true;\n _status[\"node\"] = dom;\n _status[\"selector\"] = selector;\n\n _status[\"title\"] = selector;\n //$(switcher.children()[index]).find(\"a:eq(0)\").html(selector); // set tab text\n\n _this.set_code(dom.html());\n _init_title(index);\n }\n\n /* name: _init_title */\n function _init_title(index, text) {\n if(_u(index)) {\n index = _editer_i;\n }\n text = text || editer_status[index].title;\n\n _Parent.dialog(\"option\", \"title\", text);\n }\n\n /* _save_code */\n function _save_code() {\n\n // show save dialog\n\n var code = hot_editer.getValue();\n if(cur_status[\"injectMode\"]) {\n\n cur_status[\"node\"].html(code);\n }\n else {\n save_dlg.dialog(\n {\n modal: true,\n buttons: {\n yes: function() {\n\n /*\n desc: arg [ filename, code, {..} ]\n */\n var arg =\n [\n $(\"input[name='save_name']\")[0].value,\n code,,\n {\n index: _editer_i,\n injected: editer_options[\"injected\"]\n }\n ]\n // get args\n _calls(foxes[\"onsave\"], arg);\n $(this).dialog(\"close\");\n },\n no: function() {\n $(this).dialog(\"close\");\n }\n }\n }\n )\n }\n }\n /* name: _refresh_editer */\n function _refresh_editer() {\n\n //switcher.children()[_editer_i].click();\n hot_editer.refresh();\n }\n /* listener */\n function _close_onclick() {\n\n _delete_editer($(this).parent().index());\n }\n\n /* when: when_inspect */\n function when_inspect(node) {\n\n _this.inject(node);\n\n _Parent.dialog(\"open\");\n _refresh_editer();\n }\n}", "contractAccepted(elem) {\n let contractObject = model.availableContracts.find(obj => obj.domElem === elem.closest('div'));\n model.deleteFromArray(model.availableContracts, contractObject);\n contractObject.domElem = gameApp.gameView.createActiveContractDom(contractObject);\n model.activeContracts.push(contractObject);\n gameApp.gameView.removeElem(elem.closest('div'));\n let currentContract = document.querySelector('div.current-contract .assignment')\n\n if (currentContract == undefined) {\n gameApp.gameView.addToDom(contractObject.domElem, '.current-contract');\n } else {\n gameApp.gameView.addToDom(contractObject.domElem, '.accepted-contract');\n }\n\n }", "function initSwitchTest(){\n initEditableSwitch();\n initCommandButton();\n initSwitch();\n}", "async checkboxIagree(ObjectRepo, dataprovider) {\n await Utility.clickOn(ObjectRepo.Register.iAgreeCheckbox);\n await expect(\n await Utility.getText(ObjectRepo.Register.iAgreeTextBoxSection)\n ).toEqual(dataprovider);\n }", "function bamazonManagerView() {\n\n //Take user input\n inquirer.prompt({\n type: \"list\",\n message: \"Enter your choice?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\", \"Exit app\"],\n name: \"view\"\n })\n .then(function (inquirerResponse) {\n\n //Call function with user option to execute desired operation\n switch (inquirerResponse.view) {\n\n case 'View Products for Sale':\n viewProductsForSale(true);\n break;\n\n case 'View Low Inventory':\n viewLowInventory();\n break;\n\n case 'Add to Inventory':\n addToInventory();\n break;\n\n case 'Add New Product':\n addNewProduct();\n break;\n\n default:\n console.log(\"\\n\\n\\tExiting the app!!\\n\\n\");\n connection.end();\n\n }\n\n })\n .catch(function (err) {\n console.log(err);\n });\n\n}", "function setUp() {\n $('#prod-mgmt').click(toggleParagraph);\n\n console.log('this is working');\n // $('#readmore2').click(toggleParagraph);\n // $('#readless2').click(toggleParagraph);\n // $('.learnmore').click(toggleParagraph);\n}", "async function main() {\n //Grab your Hedera testnet account ID and private key from your .env file\n const myAccountId = process.env.ACCOUNT_ID;\n const myPrivateKey = process.env.PRIVATE_KEY;\n // If we weren't able to grab it, we should throw a new error\n if (myAccountId == null || myPrivateKey == null ) {\n throw new Error(\"Environment variables myAccountId and myPrivateKey must be present\");\n } else {\n console.log('Keys imported successfully from env');\n }\n\n const client = Client.forTestnet()\n client.setOperator(process.env.ACCOUNT_ID, process.env.PRIVATE_KEY);\n\n\n\n\n /***** ACCOUNT BALANCE *****/\n //Create the account balance query\n const query = new AccountBalanceQuery()\n .setAccountId(myAccountId);\n\n //Submit the query to a Hedera network\n const accountBalance = await query.execute(client);\n console.log(\"Balance: \" + accountBalance.hbars);\n /***** ACCOUNT BALANCE *****/\n\n\n\n /***** ACCOUNT INFO *****/\n // const query2 = new AccountInfoQuery()\n // .setAccountId(myAccountId);\n\n // const accountInfo = await query2.execute(client);\n // console.log(accountInfo);\n /***** ACCOUNT INFO *****/\n\n\n\n\n /***** TRANSACTION *****/\n // Create a transaction to transfer 100 hbars\n const transaction = new TransferTransaction()\n .addHbarTransfer('0.0.2908916', new Hbar(-1))\n .addHbarTransfer('0.0.2908905', new Hbar(1));\n\n //Submit the transaction to a Hedera network\n const txResponse = await transaction.execute(client);\n\n //Request the receipt of the transaction\n const receipt = await txResponse.getReceipt(client);\n\n //Get the transaction consensus status\n const transactionStatus = receipt.status;\n\n console.log(\"The transaction consensus status is \" +transactionStatus.toString());\n /***** TRANSACTION *****/\n}", "function setUp() {\nbitgo = new BitGoJS.BitGo({ env: 'test', accessToken: configData.accessToken });\n}", "function beginApp() {\n console.log('Please build your team');\n newMemberChoice();\n}", "function populateTokenData() {\n Voting.deployed().then(function(contractInstance) {\n contractInstance.totalTokens().then(function(v) {\n $(\"#tokens-total\").html(v.toString());\n });\n contractInstance.tokensSold.call().then(function(v) {\n $(\"#tokens-sold\").html(v.toString());\n });\n contractInstance.tokenPrice().then(function(v) {\n tokenPrice = parseFloat(web3.fromWei(v.toString()));\n $(\"#token-cost\").html(tokenPrice + \" Ether\");\n });\n web3.eth.getBalance(contractInstance.address, function(error, result) {\n $(\"#contract-balance\").html(web3.fromWei(result.toString()) + \" Ether\");\n });\n });\n}", "setup() {\n // Remove buttons and nodes for current wallet (no close function)\n if (wallets.currentWallet !== false) {\n wallets.page.boxes.c2.buttonRanges.walletControls.removeButtons();\n }\n // Add button range including button nodes (which are hidden)\n wallets.page.addButtonRanges([this.buttonRanges.inputControls]);\n // Show buttons (hidden class removed)\n wallets.page.boxes.c2.buttonRanges.inputControls.showButtons();\n // Shortcut to address input\n this.addressInput = wallets.page.boxes.c2.buttonRanges.inputControls.buttons.addressInput;\n }", "function startTest() {\n $('#runOptions').modal('show');\n }", "function initDiagram() {\n\n myDiagram =\n _G(go.Diagram, \"myDiagramDiv\", // create a Diagram for the DIV HTML element\n {\n // position the graph in the middle of the diagram\n initialContentAlignment: go.Spot.Center,\n // allow double-click in background to create a new node\n // \"clickCreatingTool.archetypeNodeData\": {\n // text: \"Node\",\n // color: \"white\"\n // },\n // allow Ctrl-G to call groupSelection()\n \"commandHandler.archetypeGroupData\": {\n text: \"Module\",\n isGroup: true,\n color: \"blue\"\n },\n // enable undo & redo\n \"undoManager.isEnabled\": true\n });\n // These nodes have text surrounded by a rounded rectangle\n // whose fill color is bound to the node data.\n // The user can drag a node by dragging its TextBlock label.\n // Dragging from the Shape will start drawing a new link.\n myDiagram.nodeTemplate =\n _G(go.Node, \"Auto\", {\n locationSpot: go.Spot.Center,\n desiredSize: new go.Size(100, 100)\n },\n _G(go.Shape, new go.Binding(\"figure\", \"fig\"), {\n fill: \"white\", // the default fill, if there is no data-binding\n portId: \"\",\n cursor: \"pointer\", // the Shape is the port, not the whole Node\n // allow all kinds of links from and to this port\n fromLinkable: true,\n fromLinkableSelfNode: false,\n fromLinkableDuplicates: false,\n toLinkable: true,\n toLinkableSelfNode: false,\n toLinkableDuplicates: false\n },\n new go.Binding(\"fill\", \"color\")),\n _G(go.Panel, \"Table\", {\n defaultAlignment: go.Spot.Left,\n margin: 4,\n cursor: \"move\"\n },\n _G(go.RowColumnDefinition, {\n column: 1,\n width: 4\n }),\n _G(go.TextBlock, {\n row: 0,\n column: 0,\n columnSpan: 3,\n alignment: go.Spot.Center\n }, {\n font: \"bold 12pt sans-serif\"\n },\n new go.Binding(\"text\", \"text\")),\n _G(go.TextBlock, \"Index: \", {\n row: 1,\n column: 0\n }, {\n font: \"bold 8pt sans-serif\"\n }),\n _G(go.TextBlock, {\n row: 1,\n column: 2\n }, {\n font: \"8pt sans-serif\"\n },\n new go.Binding(\"text\", \"key\")),\n _G(go.TextBlock, \"Title: \", {\n row: 2,\n column: 0\n }, {\n font: \"bold 8pt sans-serif\"\n }),\n _G(go.TextBlock, {\n row: 3,\n column: 0\n }, {\n font: \"8pt sans-serif\"\n },\n new go.Binding(\"text\", \"title\"))\n ), { // this tooltip Adornment is shared by all nodes\n toolTip: _G(go.Adornment, \"Auto\",\n _G(go.Shape, {\n fill: \"#FFFFCC\"\n }),\n _G(go.TextBlock, {\n margin: 4\n }, // the tooltip shows the result of calling nodeInfo(data)\n new go.Binding(\"text\", \"\", nodeInfo))\n ),\n // this context menu Adornment is shared by all nodes\n contextMenu: partContextMenu\n }\n );\n // The link shape and arrowhead have their stroke brush data bound to the \"color\" property\n myDiagram.linkTemplate =\n _G(go.Link, {\n toShortLength: 3,\n relinkableFrom: true,\n relinkableTo: true\n }, // allow the user to relink existing links\n _G(go.Shape, {\n strokeWidth: 2\n },\n new go.Binding(\"stroke\", \"color\")),\n _G(go.Shape, {\n toArrow: \"Standard\",\n stroke: null\n },\n new go.Binding(\"fill\", \"color\")), { // this tooltip Adornment is shared by all links\n toolTip: _G(go.Adornment, \"Auto\",\n _G(go.Shape, {\n fill: \"#FFFFCC\"\n }),\n _G(go.TextBlock, {\n margin: 4\n }, // the tooltip shows the result of calling linkInfo(data)\n new go.Binding(\"text\", \"\", linkInfo))\n ),\n // the same context menu Adornment is shared by all links\n contextMenu: partContextMenu\n }\n );\n // Define the appearance and behavior for Groups:\n function groupInfo(adornment) { // takes the tooltip or context menu, not a group node data object\n var g = adornment.adornedPart; // get the Group that the tooltip adorns\n var mems = g.memberParts.count;\n var links = 0;\n g.memberParts.each(function(part) {\n if (part instanceof go.Link) links++;\n });\n return \"Group \" + g.data.key + \": \" + g.data.text + \"\\n\" + mems + \" members including \" + links + \" links\";\n }\n // Groups consist of a title in the color given by the group node data\n // above a translucent gray rectangle surrounding the member parts\n myDiagram.groupTemplate =\n _G(go.Group, \"Vertical\", {\n selectionObjectName: \"PANEL\", // selection handle goes around shape, not label\n ungroupable: true\n }, // enable Ctrl-Shift-G to ungroup a selected Group\n _G(go.TextBlock, {\n font: \"bold 19px sans-serif\",\n isMultiline: false, // don't allow newlines in text\n editable: true // allow in-place editing by user\n },\n new go.Binding(\"text\", \"text\").makeTwoWay(),\n new go.Binding(\"stroke\", \"color\")),\n _G(go.Panel, \"Auto\", {\n name: \"PANEL\"\n },\n _G(go.Shape, \"Rectangle\", // the rectangular shape around the members\n {\n fill: \"rgba(128,128,128,0.2)\",\n stroke: \"gray\",\n strokeWidth: 3\n }),\n _G(go.Placeholder, {\n padding: 10\n }) // represents where the members are\n ), { // this tooltip Adornment is shared by all groups\n toolTip: _G(go.Adornment, \"Auto\",\n _G(go.Shape, {\n fill: \"#FFFFCC\"\n }),\n _G(go.TextBlock, {\n margin: 4\n },\n // bind to tooltip, not to Group.data, to allow access to Group properties\n new go.Binding(\"text\", \"\", groupInfo).ofObject())\n ),\n // the same context menu Adornment is shared by all groups\n contextMenu: partContextMenu\n }\n );\n // Define the behavior for the Diagram background:\n function diagramInfo(model) { // Tooltip info for the diagram's model\n return \"Model:\\n\" + model.nodeDataArray.length + \" nodes, \" + model.linkDataArray.length + \" links\";\n }\n // provide a tooltip for the background of the Diagram, when not over any Part\n myDiagram.toolTip =\n _G(go.Adornment, \"Auto\",\n _G(go.Shape, {\n fill: \"#FFFFCC\"\n }),\n _G(go.TextBlock, {\n margin: 4\n },\n new go.Binding(\"text\", \"\", diagramInfo))\n );\n // provide a context menu for the background of the Diagram, when not over any Part\n myDiagram.contextMenu =\n _G(go.Adornment, \"Vertical\",\n makeButton(\"Paste\",\n function(e, obj) {\n e.diagram.commandHandler.pasteSelection(e.diagram.lastInput.documentPoint);\n },\n function(o) {\n return o.diagram.commandHandler.canPasteSelection();\n }),\n makeButton(\"Undo\",\n function(e, obj) {\n e.diagram.commandHandler.undo();\n },\n function(o) {\n return o.diagram.commandHandler.canUndo();\n }),\n makeButton(\"Redo\",\n function(e, obj) {\n e.diagram.commandHandler.redo();\n },\n function(o) {\n return o.diagram.commandHandler.canRedo();\n })\n );\n}" ]
[ "0.55639166", "0.55222607", "0.5474251", "0.5219257", "0.5201662", "0.5141886", "0.51216584", "0.5106375", "0.5084308", "0.50826627", "0.50687337", "0.50371957", "0.5016623", "0.5006504", "0.50060964", "0.50055546", "0.5003383", "0.4991688", "0.49864882", "0.49852166", "0.49750316", "0.496949", "0.49690902", "0.49618256", "0.4953004", "0.49486315", "0.49464008", "0.49409124", "0.49388492", "0.49270767", "0.49225858", "0.4914828", "0.4888729", "0.48835653", "0.48804507", "0.48713237", "0.4856231", "0.48541045", "0.48540193", "0.48492566", "0.4842917", "0.48278347", "0.4827245", "0.48262426", "0.4819687", "0.481771", "0.48132196", "0.48099807", "0.48074615", "0.48054743", "0.47977966", "0.47948927", "0.47940058", "0.47890007", "0.47765407", "0.47698367", "0.47689867", "0.47669482", "0.47668785", "0.47641122", "0.47585666", "0.47547436", "0.47479662", "0.47475564", "0.47469622", "0.4737287", "0.47182217", "0.47149158", "0.4714628", "0.47027308", "0.4700277", "0.46982747", "0.46948007", "0.4693813", "0.46911746", "0.46875057", "0.46866992", "0.468624", "0.46847987", "0.4673474", "0.4667882", "0.46651956", "0.46646577", "0.46646413", "0.4661978", "0.46611732", "0.46598303", "0.46482912", "0.46415716", "0.46395814", "0.46386787", "0.46316335", "0.46297416", "0.46230435", "0.4622847", "0.4617603", "0.46175623", "0.46134144", "0.46115553", "0.46112767" ]
0.6286333
0
Return true if the apply button of the detail workflow panel should be disabled at this point of time. If the implementation registers dependencies with the dependency tracker, for example by reading a bean or a value expression, the method is called again when the dependencies are invalidated. By default, this method returns false, indicating that a process can always be started.
function isApplyButtonDisabled()/*:Boolean*/ { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "canPerform() {\n return false;\n }", "function isEnabled() {\n return (tracker.currentWidget !== null &&\n tracker.currentWidget === app.shell.currentWidget);\n }", "_checkEnabled() {\n\t\tthis.isEnabled = !!this._getFirstEnabledCommand();\n\t}", "_showToggle() {\n return !this.panel.hideToggle && !this.panel.disabled;\n }", "_isEnabled() {\n return this.getOptions().enabled !== false && this._dsn !== undefined;\n }", "_isEnabled() {\n return this.getOptions().enabled !== false && this._dsn !== undefined;\n }", "isAdapterRunning() {\n return !!this._adapterProcess;\n }", "on_settings_applied(container) {\n // Settings were applied (if you weren't reflecting settings changes automatically)\n return true // Allow settings to close\n }", "_isEnabled() {\n\t return this.getOptions().enabled !== false && this._dsn !== undefined;\n\t }", "deleteDependency() {\n const me = this;\n\n /**\n * Fires on the owning Scheduler before a dependency is deleted\n * @event beforeDependencyDelete\n * @param {Scheduler.view.Scheduler} source The scheduler instance\n * @param {Scheduler.model.DependencyModel} dependencyRecord The dependency record about to be deleted\n * @preventable\n */\n if (me.client.trigger('beforeDependencyDelete', { dependencyRecord: me.dependencyRecord }) !== false) {\n if (me.editor.containsFocus) {\n me.editor.revertFocus();\n }\n\n me.client.dependencyStore.remove(me.dependencyRecord);\n me.client.project && me.client.project.propagate();\n\n return true;\n }\n\n return false;\n }", "isCurrentlyDisplaying () {\n\t\treturn !!this[CURRENT_PROMISE];\n\t}", "shouldProcess() {\n return true;\n }", "isDisabled() {\n return this.getTransition() === WizardPage.transitions.disabled;\n }", "function needsControls() {\n for(let taskName in allTasksObject) {\n if(allTasksObject[getHomeName(taskName)]) {\n return true;\n }\n }\n return false;\n }", "toggle() {\n return (\n this.modalPanel.isVisible() ?\n this.quit() :\n this.warn()\n );\n }", "_toggle() {\n if (!this.disabled) {\n this.panel.toggle();\n }\n }", "function removeButtonDisabled() {\n return (vm.annotType.options.length <= 1);\n }", "getIsEnabled() {\n return this._executeAfterInitialWait(() => this.currently.isEnabled());\n }", "isRunning() {\n return this._process !== null;\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 }", "get isEnabled() {\n\t\treturn Boolean(window.Worker);\n\t}", "cancelUpdate() {\n let addon = addonFor(this);\n if (addon._updateCheck) {\n addon._updateCheck.cancel();\n return true;\n }\n return false;\n }", "validateRegistry(){\n\t\tlet showButton = false;\n\t\tif(this.homeModel._isFromMax){\n\t\t\tshowButton = true;\n\t\t}\n\t\treturn showButton;\n\t}", "get disableRipple() {\n return !!(this._parent && this._parent.disableRipple);\n }", "isEnabled() {\n return !!this.config[this.name];\n }", "isEnabled() {\n return !!this.config[this.name];\n }", "shouldDraw() {\n // If we don't need to re-draw, then don't.\n if(!this._dirty && !this.draw_required) {\n if(!(this.scene && this.scene._dirty)) {\n this.performance.frame_start = -1;\n return false;\n }\n }\n\n if(this.paused && !this.draw_required) {\n return false;\n }\n\n // Only defer drawing when we're not loaded if we haven't drawn yet.\n if(!this.has_loaded) {\n return false;\n }\n\n return true;\n }", "shouldRerender(newProps) {\n if (newProps.disabled !== this.props.disabled) return true\n // TODO: we should still detect when the document has changed,\n // see https://github.com/substance/substance/issues/543\n return false\n }", "shouldRerender(newProps) {\n if (newProps.disabled !== this.props.disabled) return true\n // TODO: we should still detect when the document has changed,\n // see https://github.com/substance/substance/issues/543\n return false\n }", "hasValidForm() {\n return this.formConfig !== false;\n }", "isDependencyVisible(dependency, assignmentData = null) {\n const me = this,\n {\n assignmentStore,\n resourceStore,\n eventStore\n } = me.client,\n {\n fromEvent,\n toEvent\n } = dependency; // Bail out early in case source or target doesn't exist\n\n if (!(fromEvent && toEvent)) {\n return false;\n }\n\n let fromResource, toResource; // Using multi-assignment, resource obtained from assignment\n\n if (assignmentData) {\n const {\n from,\n to\n } = assignmentData;\n fromResource = from.resource;\n toResource = to.resource; // EventStore or AssignmentStore might be filtered, or assignment might opt out of dependency drawing\n\n if (from.drawDependencies === false || to.drawDependencies === false || eventStore.isFiltered && (!eventStore.includes(fromEvent) || !eventStore.includes(toEvent)) || assignmentStore.isFiltered && (!assignmentStore.includes(from) || !assignmentStore.includes(to))) {\n return false;\n }\n } // Not using assignments, resource obtained from event\n else {\n fromResource = fromEvent.resource;\n toResource = toEvent.resource;\n } // Verify these are real existing Resources and collapsed away (resource not existing in resource store)\n\n if (!resourceStore.isAvailable(fromResource) || !resourceStore.isAvailable(toResource)) {\n return false;\n }\n\n return fromEvent.isModel && !fromResource.instanceMeta(resourceStore).hidden && !toResource.instanceMeta(resourceStore).hidden;\n }", "canRedo() {\n return this.undidStack.length != 0;\n }", "function commandHasChanges() {\n if (jumbotronIsOpen) {\n if (document.getElementById(\"commitChanges\").disabled) {\n //no changes\n return false;\n } else {\n //changes\n return true;\n }\n } else {\n return false;\n }\n}", "function checkEnabled() {\n\t\tvar enabled = false;\n\t\t\n\t\tfor (var i = 0, il = this.tools.length; i < il && !enabled; i++) {\n\t\t\tenabled |= this.tools[i].enabled;\t\n\t\t}\n\t\t\n\t\treturn enabled;\n\t}", "function removeButtonDisabled() {\n return (vm.options.length <= 1);\n }", "canRedo() {\n return !isNullOrUndefined(this.redoStack) && this.redoStack.length > 0;\n }", "checkToShowAddButton() {\n const hasResult = this.hasQuery && (! this.hasUsers && ! this.hasDepartment);\n\n this.setShowAddButton( hasResult );\n }", "enableSubmit() {\n\t\tlet enabled = this.project.name.length > 0 && this.project.id.length > 0 && this.project.platforms.length > 0 && this.state.locationExists === false;\n\t\tif (this.state.submitButtonEnabled !== enabled) {\n\t\t\tthis.state.submitButtonEnabled = enabled;\n\t\t\tetch.update(this);\n\t\t}\n\t}", "get mayRebuild() {\n return false;\n }", "function isPanelAvailable(state, panelId) {\n const mode = state.mode;\n\n if (panelId === \"selectDataset\") {\n if (mode && mode.datasets && mode.datasets.length === 1) {\n return false;\n }\n }\n\n if (panelId === \"dataDisplayLabel\") {\n if (mode && mode.hideSelectLabel) {\n return false;\n }\n }\n\n if (panelId === \"saveModel\") {\n if ((mode && mode.hideSave) || didSaveSucceed(state)) {\n return false;\n }\n }\n\n return true;\n}", "function areAllDetailsPopulated() {\n if (\n document.getElementById(\"jiraTitle\").value != \"\" &&\n document.getElementById(\"projectName\").value != \"\" &&\n document.getElementById(\"issueType\").value != \"\" &&\n document.getElementById(\"searchString\").value != \"\" &&\n document.getElementById(\"stackTrace\").value != \"\" &&\n document.getElementById(\"eventOccurrences\").value != \"\"\n ) {\n disableCreateJiraButton = false;\n } else {\n disableCreateJiraButton = true;\n }\n\n console.log(\"disableCreateJiraButton:\" + disableCreateJiraButton);\n document.getElementById(\"createJira\").disabled = disableCreateJiraButton;\n }", "isPanelVisible()\n\t{\n\t\treturn this.modalPanel.isVisible();\n\t}", "_applyEnabled(value, old) {\n super._applyEnabled(value, old);\n\n if (!value) {\n if (this.isCapturing()) {\n // also release capture because out event is missing on iOS\n this.releaseCapture();\n }\n\n // remove button states\n this.removeState(\"pressed\");\n this.removeState(\"abandoned\");\n\n // stop the repeat timer and therefore the execution\n this.__stopInternalTimer();\n }\n }", "function _isSlideshowActive() {\n\t\treturn !btnStop.hasClass(CLASS_DISABLED);\n\t}", "function existingWorkItem() {\n\t\tvar len = 0;\n\t\tvar nph = _UI.current_panel;\n\n\t\tif(_UI.current_page === 'ligatures'){\n\t\t\tlen = getLength(_GP.ligatures);\n\t\t\tif(!len){\n\t\t\t\t_UI.selectedligature = false;\n\t\t\t\tif(nph !== 'npNav') nph = 'npChooser';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (_UI.current_page === 'components'){\n\t\t\tlen = getLength(_GP.components);\n\t\t\tif(!len){\n\t\t\t\t_UI.selectedcomponent = false;\n\t\t\t\tif(nph !== 'npNav') nph = 'npChooser';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else if (_UI.current_page === 'kerning'){\n\t\t\tlen = getLength(_GP.kerning);\n\t\t\tif(!len){\n\t\t\t\t_UI.selectedkern = false;\n\t\t\t\tif(nph !== 'npNav') nph = 'npAttributes';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "isEnabled() {\n return this._isEnabled;\n }", "disableSave() {\n if ((this.state.validationErrors.size > 0) || (this.state.addEditStudentId.length === 0) || (this.state.addEditFirstName.length === 0) || (this.state.addEditLastName.length === 0) || (this.state.addEditStudentEmail.length === 0)) {\n return true;\n }\n\n return false;\n }", "async deleteDependency() {\n const {\n client,\n editor,\n dependencyRecord\n } = this;\n /**\n * Fires on the owning Scheduler before a dependency is deleted\n * @event beforeDependencyDelete\n * @param {Scheduler.view.Scheduler} source The scheduler instance\n * @param {Scheduler.model.DependencyModel} dependencyRecord The dependency record about to be deleted\n * @preventable\n */\n\n if (client.trigger('beforeDependencyDelete', {\n dependencyRecord\n }) !== false) {\n var _client$project2;\n\n if (editor.containsFocus) {\n editor.revertFocus();\n }\n\n client.dependencyStore.remove(dependencyRecord);\n await ((_client$project2 = client.project) === null || _client$project2 === void 0 ? void 0 : _client$project2.commitAsync());\n return true;\n }\n\n return false;\n }", "get navigationInProgress() {\n if (!this.regions || !this.regions.length || !this.isElementValid(this.activeRegion)) {\n return false;\n }\n if (!this.lastInputEventIsKeyboard) {\n return false;\n }\n if (this.modalIsOpen || this.popupIsOpen) {\n return false;\n }\n if (!this.isElementValid(this.activeElement)) {\n return false;\n }\n return true;\n }", "isInactive() {\n return this.workStatus == 0;\n }", "enable() {\n if (this._paq || this._init()) {\n this.disabled = false;\n }\n }", "shouldDisable_(isOwnerProfile, isEnterpriseManaged, arcAdbNeedPowerwash) {\n return !isOwnerProfile || isEnterpriseManaged || arcAdbNeedPowerwash;\n }", "isRenderDue() {\n\t\t\tif (this.lastRenderTime === undefined) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tconst isDue = this.current > this.lastRenderCurrent + this.renderEvery;\n\t\t\tif (isDue) {\n\t\t\t\t// We also make sure that we never force update more often than once a second\n\t\t\t\t// This is to ensure that the progress bar isn't negatively effecting performance\n\t\t\t\treturn this.lastRenderTime.since().toSeconds() > 1;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}", "isDependencyVisible(dependency, assignmentData = null) {\n const from = dependency.sourceEvent,\n to = dependency.targetEvent;\n\n // Bail out early in case source or target doesn't exist\n if (!(from && to)) {\n return false;\n }\n\n let fromResource, toResource;\n\n // Using multi-assignment, resource obtained from assignment\n if (assignmentData) {\n fromResource = assignmentData.from.resource;\n toResource = assignmentData.to.resource;\n\n const { eventStore } = this.client;\n // Filtering EventStore does not filter AssignmentStore, determine if Event is available in this case\n if (eventStore.isFiltered && (eventStore.indexOf(from) === -1 || eventStore.indexOf(to) === -1)) {\n return false;\n }\n }\n // Not using assignments, resource obtained from event\n else {\n fromResource = from.resource;\n toResource = to.resource;\n }\n\n return (\n from instanceof Model &&\n // Verify these are real existing Resources and not placeholders (resource not existing in resource store)\n fromResource instanceof ResourceModel &&\n toResource instanceof ResourceModel &&\n !fromResource.instanceMeta(this.scheduler.store).hidden &&\n !toResource.instanceMeta(this.scheduler.store).hidden\n );\n }", "check() {\n // neither end is a bar which isn't in a collapsed group? then hide\n if ((!this.renderedFromProtein.expanded || (this.renderedFromProtein.inCollapsedGroup())) &&\n (this.renderedToProtein ? (!this.renderedToProtein.expanded || this.renderedToProtein.inCollapsedGroup()) : false)) {\n this.hide();\n return false;\n }\n\n // either end manually hidden? then hide\n if (this.renderedFromProtein.participant.hidden === true ||\n (this.renderedToProtein && this.renderedToProtein.participant.hidden === true)) {\n this.hide();\n return false;\n }\n\n // no crosslinks passed filter? then hide\n if (this.crosslink.filteredMatches_pp.length > 0) {\n this.show();\n return true;\n } else {\n this.hide();\n return false;\n }\n }", "_isRippleDisabled() {\n return this.disabled || this.disableRipple || this.selectionList.disableRipple;\n }", "_isRippleDisabled() {\n return this.disabled || this.disableRipple || this.selectionList.disableRipple;\n }", "function check() {\n var enabled = true;\n if (!UI.GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"Show Fixes\")) {\n var enabled = false;\n }\n UI.SetEnabled(\"MISC\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Nades Out\", enabled);\n UI.SetEnabled(\"MISC\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Revolver\", enabled);\n UI.SetEnabled(\"MISC\", \"JAVASCRIPT\", \"Script items\", \"No AA on knife fix\", enabled);\n if (UI.GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Nades Out\") || GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"No FakeLag With Revolver\")) {\n LagFix();\n }\n if (UI.GetValue(\"Misc\", \"JAVASCRIPT\", \"Script items\", \"No AA on knife fix\")) {\n knifeFix();\n }\n}", "hasDecisionDecided() {\n return this.node.hasDecisionDecided();\n }", "get disabled() { return !!this._disabled || this._parentDisabled(); }", "get disabled() { return !!this._disabled || this._parentDisabled(); }", "function isComputingDerivation() {\n return globalState.trackingDerivation !== null; // filter out actions inside computations\n}", "isEnabled() {\n return !this.outerElement.classList.contains('disabled');\n }", "function isResolved() {\n checkIndicator = this.patcher.getnamed('checkIndicator')\n destinationSwitch = this.patcher.getnamed('destinationSwitch')\n triggerArea = this.patcher.getnamed('triggerArea')\n ppm = this.patcher.getnamed('signal_ppm')\n\n checkIndicator.hidden = 0\n destinationSwitch.hidden = 1\n triggerArea.ignoreclick = 1\n ppm.hidden = 1\n}", "enable() {\n\t // leave empty in Widget.js\n\t }", "hasAttached() {\n return !!this._attachedPortal;\n }", "function _check_if_exist_change(){\n try{\n if(win.action_for_custom_report == 'add_job_custom_report'){\n return true;\n }\n var is_make_changed = false;\n if(_is_make_changed){\n is_make_changed = true;\n }\n return is_make_changed;\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _check_if_exist_change');\n return false; \n } \n }", "_enableHook() {\n !this._wrapper.parentNode &&\n this._viewer &&\n this._viewer.dcContainer.appendChild(this._wrapper)\n this._wrapper &&\n (this._wrapper.style.visibility = this._enable ? 'visible' : 'hidden')\n this._enable ? this._bindEvent() : this._unbindEvent()\n }", "isEnabled() {\n return this.enabled && this.severity >= exports.Severity.WARN;\n }", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "function canApplyUpdates() {\n return module.hot.status() === 'idle';\n}", "async function checkForClosedPr() {\n if (config.recreateClosed) {\n logger.debug(`${depName}: Skipping closed PR check`);\n return false;\n }\n logger.debug(`${depName}: Checking for closed PR`);\n const prExisted = await api.checkForClosedPr(branchName, prTitle);\n logger.debug(`Closed PR existed: ${prExisted}`);\n if (prExisted) {\n return true;\n }\n return false;\n }", "get disabled() {\n if (this._disabled === undefined && this.datepicker) {\n return this.datepicker.disabled;\n }\n return !!this._disabled;\n }", "get disabled() {\n if (this._disabled === undefined && this.datepicker) {\n return this.datepicker.disabled;\n }\n return !!this._disabled;\n }", "function sketchAllowsEditing() {\n return sketch.currentTouchRegime().name !== \"BackClickRegime\";\n }", "shouldComponentUpdate() {\n return false;\n }", "get enableAntics() {\n /* This is now disabled. */\n return false;\n /*return this.getValue(\"EnableForce\") && $(\"#cbForce\").is(\":checked\");*/\n }", "isValidated() {\n\t\tif (this.currentStage.currentState.isValidated()) {\n\t\t\tthis.log(\"Progressing\");\n\t\t\tthis.progressGameMode();\n\t\t}\n\t}", "get _isVisible() {\n return !this.panelElem.hasClass(\"hidden\");\n }", "isValid(): boolean {\n return this.innerComponent.isValid();\n }", "function isDisabledFor(metadata/*:MetadataTreeNode*/)/*:Boolean*/ {\n return false;\n }", "function enableChangeButton() {\t\t\n\tvar xbutton = document.getElementById(\"enableChange\");\n\tif( xbutton != undefined ){\n\t\tdocument.getElementById(\"enableChange\").removeAttribute('hidden');\n\t}\n\treturn true;\n}", "onEditMode() {\n const {selectedPage, selectedView, selectedPageDirty} = this.props;\n return ((selectedPage && selectedPage.tabId === 0) || selectedPageDirty\n || selectedView === panels.SAVE_AS_TEMPLATE_PANEL\n || selectedView === panels.ADD_MULTIPLE_PAGES_PANEL \n || selectedView === panels.CUSTOM_PAGE_DETAIL_PANEL);\n }", "isEnabled() {\n return this._node.__execute(() => this.element.isEnabled());\n }", "isLoadPerformed() {\n const entriesType = this.getEntriesType();\n\n const { isLoadPerformed = false } = this.props.state.entries[entriesType];\n\n return isLoadPerformed;\n }", "get cantFireEvent(){\n return (!this._config || !this.hass || !this._firstRendered);\n }", "shouldComponentUpdate() {\n\t\treturn false;\n\t}", "canUndo() {\n return !isNullOrUndefined(this.undoStack) && this.undoStack.length > 0;\n }", "static get enabled() {\n if (typeof window.location === 'undefined') return false;\n\n if (window.location.protocol !== \"https:\" && window.location.hostname !== \"localhost\") {\n return false\n };\n\n if (typeof ServiceWorker === 'undefined' || typeof navigator === 'undefined') {\n return false\n };\n\n // # disable service workers for the production server(s) for now. See:\n // # https://lists.w3.org/Archives/Public/public-webapps/2016JulSep/0016.html\n // if location.hostname =~ /^whimsy.*\\.apache\\.org$/\n // unless location.hostname.include? '-test'\n // # unregister service worker\n // navigator.serviceWorker.getRegistrations().then do |registrations|\n // registrations.each do |registration|\n // registration.unregister()\n // end\n // end\n //\n // return false\n // end\n // end\n return typeof navigator.serviceWorker !== 'undefined'\n }", "get showForm() {\n return !this.isLoading && !!this.sObjectName && !this.metadataError;\n }", "continue() {\n this.disable = false;\n this.add(null, null, true);\n }", "_previousButtonsDisabled() {\n return this.disabled || !this.hasPreviousPage();\n }", "function canIgraduate(module) { //true means can graduate\n if (coreCleared(module) && gemCleared(module) && peCleared(module) && ueCleared(module) && internCleared(module)) {\n return true;\n }\n return false;\n }" ]
[ "0.5844518", "0.5784208", "0.56630975", "0.55631924", "0.54433846", "0.5440499", "0.54193777", "0.53673446", "0.5348268", "0.5309957", "0.53071034", "0.52815115", "0.5280016", "0.5273651", "0.5242544", "0.5241958", "0.5202494", "0.5189242", "0.5183466", "0.51752055", "0.51520467", "0.5147446", "0.5144441", "0.5141844", "0.5125993", "0.5125993", "0.5125357", "0.5117171", "0.5117171", "0.5112365", "0.51035947", "0.50952345", "0.5057866", "0.50548834", "0.5054421", "0.5039732", "0.5034139", "0.5012906", "0.5011195", "0.5005858", "0.49904165", "0.49722448", "0.49620807", "0.4959823", "0.49512538", "0.4943288", "0.49411494", "0.49404925", "0.4935", "0.4933834", "0.49285567", "0.49186873", "0.49136803", "0.49092534", "0.4892401", "0.4890479", "0.4890479", "0.48859566", "0.4885736", "0.488388", "0.488388", "0.48812354", "0.4879068", "0.4869394", "0.4863422", "0.48622254", "0.48567176", "0.48551282", "0.48405817", "0.4833004", "0.4833004", "0.4833004", "0.4833004", "0.4833004", "0.4833004", "0.4833004", "0.4833004", "0.4833004", "0.48268682", "0.48227808", "0.48227808", "0.48213953", "0.4811184", "0.48052529", "0.48049575", "0.48001158", "0.4795286", "0.47948575", "0.47929725", "0.4790685", "0.47882333", "0.47861013", "0.47844934", "0.47793412", "0.4778744", "0.4773823", "0.47655138", "0.47647718", "0.47623694", "0.4758084" ]
0.6118231
0
var elem = document.getElementById('some_div');
function countdown() { if (timeLeft === -1) { clearTimeout(timerId); } else { timer.innerHTML = timeLeft + ' seconds remaining'; timeLeft--; console.log(timeLeft); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function el(id) {\n return document.getElementById(id);\n}", "function getEl(id) {\n return document.getElementById(id)\n}", "function $( element )\n{\n return document.getElementById( element ); \n}", "function getEl(id){\n\treturn document.getElementById(id);\n}", "function elem(id) {\n return document.getElementById(id);\n }", "function elt(id) {\n return document.getElementById(id)\n}", "function ElemId(id){\n\treturn document.getElementById(id);\n}", "function elementById(id) {\n return document.getElementById(id);\n}", "function getElById(el) {\n return document.getElementById(el);\n}", "function getEle(id) {\r\n\treturn document.getElementById(id);\r\n}", "function getElement(elementId){\n return document.getElementById(elementId);\n }", "function getElm(id) {\n return document.getElementById(id);\n}", "function domById(id)\n{\n return document.getElementById(id);\n}", "function getElement(id) {\r\n return document.getElementById(id);\r\n}", "function ele(id) {\n\treturn document.getElementById(id);\n}", "function $(elementID){\n return document.getElementById(elementID);\n}", "function $(elm_id){\r\n \treturn document.getElementById(elm_id);\r\n }", "function $(elm_id){\r\n \treturn document.getElementById(elm_id);\r\n }", "function id(el){\n return document.getElementById(el);\n}", "function getEleById(ele) {\n return document.getElementById(ele);\n}", "function ElementById(name)\n{\n return document.getElementById(name);\n}", "function elem(elemName){var getElem=document.getElementById(elemName); return getElem;}", "function getIdElement(id) {\n return document.getElementById(id);\n}", "function $(id){const el=document.getElementById(id);return el?assertInstanceof(el,HTMLElement):null}", "function nom_div(div)\r\n\t{\r\n\t\treturn document.getElementById(div);\r\n\t}", "_getElement(element) {\n if (element.indexOf(\"#\") > -1) {\n return document.getElementById(element.substring(1));\n } else {\n return document.getElementsByClassName(element.substring(1))[0];\n }\n }", "function id(element) {\n return document.getElementById(element);\n}", "function nom_div(div)\n\t{\n\t\treturn document.getElementById(div);\n\t}", "function nom_div(div)\n\t{\n\t\treturn document.getElementById(div);\n\t}", "i(id) { return document.getElementById(id); }", "function $(o) {\n return document.getElementById(o);\n}", "function $$(divID)\n{\n return document.getElementById(divID);\n}", "function id(element) {\n\n return document.getElementById(element);\n}", "function $(elementId) { return document.getElementById(elementId); } // shortcut from \"Prototype Javascript Framework\"", "function $(id) { return document.getElementById(id); }", "function E(id) { return document.getElementById(id); }", "function E(id) { return document.getElementById(id); }", "function _(el) {\n return document.getElementById(el);\n}", "static getEle(id) {\n return document.getElementById(id);\n }", "function $(id) { return document.getElementById(id) }", "function el(x){\n return document.getElementById(x);\n }", "function $(idobj) {\n return document.getElementById(idobj);\n}", "function el(elementid) {\n if (document.getElementById) {\n return document.getElementById(elementid);\n } else if (window[elementid]) {\n return window[elementid];\n }\n}", "function $(id)\n{\n return document.getElementById(id);\n}", "function getElement(el) {\n if (_Type__WEBPACK_IMPORTED_MODULE_6__[\"isString\"](el)) {\n var e = document.getElementById(el);\n if (e == null) {\n e = document.getElementsByClassName(el)[0];\n }\n if (e instanceof HTMLElement) {\n return e;\n }\n }\n else if (el instanceof HTMLElement) {\n return el;\n }\n}", "function Dom(id) {\n return document.getElementById(id);\n}", "function $(id) { return document.getElementById(id); }", "function el(id)\n{\n\tif (document.getElementById)\n\t{\n\t\treturn document.getElementById(id);\n\t}\n\telse if (window[id])\n\t{\n\t\treturn window[id];\n\t}\n\treturn null;\n}", "function $(elementID) {\n return document.getElementById(elementID);\n }", "function l(what) {return document.getElementById(what);}", "function get(elementID) { \n\tvar d = document; \n\tvar r = d.getElementById(elementID); \n\treturn r; \n}", "function $(elementName) { return document.getElementById(elementName); }", "constructor(element) {\r\n this.element = document.getElementById(element)\r\n }", "function $(id){\n return document.getElementById(id); \n}", "function $(id){\n return document.getElementById(id);\n}", "function $( id )\n{\n\treturn document.getElementById( id );\n}", "function $(id)\r\n{\r\n return document.getElementById(id);\r\n}", "function getElement(id)\n{\n\t// This is a helper function\n\t// to get element by id\n\tvar element = document.getElementById(id);\n\treturn element;\n}", "function $(id) {\n return window.document.getElementById(id);\n}", "function habdiv(){\r\n document.getElementById(\"\")\r\n}", "function find(id){\n var elem = document.getElementById(id);\n return elem;\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function e(id) {\n return document.getElementById(id);\n}", "function getEl(el) {\n return document.querySelector(el);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function getElement(element) {\n \n if(typeof(element) == \"string\") {\n \n element = document.getElementById(element);\n }\n \n return element;\n}", "function dom(id) {\n\treturn document.getElementById(id);\n}", "function $(demo){\n return document.getElementById(demo);\n}", "function $(a){return document.getElementById(a);}", "function $(id) {\r\n return document.getElementById(id);\r\n}", "function __$(id){\n return document.getElementById(id);\n}", "function get(id){ return document.getElementById(id); }", "function get(id){ return document.getElementById(id); }", "function $(id) {\r\n return document.getElementById(id);\r\n}", "function id_of(id) {\n return document.getElementById(id);\n}", "function doStuffWithDOM(element) {\n alert(\"I received the following DOM content:\\n\" + element);\n var test = document.getElementById(\"testhere\");\n test.innerHTML = element;\n }", "function _ge(id) {\r\n return document.getElementById(id);\r\n}", "getElement(el) {\n const element = document.querySelector(el);\n return element;\n }", "function getElement(str)\n{\n\tvar el = document.getElementById(str);\n\tif(!el)\n\t{\n\t\tvar els = document.getElementsByName(str);\n\t\tif (els.length > 0)\n\t\t\tvar el = els[0]\n\t\telse\n\t\t\tvar el = null;\n\t}\n\treturn el;\n}", "function byId( id ){ return document.getElementById( id ); }", "function get(id)\n{\n return document.getElementById(id);\n}", "function $el(id) {\n if (typeof id === 'string') {\n return document.getElementById(id);\n }\n return id;\n }", "function $(id) {\r\n return document.getElementById(id);\r\n}//end function $", "function $(id){\n\treturn document.getElementById(id);\n}", "function $(id){\n\treturn document.getElementById(id);\n}", "function $(id){\n\treturn document.getElementById(id);\n}", "function $(x) {return document.getElementById(x);}", "function $(id)\n{\n\treturn document.getElementById(id);\n}", "function $(id)\n{\n\treturn document.getElementById(id);\n}", "function _$(id){return document.getElementById( id );}", "function byId(id) {\n return document.getElementById(id);\n}", "function _(e) {return document.getElementById(e)}" ]
[ "0.7561145", "0.75596064", "0.74907", "0.74786055", "0.7432419", "0.74189806", "0.73773074", "0.7354568", "0.7347279", "0.73307425", "0.7287947", "0.72592455", "0.72278136", "0.7226286", "0.7213981", "0.71975815", "0.71760577", "0.71760577", "0.71755373", "0.71644795", "0.7122674", "0.7115969", "0.7080474", "0.7067298", "0.7066843", "0.7054089", "0.70331645", "0.7028872", "0.7028872", "0.70221746", "0.70173407", "0.7010709", "0.6962581", "0.69415516", "0.6937086", "0.693628", "0.693628", "0.69342273", "0.69321173", "0.6925735", "0.6910895", "0.690692", "0.6888821", "0.68721586", "0.687181", "0.6865204", "0.68519896", "0.6851737", "0.68480074", "0.6845429", "0.6842799", "0.68395996", "0.6834257", "0.68320966", "0.6828525", "0.6798097", "0.6795605", "0.67758954", "0.6774876", "0.67731357", "0.677166", "0.67630094", "0.67630094", "0.67630094", "0.67630094", "0.67630094", "0.67619646", "0.6760796", "0.6758458", "0.6758458", "0.6758458", "0.6758458", "0.6758458", "0.6758458", "0.67542887", "0.67482406", "0.6741611", "0.67398393", "0.67343074", "0.673024", "0.6723539", "0.6723539", "0.67229915", "0.67062104", "0.66896313", "0.6685743", "0.6676896", "0.66688585", "0.6668214", "0.66581964", "0.66386807", "0.66359514", "0.6628536", "0.6628536", "0.6628536", "0.66220987", "0.6619127", "0.6619127", "0.6613616", "0.6609229", "0.6598922" ]
0.0
-1
Does the given string have any repeated characters in it? Examples repeatedChars("abcd") === [] repeatedChars("abcccccccd") === ['c'] repeatedChars("aapple 1231111") === ['a', '1']
function repeatedChars(str) { const charMap = {}; // Go through each char in the string for (let char of str) { // If char exists in charMap, add 1 to it, // otherwise set it to 1. charMap[char] = charMap[char] + 1 || 1; } // Determine the repeated chars const repeated = Object.keys(charMap).reduce( (rep, key) => (charMap[key] > 1 ? [key, ...rep] : rep), [] ); // Return the repeated return repeated; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repeatedChar(string) {\n var memo = {};\n var repeated = false;\n\n string.forEach(function(letter) {\n if (memo[letter]) {\n repeated = true;\n }\n memo[letter] = true;\n });\n return repeated;\n}", "function hasRepeatingChars() {\n //\n}", "function checkRepeats( str ) {\n const regex = /(\\w)\\1+/g;\n return regex.test( str );\n}", "function uniqueChars(str) {\r\n // Set has O(1) lookup + insertion\r\n let uniqueLetters = new Set();\r\n let letterCount = 0;\r\n\r\n for (let i = 0; i < str.length; i++) {\r\n uniqueLetters.add(str[i]);\r\n letterCount++;\r\n if (uniqueLetters.size != letterCount) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n}", "function checkDuplicateLetters(string){\n for (var i = 0; i < string.length; i++) {\n var letter = string[i];\n var regExp = new RegExp(letter + letter, 'g');\n if (string.match(regExp)) {\n return true;\n }\n }\n return false;\n}", "function uniqueChars(string) {\n let chars = string.split('');\n\tif (chars.length > 256) return false;\n for (let i=0; i < chars.length; i++) {\n for (let j=i+1; j < chars.length; j++) {\n if (chars[i] === chars[j]) {\n return false;\n }\n }\n }\n return true;\n}", "function firstNonRepeatedCharacter (string) {\n\n var array = string.split(\"\");\n var repeats = [];\n var result = array.shift();\n \n while(array.length > 1) {\n if(~array.indexOf(result) || ~repeats.indexOf(result)) {\n repeats.push(result)\n result = array.shift();\n } else\n return result;\n }\n \n return 'sorry';\n\n}", "function duplicateCount(str){\n var letters = str.toLowerCase();\n var duplicates = [];\n for (let i=0; i<letters.length; i++){\n if (letters.indexOf(letters[i])!== i){\n if (!duplicates.includes(letters[i])){\n duplicates.push(letters[i]); \n }\n }\n }\n return duplicates.length\n}", "function firstNotRepeat(string){\n\tstring=string.toLowerCase()\n\tlist=\"\"\n\tvar letterCount=[]\n\tfor(var i=0;i<string.length;i++)\n\t{\n\t\tif(list.indexOf(string[i])== -1)\n\t\t{\n\t\t\tlist=list+string[i]\n\t\t}\n\t\tif(list.length == 26){\n\t\t\tbreak\n\t\t}\n\t}\n\tfor(var j=0;j<list.length;j++){\t\n\t\tvar count=0\n\t\tfor(var i=0; i< string.length;i++)\n\t\t{\n\t\t\tif(string[i]==list[j])\n\t\t\t\t{\n\t\t\t\t\tcount++\n\t\t\t\t}\n\t\t}\n\t\tletterCount.push([list[j],count])\n\t}\n\treturn letterCount.find(function(element) {\n\t\t return element[1] == 1\n\t})[0]\n}", "function isUnique(string){\n var stringArr = string.split(\"\");\n var characters = {}\n\n for (var i = 0; i < string.length; i++){\n var currentChar = stringArr[i]\n if (!characters[currentChar]){\n characters[stringArr[i]] = 0;\n } else {\n return false;\n }\n characters[currentChar]++;\n }\n return true;\n}", "function DistinctCharacters(str) {\n const dic = {};\n for (let i = 0; i < str.length; i++) {\n if (!dic[str[i]]) dic[str[i]] = true;\n }\n return (Object.keys(dic).length >= 10).toString();\n}", "function uniqCharacters(str){\n if(str.length > 256){\n return false;\n }\n var hash = {};\n function cb(preVal, currVal){\n if(!preVal){\n return false;\n }\n\n if(hash[currVal]){\n return false;\n }\n\n return hash[currVal] = true;\n }\n return Array.prototype.reduce.apply(str, [cb, true]);\n}", "function hasUniqueChars(s) {\n var chars = []\n , i = 0\n ;\n if (s.length > 256) { return false; }\n for (i; i < s.length; i++) {\n var val = s.charAt(i);\n if (chars[val]) { return false; }\n chars[val] = true;\n }\n return true;\n}", "function isUnique(string) {\n //method 1, assuming characters only containing alphabet\n let seen = {};\n let allUnique = true;\n let current;\n // string.split(\"\").forEach(letter => {\n // if (seen[letter]) allUnique = false;\n // seen[letter] = true;\n // });\n\n for(let i = 0; i < string.length; i++){\n current = string[i];\n if(seen[current]) return false;\n else seen[current] = true;\n }\n return true;\n}", "function countRepeats(string) {\n let count = 0;\n let i = 0;\n let j = 1;\n\n while (j < string.length) {\n if (string.charAt(i) === string.charAt(j)) {\n count++;\n }\n i++;\n j++;\n }\n return count;\n}", "function repeatedSubstringPattern(string){\n let pattern = \"\";\n for(let i = 0; i < string.length/2; i++){\n pattern += string[i];\n if(pattern.repeat(string.length/pattern.length) === string){\n return true;\n }\n }\n return false;\n}", "function isUnique1(string){\n let charsSet = new Set();\n\n for(let i = 0; i < string.length; i++){\n if(charsSet.has[string[i]]){\n return false;\n } else {\n charsSet.add[string[i]];\n };\n return true;\n }\n}", "function permAlone(str) {\n var single = /^.{1}$/;\n var singleTest = single.test(str); \n var first = str.charAt(0);\n if (singleTest === true) {\n return 1;\n }\n \n//checks if string is all repeats \n function allRepeats() { \n for (var i = 1; i < str.length; i++) {\n if (str.charAt(i) === first) {\n return 0;\n }\n }\n }\n allRepeats(); \n \n}", "function noRepeats(str) {\n let arr = [];\n for(let i = 0; i < str.length; i++) {\n if(arr.includes(str[i])) {\n return false\n }else if(!arr.includes(str[i])) {\n arr.push(str[i]);\n }\n }\n return true;\n }", "function isUnique(string) {\r\n // with an additional data structure\r\n let letters = new Set();\r\n for (let i = 0; i < string.length; i++){\r\n if (letters.has(string[i])) {\r\n return false;\r\n }\r\n letters.add(string[i])\r\n }\r\n return true;\r\n}", "function firstNotRepeatingCharacter(s) {\n\tlet strings = s.split('');\n\tlet repeating = {};\n\tlet nonRepeat = '';\n\tfor (let i = 0; i < s.length; i++) {\n\t\trepeating[strings[i]] ? repeating[strings[i]]++ : repeating[strings[i]] = 1;\n\t}\n\tfor (let str in repeating) {\n\t\t!nonRepeat && repeating[str] === 1 ? nonRepeat = str : null;\n\t}\n\treturn nonRepeat ? nonRepeat : '_';\n}", "function repeatedSubstringPatterm(string) {\n let subStr = '';\n\n for (let i = 1; i < string.length; i += 1) {\n subStr = string.slice(0, i);\n let substrings = [];\n [...string].reduce((str, char) => {\n if (str !== subStr) {\n str += char;\n } else {\n substrings.push(str)\n str = ''\n str += char;\n }\n\n return str;\n }, '');\n\n let regex = new RegExp(subStr, 'g')\n if (substrings.every(word => word === subStr)) {\n let array = [subStr, string.match(regex).length];\n console.log(array);\n return array;\n }\n\n return [string, 1];\n }\n}", "function removeDuplicateChars(str) {\n const repeating = new Set();\n let firsts = new Set();\n for (let char of str) {\n if (!repeating.has(char)) {\n firsts.add(char);\n repeating.add(char);\n } else firsts.delete(char);\n }\n return Array.from(firsts.values()).join(\"\");\n}", "function duplicateCount(str) {\n const string = str.split('').sort()\n const regex = /(.)\\1+/g\n return (string.join('').match(regex) || []).length\n }", "function repeatedString(s, n){\n\n if (!(s === 'a')){\n let repetition = [];\n for(let i=0; i < n; i++){\n repetition.push(s);\n }\n \n let repeated = repetition.toString().replace(/,/ig, \"\").slice(0, n);\n let aOcurrences = repeated.match(/a/ig);\n \n return aOcurrences.length;\n }\n\n return n;\n}", "function howManyRepeated(str){\n let sum = 0;\n const strArr = str.toLowerCase().split(\"\").sort().join(\"\").match(/(.)\\1+/g);\n return strArr;\n}", "function findDupe(string) { \n var dupeCheck = /(.)\\1/gi; // look for duplicated characters (character immediately followed by itself)\n var repeatTest = dupeCheck.test(string); // tests if dupe exists in string T/F\n if (repeatTest !== true) { // if doesn't exist\n counter++; // increase counter by 1\n console.log(\"counter is \" + counter);\n } \n }", "function repeatedString(s, n) {\n x = s.length\n a = []\n j = 0;\n for (i = 0; i < n; i) {\n if (j < x) {\n a.push(s[j])\n j++;\n i++;\n } else {\n j = 0;\n }\n\n }\n count = 0;\n for (let j = 0; j < n; j++) {\n if (a[j] === 'a') {\n count++;\n }\n }\n // let lenS = s.length;\n // let i = 0;\n // let charArr = [];\n // for (let j = 0; j < lenS; j) {\n // if (i < lenS) {\n // charArr.push(s[i]);\n // i++;\n // j++;\n // } else {\n // i = 0;\n // }\n // }\n // let count = 0;\n // for (let j = 0; j < n; j++) {\n // if (charArr[j] === 'a') {\n // count++;\n // }\n // }\n return count\n}", "function uniqueString(s) {\n return new Set(s).size === s.length;\n}", "function firstNonRepeatedCharacter (string) {\n var repeatedValues = [];\n\n for(var i = string.length -1; i >= 0; i--) {\n if((i) !== string.indexOf(string[i])){\n repeatedValues.push(string[i]);\n }\n }\n var store;\n for(var a = 0; a < string.length-1; a++) {\n if(repeatedValues.indexOf(string[a]) === -1) {\n store = string[a];\n break;\n }\n }\n\n if(store) {\n return store;\n } else {\n return 'sorry';\n }\n}", "function isUnique(str) {\n let chars = new Set();\n\n for (let i = 0; i < str.length; ++i) {\n if (chars.has(str[i])) {\n return false;\n }\n chars.add(str[i]);\n }\n return true;\n}", "function firstNonRepeatingChar(str) {\n // create hash table to keep track of frequencies of letters in input string\n const hash = {};\n // LOOP 1\n // put each char into hash table as key and their total frequency in the input string as their values\n for (let i = 0; i < str.length; i++) {\n const currLett = str[i];\n if (!hash[currLett]) {\n hash[currLett] = 1;\n }\n else hash[currLett]++;\n }\n // LOOP 2\n // Start from beginning of input string and look up each letter's frequency count in hash table. As soon as you find a count of 1, you have found 1st occurance of non repeating letter. Return its index.\n for (let i = 0; i < str.length; i++) {\n const currLett = str[i];\n if (hash[currLett] === 1) return i;\n }\n // have checked every letter in input string and they all have frequency counts greater than 1 so no non repeating letters\n return -1;\n}", "function firstNonRepeatingCharacter(string) {\n let seenHash = {};\n\n for (const char of string){\n if (!seenHash[char]){\n seenHash[char] = 1;\n } else {\n seenHash[char]++;\n }\n }\n\n for (const key in seenHash){\n const value = seenHash[key];\n if (value === 1)return string.indexOf(key);\n }\n\n // for (const index in string){\n // const char = string[index];\n // if (seenHash[char] === 1) return index;\n // }\n\n return -1;\n}", "function isUnique(str) {\n if (str.length > 128) {\n return false;\n }\n\n const lookup = new Set();\n\n for (let letter of str) {\n if (lookup.has(letter)) {\n return false;\n } else {\n lookup.add(letter);\n }\n }\n\n return true;\n}", "function firstRepeat(inputString) {\n var letterMemory = [];\n for (var i = 0; i < inputString.length; i++) {\n var currentLetter = (inputString.charAt(i));\n if (inArray(letterMemory, currentLetter)){\n return currentLetter;\n } else letterMemory.push(currentLetter)\n }\n return 'No repetitions'\n}", "function findDuplicateCharacters(input) {\n}", "function hasUniqueChars(str) {\n\tvar charHash = {};\n\n\tfor (var i = 0, length = str.length; i < length; i++) {\n\t\tvar character = str[i];\n\t\tif (charHash[character]) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tcharHash[character] = true;\n\t\t}\n\t}\n\n\treturn true;\n}", "function checkRepetition(rLen, str) {\n var res = \"\", repeated = false;\n for (var i = 0; i < str.length; i++) {\n repeated = true;\n for (var j = 0; j < rLen && (j + i + rLen) < str.length; j++) {\n repeated = repeated && (str.charAt(j + i) === str.charAt(j + i + rLen));\n }\n if (j < rLen) {\n repeated = false;\n }\n if (repeated) {\n i += rLen - 1;\n repeated = false;\n }\n else {\n res += str.charAt(i);\n }\n }\n return res;\n }", "function permAlone (stringToPermutate) {\n let count = 0;\n let acu = [];\n let charsToPermutate = stringToPermutate.split('');\n let passed = [];\n var regex = /([\\w\\d])\\1{1,}/g;\n\n function _permutator () {\n if (acu.length === charsToPermutate.length) {\n if (!acu.join('').match(regex)) {\n count++;\n }\n // exit function\n } else {\n for (let i = 0; i < charsToPermutate.length; i++) {\n if (!passed[i]) {\n passed[i] = true;\n acu.push(charsToPermutate[i]);\n _permutator();\n acu.pop();\n passed[i] = false;\n }\n }\n }\n }\n\n _permutator();\n return count;\n}", "function checkRepetition(rLen, str) {\n var res = \"\", repeated = false;\n for (var i = 0; i < str.length; i++) {\n repeated = true;\n for (var j = 0; j < rLen && (j + i + rLen) < str.length; j++) {\n repeated = repeated && (str.charAt(j + i) === str.charAt(j + i + rLen));\n }\n if (j < rLen) {\n repeated = false;\n }\n if (repeated) {\n i += rLen - 1;\n repeated = false;\n }\n else {\n res += str.charAt(i);\n }\n }\n return res;\n }", "function isUnique(str) {\n let charSet = new Array(128);\n for (let char of str) {\n if (charSet[char]) return false;\n charSet[char] = true;\n }\n return true;\n}", "function uniq(str) {\n\n if (str.length > 128) return false;\n \n let hash = {}\n \n for (let i = 0; i < str.length; i++) {\n let current = str.charAt(i)\n if (hash[current]) {\n return false;\n } else {\n hash[current] = 1;\n }\n }\n \n return true;\n \n}", "function repeatedFind (str) {\n\t\tconst repeated = str.match(/(.)\\1+/gi);//. any character, \\1 match the first parenthesized pattern \n\t\treturn repeated; \n\t}", "function checkUnique(str) {\n if (typeof str !== \"string\") {\n return false;\n } else if (str.length > 128) {\n return false; // must be dupes if we have more than 128 characters \n }\n charHash = {};\n for (char of str) {\n if (charHash[char]) {\n charHash[char]++;\n console.log(JSON.stringify(charHash));\n return false;\n } else {\n charHash[char] = 1;\n }\n }\n console.log(JSON.stringify(charHash));\n return true;\n}", "function repeatedCharacters(string) {\n var obj = {};\n for (var i = 0; i < string.length; i++) {\n if (string[i] in obj) {\n obj[string[i]]++;\n } else if (string.indexOf(string[i]) !== string.lastIndexOf(string[i])) {\n obj[string[i]] = 1;\n }\n }\n return obj;\n}", "function hasUniqueChars(char) {\n for(let i = 0; i < char.length; i++)\n for(let j = i + 1; j < char.length - 1; j++)\n if (char[i] === char[j]){\n\n return false;\n \n \n \n\n }\n return true;\n}", "function NonrepeatingCharacter(str) {\n str = str.replace(/ /g, \"\");\n if (str.length === 1) return str;\n // use two for loops\n const lookup = {};\n for (let i = 0; i < str.length; i++) {\n lookup[str[i]] ? lookup[str[i]]++ : (lookup[str[i]] = 1);\n }\n for (key in lookup) {\n if (lookup[key] === 1) return key;\n }\n}", "function firstNonRepeatingChar(str){\n var charCount = {};\n\n for(var i=0; i<str.length; i++){\n char = str[i];\n if(charCount[char]){\n charCount[char]++; \n }\n else{\n charCount[char] = 1;\n }\n }\n\n for (var key in charCount){\n if (charCount[key]==1)\n return key;\n }\n}", "function isUnique(s){\n var chars = {};\n for(var i=0;i<s.length;i++){\n if (chars[s[i]]) {\n \treturn false;\n } else {\n \tchars[s[i]] = 1;\n }\n }\n return true;\n}", "function uniqueChars(string) {\n var chars = [];\n\n for (var i = 0; i < string.length; i++) {\n if (chars.indexOf(string[i] !== -1)) chars.push(string[i]);\n }\n\n return chars;\n}", "function isUnique(inputString) {\n inputString += ''; // casting it to string\n var myMap = {}; // using hashmap to store the characters.\n for(var i = 0; i < inputString.length; i ++) {\n if(myMap[inputString[i]]) {\n myMap[inputString[i]] += 1;\n } else {\n myMap[inputString[i]] = 1;\n }\n }\n for(var i in myMap) {\n if(myMap[i] > 1) return false;\n }\n return true;\n}", "function firstNonRepeatedCharacter (string) {\n // Write your code here, and\n // return your final answer.\n // for(var i = 0; i < string.length; i++){\n // if(string.indexOf(string[i]) === string.lastIndexOf(string[i])){\n // return string[i];\n // }\n // }\n // return 'sorry'\n var letterStorage = string.split('').reduce(function(update, letter){\n if(!(letter in update)){\n update[letter] = 1;\n } else {\n update[letter]++;\n }\n return update;\n },{});\n //iterate thru the string and put the letters with the value being the number of appearances\n for(var i = 0; i < string.length; i++){\n if(letterStorage[string[i]] === 1){\n return string[i]\n }\n }\n return 'sorry';\n}", "function countUniqueLetters(str){\n let arr = str.split('');\n //Smoooth\n let index = 0;\n while(index < arr.length){\n if(arr[index] === arr[index + 1]){\n arr.splice(index, 1)\n }else{\n index++;\n }\n }\n return arr.length;\n }", "function duplicateCount(text) {\n const arrLetters = text.toLowerCase().split('').sort();\n const filteredArrLetters = arrLetters.filter((val, i) => (\n arrLetters[i] === arrLetters[i + 1]));\n return [...new Set(filteredArrLetters)].length;\n}", "function isUnique(str) {\n return str.length === new Set(str).size;\n}", "function countDuplicate(chars) {\n let charsArray = [...chars.toLowerCase()];\n const count = 1;\n const charsObject = {};\n for (let char of charsArray) {\n charsObject[char]\n ? (charsObject[char] += count)\n : (charsObject[char] = count);\n }\n for (let [key, value] of Object.entries(charsObject)) {\n const result =\n value > 1 ? console.log(`The ${key} repeats ${value} times`) : \"\";\n }\n}", "function findRepeatingCharacters(input) {\n const regex = /([^])(?=\\1)/g;\n return input.match(regex);\n}", "function firstNonRepeatingCharacter(string) {\n for (let i = 0; i < string.length; i++) {\n let foundDup = false;\n for (let j= 0; j < string.length; j++) {\n if (string[i] === string[j] && i !== j) foundDup = true; \n }\n \n if (!foundDup) return i;\n }\n return -1;\n}", "function countUniqueCharacters(s) {\n\tvar lowerCase = s.toLowerCase();\n\tvar uniqueChars = s.length;\n\tfor (i=0; i < lowerCase.length; i++){\n\t\tif (i != lowerCase.indexOf(lowerCase[i])){\n\t\t\tuniqueChars--;\n\t\t}\n\t}\n\treturn uniqueChars;\n}", "function firstNonRepeatingChar(str){\n var char;\n var charCount = {};\n\n for (var i = 0; i < str.length; i++){\n char = str[i]\n if(charCount[char]){\n charCount[char]++;\n } else {\n charCount[char] = 1;\n }\n }\n for (var j in charCount) {\n if (charCount[j] == 1){\n return j;\n }\n }\n}", "function uniqueChar(word) {\n let string = [...word]\n return new Set(string).size === string.length\n\n}", "function firstNonRepeating(str) {\n const repeating = new Set();\n let firsts = new Set();\n for (let char of str) {\n if (!repeating.has(char)) {\n firsts.add(char);\n repeating.add(char);\n } else firsts.delete(char);\n }\n console.log(firsts);\n return Array.from(firsts.values())[0];\n}", "function threePlusCharsRepeatTwice(str) {\n return (str.length < 80 && /(....*)[ \\-._!@]*\\1[ \\-._!@]*\\1/g.test(str))\n}", "function isUniqueSet(str) {\n var set = new Set();\n\n for( var i = 0; i < str.length; i++ ) {\n var char = str.charAt(i);\n\n if( set.has(char) ) {\n return false;\n }\n\n set.add(char)\n }\n\n return true;\n }", "function check(string) {\n\tlet chars = {};\n\tif (string.length > 1) {\n\t\tfor (let i = 0; i < string.length; i++) {\n\t\t\tif (chars[string[i]]) {\n\t\t\t\tdelete chars[string[i]];\n\t\t\t} else {\n\t\t\t\tchars[string[i]] = 1;\n\t\t\t}\n\t\t}\n\t\treturn !(Object.keys(chars).length >= 2);\n\t}\n}", "function checkDups(alphabet) {\n count = 0; \n for (i = 0; i < alphabet.length; i++){\n for (j = 0; j < alphabet.length; j++){\n if (alphabet[i] === alphabet[j] && i != j) {\n return true;\n }\n }\n }\n }", "function firstNonRepeatingLetter(s) {\n // Split input string into array of substrings.\n let chars = s.split(\"\");\n // Initialize a variable to store the answer. \n let ans = '';\n // Iterate through the \"chars\" array to find any case-insensitive matches to the current element.\n for (var i = 0; i < chars.length; i++) {\n var regex = new RegExp(chars[i], 'gi');\n // Store any matches in a new array.\n let arr = s.match(regex);\n /**\n * If there is only one element in the array, we assume that element is unique.\n * Stop after the first unique element is found.\n */\n if (arr.length == 1) { \n ans = arr.toString(); \n break; \n } \n }\n return ans;\n }", "function isUnique(str) {\n let hash = {};\n for (let char of str) {\n if (hash[char]) return false;\n hash[char] = 1;\n }\n return true;\n}", "function repeatedString(s, n) {\n const repeats = n % s.length;\n const repeatMath = (n - repeats)/ s.length;\n let count = 0;\n\n for(let i = 0; i < s.length; i++) {\n if(s[i] === \"a\") {\n count += repeatMath + (i < repeats);\n }\n }\n return count;\n}", "function repeatedString(s, n) {\n const repeats = n % s.length;\n const repeatMath = (n - repeats)/ s.length;\n let count = 0;\n\n for(let i = 0; i < s.length; i++) {\n if(s[i] === \"a\") {\n count += repeatMath + (i < repeats);\n }\n }\n return count;\n}", "function isUnique(str){\n for(let i = 0; i < str.length; i++){\n for(let j = 1 + i; j < str.length; j++){\n if(str[i] === str[j]) return false;\n }\n }\n return true;\n }", "function duplicateCount(text) {\n let count = 0\n console.log(new Set(text.toLowerCase().split('')))\n new Set(text.toLowerCase().split('')).forEach(char => {\n if (text.match(new RegExp(char, 'gi')).length > 1) count += 1\n })\n return count\n}", "function isUnique(string) {\n // clarify if string is only unicode characters\n // if string has more characters than unicode, chars cannot be unique\n if (string.length > 128) return false;\n\n let charMap = new Map();\n // iterate through each character\n for (let i = 0; i < string.length; i++) {\n //\n if (charMap.has(string[i])) {\n return false;\n }\n charMap.set(string[i], true);\n }\n return true;\n}", "function repeatChar(str,char){\r\n\t\tvar num=0;\r\n\t\tfor(i=0;i<=str.length;i++){\r\n\t\t\tif(str[i]==char){\r\n\t\t\t\tnum++;\r\n\t\t}\r\n\t\t\t}\r\n\t\t\treturn num;\r\n\t}", "function permAlone(str) {\n \n var perm = function(str) {\n var arr = [];\n \n if (str.length === 1) {\n arr.push(str);\n return arr;\n }\n \n for (var i = 0; i < str.length; i++) {\n var firstChar = str[i];\n var rest = str.substring(0, i) + str.substring(i + 1);\n var permutations = perm(rest);\n for (var j = 0; j < permutations.length; j++) {\n arr.push(firstChar + permutations[j]);\n }\n }\n \n return arr;\n };\n \n var arr = perm(str);\n \n var regex = /(.)\\1+/g;\n \n var filtered = arr.filter(function(el) {\n return !el.match(regex);\n });\n \n return filtered.length;\n \n }", "function isUnique(str) {\n // iterate through the string character by character\n for (var i = 0; i< str.length; i++) {\n // check to see if the first occurance and last occurane of the character are not the same.\n // if this isn't true then return false\n if (str.indexOf(str[i]) !== str.lastIndexOf(str[i])) return false;\n }\n // if after going through the whole array and no matches are found return true\n return true;\n}", "function allRepeats() { \n for (var i = 1; i < str.length; i++) {\n if (str.charAt(i) === first) {\n return 0;\n }\n }\n }", "function allRepeats() { \n for (var i = 1; i < str.length; i++) {\n if (str.charAt(i) === first) {\n return 0;\n }\n }\n }", "function isUnique(str) {\n for( var i = 0, n = str.length; i < n; i++ ) {\n for( var j = i + 1; j < n; j++ ) {\n if( str.charAt(i) === str.charAt(j) ) {\n return false;\n }\n }\n }\n\n return true;\n }", "function repeatedString(s, n) {\n\n let string = '';\n let total = 0;\n\n while(string.length < n){\n string += s;\n }\n\n\n for(let char = 0; char < n; char++){\n if(string.charAt(char) === \"a\"){\n total ++\n }\n }\n return total;\n}", "function RemoveDuplicates(str){\n var nonDuplicates = \"\";\n if(typeof str == \"string\"){\n for (var i=0; i < str.length; i++){\n if (! nonDuplicates.includes(str.charAt(i))){\n nonDuplicates = nonDuplicates.concat(str.charAt(i));\n }\n } \n }\n console.log(nonDuplicates);\n\n}", "function isUnique(str) {\n for (let i = 0; i < str.length; i++) {\n for (let j = 1 + i; j < str.length; j++) {\n if (str[i] === str[j]) {\n return false;\n }\n }\n }\n return true;\n }", "function removeDuplicates(str) {\n let letters = [];\n for (let i = 0; i < str.length; i++) {\n if (!letters.includes(str[i])) letters.push(str[i]);\n }\n return letters.join('');\n}", "function unique3(str) {\n\n if (!str) {\n return \"please provide valid string as input\";\n }\n\n var charMap = new Array(26); // 26 elements\n var len = str.length;\n var charMapIndex;\n\n for (var i=0; i<len; i++) {\n charMapIndex = str[i].charCodeAt(0) - 'a'.charCodeAt(0);\n if (charMap[charMapIndex]) {\n return false;\n }\n charMap[charMapIndex] = true;\n }\n\n return true;\n}", "function isUnique(str) {\n for(let i = 0; i < str.length; i++) {\n for(let j = i+1; j < str.length; j++) {\n if(str[i] === str[j]) {\n return false;\n }\n }\n }\n return true;\n}", "function isUnique(str) {\n let seenMap = new Map();\n seenMap.set(str[0], 0);\n for (let i = 1; i < str.length; i++) {\n if (str[i] == \" \") continue;\n if (seenMap.has(str[i])) {\n return false;\n } else {\n seenMap.set(str[i], i);\n }\n }\n return true;\n}", "function repeatChar(str,x){\n\tvar n=0;\n for(i=0 ; i<str.length ; i++){\n if (str.charAt(i) == x){\n \tn = n+1;\n }\n }return n;\n }", "function isUnique(str) {\n if (str.length > 256) {\n return false;\n }\n for (var i = 0; i < str.length; i++) {\n if (str.indexOf(str[i]) !== str.lastIndexOf(str[i])) {\n return false;\n }\n }\n return true;\n}", "function twoCharaters(s) {\n let maxSize = 0;\n let duppedStr = s.slice(0);\n const chrsSet = new Set();\n\n for (let i = 0; i < s.length; i++) {\n chrsSet.add(duppedStr[i]);\n }\n\n const uniqChrs = Array.from(chrsSet);\n for (let i = 0; i < uniqChrs.length - 1; i++) {\n for (let j = i + 1; j < uniqChrs.length; j++) {\n duppedStr = duppedStr.split(\"\").filter((chr) => (chr === uniqChrs[i] || chr === uniqChrs[j])).join(\"\");\n if (validT(duppedStr)) {\n if (duppedStr.length > maxSize) {\n maxSize = duppedStr.length;\n }\n }\n duppedStr = s.slice(0);\n }\n }\n return maxSize;\n}", "function permAlone(str) {\n function permute(str) {\n if (str.length < 2) {\n return str;\n }\n const permutations = [];\n for (let i = 0; i < str.length; i++) {\n const first = str[i];\n const remaining = str.slice(0, i) + str.slice(i + 1);\n const subPerms = permute(remaining);\n for (let subPerm of subPerms) {\n // don't add if 2 repeated consecutive letters\n if (first !== subPerm[0]) {\n permutations.push(first + subPerm);\n }\n }\n }\n return permutations;\n }\n const result = permute(str);\n return result.length;\n}", "function uniqueChar(str) {\n for (let i = 0; i < str.length - 1; i++) {\n for (j = i + 1; j < str.length; j++) {\n if (str[i] == str[j]) {\n return false;\n }\n }\n }\n return true;\n}", "function reg(s) {\n let good = s.split(`\\n`).filter( e => {\n let bad = /ab|cd|pq|xy/g.test(e);\n let vowels = e.match(/[aeiou]/g) ? e.match(/[aeiou]/g).length : 0;\n let repeat = /(.)\\1{1}/g.test(e);\n return !bad && vowels >= 3 && repeat;\n }).length;\n console.log(good);\n}", "function unique(str) {\n var len = str.length;\n var isUnique = true;\n for(var i=0; i<len -1; i++) {\n for(var j=i+1; j<len; j++) {\n if (str[i] == str[j]) {\n isUnique = false;\n break;\n }\n }\n }\n\n return isUnique;\n}", "function repeatedCharacter(find) {\n for(let i = 0; i <= find.length; i++){\n for(let m = i+1; m <= find.length; m++){\n if(find[m] === find[i]){\n return find[i].repeat(1);\n }\n }\n }\nreturn false;\n}", "function isUnique(s) {\n\tvar e = '';\n\n\tfor(var i = 0; i<s.length; i++) {\n\t\te = s[i]; //get an element from array for testing \n\n\t\tfor (var j = i+1; j<s.length; j++) { // Sweep through array to check if element is repeated\n\t\t\tif( e == s[j] ) return false;\t\n\t\t}\n\t}\n\n\treturn true;\n}", "function none_repeating_char(str) {\n\tconst map = {};\n\tconst queue = [];\n\tfor (let i = 0; i < str.length; i++) {\n\t\tif (str[i] in map) {\n\t\t\tmap[str[i]] = map[str[i]] + 1;\n\t\t\tif (str[i] == queue[0]) {\n\t\t\t\tqueue.shift();\n\t\t\t}\n\t\t} else {\n\t\t\tmap[str[i]] = 1;\n\t\t\tqueue.push(str[i]);\n\t\t}\n\t}\n\tfor (key in map) {\n\t\tif (map[key] == 1) return key;\n\t}\n\treturn -1;\n}", "function isIsogram(str){\n return (new Set(str.toLowerCase().split(''))).size === str.split('').length\n}", "function uniqChars(str) {\n return str.replace(/[\\s\\S](?=([\\s\\S]+))/g, function(c, s) {\n return s.indexOf(c) + 1 ? '' : c;\n });\n }", "function removeDuplicates(str) {\n let nonDuplicate = \"\";\n for(var i = 0; i < str.length; i++){\n if(!nonDuplicate.includes(str.charAt(i))){\n\n nonDuplicate += str.charAt(i);\n\n }\n }\n console.log(nonDuplicate);\n}", "function isPangram(string){\n return string.match(/([a-z])(?!.*\\1)/ig || []).length == 26\n}" ]
[ "0.79082435", "0.75011957", "0.7384266", "0.7303107", "0.72579616", "0.7198893", "0.71885884", "0.71400213", "0.70810854", "0.70702726", "0.7047062", "0.7017877", "0.70103997", "0.698779", "0.6954114", "0.6948797", "0.69455945", "0.68819547", "0.68647456", "0.6854588", "0.6841904", "0.6836728", "0.6819401", "0.67965317", "0.67857575", "0.678511", "0.67703843", "0.6723006", "0.6721558", "0.67204034", "0.6706972", "0.670498", "0.6699303", "0.66938674", "0.6693387", "0.6693053", "0.66763663", "0.667201", "0.6616556", "0.6616523", "0.66144705", "0.65980184", "0.6584205", "0.6567554", "0.6562733", "0.65571445", "0.65545595", "0.65516204", "0.6545166", "0.65420336", "0.6533598", "0.65096486", "0.6491819", "0.6491375", "0.64860314", "0.64842415", "0.64753336", "0.6467973", "0.64543957", "0.6445037", "0.63992244", "0.63887334", "0.6379567", "0.6364146", "0.6346141", "0.6340209", "0.63333815", "0.6325891", "0.6322955", "0.6322955", "0.63226765", "0.6301683", "0.6301114", "0.6297115", "0.62968785", "0.6286905", "0.6285237", "0.6285237", "0.6284882", "0.62812", "0.62799704", "0.627643", "0.6269528", "0.626096", "0.62509114", "0.6244654", "0.6243392", "0.6239159", "0.62355846", "0.6234968", "0.62254155", "0.62081957", "0.62050134", "0.6200444", "0.6196456", "0.6187267", "0.6182372", "0.61822176", "0.6161662", "0.615595" ]
0.80008787
0
console.log(apiURL); console.log(' get comic character data from the Marvel API using XMLHttpRequest object
function getMarvelData(callBack) { var xhr = new XMLHttpRequest(); xhr.onreadystatechange = function() { if(this.readyState == 4 && this.status == 200) { console.log("success!", this.readyState, this.status, this.statusText, this.responseText); callBack(JSON.parse(this.responseText)); // callBack(this.responseText); } else { console.log("error!", this.readyState, this.status, this.statusText); } }; xhr.open("GET", apiURL, true); xhr.send(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getBomData() {\n\n // Create the AJAX request object\n let lBomRequest = new XMLHttpRequest();\n\n // Tell the request object what to do\n lBomRequest.onreadystatechange = function() {\n \n if (this.readyState == 4 && this.status == 200) {\n // Display the data returned by the server\n displayBomData(this.responseText);\n }\n }\n \n // Open the request object\n lBomRequest.open(\"GET\", \"getApiResponse.php?url=\"+encodeURI(BOM_COMPARISON_STATION_URL), true);\n\n // Send the request\n lBomRequest.send();\n\n}", "function getFollowCharity() {\n var xhr = new XMLHttpRequest(),\n method = \"GET\",\n url = \"https://chari.azurewebsites.net/api/Account/currentcharity\"\n xhr.open(method, url, true);\n //xhr.setRequestHeader(\"Content-type\", \"application/json\");\n xhr.setRequestHeader(\"Authorization\", \"Bearer \" + getToken());\n xhr.send();\n\n xhr.onload = function () {\n //DISPLAY followed charity*************************************\n console.log(xhr.responseText);\n };\n\n xhr.onerror = function () {\n console.log('Error occurred');\n }\n}", "function handleApi() {\n httpRequest = new XMLHttpRequest();\n\n // Local Variables\n let method = \"GET\",\n url = \"http://quotes.stormconsultancy.co.uk/random.json\";\n\n //call (open, readystate, and send) methods\n httpRequest.open(method, url, true);\n httpRequest.onreadystatechange = requestStatus;\n httpRequest.send();\n }", "function req(url) {\n\n let req = new XMLHttpRequest();//Saves a constructor\n req.addEventListener(\"load\", function () { //Sets an eventListener with the anonymous function below, parsing the data.\n let parsedData = JSON.parse(this.responseText); //Parses the JSON-Data.\n let data = parsedData.message; //Creates a variable containing the parsed JSON-data message.\n renderText(data, url);//Calls upon the function renderText. See Chapter 2.2.\n });\n req.open(\"GET\", \"https://dog.ceo/api/breed\" + url); // Makes a GET-call to get the data from the server (itc: a list)\n req.send(); // Sends a HTTP-request to the browser.\n}", "function apiCall(){\r\nxhr.open('GET', url);\r\nxhr.send();\r\n}", "function movieinfo() {\n \n var queryURL = \"http://www.omdbapi.com/?t=rock&apikey=//!InsertKey\";\n // Creating an AJAX call for the specific movie \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n }\n)}", "function movie(){request(\"http://www.omdbapi.com/?apikey=40e9cece&t=Mr.+Nobody\", function(error, response, body) {\n if (!error && response.statusCode === 200) {\n\n // Then log the body from the site!\n console.log(body);\n }\n});\n}", "function getData(url){\n const ajax = new XMLHttpRequest();\n console.log(ajax);\n ajax.open('GET',url,true);\n ajax.onreadystatechange = function(){\n if(this.status ===200 && this.readyState===4){\n // we can avoid writing ready State==4 by,\n // checking if the page is loaded or not by ajax.load=function()\n //{\n //if(this.status==200)\n //}\n console.log('success');\n console.log(this.responseText);\n info.textContent = this.responseText; \n } else{\n console.log(this.statusText);\n }\n };\n\n ajax.onerror = function(){\n console.log(\"There was an error\");\n }\n ajax.send();\n}", "function buscaLancamentos(){\r\n let xhr = new XMLHttpRequest();\r\n\r\n // GET populares da API\r\n xhr.onload = exibeLancamentos;\r\n xhr.open('GET', `https://api.themoviedb.org/3/movie/top_rated?api_key=${API_KEY}&language=pt-BR`);\r\n xhr.send();\r\n\r\n}", "function Initialize() {\n request = new XMLHttpRequest();\n // configure the request:\n // We use the GET method (as shown at https://dataweb.stoplight.io/docs/dwapi/reference/dwAPI.v1.json/paths/~1item~1read/get)\n // As a GET parameter, we use the url from that same page\n request.open(\"GET\", \"https://api.data-web.be/item/read?project=QNyG0s83pm3i&entity=producten\");\n\n // When the server is ready and sends us a response, it needs a function to call\n // We've created the function 'ProcessServerResponse' for this purpose\n request.addEventListener(\"load\", ProcessServerResponse);\n\n // after configuring the request, we can send it to the server!\n request.send();\n}", "loadCharacters(page, filter){\n var response = \"\";\n req.open('GET', url_SWAPI+'?page='+page, false);\n req.addEventListener('load', function(){\n if (req.status >= 200 && req.status < 400){\n response = JSON.parse(req.responseText);\n } else{\n console.log(\"Não conseguiu conectar =/\");\n }\n });\n req.send(null); \n return response.results; \n }", "function getWeather() { \n var request = new XMLHttpRequest();\n var url1 ='http://api.openweathermap.org/data/2.5/weather?q=';\n var url2 = '&&appid=43eb6e1f55e024017f7ff34fafbd2d0b';\n var url = url1 + cityName.value + url2;\n request.open('GET', url); //type of request and where its going \n request.send(); //send request to API\n //req.setRequestHeader('Content-Type', 'application/json'); //key value pair\n request.onload = function(){ \n //console.log(req.responseText);\n var data = JSON.parse(request.responseText);\n var sOutput = '<p>' + cityName.value + ':' + data.weather[0].description + '<p>';\n skyOutput.innerHTML = sOutput;\n var temp = (data.main.temp - 273.15) * 9/5 + 32;\n var tOutput = '<p>'+ 'Temp: ' + \n temp.toFixed(2) + ' F' +'<p>';\n tempOutput.innerHTML = tOutput;\n var cOutput = '<p>'+ 'Coord: ' + data.coord.lon.toFixed(2) + ', ' + data.coord.lat.toFixed(2) + '<p>';\n coordOutput.innerHTML = cOutput;\n }\n}", "function requestAlphaVantageData(symbol) {\n var alpha = \"https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=MSFT&interval=1min&apikey=974UTD95QA2DV3Y5\";\n var http = new XMLHttpRequest();\n http.open(\"GET\", quandl, true);\n http.onreadystatechange = function () {\n if (http.readyState == 4 && http.status == 200) {\n var response = JSON.parse(http.responseText);\n console.log(response);\n }\n }\n http.send();\n }", "function detail_action() {\n \n var xhr = new XMLHttpRequest();\n var uri = encodeURI('http://www.omdbapi.com/?i='+ this.attributes['data-imdbid'].value + '&y=&plot=long&r=json')\n\n xhr.open('GET', uri, true);\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n detail_result(JSON.parse(xhr.response))\n }\n }\n\n xhr.send(null);\n \n}", "function getWeather(city){\r\n var xhr = new XMLHttpRequest();\r\n\r\n\r\n let url = apiUrl + '?' + 'key=' + apiKey + '&q=' + city + '&aqi=yes';\r\n\r\n xhr.open('GET', url);\r\n\r\n xhr.onreadystatechange = function(){\r\n if(this.readyState ===4 ){\r\n let response = JSON.parse(this.response); \r\n console.log(response);\r\n document.getElementById('city').innerHTML = response.location.name;\r\n document.getElementById('img').src = response.current.condition.icon;\r\n document.getElementById('temperature').innerHTML = response.current.temp_c + '°C';\r\n document.getElementById('condition').innerHTML = response.current.condition.text;\r\n document.getElementById('wind').innerHTML = response.current.wind_kph + ' km/h';\r\n\r\n }\r\n\r\n\r\n }\r\n\r\n xhr.send();\r\n}", "function enhancednav_api(lat, long, radius, id) {\r\n\r\n // Step 1 - Create a new Request\r\n var request = new XMLHttpRequest(); // Prep to make an HTTP request\r\n\r\n // Step 2 - Register a function with the Request\r\n request.onreadystatechange = function() {\r\n\r\n if( this.readyState == 4 && this.status == 200 ) {\r\n\r\n // convert response into json and get stars record\r\n var response_json = JSON.parse(this.responseText);\r\n var attraction_array = response_json.data;\r\n\r\n // console.log(`-----------------${id}-------------`);\r\n // console.log(attraction_array);\r\n\r\n card_carousel(attraction_array, id); \r\n\r\n }\r\n\r\n }\r\n\r\n // Step 3\r\n // Specify method: GET for retrieval\r\n var url = `https://tih-api.stb.gov.sg/map/v1/search/multidataset?location=${lat}%2C%20${long}&radius=${radius}&dataset=accommodation%2C%20attractions%2C%20bars_clubs%2C%20food_beverages%2C%20walking_trail&sort=rating&apikey=${apikey}`;\r\n\r\n request.open(\"GET\", url, true);\r\n\r\n // console.log(url);\r\n\r\n // Step 4\r\n // calling the api\r\n request.send();\r\n}", "function reqGetXHR() {\n let request = new XMLHttpRequest();\n\n request.open('GET', 'http://localhost:3000/people');\n request.setRequestHeader('Content-type', 'application/json; utf-8');\n request.send();\n\n request.addEventListener('load', function() {\n if (request.status === 200) {\n let data = JSON.parse(request.response);\n displayCards(data);\n button.remove();\n } else {\n console.error('ERROR', request.status);\n }\n });\n }", "function access()\n {\n\n var myRequest = new XMLHttpRequest();\n //myRequest.open(\"GET\",\"chepomail.php?index=\" + indexvalue,false);\n myRequest.open(\"GET\",\"https://info2180_project_4-c9-jeremydane.c9.io/chepomail.php?username=\" + user.value,true);\n myRequest.send();\n var mytext = myRequest.responseText;\n //console.log(mytext);\n alert(\"access response:\"+mytext);\n\n }", "function getFacDepts(){\n // Creating the AJAX element to receive data\n let xhr = new XMLHttpRequest();\n xhr.open('GET', '../../php/api/GetData/getFacDept.php?id='+fac_id.value, true);\n xhr.onload = function(){\n if(this.status == 200){\n let response = this.responseText;\n // alert(response);\n candidateDepts(JSON.parse(response));\n }else{\n alert(this.status);\n }\n }\n xhr.send();\n}", "function grab(){\n var xhr = new XMLHttpRequest()\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n if (xhr.status == 200) {\n var json = JSON.parse(xhr.responseText);\n let result = json.results\n collectValidQuestions(result)\n }\n if (xhr.status == 500) {\n console.log(\"serverfel\");\n }\n }\n }\n xhr.open(\"GET\", apiUrl);\n xhr.responseType = \"json\";\n xhr.send();\n}", "function createCharizard() {\n var xhttp = new XMLHttpRequest();\n var jsonPost = '{\"id\":0, \"name\":\"Charizard\",\"description\":\"Charizard flies \\'round the sky in search of powerful opponents. \\'t breathes fire of such most wondrous heat yond \\'t melts aught. However, \\'t nev\\'r turns its fiery breath on any opponent weaker than itself.\"}';\n //document.getElementById(\"httpRequest\").innerHTML = jsonPost;\n\n xhttp.open(\"POST\", baseURL,true);\n xhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xhttp.setRequestHeader(\"X-Atlassian-Token\", \"nocheck\");\n xhttp.send(jsonPost);\n \n\n xhttp.onreadystatechange = function() {\n if (xhttp.readyState == 4) {\n var data = JSON.parse(xhttp.responseText)\n console.log(data.name)\n document.getElementById(\"description\").innerHTML = data.description;\n }\n };\n\n}", "function getNumberAnalysis(){\n // Creating the AJAX element to receive data\n let xhr = new XMLHttpRequest();\n xhr.open('GET', '../../php/api/GetData/numberAnalysisFac.php?id='+fac_id.value, true);\n xhr.onload = function(){\n if(this.status == 200){\n let response = this.responseText;\n // alert(response);\n populateDom(JSON.parse(response));\n }else{\n alert(this.status);\n }\n }\n xhr.send();\n}", "function requestChar () {\n const request = new XMLHttpRequest();\n request.open(`GET`,`data.json`);\n request.responseType = `json`;\n request.send();\n request.onload = () => {\n charObj = request.response.ipaChar\n charObj = charObj[getRandomIndex(charObj)];\n }\n}", "function callDataAPI() {\n var xhr = new XMLHttpRequest();\n xhr.open(\n \"GET\",\n \"https://api.coronavirus.data.gov.uk/v1/data?filters=areaType%3Dnation%3BareaName%3Dengland&structure=%7B%22date%22%3A%22date%22%2C%22name%22%3A%22areaName%22%2C%22code%22%3A%22areaCode%22%2C%22cases%22%3A%7B%22daily%22%3A%22newCasesByPublishDate%22%2C%22cumulative%22%3A%22cumCasesByPublishDate%22%7D%2C%22deaths%22%3A%7B%22daily%22%3A%22newDeathsByDeathDate%22%2C%22cumulative%22%3A%22cumDeathsByDeathDate%22%7D%2C%22vaccines%22%3A%7B%22weekly2nddose%22%3A%22weeklyPeopleVaccinatedSecondDoseByVaccinationDate%22%2C%22weekly1stdose%22%3A%22weeklyPeopleVaccinatedFirstDoseByVaccinationDate%22%2C%22cum1stdose%22%3A%22cumPeopleVaccinatedFirstDoseByVaccinationDate%22%2C%22cum2nddose%22%3A%22cumPeopleVaccinatedSecondDoseByVaccinationDate%22%7D%7D\",\n false\n );\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(null);\n \n var jsonObject = JSON.parse(xhr.responseText);\n return jsonObject;\n }", "function getData (){\n var carData = JSON.parse(this.responseText).cars;\n carInfo(carData);\n }", "function getGlumacName() {\n var ruta = \"http://localhost:8080/glumci\";\n var httprequest = new XMLHttpRequest();\n\n httprequest.onreadystatechange = function() {\n if (httprequest.readyState == 4) {\n\n document.getElementById(\"content\").innerHTML = httprequest.responseType; \n\n var ourGlumacData = JSON.parse(httprequest.responseText);\n renderGlHTML(ourGlumacData);\n }\n }\n\n httprequest.open(\"GET\", ruta, true);\n httprequest.send();\n}", "function getAdventureFilmovi() {\n var ruta = \"http://localhost:8080/filmovi/search/adventure\";\n var httprequest = new XMLHttpRequest();\n\n httprequest.onreadystatechange = function() {\n if (httprequest.readyState == 4) {\n\n document.getElementById(\"content\").innerHTML = httprequest.responseType; \n\n var ourAdventureData = JSON.parse(httprequest.responseText);\n renderAdventureHTML(ourAdventureData);\n console.log(ourAdventureData);\n }\n }\n\n httprequest.open(\"GET\", ruta, true);\n httprequest.send();\n}", "function demoAjax() {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n currentArticle = \"article-button-demo\";\n demo = this.responseText;\n }\n };\n xhttp.open(\"GET\", \"/demo-speedreader\", true);\n xhttp.send();\n}", "function getActionFilmovi() {\n var ruta = \"http://localhost:8080/filmovi/search/action\";\n var httprequest = new XMLHttpRequest();\n\n httprequest.onreadystatechange = function() {\n if (httprequest.readyState == 4) {\n\n document.getElementById(\"content\").innerHTML = httprequest.responseType; \n\n var ourActionData = JSON.parse(httprequest.responseText);\n renderActionHTML(ourActionData);\n console.log(ourActionData);\n }\n }\n\n httprequest.open(\"GET\", ruta, true);\n httprequest.send();\n}", "function getData() {\n openWebEocSession();\n var data = new XMLHttpRequest();\n data.open('GET', baseURL + boardURL, true);\n data.onload = function () {\n if (this.status == 200) {\n let allData = JSON.parse(this.responseText);\n populateAllVariables(allData);\n }\n }\n data.send();\n\n\n}", "function loadData() \r\n{\r\n\tplay_load_gif()\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function() {\r\n\t//alert(\"ready state\");\r\n\t//alert(this.readyState);\r\n\t//alert(\"status\");\r\n\t//alert(this.status);\r\n if (this.readyState == 4 && this.status == 200) {\r\n\t /*document.getElementById(\"demo\").innerHTML =\r\n this.responseText;*/\r\n\t data = this.responseText;\r\n\t printData();\r\n }\r\n };\r\n xhttp.open(\"GET\", \"/kaam1\", true);\r\n xhttp.withCredentials = false;\r\n xhttp.send();\r\n}", "function xmlRequest(url, number) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.send();\n\n xhr.onreadystatechange = function() {\n if (this.readyState != 4) return;\n\n if (this.status != 200) {\n console.log('sth goes wrong')\n } else {\n var response = JSON.parse(xhr.response);\n\n switch(number) {\n case 1:\n document.getElementById('movie-name').innerText = response.title;\n xmlRequest('https://api.themoviedb.org/3/movie/' + movie_id + '/credits' + key, 2);\n break\n case 2:\n document.getElementById('team-size').innerText = response.crew.length;\n var person_id = (response.crew[0]).id;\n xmlRequest('https://api.themoviedb.org/3/person/' + person_id + key, 3);\n break\n case 3:\n document.getElementById('member-name').innerText = response.name;\n image_path = response.profile_path;\n document.getElementById('member-picture').src = 'https://image.tmdb.org/t/p/w600_and_h900_bestv2' + image_path + key;\n break\n default:\n console.log(response)\n\n }\n }\n }\n}", "function today_weather_api_open(){\r\n\r\n// Step 1 - Create a new Request\r\n var request = new XMLHttpRequest(); // Prep to make an HTTP request\r\n\r\n // Step 2 - Register a function with the Request\r\n request.onreadystatechange = function() {\r\n\r\n if( this.readyState == 4 && this.status == 200 ) {\r\n\r\n var response_json = JSON.parse(this.responseText);\r\n var temp_min = response_json.main.temp_min;\r\n var temp_max = response_json.main.temp_max;\r\n var humidity = response_json.main.humidity;\r\n var wind_speed = response_json.wind.speed;\r\n wind_speed = (wind_speed * 3.6).toFixed();\r\n temp_max = temp_max.toFixed();\r\n temp_min = temp_min.toFixed();\r\n\r\n document.getElementById(\"today_temp\").innerHTML = `${temp_min} - ${temp_max}°C \r\n `;\r\n document.getElementById(\"today_details\").innerHTML = `<span><i class='fas fa-wind'></i> ${wind_speed} km/h</span> <span><i class='fas fa-water'></i> ${humidity}%</span>\r\n `;\r\n\r\n } \r\n //End of if ready state\r\n }\r\n //End of onreadystate\r\n\r\n // Step 3\r\n // Specify method: GET for retrieval\r\n var url = `http://api.openweathermap.org/data/2.5/weather?lat=1.287953&lon=103.851784&appid=${apikey_open}&units=metric`;\r\n\r\n request.open(\"GET\", url, true);\r\n\r\n // console.log(url);\r\n\r\n // Step 4\r\n // calling the api\r\n request.send();\r\n}", "function getInvInfo() {\n //create new request\n var req = new XMLHttpRequest();\n if (!req) {\n throw \"Unable to create HttpRequest.\";\n }\n //url should be appropriate php reference\n var url = 'http://web.engr.oregonstate.edu/~weckwera/290/wk10/lab.php';\n req.onload = function () {\n if (this.readyState === 4) {\n console.log(this.status); //tell me that you're doing something\n console.log(this.responseText);//check out server response\n \n //var response = JSON.parse(this.responseText);\n var response = (this.responseText);\n \n //call function with results\n drawInvInfo(response);\n }\n }\n\n var args = \"getInvInfo=true\";\n \n req.open('POST', url);\n req.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n req.send(args);\n}", "function request(){\n\n var xhr = GethttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'json';\n xhr.onload = function() {\n var status = xhr.status;\n if (status == 200) {\n callback(status, xhr.response);\n } else {\n callback(status);\n }\n };\n xhr.send();\n }", "function carica(){\r\n var xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = gestisciResponse;\r\n xhttp.open(\"GET\",\"filmlist.json\",true);\r\n xhttp.send();\r\n}", "function getFactAjax2(){\r\n let year = yearInput.value;\r\n if(year != ''){\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', 'http://numbersapi.com/'+year+'/year');\r\n\r\n xhr.onload = function(){\r\n if(this.status == 200){\r\n fact2.style.display = 'block';\r\n factText2.innerText = this.responseText;\r\n }\r\n }\r\n\r\n xhr.send(); \r\n }\r\n }", "function getData() {\n let currentBreed = window.location.hash.substring(1);\n let req = new XMLHttpRequest (); //\n req.open(\"GET\", \"https://dog.ceo/api/breeds/list/all\");\n req.addEventListener(\"load\", parse);\n req.send();\n}", "function fetchDetails(search){\n \n console.log('called ')\n var xhrRequest =new XMLHttpRequest();\n xhrRequest.onload = function(){\n var responseJSON = JSON.parse(xhrRequest.response);\n\n if(responseJSON.response === 'error'){\n\n alert('Sorry your super Hero lost in space');\n }\n\n addToContainer(responseJSON);\n\n \n }\n xhrRequest.open('GET',`https://superheroapi.com/api/936106680158599/search/${search}`);\n \n xhrRequest.send();\n}", "function ajaxReq(method, url, callback) {\n var xhttp = new XMLHttpRequest();\n xhttp.open(method, url, true);\n xhttp.send();\n xhttp.onreadystatechange = function() {\n if (xhttp.readyState === 4 && xhttp.status === 200) {\n // console.log(JSON.parse(xhttp.responseText));\n callback(xhttp.responseText);\n }\n };\n}", "function xmlHttpRequest(parameter){\r\n xhr = new XMLHttpRequest();\r\n xhr.withCredentials = true;\r\n \r\n //store the parameter and made dynamic URL\r\n let argument = parameter; \r\n xhr.open(\"GET\", \"https://deezerdevs-deezer.p.rapidapi.com/search?q='\" + argument + \"'\");\r\n xhr.setRequestHeader(\"x-rapidapi-host\", \"deezerdevs-deezer.p.rapidapi.com\");\r\n xhr.setRequestHeader(\"x-rapidapi-key\", \"e4b18eca08msh4b189d0eddc1567p102bc4jsned4f75eac788\");\r\n xhr.send();\r\n //alert(\"send\");\r\n}", "function test() {\n\t\tconsole.log('salam');\n\t\tconst http = new XMLHttpRequest();\n\n\t\thttp.open(\n\t\t\t'GET',\n\t\t\t'https://online.agah.com/TradingView/history?symbol=IRO1BMLT0001-1&resolution=D&from=1251269918&to=1262753999&symbolType=%D8%B3%D9%87%D8%A7%D9%85',\n\t\t);\n\t\thttp.send();\n\n\t\thttp.onload = () => console.log(http.responseText);\n\t}", "function getJSONdata(url) {\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.open('GET', url);\n\t\trequest.onreadystatechange = function(){\n\t\t\tif((request.status==200) && (request.readyState==4)){\n\t\t\t\tconsole.log(request.responseText);\n\t\t\t}\n\t }\n \t\n\t request(send);\n }", "function testGetCharizard() {\n document.getElementById(\"httpRequest\").innerHTML = \"/Charizard\";\n fetch(baseURL + \"/Charizard\")\n .then(res => res.text())\n .then(res => {\n console.log(res);\n document.getElementById(\"httpResponse\").innerHTML = res;\n })\n}", "function ajaxGet(url) {\n // 03 : create XML Ajax request Object\n const ajaxReq = new XMLHttpRequest();\n console.log(\"const ajaxReq = new XMLHttpRequest();\");\n console.log(ajaxReq);\n // 04 : OPEN - type url / file - async true\n ajaxReq.open('GET', url, true);\n\n // 05 : Event listener \" onreadystatechange() \"\n // ajaxReq.onreadystatechange() = function () \n ajaxReq.onreadystatechange = function () {\n // 06\n console.log('\\n');\n console.log('\\'READYSTATE : \\', ajaxReq.readyState01');\n console.log('READYSTATE : ', ajaxReq.readyState);\n console.log('\\n');\n\n // 07 : condition if \n if (this.readyState === XMLHttpRequest.DONE && this.status >= 200 && this.status < 400) {\n console.log(\" if (this.readyState === XMLHttpRequest.DONE && this.status >= 200 && this.status < 400) \");\n console.log(\" this responseText \");\n console.log(this.responseText);\n\n // Appelle la fonction callback en lui passant la réponse de la requête\n //callback(req.responseText);\n\n // Exemple de transformation de données JSON\n // Transforme l'objet JSON en chaîne de caractères\n //var texteAvion = JSON.stringify(avion);\n //console.log(texteAvion);\n // Transforme la chaîne de caractères en objet JSON\n //console.log(JSON.parse(texteAvion));\n\n // Définit le contenu de la requête comme étant du JSON\n //ajaxReq.setRequestHeader(\"Content-Type\", \"application/json\");\n // Transforme la donnée du format JSON vers le format texte avant l'envoi\n //data = JSON.stringify(data);\n\n // Transforme la réponse en tableau d'objets JSON\n var productsCams = JSON.parse(this.responseText);\n\n // 10 : Inserer données JSON dans DOM HTML\n let outputApp = '',\n outProduit = '',\n outFull = '';\n\n console.log(\"productsCams\");\n console.log(productsCams);\n\n outputApp += productsCams;\n // Ajout du contenu de données json dans la div id = \"app\"\n divApp.innerHTML = outputApp;\n\n // Affiche le titre de chaque film\n productsCams.forEach(function (product) {\n console.log(product.name);\n\n let tableauPanier = [];\n let cameraPanier = {\n id: product._id,\n nom: product.name,\n prix: product.price,\n image: product.imageUrl,\n }\n console.log(cameraPanier );\n tableauPanier.push(cameraPanier );\n console.log(tableauPanier);\n outputApp += '<ul>' + product.Object + '</ul><hr>';\n\n outputApp+= tableauPanier;\n\n outProduit += '<ul>' +\n '<li>ID : ' + product._id + '</li>' +\n '<li>Name : ' + product.name + '</li>' +\n '<li>Description : ' + product.description + '</li>' +\n '<li>Image : ' + product.imageUrl + '</li>' +\n '<li>Price : ' + product.price + '</li>' +\n '<li>Lenses : ' + product.lenses + '</li>' +\n '</ul>';\n\n outFull += '<br><ul>' +\n '<li>ID : ' + product._id + '</li>' +\n '<li>Name : ' + product.name + '</li>' +\n '<li>Description : ' + product.description + '</li>' +\n '<li>Image : ' + '<img src=\"' + product.imageUrl + '\" width=\"200\" height=\"100\">' +'</li>' +\n '<li>Price : ' + product.price/100 + ' €</li>' +\n '<li>Lenses : ' + product.lenses + '</li>' +\n '<a href=\"\\produit.html?id=' + product._id + '\\\">Voir l\\'article</a>' +\n '</ul>';\n //<a href=\"produit.html?id= + product._id + \">Voir l'article</a>\n })\n divApp.innerHTML = outputApp;\n divProductName.innerHTML = outProduit;\n divProductFull.innerHTML = outFull;\n } else {\n console.error(ajaxReq.status + \" \" + ajaxReq.statusText + \" \" + url);\n }\n }\n // 08 : Event listener \" error \"\n ajaxReq.addEventListener(\"error\", function () {\n console.error(\"Erreur réseau avec l'URL \" + url);\n });\n\n // 10 : Sends Request\n ajaxReq.send();\n}", "function getComedyFilmovi() {\n var ruta = \"http://localhost:8080/filmovi/search/comedy\";\n var httprequest = new XMLHttpRequest();\n\n httprequest.onreadystatechange = function() {\n if (httprequest.readyState == 4) {\n\n document.getElementById(\"content\").innerHTML = httprequest.responseType; \n\n var ourComedyData = JSON.parse(httprequest.responseText);\n renderComedyHTML(ourComedyData);\n console.log(ourComedyData);\n }\n }\n\n httprequest.open(\"GET\", ruta, true);\n httprequest.send();\n}", "function movieData() {\n var request = require('request');\n request('http://www.omdbapi.com/?apikey=Trilogy&t='+ name , function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n\n console.log(\"\\nTitle of the movie: \" + JSON.parse(body).Title);\n console.log(\"Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating of the movie: \" + JSON.parse(body).imdbRating);\n console.log(\"Country where the movie was produced: \" + JSON.parse(body).Country);\n console.log(\"Language of the movie: \" + JSON.parse(body).Language);\n console.log(\"Plot of the movie: \" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL + \"\\n\");\n \n }\n\n }); \n}", "function fetch_info(getinfo){\n \n\t\n\tvar xmlhttp = new XMLHttpRequest();\n\tvar url=getinfo.url;\n\t\n\txmlhttp.onreadystatechange = function() {\n\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\t\t\t\n\t\t\t\n\t\t\tvar data = JSON.parse(xmlhttp.responseText);\n\t\t\t\n\t\t\tswitch(getinfo.action){\n\t\t\t\tcase \"liveweather\":\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tprocessWeather(data);\n\t\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t //kept switch for future expansion\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t};\n\txmlhttp.open(\"POST\", url, true);\n\txmlhttp.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\txmlhttp.send(getinfo.data);\n}", "function getMoviesWithXHR(apiUrl, callback) {\n const request = new XMLHttpRequest();\n\n request.open('GET', apiUrl);\n request.send();\n\n request.addEventListener('readystatechange', () => {\n if(request.readyState === 4 && request.status === 200) {\n callback(undefined, request.responseText);\n }\n if(request.readyState === 4 && request.status !== 200) {\n callback(`Something went wrong and status is: ${request.status}`, undefined);\n }\n\n });\n\n\n}", "function getWeather() {\r\n document.getElementById(\"weatherReport\").addEventListener(\"click\", function (event) {\r\n var request = new XMLHttpRequest();\r\n // builds parameters being sent to the API\r\n var city = document.getElementById(\"city\").value;\r\n var zipCode = document.getElementById(\"zip\").value;\r\n var countryCode = document.getElementById(\"country\").value;\r\n var payload;\r\n // adjusts the URL parameters sent to the API if the user inputs a City, else it uses the zipCode variabel in the URL parameters\r\n if (city) {\r\n payload = \"http://api.openweathermap.org/data/2.5/weather?q=\" + city + \",\" + countryCode + \"&appid=\" + appid + \"&units=imperial\";\r\n console.log(payload)\r\n } else {\r\n payload = \"http://api.openweathermap.org/data/2.5/weather?zip=\" + zipCode + \",\" + countryCode + \"&appid=\" + appid + \"&units=imperial\";\r\n console.log(payload)\r\n }\r\n\r\n request.open(\"GET\", payload, true);\r\n request.addEventListener(\"load\", function () {\r\n if (request.status >= 200 && request.status < 400) {\r\n var response = JSON.parse(request.responseText);\r\n document.getElementById(\"weatherDisplay\").textContent = \"It is \" + response.main.temp + \" degrees in \" + response.name;\r\n } else {\r\n console.log(\"error: \" + request.statusText);\r\n }\r\n });\r\n request.send();\r\n event.preventDefault();\r\n })\r\n}", "function makeCorsRequest() {\n var url =\n \"https://api.edamam.com/api/nutrition-details?app_id=\" +\n app_id +\n \"&app_key=\" +\n app_key;\n var xhr = createCORSRequest(\"POST\", url);\n if (!xhr) {\n alert(\"CORS not supported\");\n return;\n }\n // Response handlers.\n xhr.onload = function() {\n console.log(JSON.parse(xhr.responseText));\n var response = JSON.parse(xhr.responseText);\n\n if (response.totalNutrients !== undefined) {\n protein = printNutrients(\n response.totalNutrients,\n \"PROCNT\",\n \"protein\",\n \" g\"\n );\n carbs = printNutrients(\n response.totalNutrients,\n \"CHOCDF\",\n \"carb\",\n \" g\"\n );\n fat = printNutrients(response.totalNutrients, \"FAT\", \"fat\", \" g\");\n printNutrients(response.totalNutrients, \"FASAT\", \"satfat\", \" g\");\n printNutrients(response.totalNutrients, \"ENERC_KCAL\", \"cal\", \"\");\n printNutrients(response.totalNutrients, \"CHOLE\", \"chol\", \" mg\");\n printNutrients(response.totalNutrients, \"NA\", \"sodium\", \" mg\");\n printNutrients(response.totalNutrients, \"FIBTG\", \"fiber\", \" g\");\n printNutrients(response.totalNutrients, \"SUGAR\", \"sugar\", \" g\");\n makeChart();\n } else {\n infoNotAvailable();\n }\n };\n\n xhr.onerror = function() {\n alert(\"Woops, there was an error making the request.\");\n };\n\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(JSON.stringify(recipe));\n }", "function getPlayerData() {\n\n var request = new XMLHttpRequest();\n\n request.open(\"GET\", \"https://api.spotify.com/v1/me/player/devices/\", true);\n request.setRequestHeader(\"Authorization\", \"Bearer \" + fullAccessToken);\n request.onload = function () {\n var data = JSON.parse(this.response);\n if (request.status >= 200 && request.status < 400) {\n console.log(data);\n writePlayerData(data);\n } else {\n alert('An error occurred while getting player data.');\n }\n }\n request.send();\n}", "function obtemInfos() {\r\n let xhr = new XMLHttpRequest();\r\n xhr.open('GET', 'https://servergerenciamento.herokuapp.com/videos');\r\n xhr.onload = exibeVideos;\r\n xhr.send();\r\n}", "function makeAPICall()\n{\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() { \n if (4 == xhr.readyState && 200 == xhr.status) {\n handleAPICall(xhr.responseText);\n }\n }\n xhr.open(\"GET\", \"https://api.torn.com/user/1643506?selections=&key=SFfDBKRg\", true); \n xhr.send(null);\n}", "function getReq() {\n\txmlhttp=GetXmlHttpObject();\n\n if (xmlhttp==null){\n \t\talert (\"Your browser does not support Ajax HTTP\");\n \t\treturn;\n \t}\n var url = \"/gmplaces/getdata\";\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.onreadystatechange = function() {\n \t\tif (xmlhttp.readyState == 4) {\n \t\tif(xmlhttp.status == 200) {\n \t\t\tparseRequest();\n \t}\n \t\t}\n\t};\n xmlhttp.send(null);\n}", "function recommendation_api(category) {\r\n\r\n // Calling the API to retrieve top 5 from each categories \r\n // Step 1 - Create a new Request\r\n var request = new XMLHttpRequest(); // Prep to make an HTTP request\r\n\r\n // Step 2 - Register a function with the Request\r\n request.onreadystatechange = function() {\r\n\r\n if( this.readyState == 4 && this.status == 200 ) {\r\n\r\n // convert response into json and get stars record\r\n var response_json = JSON.parse(this.responseText);\r\n var attraction_array = response_json.data.results;\r\n\r\n // console.log(category);\r\n // console.log(attraction_array);\r\n card_carousel(attraction_array, category); \r\n\r\n }\r\n }\r\n\r\n // Step 3\r\n // Specify method: GET for retrieval\r\n\r\n var url = `https://tih-api.stb.gov.sg/content/v1/search/all?dataset=${category}&sortBy=rating&sortOrder=DESC&language=en&apikey=${apikey}`;\r\n\r\n request.open(\"GET\", url, true);\r\n\r\n // console.log(url);\r\n\r\n // Step 4\r\n // calling the api\r\n request.send(); \r\n\r\n}", "function makeCorsRequest() {\n var url =\n \"https://api.edamam.com/api/nutrition-details?app_id=\" +\n app_id +\n \"&app_key=\" +\n app_key;\n var xhr = createCORSRequest(\"POST\", url);\n if (!xhr) {\n alert(\"CORS not supported\");\n return;\n }\n // Response handlers.\n xhr.onload = function() {\n console.log(JSON.parse(xhr.responseText));\n var response = JSON.parse(xhr.responseText);\n console.log(response.totalNutrients);\n if (response.totalNutrients !== undefined) {\n protein = printNutrients(\n response.totalNutrients,\n \"PROCNT\",\n \"protein\",\n \" g\"\n );\n carbs = printNutrients(\n response.totalNutrients,\n \"CHOCDF\",\n \"carb\",\n \" g\"\n );\n fat = printNutrients(response.totalNutrients, \"FAT\", \"fat\", \" g\");\n printNutrients(response.totalNutrients, \"FASAT\", \"satfat\", \" g\");\n printNutrients(response.totalNutrients, \"ENERC_KCAL\", \"cal\", \"\");\n printNutrients(response.totalNutrients, \"CHOLE\", \"chol\", \" mg\");\n printNutrients(response.totalNutrients, \"NA\", \"sodium\", \" mg\");\n printNutrients(response.totalNutrients, \"FIBTG\", \"fiber\", \" g\");\n printNutrients(response.totalNutrients, \"SUGAR\", \"sugar\", \" g\");\n makeChart();\n } else {\n infoNotAvailable();\n }\n };\n\n xhr.onerror = function() {\n alert(\"Woops, there was an error making the request.\");\n };\n\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(JSON.stringify(recipe));\n }", "function getData() \n{\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function ()\n {\n if (this.readyState == 4 && this.status == 200)\n {\n // creates a new Data() object from picalc.js\n window.data = new Data(JSON.parse (this.responseText));\n\n // this is essentially the view logic; it builds the HTML\n setup();\n }\n };\n\n xmlhttp.open(\"GET\", \"https://tspi.io/factory-planet/planetary_commodities.json\", true);\n xmlhttp.send();\n}", "function ajaxCall() {\n\n // here is where we open up the XMLHttpRequest Object to fetch data from a server (or post)\n let idNum = pokeId.value;\n\n // 1 attain XMLHttpRequest Object to send the request\n let xhr = new XMLHttpRequest();\n\n\n /**\n * 0. UNSENT: open() method has not been called \n * 1. OPENED: open() method has been called\n * 2. HEADERS_REQUEST: send() method has been called and the ehaders + status code of the HTTP response are available\n * 3. LOADING: downloading the full response from the server\n * 4. DONE: entire operation is complete and now we have a server response.\n */\n xhr.onreadystatechange = function () {\n\n // check that the ready state is 4 and that the status code is 200\n if (this.readyState == 4 && this.status == 200) {\n\n // if it is, grab the data and PARSE it from a string to an object\n let receivedPokemon = JSON.parse(xhr.responseText);\n\n console.log(receivedPokemon);\n // call the render HTML method and render the received JSON\n renderHTML(receivedPokemon);\n }\n }\n\n xhr.open(\"GET\", `https://pokeapi.co/api/v2/pokemon/${idNum}`)\n\n xhr.send();\n}", "function makeCorsRequest() {\n var url =\n \"https://api.edamam.com/api/nutrition-details?app_id=\" +\n app_id +\n \"&app_key=\" +\n app_key;\n var xhr = createCORSRequest(\"POST\", url);\n if (!xhr) {\n alert(\"CORS not supported\");\n return;\n }\n // Response handlers.\n xhr.onload = function() {\n console.log(JSON.parse(xhr.responseText));\n var response = JSON.parse(xhr.responseText);\n\n if (response.totalNutrients !== undefined) {\n protein = printNutrients(\n response.totalNutrients,\n \"PROCNT\",\n \"protein\",\n \" g\"\n );\n carbs = printNutrients(\n response.totalNutrients,\n \"CHOCDF\",\n \"carb\",\n \" g\"\n );\n fat = printNutrients(response.totalNutrients, \"FAT\", \"fat\", \" g\");\n printNutrients(response.totalNutrients, \"FASAT\", \"satfat\", \" g\");\n printNutrients(response.totalNutrients, \"ENERC_KCAL\", \"cal\", \"\");\n printNutrients(response.totalNutrients, \"CHOLE\", \"chol\", \" mg\");\n printNutrients(response.totalNutrients, \"NA\", \"sodium\", \" mg\");\n printNutrients(response.totalNutrients, \"FIBTG\", \"fiber\", \" g\");\n printNutrients(response.totalNutrients, \"SUGAR\", \"sugar\", \" g\");\n makeChart();\n } else {\n infoNotAvailable();\n }\n };\n\n xhr.onerror = function() {\n alert(\"Woops, there was an error making the request.\");\n };\n\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send(JSON.stringify(recipe));\n }", "function getObservation(requestData)\n{\n var url = requestData;\n console.log(\"HEREEEE\");\n console.log(requestData);\n var options = {\n uri: url,\n method: 'GET',\n headers:{\n 'Authorization': 'Basic ' + new Buffer(\"admin:Uclactive15\").toString('base64')\n } \n };\n\n request(options, function (error, response, body) {\n if (!error && (response.statusCode == 200 || response.statusCode == 201)) {\n console.log(body) // Print the shortened url.\n } else {\n console.log(\"error: \" + error)\n console.log(\"response.statusCode: \" + response.statusCode)\n console.log(\"response.statusText: \" + response.statusText)\n }\n });\n}", "function sendApiRequest() {\n let response = fetch(\"https://api.giphy.com/v1/gifs/search?api_key=YOUR_API_KEY&q=Pandas&limit=25&offset=0&rating=G&lang=en\");\n console.log(response);\n}", "function moviethis(movie_name) {\n request(\"http://www.omdbapi.com/?t=\" + movie_name + \"&y=&plot=short&apikey=trilogy\", function (error, response, body, Title) {\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n\n console.log(\"*Title of the movie: \" + JSON.parse(body).Title);\n console.log(\"* Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"* Country produced:\" + JSON.parse(body).Country);\n console.log(\"* Language of the movie:\" + JSON.parse(body).Language);\n console.log(\"* Plot of the movie:\" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(\"* IMDB Rating of the movie: \" + JSON.parse(body).imdbRating);\n }\n });\n} // end of movie function----------------------", "function OMDBrequest(){\n request(\"https://www.omdbapi.com/?t=\" + fetch + \"&y=&plot=short&apikey=trilogy\", function(error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(\"The title of the movie is: \" + JSON.parse(body).Title);\n console.log(\"The year the movie was released is: \" + JSON.parse(body).Released);\n console.log(\"The movie's IMDB rating is: \" + JSON.parse(body).imdbRating);\n console.log(\"The Rotten Tomatoes rating of the movie is: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"The movie was produced in: \" + JSON.parse(body).Country);\n console.log(\"The language of the movie is: \" + JSON.parse(body).Language);\n console.log(\"The actors in the movie are: \" + JSON.parse(body).Actors);\n console.log(\"The plot of the movie is: \" + JSON.parse(body).Plot);\n }\n else {\n console.log(\"Uh-oh! An error has occured! Please try again later.\");\n }\n })\n}", "function getData() {\n if (xhr) {\n if (xhr.readyState == 4 && xhr.status == 200) {\n console.log(xhr.responseText);\n // return;\n var data = JSON.parse(xhr.responseText);\n if (data.status == 1)\n switch (data.action) {\n case \"get_banner\":\n data.links.forEach(element => set_link(element));\n break;\n }\n }\n }\n }", "function parseGenre () {\n console.log(\"parseGenre: \");\n const userkey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6ImNvb3BlckBtcG9pbnRpbmMuY29tIiwiaWQiOjM5Nywib3JnX2lkIjozMzEsIm9yZ19yb2xlIjoxfQ._M233oOb-MuhaXGAnLGow95r0Ap6YHZ2stt7Nxlxn9M';\n var domainString = window.location.href;\n console.log(\"parseGenre - domainString: \", domainString );\n\n var xhttp1 = new XMLHttpRequest()\n xhttp1.onreadystatechange = function(){\n if ( this.readyState == 4 && this.status == 200 ) {\n console.log(\"parseGenre response: \", this.responseText )\n return this.resonseText \n }\n }//end xttp call\n\n xhttp1.open(\"GET\", \"https://api.frase.io/api/v1/analysis_for_url?url=\"+domainString+\"&fields=genre\", true)\n xhttp1.setRequestHeader('key', userkey );\n xhttp1.send();\n\n}//end parseGenre", "function getObservation(requestData)\n{\n var url = requestData;\n console.log(\"HEREEEE\");\n console.log(requestData);\n var options = {\n uri: url,\n method: 'GET',\n headers:{\n 'Authorization': 'Basic ' + new Buffer(\"nodejs:[]Uclactive15\").toString('base64')\n } \n };\n\n request(options, function (error, response, body) {\n if (!error && (response.statusCode == 200 || response.statusCode == 201)) {\n console.log(body) // Print the shortened url.\n } else {\n console.log(\"error: \" + error)\n console.log(\"response.statusCode: \" + response.statusCode)\n console.log(\"response.statusText: \" + response.statusText)\n }\n });\n}", "function movieThis(){\n\tif (movie === undefined) {\n\tmovie = 'Mr.Nobody';\n\t};\n\tvar url = 'http://www.omdbapi.com/?t=' + movie +'&y=&plot=long&tomatoes=true&r=json';\n\trequest(url, function(error, body, data){\n \t\tif (error){\n \t\t\tconsole.log(\"Request has returned an error. Please try again.\")\n \t\t}\n \tvar response = JSON.parse(data);\n\t\tconsole.log(\"******************************\")\n\t\tconsole.log(\"Movie title: \" + response.Title);\n\t\tconsole.log(\"Release Year: \" + response.Year);\n\t\tconsole.log(\"IMDB Rating: \" + response.imdbRating);\n\t\tconsole.log(\"Country where filmed: \" + response.Country);\n\t\tconsole.log(\"Language: \" + response.Language);\n\t\tconsole.log(\"Movie Plot: \" + response.Plot);\n\t\tconsole.log(\"Actors: \" + response.Actors);\n\t\tconsole.log(\"Rotten Tomatoes URL: \" + response.tomatoURL);\n\t\tconsole.log(\"******************************\")\n\t});\n}", "function getStockData(symbol){\n\n //1. Create an XMLHttpRequest object (request object)\n const xhr = new XMLHttpRequest();\n //2.Define event listener\n xhr.onreadystatechange = function response(){\n if (xhr.readyState==4){\n if (xhr.status==200){\n //store response text to local storage to generate all tables\n insertRefreshTime();\n var responseText = xhr.responseText;\n localStorage.setItem(\"searchResult\",responseText);\n console.log(symbol + \"set in search result\");\n \n //print response text to console for troubleshooting\n console.log(\"Showing response text:\");\n console.log(xhr.responseText); \n\n //display results for user\n displayResults();\n \n if(xhr.status==404){\n console.log(\"File or resource not found\");\n }\n }\n }\n };\n //3.trim whitespace and carriage returns from user input\n //var symbol = document.getElementById(\"userInput\").value.trim().replace(/[\\n\\r]/g, '');\n //4.add trimmed output variable 'symbol' in url and send request\n url = \"https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=\"\n +symbol+\"&apikey=QTC0C7W8VC9B36VW\";\n //5.prepare request\n xhr.open('get',url,true);\n //6.send request\n xhr.send();\n //alternate api key: QTC0C7W8VC9B36VW\n //original api key:TXLZQ0VXP5QUYSXN\n}", "function getData(url){\r\n let xhr = new XMLHttpRequest();\r\n xhr.onload = dataLoaded;\r\n xhr.onerror = dataError;\r\n xhr.open(\"GET\",url);\r\n xhr.send();\r\n}", "function requestRoom() {\n get_backend(\"MainRoom\");\n var xhttp_room = new XMLHttpRequest();\n xhttp_room.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n room_list = JSON.parse(xhttp_room.responseText);\n client.subscribe(\"/temperature/MainRoom\");\n currentRoom = room_list.indexOf(\"MainRoom\");\n\n\n }\n };\n xhttp_room.open(\"GET\", \"http://localhost:8080/setting/room/list\", true);\n xhttp_room.send();\n}", "characterList() {\n var charSearch = this.state.charSearch;\n var url = `https://gateway.marvel.com/v1/public/characters?nameStartsWith=${charSearch}&limit=50&ts=1&apikey=24b734a9df515f87bbe1bac66f8dbd5c&hash=a4374486b969b3e7b91f44c63fe5a64d`;\n return $.ajax({\n url: url,\n method: \"GET\",\n success: data => {\n const newAddress = `${data.attributionHTML.slice(\n 0,\n 27\n )} target=\"_blank\"${data.attributionHTML.slice(27)}`;\n\n this.setState({\n characters: data.data.results,\n // credit: data.attributionHTML\n credit: newAddress\n });\n }\n });\n }", "function loadLE() {\r\n\r\n var myRequest1 = new XMLHttpRequest();\r\n myRequest1.open(\"GET\", \"http://api.population.io:80/1.0/life-expectancy/total/\" + gender + \"/\" + country + \"/\" + dob + \"/\", true);\r\n \r\n\r\n myRequest1.onload = function () {\r\n\r\n if (myRequest1.readyState == 4 && myRequest1.status == 200) {\r\n\r\n var lifeExp = JSON.parse(myRequest1.responseText);\r\n console.log(lifeExp);\r\n le = Math.floor(lifeExp.total_life_expectancy);\r\n var result = document.getElementById(\"result\");\r\n result.innerHTML = \"You have a life expectancy of \" + le + \" years.\";\r\n modal.style.display = 'block';\r\n \r\n \r\n\r\n }\r\n\r\n isGender();\r\n isDate();\r\n loadPop();\r\n };\r\n\r\n myRequest1.send();\r\n\r\n}", "function makeCorsRequest() {\n console.log(\"here\");\n let app_id = \"09c4ffa3\";\n let app_key = \"e0753762f0aeccf2a8ac436055088771\";\n\n /*let recipe = document.getElementById('recipe').value;*/\n let recipe = getJson();\n let loadingIndicator = document.getElementById('loading');\n\n var url = 'https://api.edamam.com/api/nutrition-details?app_id=' + app_id + '&app_key=' + app_key;\n\n var xhr = createCORSRequest('POST', url);\n if (!xhr) {\n alert('CORS not supported');\n return;\n }\n\n // Response handlers.\n xhr.onload = function() {\n var nutritionData = xhr.response;\n //pre.innerHTML = text;\n console.log(nutritionData);\n fillNutritionTable(nutritionData);\n };\n\n xhr.onerror = function() {\n alert('Woops, there was an error making the request.');\n };\n\n loadingIndicator.innerHTML = 'Loading...';\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.responseType = 'json';\n xhr.send(recipe);\n loadingIndicator.innerHTML = '';\n}", "function getAPIKeyRequest() {\n console.log(\"MarvelAPIURL \", marvelApiURL().marvelApiKey);\n return $.ajax ({\n url: marvelApiURL().marvelApiKey,\n method: \"GET\"\n }).done((marvelData) => {\n return marvelData;\n });\n}", "function getWeatherData(lat, long) {\r\n var key = \"1234f59e5798e86cc9241a1ff070cd36\";\r\n var req1 = new XMLHttpRequest();\r\n req1.open(\r\n \"GET\",\r\n `http://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${long}&appid=${key}`,\r\n true\r\n );\r\n req1.send();\r\n req1.onload = function () {\r\n var result = JSON.parse(this.response);\r\n console.log(result);\r\n };\r\n}", "function getMovie() {\n\n var movie = \"Pacific Rim\"\n\n request(\"https://www.omdbapi.com/?apikey=\"+ process.env.OMDB_API_KEY +\"&t=\" + value, function (error, response, body) {\n if(error){\n console.log(error)\n }\n\n console.log(JSON.parse(body)['Title'])\n console.log(JSON.parse(body).Title)\n \n });\n}", "function info_metal()\n{\n\t$.ajax({\n\turl : 'http://163.5.245.219:3000/api/1/metalmines',\n\txhrFields: { withCredentials: true },\n\ttype : 'GET',\n\tdata : {\"username\": \"[email protected]\",\n\t\t\t\"password\": \"TaZY8rg3\"},\n\tdataType : \"json\",\n\tsuccess : function(data){\n\t\t\t$($('p', '#lvl')[0]).text(\"Lvl \" + data['level']);\n\t\t\t$($('p', '#ressources')[0]).text(\"Production \" + data['production']);\n\t\t\t$($('p', '#ressources')[1]).text(\"Reserves \" + data['amount']);\n\t\t\t$($('p', '#infoMine')[0]).text(\"Next Lvl: Metal=> \" + data.costNext.metal);\n\t\t\t$($('p', '#infoMine')[1]).text(\"Next Lvl: Crystal=> \" + data.costNext.crystal);}\n\t\t\t})\n}", "_getWordFromAPI(obj){\n //test:\n // word = \"Harry Potter potter\";\n\n const http = new XMLHttpRequest();\n const url = urlprefix;\n http.open(\"GET\",url);\n http.send();\n \n http.onreadystatechange = function(){\n if(this.readyState == 4 && this.status ==200){\n var j = JSON.parse(http.responseText)\n var characterId = Math.floor(Math.random() * j.length); //random charactor id generating\n\n obj._word = j[characterId].name.toLowerCase();\n obj._imgLink = j[characterId].image;\n \n for (let i = 0; i<obj._word.length;i++){\n if (obj._word[i] !== \" \"){\n obj._wordLetter.push(false);\n }else{\n obj._wordLetter.push(true);\n }\n }\n obj.gameReady = true;\n console.log(\"the charachtoer you are trying to guess is: \"+obj._word);\n obj.updateUI();\n }else if(this.status !== 200){\n alert(\"Sorry, API isn't working! Try again later!\");\n }else{\n //log status;\n }\n }\n\n }", "function ajaxRequest() {\n\n var data = {};\n var request = new XMLHttpRequest();\n request.open('GET', 'http://localhost/Redcraft/php/index.php', true);\n request.onload = function () {\n if (request.status >= 200 && request.status < 400) {\n console.log(\"succes\");\n data = JSON.parse(request.responseText);\n\n processData(data);\n\n } else {\n console.log(\"We reached our target server, but it returned an error\")\n }\n };\n request.onerror = function () {\n console.log(\"There was a connection error of some sort\");\n };\n request.send();\n\n}", "function getMovieInfo(movie) {\n // If no movie is provided, get the deets for Mr. Nobody\n if (movie === \"\") {\n movie = \"Mr. Nobody\";\n }\n // Variable to hold the query URL\n let queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\";\n // API request\n request(queryURL, function (error, response, body) {\n let movieResponse = JSON.parse(body);\n if (error || movieResponse.Response == \"False\") {\n console.log(\"Something went wrong. Try again?\", error);\n }\n else {\n let arrLog = [];\n arrLog.push(\"Title: \" + movieResponse.Title);\n arrLog.push(\"Year: \" + movieResponse.Year);\n arrLog.push(\"IMDB Rating: \" + movieResponse.Ratings[0].Value);\n arrLog.push(\"Rotten Tomatoes Rating: \" + movieResponse.Ratings[1].Value);\n arrLog.push(\"Produced in: \" + movieResponse.Country);\n arrLog.push(\"Language: \" + movieResponse.Language);\n arrLog.push(\"Plot: \" + movieResponse.Plot);\n arrLog.push(\"Actors: \" + movieResponse.Actors);\n arrLog.push(logSeparator);\n logAndStoreResults(arrLog);\n }\n });\n}", "function getPiHoleStatus(){\r\n getStorage(); //get the API key from local storage\r\n\r\n var httpResponse = new XMLHttpRequest(); //make a new request object\r\n httpResponse.addEventListener(\"load\", setStatus); //add listener to the load\r\n httpResponse.addEventListener(\"error\", statusError); //add listener to error\r\n httpResponse.open(\"GET\", \"http://pi.hole/admin/api.php?\"); //set up get\r\n httpResponse.send(); //send it to the server\r\n}", "function getMileage()\n{\n\tvar xmlhttp = new XMLHttpRequest();\n\n\t// Link to C++ file\n\tvar url = \"http://157.201.194.254/cgi-bin/ercanbracks/mileage/mileageAjaxXML\";\n\n\t// Use this to build our GET query.\n\tvar query = \"\";\n\n\t// Get the values from the form.\n\tvar startCity = $(\"#startCity\")[0].value;\n\tvar startState = $(\"#startState\")[0].value;\n\tvar endCity = $(\"#endCity\")[0].value;\n\tvar endState = $(\"#endState\")[0].value;\n\n\t// Build Query.\n\tquery += \"?startCity=\" + startCity + \"&startState=\" + startState + \"&endCity=\" + endCity + \"&endState=\" + endState;\n\t\n\txmlhttp.onreadystatechange = function()\n\t{\n\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200)\n\t\t{\n\t\t\t// Get data back as XML\n\t\t\tvar xmlDoc = xmlhttp.responseXML;\n\n\t\t\t// Get values for each variable.\n\t\t\tvar startCityV = getXmlData(xmlDoc, \"startcity\", false);\n\t\t\tvar startStateV = getXmlData(xmlDoc, \"startstate\", false);\n\t\t\tvar endCityV = getXmlData(xmlDoc, \"endcity\", false);\n\t\t\tvar endStateV = getXmlData(xmlDoc, \"endstate\", false);\n\t\t\tvar milesV = getXmlData(xmlDoc, \"miles\", false);\n\t\t\tvar modesV = getXmlData(xmlDoc, \"tmode\", true);\n\n\t\t\t// Display the data.\n\t\t\tdisplayData(startCityV, startStateV, endCityV, endStateV, milesV, modesV);\n\t\t}\n\t}\n\n\txmlhttp.open(\"GET\", url + query, true);\n\txmlhttp.send();\n}", "function sendRequest(url) {\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n var data = JSON.parse(xmlhttp.responseText);\n var weather = {};\n weather.townName = data.name;\n weather.temperature = Math.round(data.main.temp - 273.15);\n \n update(weather);\n }\n };\n xmlhttp.open(\"GET\", url, true);\n xmlhttp.send();\n}", "function updateLecturers(){\n let url = window.location.href.split(\"/pages\")[0] + \"/getLecturers\";\n\n // make request\n let lecturersRequest = new XMLHttpRequest();\n lecturersRequest.open(\"GET\", url, true);\n lecturersRequest.setRequestHeader(\"Content-Type\", \"application/json\");\n \n lecturersRequest.onload = function () { \n let lecturer = JSON.parse(lecturersRequest.responseText).data;\n \n fillLecturers(lecturer);\n };\n\n lecturersRequest.onerror = function () {\n alert(\"something went wrong\");\n };\n\n lecturersRequest.send();\n}", "function request(method,url,params,callbackSuccess,callbackError) {\n httpRequest = new XMLHttpRequest();\n httpRequest.onreadystatechange = function() {\n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n callbackSuccess(JSON.parse(httpRequest.responseText));\n } else {\n callbackError(httpRequest);\n }\n }\n };\n httpRequest.open(method,'https://api.trello.com/1' + url + (url.includes('?') ? '&' : '?') + 'key=45cb99fb34a85706e8d9a5ea9bcf8571&token='+window._gtToken);\n httpRequest.send();\n}", "function getData(){\n// new request\nvar req = new XMLHttpRequest();\n\n// open request with zendesk account name\nreq.open(\"GET\", \"https://gabruapparel.zendesk.com/api/v2/tickets.json\", false);\n\n//basic authorisation with username and password\n\nreq.setRequestHeader(\"Authorization\", \"Basic \" + new Buffer('[email protected]:test123').toString('base64'));\nreq.send();\t\n\n/* debugging code when connecting to API\nconsole.log(req.status);\nconsole.log(req.statusText);\n*/\nstatus=req.status\n\n\n// stored requested data\nif(status!=0 && status!=404 && status!=401){\n\ttickData = JSON.parse(req.responseText);\n}\n/*debug code, testing whether API was getting all tickets.\nfor(var i=0;i<tickData.tickets.length){\n\tconsole.log(tickData.tickets.id[i]);\n}\n\n*/\n}", "function fetchData(url_api, callback){\n\n let xhttp = new XMLHttpRequest();//Generamos referencia al objeto que necesito(en este caso xmlht...)\n xhttp.open('GET', url_api, true);//Hacer llamados a una url.\n //Obtener info, url de la data, activar el asincronismo(por defecto es true)\n xhttp.onreadystatechange = function(e){//Escuchar sobre la conexion y llamar\n //una funcion cuando ha cambiado el estado. //Mas info https://www.w3schools.com/xml/ajax_xmlhttprequest_response.asp\n if(xhttp.readyState === 4){//Validacion sobre que se encuentra la conexion\n //4 significa ha sido completado\n if(xhttp.status === 200){//Validar el estado en que llego ej: 200 ha sido completada correctamente\n callback(null, JSON.parse(xhttp.responseText))//Primer parametro error, info que se desencadena(el resultado de llamarla)\n //hago parse porque recibo una respuesta en texto y lo necesito tipo JSON\n //una notacion de objetos de JS.\n }else{\n\n const error = new Error('Error' + url_api);//Mostrar si sucede un error\n return callback(error, null);\n }\n }\n }\n xhttp.send();//Enviar la solicitud\n}", "function getCharacter() {\n const charName = document.querySelector('.char-name');\n const charGender = document.querySelector('.char-gender');\n const charBirth = document.querySelector('.char-birth');\n const charSkin = document.querySelector('.char-skin');\n\n axios({ url: `${baseURL}/people/${generateRandomNumber(1, 25)}` })\n .then(\n (res) => (\n (charName.innerText = res.data.name),\n (charGender.innerText = res.data.gender),\n (charBirth.innerText = res.data.birth_year),\n (charSkin.innerText = res.data.skin_color)\n )\n )\n .catch((err) => {\n catchNotFoundError();\n console.log(err);\n });\n}", "function readmode(){\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (xhr.readyState === 4) {\n var data = xhr.responseText;\n var obj=JSON.parse(data);\n var tr=obj[i].info;\n document.getElementById('modality').innerHTML = tr;\n console.log(data);\n }\n };\n xhr.open('GET', 'Readmode', true);\n xhr.send(null);\n}", "function locationCharityAPI(lat, lng) {\n // console.log('AUTO CHARITIY RUNNING')\n // console.log('Lat and Lng is: ' + lat + ', ' + lng)\n\n var API_KEY = \"aca9cc829aaa6b9d9b3fd4f972f5acf0\"; // Andrews Key //\n var queryURL = \"http://data.orghunter.com/v1/charitysearch?user_key=\" + API_KEY + \"&rows=10&latitude=\" + lat + \"&longitude=\" + lng;\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n // $(\"#categoryInput\").text(JSON.stringify(response));\n renderButtons(response.data);\n });\n // console.log(categoryInput.value)\n} // end of API //", "function loadCategories() {\r\n var request = new XMLHttpRequest();\r\n var url = \"http://localhost:8080/tradetunnel-api-0.0.1-SNAPSHOT/categorieses\";\r\n\r\n request.onreadystatechange = function () {\r\n if (this.readyState == 4) {\r\n var data = JSON.parse(this.responseText);\r\n populateCategory(data);\r\n catList = data;\r\n }\r\n };\r\n request.open(\"GET\", url, true);\r\n request.send();\r\n}", "function getFInfo() {\n var ajaxI = new XMLHttpRequest();\n let slcCity = document.getElementById('selectCiudad').value;\n let slcTipo = document.getElementById('selectTipo').value;\n let cityV = (slcCity == -1) ? \"?cityv=\" : \"?cityv=\" + slcCity;\n let tipoV = (slcTipo == -1) ? \"&typev=\" : \"&typev=\" + slcTipo;\n const urla = `${protocol}//${url}/pruebaBack/backend/Controller/bienes/get/` + cityV + tipoV;\n ajaxI.open('GET', urla, true);\n\n ajaxI.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n renderBf(this.responseText);\n } else if (this.readyState == 4 && this.status == 404) {\n console.log('error');\n }\n }\n //enviamos la peticion\n ajaxI.send();\n}", "function loadDoc() {\n const xhttp = new XMLHttpRequest();\n xhttp.onload = function () {\n myFunction(this);\n color();\n colorSup();\n colorCloth();\n //colorClass(updateClassModal.getAttribute(\"eventType\"));\n };\n xhttp.open(\n \"GET\",\n \"https://api.worldweatheronline.com/premium/v1/marine.ashx?key=1b1e6966b5b6408e95e150055210210&format=xml&q=32.017136,34.745441&lang=he\"\n );\n xhttp.send();\n}", "function _request(method, url, data, callback) {\n const xhr = new XMLHttpRequest();\n \n \n // console.log(\"Data in request file: \" + url);\n\n // no need to pass the data here\n // - json endpoint is passed into request function in index.js\n // const dataString = JSON.parse(data);\n\n\n\n xhr.onreadystatechange = function() {\n // wait until response is ready\n if (xhr.readyState === 4) {\n // 200 http status code\n if (xhr.status === 200) {\n // console.log(\"xhr response text\" + xhr.responseText);\n callback(null, JSON.parse(xhr.responseText));\n } else {\n callback(true);\n }\n }\n };\n\n // open the xhr request, set header, and send\n xhr.open(method, url);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.send();\n }", "function HTTP_Get(url) {\n\n console.log(\"Request \" + url);\n var XMLHttpRequest = xmlhttprequest.XMLHttpRequest;\n xhttp=new XMLHttpRequest();\n var requestOK=true\n xhttp.addEventListener(\"error\", function transferFailed(evt) {\n console.error(\"Unable to process request\");\n console.error(xhttp.statusText);\n requestOK=false;\n });\n xhttp.open(\"GET\", url, false);\n xhttp.send();\n if ( requestOK ) {\n // console.log(JSON.stringify(xhttp));\n var result=JSON.parse(xhttp.responseText);\n // console.log(\"result: \\n\" + JSON.stringify(result));\n return result;\n } else {\n return null;\n }\n }", "function getElectionsCreated(){\n // Creating the AJAX element to receive data\n let xhr = new XMLHttpRequest();\n xhr.open('GET', '../../php/api/GetData/getFacElections.php?id='+fac_id.value, true);\n xhr.onload = function(){\n if(this.status == 200){\n let response = this.responseText;\n // alert(response);\n popElections(JSON.parse(response));\n popPositions(JSON.parse(response));\n candidateElection(JSON.parse(response));\n viewCandElect(JSON.parse(response));\n }else{\n alert(this.status);\n }\n }\n xhr.send();\n}", "function httpGet(url) {\n var doc = new XMLHttpRequest();\n var result = \"\";\n var web_page = \"\";\n\n doc.open(\"GET\", url);\n\n doc.onreadystatechange = function() {\n if (doc.readyState === XMLHttpRequest.DONE) {\n web_page = doc.responseText;\n if(web_page.indexOf(\"台東大學無線網路驗證系統\")===0) {\n var magic = web_page.search('magic');\n magic = web_page.substring([magic+14], 16);\n result = \"magic=\"+magic;\n }\n else if(web_page.indexOf(\"USERNAME\")===0) {\n result = \"need_auth2\";\n }\n else {\n result = \"已經正在上網或是不在學校網域內!\";\n }\n msgTxt.text = result;\n }\n }\n\n doc.setRequestHeader(\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8\");\n doc.setRequestHeader(\"User-Agent\", \"Mozilla/5.0 (X11; Linux i686 (x86_64)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.81 Safari/537.36\");\n doc.send();\n}", "function getRequest()\r\n{\r\nrequest.open('GET', 'https://www.blockchain.com/ticker', true)\r\n//Log progress\r\nconsole.log('Get Called')\r\n\r\nrequest.onload = function() {\r\n // Begin accessing JSON data here\r\n data = JSON.parse(this.response)\r\n\r\n // if we get a good response from server\r\n if (request.status >= 200 && request.status < 400) {\r\n\t //Log good news\r\n\t console.log('Api Good')\r\n console.log(data[currency])\r\n\t //Add to data points array for chart\r\n\t dataPoints.push({y: data[currency][\"15m\"]});\r\n\t //Update the chart\r\n\t window.updateChart();\r\n\t //Update the table with bitcoin info\r\n\t UpdateTable()\r\n\t//If API fail, output error!\r\n } else {\r\n console.log('error')\r\n }\r\n}\r\n//Send the request\r\nrequest.send()\r\n}", "function httpRequest()\n{\n var http=new XMLHttpRequest();\n http.open('GET', 'https://5d76bf96515d1a0014085cf9.mockapi.io/quiz',true);\n http.send();\n return http;\n}" ]
[ "0.68716997", "0.6770742", "0.67243963", "0.67118037", "0.6620791", "0.66099674", "0.6593366", "0.65704346", "0.65567404", "0.64133406", "0.64079404", "0.6313315", "0.6306508", "0.63015556", "0.6296382", "0.62742263", "0.6250477", "0.62473", "0.6246151", "0.6217022", "0.62064976", "0.61951536", "0.6190443", "0.6180821", "0.6166462", "0.616085", "0.61587185", "0.61556536", "0.61551404", "0.6154003", "0.6153919", "0.6143009", "0.61405337", "0.613408", "0.6132169", "0.6127429", "0.61239594", "0.6117792", "0.61110103", "0.61093736", "0.6107825", "0.61039996", "0.60997444", "0.6091937", "0.6086902", "0.60845983", "0.6083477", "0.60685223", "0.6068486", "0.6047233", "0.60435516", "0.6040557", "0.6033483", "0.6026958", "0.60186374", "0.60081017", "0.60041374", "0.6001256", "0.5997089", "0.59966016", "0.5994152", "0.59850144", "0.59848785", "0.5979148", "0.59757817", "0.5975638", "0.59755224", "0.5973979", "0.59708315", "0.5967372", "0.59533834", "0.59533334", "0.59495866", "0.59477466", "0.59462017", "0.5934496", "0.59328735", "0.5930429", "0.59283435", "0.5926546", "0.59248054", "0.59187424", "0.59109545", "0.5908647", "0.5907498", "0.5904852", "0.590281", "0.5901558", "0.59008294", "0.58976614", "0.5892023", "0.58844393", "0.58828646", "0.5882455", "0.5878816", "0.58776385", "0.5869268", "0.5866183", "0.5865031", "0.58625853" ]
0.6547172
9
callback function that retrieves comic character data from getMarvelData function and adds to index.html using page section functions
function showMarvelData(data) { marvelData(data); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPage ( data ) {\n document.title = data.title;\n $('#logo').html('<img src=\"images/' + data.logo + '\"/>');\n $('h3').css('color', data.mainColor);\n $('#sectOne').css('background-image', data.headerBkg);\n $('#headerText').html( data.header );\n setTwoColumn( data.about );\n $('#sectThree').css('background-image', data.subBkg);\n $('#heading2').html( data.subhead );\n $('#addInfo').html( data.subText );\n $('body').css('background', '#ffffff none');\n getMap( data.address, data.zip );\n currentSect = 5;\n nextForm();\n}", "function outputPageContent() {\n \n $('#APIdata').html(outhtml); // this prints the apidata in the blank div section in the html\n }", "function addData() {\n // resets all info on the page\n resetTeamPage();\n // adds in images\n addImagesToPage();\n // adds in pit data\n addPitDataToPage();\n // adds in prescout data\n if (Object.keys(prescout_data).length !== 0) {\n addPrescoutDataToPage();\n }\n // adds in stand data\n addStandDataToPage();\n // adding average/mean/max to btn-div (non match-specific)\n addOverallStatsToPage();\n // adds in notes data\n addNotesToPage();\n // view data button functionality\n addDataToViewDataButton();\n // hides sensitive info if applicable\n displaySensitiveInfo();\n}", "function get_page_data() {\n socket.emit('get_page_data', {data: ''});\n //call server to tell we want all data, so we can fill the ui (normally done once on full page load/refresh)\n}", "function renderCvtPage(data) { \n // get cvt data from API call...\n $.getJSON(\"api/cvt\", function(data) {\n // generate the proper HTML...\n generateAllCvtHTML(data);\n\n var page = $('.cvt-report');\n page.addClass('visible'); \n });\n }", "function displayMarvelData(data) {\n if (data.data.results[0] === undefined) {\n $('.unknown-section').html(`\n <div class='unknown'>\n <h2>No character found by that name.</h2>\n </div>\n `);\n\n $('.main-unknown-section').prop('hidden', false);\n $('.main-results-section').prop('hidden', true);\n $('.main-events-section').prop('hidden', true);\n $('.main-comics-section').prop('hidden', true);\n $('.main-videos-section').prop('hidden', true);\n $('.main-share-section').prop('hidden', true);\n return;\n }\n else {\n if (data.data.results[0].description === '') {\n $('.results-section').html(`\n <div class='results-text'>\n <img src='${cleanUpLink(data.data.results[0].thumbnail.path + '.' + data.data.results[0].thumbnail.extension)}' class='character-photo' alt='character-photo'>\n <h2 class='character-name'>${data.data.results[0].name}</h2>\n <hr>\n <p class='character-description'>No Description Available.</p>\n <a href='${data.data.results[0].urls[0].url}' target='_blank' class='for-more'><p>For Information <img src='https://image.flaticon.com/icons/png/128/108/108528.png' class='more-icon' alt='click-more-icon'></a></p>\n </div>\n `);\n\n $('.main-unknown-section').prop('hidden', true);\n $('.main-comics-section').prop('hidden', false);\n $('.main-events-section').prop('hidden', false);\n $('.main-videos-section').prop('hidden', false);\n $('.main-results-section').prop('hidden', false);\n $('.main-share-section').prop('hidden', false);\n }\n else {\n $('.results-section').html(`\n <img src='${cleanUpLink(data.data.results[0].thumbnail.path + '.' + data.data.results[0].thumbnail.extension)}' class='character-photo' alt='character-photo'>\n <div class='results-text'>\n <h2 class='character-name'>${data.data.results[0].name}</h2>\n <hr>\n <p class='character-description'>${data.data.results[0].description}</p>\n <a href='${data.data.results[0].urls[0].url}' target='_blank' class='read-more'><p>Read More <img src='https://image.flaticon.com/icons/png/128/108/108528.png' class='more-icon' alt='click-more-icon'></a></p>\n </div>\n `);\n\n $('.main-unknown-section').prop('hidden', true);\n $('.main-comics-section').prop('hidden', false);\n $('.main-events-section').prop('hidden', false);\n $('.main-videos-section').prop('hidden', false);\n $('.main-results-section').prop('hidden', false);\n $('.main-share-section').prop('hidden', false);\n }\n\n /* JSON method and Marvel Events data display */\n\n const query_events = {\n apikey: 'b9387eb3d701ea1e371e1f554eb585c5',\n ts: '1',\n hash: 'c516f34ed1b8c272e76721b1be1dfe71',\n limit: 3\n };\n\n $.getJSON(MARVEL_EVENTS_API + data.data.results[0].id + '/events', query_events, function(data) {\n const results = data.data.results.map((item, index) => {\n return `\n <div class='event-result'>\n <a href='${item.urls[0].url}' target='_blank'><img src='${cleanUpLink(item.thumbnail.path + '.' + item.thumbnail.extension)}' class='image' alt='event-photo'></a>\n <h4 class='item-title'>${item.title}</h4>\n <p class='description'>${cleanUpDescription(item.description)}</p>\n </div>\n `});\n\n $('.events-section').html(results);\n });\n\n /* JSON method and Marvel Comics data display */\n\n const query_comics = {\n apikey: 'b9387eb3d701ea1e371e1f554eb585c5',\n ts: '1',\n hash: 'c516f34ed1b8c272e76721b1be1dfe71',\n limit: 3\n };\n\n $.getJSON(MARVEL_COMICS_API + data.data.results[0].id + '/comics', query_comics, function(data) {\n const results = data.data.results.map((item, index) => {\n if (item.description === null) {\n return `\n <div class='comic-result'>\n <a href='${item.urls[0].url}' target='_blank'><img src='${cleanUpLink(item.thumbnail.path + '.' + item.thumbnail.extension)}' class='image' alt='comic-photo'></a>\n <h4 class='item-title'>${item.title}</h4>\n <p class='no-description'>No description available.</p>\n </div>\n `;\n }\n else {\n return `\n <div class='comic-result'>\n <a href='${item.urls[0].url}' target='_blank'><img src='${cleanUpLink(item.thumbnail.path + '.' + item.thumbnail.extension)}' class='image' alt='comic-photo'></a>\n <h4 class='item-title'>${item.title}</h4>\n <p class='description'>${cleanUpDescription(item.description)}</p>\n </div>\n `;\n }\n });\n\n $('.comics-section').html(results);\n });\n }\n}", "loadCharacters(page, filter){\n var response = \"\";\n req.open('GET', url_SWAPI+'?page='+page, false);\n req.addEventListener('load', function(){\n if (req.status >= 200 && req.status < 400){\n response = JSON.parse(req.responseText);\n } else{\n console.log(\"Não conseguiu conectar =/\");\n }\n });\n req.send(null); \n return response.results; \n }", "function getAboutData() {\n\n //var featureRelId = getUrlVars()['transferId'];\n var userSiteId = getUrlVars()['touchId'];\n var itemId = getUrlVars()['itemId'];\n\tvar featureName = getUrlVars()['featureName'];\n\tfeatureName = featureName.replace(/\\%20/g,' ');\n\tfeatureNameTitle(featureName);\n\t\n var menuhtml = $(\"userSiteId\").find('a').html();\n //var userSiteId = $('#userSiteId').val();\n var url = baseUrl + 'web/web/getAboutUsDescription/' + itemId;\n var data = '';\n doAjaxCall(url, data, false, function (html) {\n //console.log(html);\n $('title,.header-content h1').html(menuhtml);\n $('.header-content .back').show();\n $('#main-content').html(html[0].description);\n\t\t$('#main-content').css({ 'background-color': '#' + html[0].globalBackground, 'color': '#' + html[0].globalTextColor });\n });\n\tgetUserAppereance();\n}", "function onPageStart() {\n setInnerHTML(global_txtObj[\"txts\"], global_txtObj[\"attrsx\"], global_txtObj[\"components_ids\"]); // se fijan textos\n /* setInnerAttrs(global_hintsObj[\"txts\"], global_hintsObj[\"attrsx\"], global_hintsObj[\"components_ids\"]) */ // fija atributos\n switch (globalLang) {\n case \"es\":\n LangLabelsURL = LangLabels[0];\n break;\n case \"en\":\n LangLabelsURL = LangLabels[1];\n break;\n case \"pt\":\n LangLabelsURL = LangLabels[2];\n break;\n case \"gh\":\n LangLabelsURL = LangLabels[3];\n break;\n }\n\n //TableIndexs contiene los indices de las columnas de res.data que me interesa conservar, res es la respuesta del servidor al hacer la consulta, dentro trae data que son todas las filas y columnas\n var tableIndexs = [1, 7, 9, 4];\n\n var juntar = [{\n \"fields\": [9, 5],\n \"firstIndex\": 2\n }];\n\n var pushToTheEnd = ['<a href=\"#\" id=\"e-{id}\" data-toggle=\"modal\" data-target=\"#ModalVerTodos\" data-placement=\"top\" title=\"Ver detalles\" class=\"updateData\"><i class=\"far fa-newspaper\"></i></a>']\n\n setTableLabels('#tablaVerTodos', LangLabelsURL, true, './ajax_cent_op_rcvry.php?Lang=' + globalLang + '&enbd=2&UID=' + getCookie(\"UID\") + '&USS=' + getCookie(\"USS\") + '', function (res) {\n return formatDataTable(res, tableIndexs, juntar, pushToTheEnd);\n }); // Se fijan los labels estandars de las tablas y sus busquedas\n\n\n //Se rellenan los slecets de paises y provincias\n selectCtryPopulate('#country', 0, 'Seleccione Pais');\n selectProvPopulate('#Provincia', 0, 'Seleccione Provincia', 168);\n selectCodCtryPopulate(\"#CodPais1\", 168);\n\n\n //Se detecta el evento de cambio de país para rellenar el select de provincia\n $(\"#country\").on(\"change\", function () {\n selectProvPopulate('#Provincia', 0, 'Seleccione Provincia', this.value);\n selectCodCtryPopulate(\"#CodPais1\", this.value);\n });\n\n //Rellena el idplan\n selectPopulate(\"#id_cap\", \"getCaps\", 0, 1);\n\n selectPopulate(\"#CodPais1\", \"getctrycode\", 0, 2);\n\n //Detecta la inserción de archivos\n var filesToUpload = new FormData();\n $(document).on(\"change\", \"#documents\", function (e) {\n\n for (var i = 0; i < this.files.length; i++) {\n var element = this.files[i];\n var id = getRandomString(7);\n filesToUpload.append(id, element);\n\n var picture = createFile(element, id);\n $(\"#all-images\").append(picture);\n }\n\n this.value = \"\";\n\n });\n\n //Detecta cuando se elimina una imagen a subir\n $(document).on(\"click\", \".item-container\", function (e) {\n\n var id = this.id;\n $(`#${id}`).remove();\n id = id.split(\"-\")[1];\n filesToUpload.delete(id);\n\n });\n\n // Código para actualizar la data\n\n var isUpdating = false; //Variable que indica si el formulario va a ser para actualizar o insertar\n var idToUpdate;\n\n $(document).on(\"click\", \".updateData\", function () {\n isUpdating = true;\n idToUpdate = this.id.split(\"-\")[1];\n\n $(\"#uploadDocs\").show();\n $(\"#loadedFiles\").attr(\"href\", $(\"#loadedFiles\").attr(\"href\") + \"&sect=centOp&reg=\" + idToUpdate);\n $(\"#idBtnLimpiar\").hide();\n\n getDataOfThisRecord(idToUpdate, \"getCentOpData\", {\n idCliente: 0,\n razSocCliente: 1,\n ruc: 2,\n address: 3,\n country: 4,\n Provincia: 5,\n email: 6,\n CodPais1: 7,\n telefono: 8,\n customCheck1: [9, \"checkbox\"]\n });\n });\n\n $(document).on(\"click\", \"#idBtnNuevo\", function () {\n isUpdating = false;\n $(\"#uploadDocs\").hide();\n $(\"#idBtnLimpiar\").show();\n resetDefaultForm();\n });\n\n // Termina código para actualizar la data\n\n //Limpia el formulario\n $(document).on(\"click\", \"#idBtnLimpiar\", function (e) {\n resetDefaultForm();\n });\n\n //Envía el formulario\n $(\"#idFormDetalles\").on(\"submit\", function (e) {\n e.preventDefault();\n\n var inputs = $(\"#idFormDetalles .required\");\n\n if (validateInputs(inputs) || isUpdating) {\n\n var formData = new FormData(this);\n\n //Inserto los archivos a subir\n for (var pair of filesToUpload.entries()) {\n formData.append(pair[0], pair[1]);\n }\n\n var successText;\n\n if (isUpdating) {\n formData.append(\"mode\", \"updateCentOpInfo\");\n formData.append(\"idToUpdate\", idToUpdate);\n successText = \"¡Registro actualizado con éxito!\";\n } else {\n formData.append(\"mode\", \"uploadCentOpInfo\");\n successText = \"¡Registro agregado con éxito!\";\n }\n\n for (var pair of formData.entries()) {\n console.log(pair[0] + ': ' + pair[1]);\n }\n\n //Inserto los datos mediante Ajax\n $.ajax({\n url: './ajax_requests_rcvry.php?Lang=' + globalLang + '&enbd=2&UID=' + getCookie(\"UID\") + '&USS=' + getCookie(\"USS\") + '',\n type: \"post\",\n data: formData,\n cache: false,\n contentType: false,\n processData: false,\n beforeSend: function () {\n console.log(\"Enviando...\");\n },\n success: function (res) {\n console.log(res);\n\n //Limpio el formulario\n if(!isUpdating)\n resetDefaultForm();\n //Actualizo la DataTable\n $(\"#tablaVerTodos\").DataTable().destroy();\n setTableLabels('#tablaVerTodos', LangLabelsURL, true, './ajax_cent_op_rcvry.php?Lang=' + globalLang + '&enbd=2&UID=' + getCookie(\"UID\") + '&USS=' + getCookie(\"USS\") + '', function (res) {\n return formatDataTable(res, tableIndexs, juntar, pushToTheEnd);\n });\n\n //Elimino las vistas previas y limpio el formData\n filesToUpload = new FormData();\n $(\"#all-images\").children().remove();\n\n //Informo de éxito\n Swal.fire(\n '¡Listo!',\n successText,\n 'success'\n )\n },\n error: function (e) {\n console.log(e);\n }\n });\n } else {\n alert(\"¡Rellena todos los campos requeridos!\");\n }\n\n });\n\n}", "function getData() {\n\n var charURL = \"https://www.anapioficeandfire.com/api/characters?page=\" + defPageNum + \"&pageSize=10\";\n\n \n $.ajax({\n url: charURL,\n method: \"GET\"\n }).done(function (response) {\n // $(\"#div1\").text(JSON.stringify(response));\n\n console.log(response);\n\n //for look will filter through array response & then append with the below code\n for (var i = 0; i < response.length; i++) {\n\n var tableRow = $(\"<tr>\");\n var nameTd = $(\"<td scope = 'col'>\");\n var cultureTd = $(\"<td scope = 'col'>\");\n var bornTd = $(\"<td scope = 'col'>\");\n var diedTd = $(\"<td scope = 'col'>\");\n var titlesTd = $(\"<td scope = 'col'>\");\n var aliasesTd = $(\"<td scope = 'col'>\");\n var allegianceTd = $(\"<td scope = 'col'>\");\n var playedByTd = $(\"<td scope = 'col'>\");\n\n nameTd.text(response[i].name);\n cultureTd.text(response[i].culture);\n bornTd.text(response[i].born);\n diedTd.text(response[i].died);\n titlesTd.text(response[i].titles);\n aliasesTd.text(response[i].aliases);\n allegianceTd.text(response[i].allegiance);\n playedByTd.text(response[i].playedBy);\n\n tableRow.append(nameTd, cultureTd, bornTd, diedTd, titlesTd, aliasesTd, allegianceTd, playedByTd);;\n\n $(\"#tableBody\").append(tableRow);\n\n //character URL with default page size of 10 and page number that can decrease + increase with buttons\n \n //default page number\n\n console.log(charURL);\n };\n });\n}", "function manager(args) {\n\n // get the actual page name\n var parts = args.split('&');\n var page = parts[0];\n // special is an additional parameter to render the same page in different ways\n // for istance, single_class.html can contains different informations based on\n // different values of special\n var special = parts[1];\n var id = parts[2];\n\n // enable script for calls to external php\n \n // load the page dinamycally inside the template\n $( \".mainContent\" ).load(page+'.html', function() {\n\n //************** SPECIFIC PAGE FUNCTIONS ****************//\n // after loading the whole page we should load the page manager for links inside the main div, this is because\n // the callback function\n switch (page) {\n case 'home':\n clickPageLinks();\n break;\n case 'allPromotions':\n getPromoIndex();\n clickPageLinks();\n break;\n case 'allSmartLifeServices':\n var categoria=\"smartlife\";\n getCategorie(categoria,function () { clickPageLinks(); });\n break;\n case 'allAssistanceServices':\n clickPageLinks();\n break;\n case 'assistanceServices':\n var tabella='assistanceservices';\n var categoria=special;\n var prevSection='allAssistanceServices';\n if(categoria=='promotions'){\n getIntro(tabella, categoria, function () { clickPageLinks(); });\n fillMultipleGroupDynamicButtons('allPromotions',categoria);\n loadSidebar('assistanceServicesPromo');\n }\n else{\n getIntro(tabella,categoria,function () { clickPageLinks(); });\n loadSidebar(special);\n fillMultipleGroupDynamicButtons(prevSection,categoria);\n }\n loadCategoryName(special);\n loadTableName(tabella);\n loadBreadCrumb(special);\n break;\n case 'assistanceServicesInfo':\n var tabella='assistanceservices';\n var prevSection='assistanceServices';\n getAssistanceInfo(tabella,special,id,function () { clickPageLinks(); });\n loadCategoryName(special);\n loadTableName(tabella);\n loadBreadCrumb(special);\n fillTopicDynamicButtons(prevSection,special,id);\n clickPageLinks();\n break;\n case 'smartlifeservices': //è da modificare: plans deve andare dentro la tabella smartlife\n var tabella='smartlifeservices';\n var categoria=special;\n var prevSection='allSmartLifeServices';\n if(categoria!='promotions') {\n getIntro(tabella,categoria,function () { clickPageLinks(); });\n loadSidebar(special);\n loadTableName(tabella);\n fillMultipleGroupDynamicButtons(prevSection,categoria);\n }\n else {\n getPromoIntro(tabella,function () { clickPageLinks(); });\n loadTableName(tabella);\n fillMultipleGroupDynamicButtons('allPromotions',categoria);\n loadSidebar('smartlifePromo');\n }\n loadCategoryName(special);\n loadBreadCrumb(special);\n break;\n case 'smartlifeInfo':\n var tabella='smartlifeservices';\n getPlanInfo(tabella,special,id,function () { clickPageLinks(); });\n loadCategoryName(special);\n loadTableName(tabella);\n loadBreadCrumb(special);\n fillTopicDynamicButtons(tabella,special,id);\n clickPageLinks();\n break;\n case 'devices':\n getIntro(page,special,function () { clickPageLinks(); });\n loadSidebar(special);\n loadCategoryName(special);\n loadBreadCrumb(special);\n loadTableName(page);\n if(special!='promotions')\n fillMultipleGroupDynamicButtons('allDevices',special);\n else\n fillMultipleGroupDynamicButtons('allPromotions',special);\n break;\n case 'transitionDeviceToSmartLife':\n getCombinedSmartLife(special,id,function () { clickPageLinks(); });\n loadBreadCrumb(special);\n break;\n case 'transitionDeviceToAssistantServices':\n getCombinedAssistantServices(special,id,function () { clickPageLinks(); });\n loadBreadCrumb(special);\n break;\n case 'deviceInfo':\n var tabella='devices';\n getDeviceInfo(tabella,special,id,function () { clickPageLinks(); });\n fillTopicDynamicButtons(tabella,special,id);\n loadBreadCrumb(special);\n break;\n case 'caratteristicheTecniche':\n clickPageLinks();\n break;\n case 'whoweare':\n loadStaticPageBreadCrumb('Innovation');\n clickPageLinks();\n break;\n case 'transitionSmartLifeToDevice':\n var tabella='smartlifeservices';\n loadCategoryName(special);\n loadTableName(page);\n loadBreadCrumb(special);\n getCombinedDevices(special,id,function () { clickPageLinks(); });\n break;\n case 'transitionAssistancetoDevices':\n var tabella='assistanceservices';\n loadCategoryName(special);\n loadTableName(page);\n loadBreadCrumb(special);\n getCombinedDevicesForAssistance(special,id,function () { clickPageLinks(); });\n break;\n case 'groupTelecomItalia':\n loadStaticPageBreadCrumb('Group Description');\n clickPageLinks();\n break;\n default:\n clickPageLinks();\n }\n //************** END SPECIFIC PAGE FUNCTIONS ***********//\n\n // scroll to top when loading a new page\n window.scrollTo(0,0);\n });\n\n}", "function showjson (data){\n if(queryString.length) {\n $('.container').empty();\n } else {\n $('.container').load('../KIITimelineCS/includes/landingPage.html')\n }\n $.each(data, function (index, value, n) {\n\n while (index == 'request'){\n // console.log(value);\n //console.log(value.Chapter);\n //console.log(value.Section);\n $('#chapter').append('<li>Chapter:'+value.Chapter+' </li>');\n \n break;\n };\n\n while (index === 'Data'){\n //GET SECTION INFORMATION\n var SectionContent=value.Content;\n for (var SC=0; SC<SectionContent.length; SC++){\n mySectionTitle=SectionContent[SC].SectionTitle;\n mySectionNumber=SectionContent[SC].SectionNumber;\n mySectionDate=SectionContent[SC].SectionDate;\n mySectionIntro=SectionContent[SC].SectionIntro;\n mySectionHero=SectionContent[SC].SectionHero;\n var mySectionID = mySectionTitle.replace(/ /g, ''),\n mySectionPath = mySectionTitle.replace(/ /g, '_'),\n mySectionIDReplace = mySectionID.replace(/'/g, '');\n $('.container').attr('id', mySectionIDReplace);\n $('.container').append('<section class=\"sectionIntro col-16 row-15\"><!-- sectionInterior --><div class=\"sectionTitle posX-1 posY-1 abs\"><div><p class=\"sectionYear\">' + mySectionDate + '</p><p class=\"chapterName\">' + Chapter + '</p></div><h1>' + mySectionTitle + '</h1></div></section>')\n // $('#section').append('<h3>'+mySectionIntro+' intro testing</h3>');\n\n \n ////////////////////////////////////////\n var myModules = value.Content[SC].Modules,\n dataStore = [];\n // LOAD MODULE HTML INTO .CONTAINER\n for (var M = 0; M < myModules.length; M++) {\n myModuleTitle = myModules[M].Module_Title;\n myModuleYear = myModules[M].Module_Year;\n myModuleOrder = myModules[M].Module_Order;\n myModuleSubtitle=myModules[M].Module_Subtitle;\n myModuleCopy=myModules[M].Module_Copy;\n myModuleType=myModules[M].Module_Type;\n myModulePosX=myModules[M].PosX;\n myModulePosY=myModules[M].PosY;\n myModuleCol=myModules[M].Col;\n myModuleRow=myModules[M].Row;\n moduleLoad=myModules[M].Module_Type;\n\n var n = M,\n myMedias = value.Content[SC].Modules[M].Medias,\n loadModules = 'modules/' + mySectionPath + '/' + moduleLoad + '.html',\n n = M + 1,\n appendModuleOrder = myModules[M].Module_Order,\n appendModuleName = myModules[M].Module_Type,\n appendModuleHighlight = myModules[M].Module_Highlight,\n length = myModules.length;\n\n // APPEND TEXT TO THE DOM\n function appendText(){\n \n // CHECK TO SEE IF JSON HAS ATTRIBUTES ELSE REMOVE\n if (myModuleTitle === 'undefined' || myModuleTitle === 'null') {\n myModuleTitle = '';\n }\n if (myModuleYear === 'undefined' || myModuleYear === 0) {\n myModuleYear = '';\n }\n if (myModuleCopy === 'undefined' || myModuleCopy === 'null') {\n myModuleCopy = '';\n }\n $('#' + appendModuleOrder).append('<h1>' + myModuleTitle + '</h1>' + '<p class=\"date\">' + myModuleYear +'</p>' + myModuleCopy);\n\n } \n\n //ITTERATE THROUGH MEDIA\n function myMediaFunction(){\n\n if(myModules[M].hasOwnProperty('Medias')) {\n\n for (var MM= 0; MM < myMedias.length; MM++){\n // DEFINE UNIVERSAL MEDIA TYPES\n myMediaTitle = myMedias[MM].Media_Title;\n myMediaType = myMedias[MM].Media_Type;\n myMediaPath = myMedias[MM].Option_File;\n myMediaDescription = myMedias[MM].Media_Description;\n myMediaCopyright = myMedias[MM].Media_Copyright;\n\n if (myMediaCopyright === 'undefined' || myMediaCopyright === 'null') {\n myModuleTitle = ' ';\n }\n\n function appendPhoto(){\n\n var mySectionIDReplace = mySectionID.replace(/'/g, '');\n // console.log(mySectionIDTwo)\n if($(window).width() > 768) {\n $('#' + appendModuleOrder).append('<img src=\"http://kochindsandbox.kochdev.com/KochSandbox/media/kochTimeline/' + mySectionIDReplace + '/' + myMediaPath + '\" alt=\"' + myMediaTitle + ' | ' + myMediaDescription + ' | ' + myMediaCopyright + '\" />');\n } else {\n $('#' + appendModuleOrder).append('<img src=\"http://kochindsandbox.kochdev.com/KochSandbox/media/kochTimeline/' + mySectionIDTwo + '/Mobile_' + myMediaPath + '\" alt=\"' + myMediaTitle + ' | ' + myMediaDescription + ' | ' + myMediaCopyright + '\" />');\n }\n\n }\n\n function appendGraphic(){\n $('#' + appendModuleOrder).append('<img src=\"http://kochindsandbox.kochdev.com/KochSandbox/media/kochTimeline/' + mySectionID + '/' + myMediaPath + '\" alt=\"' + myMediaTitle + ' | ' + myMediaDescription + ' | ' + myMediaCopyright + '\" />');\n }\n\n function appendAudio(){\n $('#' + appendModuleOrder).append('<img src=\"http://kochindsandbox.kochdev.com/KochSandbox/media/kochTimeline/' + myMediaPath + ' | ' + myMediaCopyright + '\" />');\n }\n\n function appendVideo(){\n myVideoPath = myMedias[MM].Option_Link;\n $('#' + appendModuleOrder).append('<iframe src=\"http://video.kochcreativegroupdev.com/players/' + myVideoPath + '-C0ABUaWy.html\" frameborder=\"0\" scrolling=\"auto\" allowfullscreen></iframe>');\n }\n\n function appendSvgCode(){\n mySVGPath = myMedias[MM].Option_SVG_Code;\n $('#' + appendModuleOrder).append(mySVGPath);\n }\n\n function appendJsCode(){\n myJSPath = myMedias[MM].Option_JS_Code;\n $('body').append('<script>' + myJSPath + '</script>');\n }\n\n // RUN SWITCH STATEMENT TO CHANGE HOW MEDIA IS UPLOADED BASED UPON MEDIA TYPE\n switch (myMediaType) {\n case 'photo':\n appendPhoto();\n break;\n\n case 'graphic':\n appendGraphic();\n break;\n\n case 'audio':\n appendAudio();\n break;\n\n case 'video':\n appendVideo();\n break;\n\n case 'svg-code':\n appendSvgCode();\n break;\n\n case 'js-code':\n appendJsCode();\n break;\n }\n\n }\n }\n // GIVES RULE TO FUNCTION TO ENSURE IT RUNS IN ABOVE IF STATEMENTS\n var p = true;\n }\n\n // LOAD IN SECTION MODULES\n function loadMyModules(){\n var module = $('#' + appendModuleOrder);\n\n // APPEND PARENT DIVS\n $('.container').append('<section id=\"' + appendModuleOrder + '\" class=\"module ' + appendModuleName + ' posX-' + myModulePosX + ' ' + 'posY-' + myModulePosY + ' ' + 'col-' + myModuleCol + ' ' + 'row-' + myModuleRow + ' ' + appendModuleHighlight + '\"></section>');\n\n // IF MODULE EXISTS RUN TEXT FUNCTION TO APPEND TEXT\n if($('#' + appendModuleOrder).length) {\n appendText();\n\n // IF MODULE H1 TEXT EXISTS RUN MEDIA FUNCTION\n if($('#' + appendModuleOrder).find('h1').length) {\n myMediaFunction();\n\n // IF MEDIA FUNCTION IS FINSIHED RUN RE-ORDER function\n if(p = true) {\n window[appendModuleName]();\n } else {\n alert('Please refresh your page');\n }\n\n } else {\n alert('Please refresh your page');\n }\n } else {\n alert('Please refresh your page');\n }\n\n\n } loadMyModules();\n\n }\n\n }\n\n break;\n };\n });\n }", "function getUrlCallback(data) {\r\n\ttry{\r\n\t\t$('#content').html(data);\r\n\t} catch (e) {};\r\n\treadStyle='style-ebook';\r\n\treadSize='size-medium';\r\n\treadMargin='margin-x-narrow';\r\n\tvar obj_content = readability.init();\r\n\t// $('.panel-heading').html(obj_content.title);\r\n\t// $('.panel-body').html(obj_content.content);\r\n\treturn obj_content;\r\n}", "function textSection1() {\r\n const t = `The full name is ${messi.fullName} an ${messi.nationality} ${messi.positions} soccer player. He was born in ${messi.dateOfBirth} as the third child of 4. His father Jorge Messi was a steel factory manager and his mother was working in a magnet manufacturing workshop.\r\n His career started with ${messi.youthClubs[0]} in the duration ${messi.youthClubsDurations[0]} then moved to ${messi.youthClubs[0]} starting from ${messi.youthClubsDurations[1]}.\r\n If we dug up a little further through Lionel's personality, we will find that is calm and concentrating in the field. Not only just in the field, but also outside of the football field, which means he cares so much about the style of management of the club he plays for.\r\n Until this very moment, ${messi.fullName} still plays for ${messi.youthClubs[1]}. However, his future with the club is a mystery in the moment due to the instabilty of the club's management.`;\r\n //Text to be added to section 1\r\n addTextToSection(t,0); \r\n}//This function is used to add the data of the first section about the player from the js file to the html file.", "function glueMainPageData(data) {\n console.log(typeof data);\n life = data.Life;\n console.assert(life !== undefined, \"Life is undefined.\");\n resolutionUnit = data.ResolutionUnit;\n if(life.Notes == null){\n life.Notes = [];\n }\n lifeService.datifyLifeObject(life);\n console.log(\"life\");\n console.log(life);\n visibleNotes = life.Notes;\n //createMomentsFromDataAttrs(); // Done here in the beginning so only need to create Moments once (performance problems).\n updateLifeComponents();\n zoomLifeCalendar();\n refreshDragSelectObject();\n}", "function on_pageLoad() \n{ \n getDataSets(); \n\t//debug(\"createMap()\"); \n\t//getUrlParas(); \n\tcreateMap(); \n}", "function page_callback(request, json) {\n\tif (json) {\n\n\t\tvar title = json.resourceURI.split('/').pop();\n\n\t\trender_navigation(d3.select('#breadcrumbs'));\n\t\trender_operations(d3.select('#operations'), json.operations)\n\n\t\td3.select('#resource-title').text(title);\n\t\trender_metadata(d3.select('#metadata'), metadata(json));\n\t\trender_acl(d3.select('#acl'), json.acl)\n\t\tclear_error_dialog();\n\n\t\tvar content_element = d3.select('#content');\n\t\tvar contents = content(json);\n\t\tif (title == 'CloudEntryPoint') {\n\t\t console.log('rendering CEP: ' + contents);\n\t\t\trender_cep(content_element, contents);\n\t\t} else if (title.match(/Collection$/)) {\n\t\t\trender_collection(content_element, contents)\n\t\t} else {\n\t\t\trender_item(content_element, contents);\n\t\t}\n\n /* update the JSON contents in the editor */\n var s = JSON.stringify(json, null, 2);\n if (editor) {\n editor.setValue(s);\n format_json();\n }\n\n\t} else {\n\t\trender_error(request);\n\t}\n}", "function main() {\n\n Memes.getMemesUrl(memes => {\n clearElement('feed')\n memes.forEach(meme => {\n \n let cardHtml = createMemeHtml(meme);\n insertHtml('feed', cardHtml)\n })\n })\n \n\n\n }", "function loadDataIntoDOM(pageData) {\r\n // Browser State\r\n document.title = pageData.title + \" | \" + COMIC.title;\r\n\r\n // Compute Tag HTML\r\n let tagHTML = \"\";\r\n pageData.tag_types.forEach(function (tagType) {\r\n let tagStrings = \"\";\r\n tagType.tags.forEach(function (tag) {\r\n if (tag.icon !== \"\") {\r\n tagStrings += `<a class=\"tag\" style=\"background-image: url(${tag.icon});\" href=\"${tag.url}\">${tag.title}</a>`;\r\n } else {\r\n tagStrings += `<a class=\"tag\" href=\"${tag.url}\">${tag.title}</a>`;\r\n }\r\n });\r\n\r\n tagHTML += `<p>${tagType.title}: ${tagStrings}</p>`;\r\n });\r\n\r\n // Page Content\r\n document.getElementById(\"comic-title\").innerHTML = pageData.title;\r\n document.getElementById(\"comic-tags\").innerHTML = tagHTML;\r\n document.getElementById(\"comic-post-date\").innerHTML = pageData.posted_at;\r\n document.getElementById(\"comic-post\").innerHTML = pageData.post;\r\n document.getElementById(\"comic-transcript\").innerHTML = pageData.transcript;\r\n document.getElementById(\"comic-alt-text\").innerHTML = pageData.alt_text;\r\n document.getElementById(\"comic-image\").src = pageData.image;\r\n document.getElementById(\"comic-image\").title = pageData.alt_text;\r\n setOpacity(\"#comic-image\", 0.5);\r\n setOpacity(\"#comic-image-spinner\", 1);\r\n\r\n if (localStorage.getItem(\"admin\") === \"true\") {\r\n // TODO: instead of showing/hiding this, inject it\r\n document.getElementById(\"staff-text\").style.display = \"block\";\r\n document.getElementById(\"staff-link\").href = pageData.admin;\r\n }\r\n\r\n // Navigation Buttons\r\n recalculateNavigationVisibility();\r\n }", "function loadPageData() {\n\tvar cC = '#mw-content-text';\n\t$(cC).load(location.href + \" \" + cC + \" &gt; *\", function (data) {\n\t\tif (doRefresh) {\n\t\t\tajaxTimer = setTimeout(loadPageData, ajaxRefresh);\n\t\t}\n\t});\n}", "function home() {\r\n document.getElementById(\"vermas\").style.display = \"none\";\r\n let loadingHome = document.createElement(\"h2\");\r\n document.getElementById(\"main\").appendChild(loadingHome);\r\n loadingHome.setAttribute(\"id\", \"cargando\");\r\n loadingHome.innerHTML = \"AGUARDA STAN LEE ESTA OCUPADO...\";\r\n\r\n const urlApi = `https://gateway.marvel.com:443/v1/public/characters?&limit=${qLimit}&offset=${offset}&ts=${ts}&apikey=${publicKey}&hash=${hash}`;\r\n\r\n apiMarvel(urlApi);\r\n}", "function loadDataIntoDOM(pageData) {\r\n // Browser State\r\n var newTitle = pageData.title + \" | \" + COMIC.title;\r\n document.title = pageData.title;\r\n\r\n // Compute Tag HTML\r\n var tagHTML = \"\";\r\n pageData.tag_types.forEach(function (tagType) {\r\n var tagStrings = \"\";\r\n tagType.tags.forEach(function (tag){\r\n if (tag.icon !== \"\") {\r\n tagStrings += `\r\n <a class=\"tag\" href=\"${tag.url}\">\r\n <div style=\"background-image: url(${tag.icon});\"></div>&nbsp;${tag.title}\r\n </a>`;\r\n } else {\r\n tagStrings += `<a class=\"tag\" href=\"${tag.url}\">${tag.title}</a>`;\r\n }\r\n });\r\n\r\n tagHTML += `\r\n <div class=\"tag-group\">\r\n <p>${tagType.title}:</p>\r\n ${tagStrings}\r\n </div>`;\r\n });\r\n\r\n // Page Content\r\n document.getElementById(\"comic-title\").innerHTML = pageData.title;\r\n document.getElementById(\"comic-tags\").innerHTML = tagHTML;\r\n document.getElementById(\"comic-post-date\").innerHTML = pageData.posted_at;\r\n document.getElementById(\"comic-post\").innerHTML = MARKDOWN.render(pageData.post);\r\n document.getElementById(\"comic-transcript\").innerHTML = MARKDOWN.render(pageData.transcript);\r\n document.getElementById(\"comic-image\").src = pageData.image; // TODO: Preload data so it's cached\r\n document.getElementById(\"comic-image\").title = pageData.alt_text;\r\n document.getElementById(\"comic-image\").style.opacity = 0.5;\r\n document.getElementById(\"comic-image-spinner\").style.opacity = 1.0;\r\n\r\n var adminLink = document.getElementById(\"admin-edit-link\");\r\n if (adminLink) { adminLink.href = pageData.admin; }\r\n\r\n // TODO: Should we scroll to the top of the page?\r\n\r\n // Navigation Buttons\r\n recalculateNavigationVisibility();\r\n }", "function initPage() {\n $.get('/api/headlines?saved=true').done((data) => {\n articleContainer.empty();\n\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "function loadPage(page_num, filename) {\n var chants_on_page = [];\n if (pageHasChanged()) {\n chants_on_page = antiphoner.getChants(data.current_folio);\n $('#metadata-tab').html(incipit_template({incipits: chants_on_page, folio: data.current_folio}));\n $('#metadata-tab h3').click(function () {\n $(this).next('.metadata').slideToggle().siblings('.metadata:visible').slideUp();\n });\n }\n }", "function setPageData() {\n var cardArray = window.localStorage.getItem('cryptoCard');\n var parseCards = cardArray && JSON.parse(cardArray) || [];\n\n parseCards && parseCards.forEach(card => {\n populateCard(card);\n });\n}", "function fillPageWithData ( data )\n{\n\tdocument.getElementById(\"city\").innerHTML = data[\"current_observation\"][\"display_location\"][\"full\"];\n\tdocument.getElementById(\"temp\").innerHTML = parseInt(data[\"current_observation\"][\"temp_c\"]) + \"°C\";\n\tdocument.getElementById(\"weather\").innerHTML = data[\"current_observation\"][\"weather\"];\n\tvar iconName = data[\"current_observation\"][\"icon\"];\n\tif ( retina3 )\n\t\ticonName += \"@3x\";\n\telse if ( retina )\n\t\ticonName += \"@2x\";\n\tdocument.getElementById(\"iconImg\").src = \"./icon_\" + iconName + \".png\";\n\tdocument.getElementById(\"iconImg\").style.display = \"block\";\n\tsetBodyBackgroundColorWithTemp ( parseInt(data[\"current_observation\"][\"temp_c\"]) );\n}", "function staffCallBack(res){\n let pageContent = `\n <h3 class='pb-3 text-center'>STAFF LIST</h3>\n ${page.staffTableFxn(res)}\n `;\n document.querySelector('main').innerHTML = pageContent;\n staffProfileBtnInit();\n return pageContent;\n}", "function initPage() {\n $.get('/api/headlines?saved=false').done((data) => {\n articleContainer.empty();\n if (data && data.length > 0) {\n renderArticles(data);\n\n // Activate tooltips for the action buttons.\n $('[data-toggle=\"tooltip\"]').tooltip();\n } else {\n renderEmpty();\n }\n });\n }", "function load() {\n \n //writes all the html for the page\n htmlWriter();\n }", "function startPage() {\n\tgetStaticData(\"data\", true, function(result) {\n data = keepOnlyOneInstance(result);\n for (var index = data.length; index--;) {\n dataById[data[index].id] = data[index];\n }\n getStaticData(\"units\", true, function(result) {\n units = result;\n getCorrections();\n });\n });\n \n // Reset search if escape is used\n $(window).on('keyup', function (e) {\n if (e.keyCode === 27) {\n $(\"#searchText\").val('').trigger('input').focus();\n }\n });\n \n // Triggers on search text box change\n $(\"#searchText\").on(\"input\", $.debounce(300,updateResults));\n \n $('#addAccessModal').on('hidden.bs.modal', function(event) {\n var itemId = $(\"#accessList\").data(\"id\");\n setAccess(itemId, getSelectedValuesFor(\"accessList\"));\n });\n addTextChoicesTo(\"accessList\",'checkbox',{ 'Shop':'shop', 'Recipe':'recipe', 'Chest':'chest', 'Chest Recipe':'recipe-chest', 'Quest':'quest', 'Key':'key', 'Chocobo':'chocobo', 'Event':'event', 'Event Recipe':'recipe-event', 'Trial':'trial', 'Trophy':'trophy', 'Colosseum':'colosseum', 'Premium':'premium', 'STMR':'STMR', 'TMR 5*':'TMR-5*', 'TMR 4*':'TMR-4*', 'TMR 3*':'TMR-3*', 'TMR 2*':'TMR-2*', 'TMR 1*':'TMR-1*', 'Not released yet':'not released yet'});\n}", "function load_page(data){\n $(\".block-container\").empty();\n var infos = data.Infos;\n var page = \"<block class='block'>\";\n for (var i = 0; i < infos.length; i++) {\n page += infos[i].html;\n }\n page += \"</div>\";\n $(\".block-container\").append(page);\n}", "function makePage(){\n\n codeFellows.makeList();\n disneyLand.makeList();\n}", "function loadPageData() {\n\tvar cC = '#mw-content-text';\n\t$( cC ).load( location.href + \" \" + cC + \" > *\", function ( data ) {\n\t\tif ( doRefresh ) {\n\t\t\tajaxTimer = setTimeout( loadPageData, ajaxRefresh );\n\t\t}\n\t} );\n}", "function loadPageData() {\n\tvar cC = '#mw-content-text';\n\t$( cC ).load( location.href + \" \" + cC + \" > *\", function ( data ) {\n\t\tif ( doRefresh ) {\n\t\t\tajaxTimer = setTimeout( loadPageData, ajaxRefresh );\n\t\t}\n\t} );\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 initializePage() {\r\n requestPageData(COMIC.slug, getComicAndPageFromActiveUrl().pageSlug, function (response) {\r\n navigateToPage(response.slug, false);\r\n });\r\n }", "function initPage() {\n\n initHeader();\n\n initForm();\n\n initDatalist();\n}", "function initialPageSetup() {\n\n\n //Dynamically creating a pagelayout\n $('body').html($('<div>', {\n class: 'container'\n }));\n\n //Setting background image when page loads\n $('.container').css({\n 'background-image': 'url(' + bgImageUrl + ')',\n 'background-repeat': 'no-repeat',\n 'background-size' : 'cover',\n 'height' : '100vh'\n });\n\n\n //First row would hold all the character names, images and health points\n {\n $('.container').append($('<div>', {\n class: 'row justify-content-md-left',\n id: 'characterRow'\n }));\n\n for (var i = 0; i < 4; i++) {\n $('#characterRow').append($('<div>', {\n class: 'col-3 character',\n id: 'charNumber' + starWarsChar[i].charNumber\n }));\n $('#charNumber' + starWarsChar[i].charNumber).append($('<div>', {\n class: 'charText',\n text: starWarsChar[i].name\n }));\n $('#charNumber' + starWarsChar[i].charNumber).append($('<img>', {\n class: 'charImage img-fluid ',\n id: 'charImage' + starWarsChar[i].charNumber,\n src: starWarsChar[i].imageUrl,\n attr: {\n 'characterNumber': starWarsChar[i].charNumber\n }\n\n }));\n $('#charNumber' + starWarsChar[i].charNumber).append($('<div>', {\n class: 'charHealthPoints',\n text: starWarsChar[i].healthPoints\n }));\n var currentImage = $('#charImage' + starWarsChar[i].charNumber);\n currentImage.wrap(\"<a href='#'></a>\");\n }\n\n // Setting up on click event since these are dynamically created classes\n $('.charImage').on('click', function () {\n // console.log(\"clicked a char\");\n var clickedChar = $(this).attr(\"characterNumber\");\n selectedChar(clickedChar);\n });\n }\n\n //Second row would hold the selected character\n {\n $('.container').append($('<div>', {\n class: 'row justify-content-md-left',\n id: 'yourCharacter'\n }));\n\n $('#yourCharacter').append($('<div>', {\n class: 'col-12 sectionHeadings',\n text: 'Your Character'\n }));\n }\n\n //Third row would hold the enemy characters\n {\n $('.container').append($('<div>', {\n class: 'row justify-content-md-left',\n id: 'enemyCharacters'\n }));\n\n $('#enemyCharacters').append($('<div>', {\n class: 'col-12 sectionHeadings',\n text: 'Enemies Available to attack'\n }));\n }\n\n //Fourth row would hold the defender characters\n {\n $('.container').append($('<div>', {\n class: 'row justify-content-md-left',\n id: 'defenderCharacter'\n }));\n\n $('#defenderCharacter').append($('<div>', {\n class: 'col-12 sectionHeadings',\n text: 'Defender'\n }));\n }\n\n //Fifth row would hold the Game messages\n {\n $('.container').append($('<div>', {\n class: 'row justify-content-md-left',\n id: 'gameMessages'\n }));\n\n $('#gameMessages').append($('<span>', {\n class: 'col-12',\n id: 'gameMessageText'\n }));\n }\n }", "function characterSheet() {\n\t$.get(\"../php/playerPage/characterSheet.php\", {}, returnCharacterSheet);\n}", "function buildPage(error, geoData) {\n // our admin geo is a topojson, so we need to pull out GeoJSON features\n adminFeatures = topojson.feature(geoData, geoData.objects[topojsonObjectsGroup]).features;\n // create a map for each sector\n var iterations = 0;\n for(i=0; i<responseDataObject.length; i++) {\n createSectorMap(i, function(){\n iterations++\n // and do some stuff once all the maps have been created\n if(iterations == responseDataObject.length) {\n syncMaps();\n setDefaultView();\n }\n }); \n } \n}", "function loadAmplifiersPage(){\n\tloadNavbar();\n\tgenerateProductPage(\"amplifier\");\n}", "function process_page() {\r\n\tconst loadPage = function(page) {\r\n\t\tconst main = $('#mdl-layout__content');\r\n\t\tmain.html(page);\r\n\t\tprocess_accordions(main);\r\n\t\tprocess_links(main);\r\n\t\tprocess_code_lines();\r\n\t\tcomponentHandler.upgradeDom();\r\n\t\t$(\".app-loading\").fadeOut();\r\n\t}\r\n\t\r\n\tswitch (window.location.hash) {\r\n\t\tcase '':\r\n\t\tcase '#apis':\r\n\t\t\t$(\"#apis\").addClass(\"is-active\");\r\n\t\t\t$(\"#guides\").removeClass(\"is-active\");\r\n\t\t\tloadPage(compileTemplate('apis'));\r\n\t\t\tbreak;\r\n\t\tcase '#guides':\r\n\t\t\t$(\"#apis\").removeClass(\"is-active\");\r\n\t\t\t$(\"#guides\").addClass(\"is-active\");\r\n\t\t\tloadPage(compileTemplate('guides'));\r\n\t\t\tbreak;\r\n\t\tdefault:\t\r\n\t\t\tconst hash = unescape(window.location.hash.substring(1));\r\n\t\t\tconst item = MEMBERS.find(it => it.signature == hash);\r\n\t\t\tif (item) {\r\n\t\t\t\tloadPage(compileTemplate('default', item));\r\n\t\t\t} else {\r\n\t\t\t\tconst guide = GUIDES[hash];\r\n\t\t\t\tif (guide) {\r\n\t\t\t\t\tif (!guide.processed) {\r\n\t\t\t\t\t\tguide.content = process_comment(undefined, guide.content);\r\n\t\t\t\t\t\tguide.processed = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tloadPage(Handlebars.compile(guide.content)());\r\n\t\t\t\t} else {\r\n\t\t\t\t\tloadPage(compileTemplate('error'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t}\r\n}", "function prepPage() {\r\n uriObj = parseURI();\r\n if (uriObj['show'] && uriObj['show'] != 'ep' && !uriObj['eid'] && !uriObj['aid']) return;\r\n\tinitTooltips();\r\n loadData('anime/a'+uriObj['aid']+'.xml',parseData);\r\n}", "function PagesContent() {\n\n}", "function loadListPageData() {\n $('#list > ul').html(setListPageSensors());\n}", "function getData(page, cb) {\n var xhr = new XMLHttpRequest();\n \n\n xhr.open(\"GET\", baseURL + offsetValue + apikey );\n xhr.send();\n\n xhr.onreadystatechange = function () {\n //console.dir(data);\n if (this.readyState == 4 && this.status == 200) {\n cb(JSON.parse(this.responseText));\n }\n };\n}", "function myHome(data){\n let theHouseNumber = window.location.search //searches the URL\n let i = theHouseNumber.slice(1); //slices our the '?'\n let housePrice = data[i].price;\n let houseSqft = data[i].sqft;\n let details = data[i].fname + \" \" + data[i].lname + \"<br>Bathrooms: \" + data[i].baths + \" Bedrooms: \" + data[i].beds + \"<br>Year built: \" + data[i].yrblt.slice(0, 4) + \"<br>Square feet: \" + houseSqft.toLocaleString();\n let address = data[i].street + \", \" + data[i].city + \", \" + data[i].state + \" \" + data[i].zip ;\n let img = \"<img style='max-width:100%; height:auto' src='http://localhost:8080/\" + data[i].imageurl + \"'></img>\" ;\n let lister = data[i].listing + \" \" + data[i].phone;\n\n //the following appends to the html that is already loaded onto the page\n $(\"#htmlImg\").html(img);\n $(\"#htmlTitle\").append(housePrice.toLocaleString());\n $(\"#htmlDetails\").append(details);\n $(\"#htmlLister\").append(lister);\n $(\"#htmlAddress\").append(address);\n}", "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headGeneralInformationLi\").addClass(\"active\");\r\n\t\tgetSeries();\r\n\t\t$(\"#divLeft,#divHead,#divFoot\").addClass(\"notPrintable\");\r\n\t\t$(\"#startTime\").val(window.byd.DateUtil.lastWorkDate());\r\n\r\n\t\tajaxQueryReplacementCost(\"monthly\");\r\n \tajaxQueryReplacementCost(\"yearly\");\r\n \tajaxQueryCostDistribute();\r\n\t\tresetAll();\r\n\t}", "function mainPage() { //Fetch from Web service and get Json data with Fetch\n\n fetch(DATA.showUrl.url).then( (response)=> {//Response is Promise object\n return response.json();\n }).then(function (myJson) {\n const shows = DATA.createShow(myJson); //Create Shows\n UI.createMainPage(shows) //Append show to Page\n }).catch((myJsonError)=>{\n alert(\"Your request failed\",myJsonError);\n });\n }", "function load_game_overview_data(page_data) {\n var status = page_data.game_status;\n var map_data;\n delete page_data.game_status;\n\n if(status == \"ongoing\"){\n var orders = page_data.orders;\n var punits = page_data.player_units;\n var year = page_data.year;\n var season = page_data.season;\n var phase = page_data.phase;\n var order_result = page_data.order_result;\n delete page_data.orders;\n delete page_data.player_units;\n delete page_data.year;\n delete page_data.season;\n delete page_data.phase;\n delete page_data.order_result;\n var stat_acc = \"<b>\"+year+\"_\"+season+\"_\"+phase+\"</b>\";\n\n $('#game_header').html(\"<h1>Game Overview</h1>\");\n $('#game_order_info').html(orders?interpret_orders(orders):\"No Orders\");\n $('#order_feedback').html(order_result?interpret_result_orders(order_result):\"No resulting orders\");\n $('#game_stat_info').html(stat_acc);\n $('#game_stat').show();\n $('#press_game_id').val(page_data.game_id);\n\n rownum = 0;\n $('#order_gen').html(\"\");\n\n map_data = {\n punits: punits,\n country: page_data.country,\n phase: phase,\n resOrd: order_result\n };\n }else if(page_data.status == \"finished\"){\n $('#game_header').html(\"<h1>Finished Game Overview</h1>\");\n $('#game_stat').hide();\n }\n\n var units = page_data.unit_list;\n var owners = page_data.owner_list;\n\n delete page_data.unit_list;\n delete page_data.owner_list;\n var acc = \"\";\n for(var i in page_data){\n acc += i+\": <b>\"+page_data[i]+\"</b><br>\";\n }\n acc += \"<br>\";\n $('#gov_info').html(acc);\n $('#game_id').val(page_data.game_id);\n $('#mid_area').html('<div id=\"canvas_div\"><canvas id=\"canvas\" width=\"1154\" height=\"996\"></canvas></div>');\n $('#canvas_div').css('left', ((window.innerWidth-1154)*0.5-7)+'px');\n\n //Keep the map always in the middle\n window.onresize = function(){\n $('#canvas_div').css('left', ((window.innerWidth-1154)*0.5-7)+'px');\n if(page!==\"game\")\n window.onresize = null;\n }\n\n //after page contents are loaded, draw the map and units\n $('#world').ready(function(){\n prepareCanvas(units, owners, map_data);\n });\n}", "function goFoward(){\n // update the master page number setting and fetch the next page of data\n page += 1\n getMonsters()\n}", "function initializePage() {\n\t// add any functionality and listeners you want here\n\tvar path = window.location.pathname;\n\tvar data = 'data';\n\tif (path.slice(0,path.lastIndexOf('/')+1) == \"/profile/\"){\n\t\tdata = '../data';\n\t}\n\n\n\t$.get(data,checkData);\n\n}", "getCharactersDataAPI() {\n this.props.setLoadingSpinnerStatus(true);\n\n getCharacter({ page: this.props.charactersPageNumber })\n .then(data => {\n this.props.setCharacterList([\n ...this.props.charactersList,\n ...data.results\n ]);\n this.props.setCharactersPageNumber(\n checkValue(data.info.next)\n ? this.props.charactersPageNumber + 1\n : false\n );\n this.props.setLoadingSpinnerStatus(false);\n })\n .catch(err => handleError(err));\n }", "function artistInfoTab() {\n var featureRelId = getUrlVars()['transferId'];\n var userSiteId = getUrlVars()['touchId'];\n var featureId = getUrlVars()['mId'];\n var url = baseUrl + 'web/web/getMenuHtml/' + featureId + '/' + featureRelId + '/' + userSiteId;\n\n var data = '';\n doAjaxCall(url, data, false, function (html) {\n\t\tconsole.log(html);\n if ($.isEmptyObject(html)) {\n $('#main-content').html('Sorry we do not have data');\n } else {\n\t\t \n\t\t\tvar featureName='';\n var backGroundColor, textColor, description,pic;\n $.each(html, function (i, item) {\n backGroundColor = item.globalBackground;\n textColor = item.globalTextColor;\n\t\t\t\tif(item.thumbnail=='')\n\t\t\t\t{\n\t\t\t\tpic='';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\tpic='<img src=\"'+baseUrl+item.thumbnail+'\"width=\"100%\" height=\"80px\"/>'\n\t\t\t\t}\n description= '<div>'+pic+item.description+'</div>';\n featureName = item.featureName;\n\t\t\t\t\n })\n if (description == '') {\n $('#main-content').html('Sorry We Have An Empty Data');\n } else {\n $('#main-content').html(description);\n\t\t\t\tfeatureNameTitle(featureName);\n\t\t\t\n\t\t\t\t getUserAppereance();\n\t\t\t\t\n\t\t\t}\n $('#main-content').css({ 'background-color': '#' + backGroundColor, 'color': '#' + textColor });\n }\n \n });\n}", "function showInfo(data, tabletop) {\n\n // TODO: sanitize data from Spreadsheet completely from any HTML tags, maybe here. (maybe also replace old tags by new Markup Syntax)\n\n var curItem = \"\";\n var curType = \"\";\n var curM = [];\n var curR = [];\n var curMText = \"\";\n var curRText = \"\";\n var curMScores = 0;\n var curRScores = 0;\n var curMUsers = \"\";\n var curRUsers = \"\";\n var curMLength = 0;\n var curRLength = 0;\n var curSortMap = [];\n var curPageMap = [];\n var newItem = true;\n var addItems = data.length;\n\n CMTableData = data;\n\n if (!CMIsList) {\n\n CMChar = (CMIsReview) ? decodeURIComponent($(\"#character span\").html()) : ((CMIsLesson) ? decodeURIComponent($(\"#character\").html()) :\n decodeURIComponent(window.location.pathname.substring(window.location.pathname.lastIndexOf(\"/\") + 1)));\n CMType = (CMIsReview) ? (($(\"#character\").attr(\"class\") !== \"radical\") ? (($(\"#character\").attr(\"class\") == \"kanji\") ? \"k\" : \"v\") : \"r\") :\n ((CMIsLesson) ? (($(\"#main-info\").attr(\"class\") !== \"radical\") ? (($(\"#main-info\").attr(\"class\") == \"kanji\") ? \"k\" : \"v\") : \"r\") : ((window.location.pathname.indexOf(\"kanji\") > -1) ? \"k\" : \"v\"));\n\n for (var a = 0; a < data.length; a++) {\n if (data[a].Item.substring(1) == CMChar && data[a].Item.substring(0, 1) == CMType) {\n newItem = false;\n CMIndex = a + 2;\n break;\n }\n }\n\n } else {\n\n var urlString = window.location.pathname;\n\n newItem = false;\n\n if ((urlString).indexOf(\"/level/\") > -1) CMIndex = 0;\n else {\n if ((urlString).indexOf(\"/kanji\") > -1) CMIndex = 1;\n else CMIndex = 2;\n }\n }\n\n if (CMInitSettings || CMInitVotes)\n CMInitData = true;\n\n if (!CMInitData && !newItem && data.length > (Object.keys(CMData.k).length + Object.keys(CMData.v).length)) {\n var lastItem = data[Object.keys(CMData.k).length + Object.keys(CMData.v).length - 1].Item;\n if (lastItem == \"k\" + Object.keys(CMData.k)[Object.keys(CMData.k).length - 1] ||\n lastItem == \"v\" + Object.keys(CMData.v)[Object.keys(CMData.v).length - 1])\n addItems = Object.keys(CMData.k).length + Object.keys(CMData.v).length;\n else {\n CMInitData = true;\n CMData = {\"k\": [], \"v\": []};\n }\n } else if (!CMInitData && data.length < (Object.keys(CMData.k).length + Object.keys(CMData.v).length)) {\n CMInitData = true;\n CMData = {\"k\": [], \"v\": []};\n }\n\n for (var d = 0; d < data.length; d++) {\n\n if (CMInitData || d + 2 == CMIndex || d >= addItems) {\n\n curItem = data[d].Item.substring(1);\n \tcurType = data[d].Item.substring(0, 1);\n curMText = data[d].Meaning_Mnem.split(\"|\");\n curRText = data[d].Reading_Mnem.split(\"|\");\n curMScores = data[d].Meaning_Score.split(\"|\");\n curRScores = data[d].Reading_Score.split(\"|\");\n curMUsers = data[d].Meaning_User.split(\"|\");\n curRUsers = data[d].Reading_User.split(\"|\");\n curMLength = curMUsers.length;\n curRLength = curRUsers.length;\n\n if (!CMIsList && !newItem && d + 2 == CMIndex) {\n if (CMData[CMType][CMChar] == undefined) {\n CMData[CMType][CMChar] = {\"m\": {\"t\": curMText, \"s\": curMScores, \"u\": curMUsers}, \"r\": {\"t\": curRText, \"s\": curRScores, \"u\": curRUsers}};\n }\n if (!CMInitData) CMDataConvert();\n CMSortMap = getCMSortMap(curMScores, curRScores);\n CMPageMap = getCMPageMap(curMUsers, curRUsers);\n }\n\n curSortMap = (d + 2 !== CMIndex) ? getCMSortMap(curMScores, curRScores) : CMSortMap;\n curPageMap = (d + 2 !== CMIndex) ? getCMPageMap(curMUsers, curRUsers) : CMPageMap;\n\n if (CMInitSettings || CMSettings[curType][curItem] === undefined ) CMSettings[curType][curItem] = {\"m\": {\"p\": ((curMLength > 0) ? curMUsers[curSortMap.m[0]] : \"\"),\n \"c\": ((($.inArray( CMUser, curMUsers )) > -1))}, \"r\": {\"p\": ((curRLength > 0) ? curRUsers[curSortMap.r[0]] : \"\"), \"c\": (($.inArray( CMUser, curRUsers )) > -1)}};\n else {\n if (($.inArray( CMSettings[curType][curItem].m.p, curMUsers )) < 0) CMSettings[curType][curItem].m.p = curMUsers[curSortMap.m[0]];\n if (($.inArray( CMSettings[curType][curItem].r.p, curRUsers )) < 0) CMSettings[curType][curItem].r.p = curRUsers[curSortMap.r[0]];\n CMSettings[curType][curItem].m.c = (($.inArray( CMUser, curMUsers )) > -1);\n CMSettings[curType][curItem].r.c = (($.inArray( CMUser, curRUsers )) > -1);\n }\n if (CMInitVotes || CMVotes[curType][curItem] === undefined) {\n CMVotes[curType][curItem] = {\"m\": [], \"r\": []};\n for (var mv = 0; mv < curMLength; mv++) CMVotes[curType][curItem].m[curMUsers[mv] + \":\" + curMText[mv]] = 0;\n for (var rv = 0; rv < curRLength; rv++) CMVotes[curType][curItem].r[curRUsers[rv] + \":\" + curRText[rv]] = 0;\n }\n\n for (var ms = 0; ms < curMLength; ms++) curMScores[ms] = parseInt(curMScores[ms]);\n for (var rs = 0; rs < curRLength; rs++) curRScores[rs] = parseInt(curRScores[rs]);\n\n CMData[curType][curItem] = {\"i\": d + 2, \"m\": {\"t\": curMText, \"s\": curMScores, \"u\": curMUsers}, \"r\": {\"t\": curRText, \"s\": curRScores, \"u\": curRUsers}};\n\n curM = [];\n curR = [];\n\n if (!CMInitData && addItems == data.length) break;\n\n }\n }\n\n if (newItem) {\n if (CMChar.length > 0 && CMChar !== \"&nbsp\" && CMType !== \"r\") {\n CMIndex = (CMInitSettings) ? d : data.length + 2;\n CMSettings[CMType][CMChar] = {\"m\": {\"p\": \"\", \"c\": false}, \"r\": {\"p\": \"\", \"c\": false}};\n CMVotes[CMType][CMChar] = {\"m\": [], \"r\": []};\n CMData[CMType][CMChar] = {\"i\": d + 2, \"m\": {\"t\": [\"\"], \"s\": [], \"u\": [\"\"]}, \"r\": {\"t\": [\"\"], \"s\": [], \"u\": [\"\"]}};\n CMSortMap = getCMSortMap([], []);\n CMPageMap = getCMPageMap([], []);\n CMPageIndex.m = 0;\n \tCMPageIndex.r = 0;\n postCM(0);\n }\n } else {\n if (!CMIsList) CMPageIndex = {\"m\": $.inArray( CMPageMap.m[CMSettings[CMType][CMChar].m.p], CMSortMap.m ), \"r\": $.inArray( CMPageMap.r[CMSettings[CMType][CMChar].r.p], CMSortMap.r )};\n CMReady = true;\n }\n\n saveCMData();\n saveCMSettings();\n if (CMInitVotes) saveCMVotes();\n\n if (CMIsLesson) {\n if (CMType !== \"r\") {\n $('<h2>Community Meaning Mnemonic</h2><div id=\"cm-meaning\" class=\"cm\"><p class=\"loadingCM\">Loading...</p></div>')\n .insertAfter($(\"#supplement-\" + ((CMType == \"k\") ? \"kan\" : \"voc\") + \"-meaning-notes\"));\n $('<h2>Community Reading Mnemonic</h2><div id=\"cm-reading\" class=\"cm\"><p class=\"loadingCM\">Loading...</p></div>')\n .insertAfter($(\"#supplement-\" + ((CMType == \"k\") ? \"kan\" : \"voc\") + \"-reading-notes\"));\n \t}\n }\n\n if (!CMIsReview && !CMIsList) loadCM(false, false);\n else if (CMIsList) initCMList();\n}", "renderPage() {}", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let content = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = content.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n description = content.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('contentDisplay').innerHTML =description;\r\n //console.log(content); \r\n // access summary brute force \r\n //let summary = page[pageID].revisions[0][\"*\"][10];\r\n //console.log('SUMMARY' + summary);\r\n }", "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headAssemblyLi\").addClass(\"active\");\r\n\t\t$(\"#leftCarQueryLi\").addClass(\"active\");\r\n\t\tgetSeries();\r\n\t\tfillLineSelect();\r\n\t\t$(\"#carTag\").hide();\r\n\t\t$(\"#resultTable\").hide();\r\n\t\t$(\"#tabTestLine\").hide();\r\n\t}", "function loadStringsPage(){\n\tloadNavbar();\n\tgenerateProductPage(\"strings\");\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 initializePage() {\n $(\".glyphicon-user\").closest('button').addClass('active');\n\t$.get(\"/chars\", loadUser);\n \n\n var team = $(\"#tm\").text();\n $(\"#teamname\").text(team);\n if(team == \"Heroes\"){\n $('link[rel=stylesheet][href~=\"/css/team2.css\"]').remove();\n // $('#smallher').show();\n }\n if(team == \"Villains\"){\n $('link[rel=stylesheet][href~=\"/css/team1.css\"]').remove();\n //$('#smallvil').show();\n }\n\n var avat = $('#avat').text();\n // var newavatar =\"#\"+ avat + \"Big\";\n //$(newavatar).show();\n var name = $('#name').text();\n $(\"#user\").text(name);\n var points = $(\"#pts\").text();\n //console.log(points);\n $('#points').text(points + \" points\");\n}", "function init() {\n\n\t\t// > = greatar than\n\t\t// < = less than\n\t\t\n\n\t\t/* -------------------------------------------------- */\n\t\t/* CACHE\n\t\t/* -------------------------------------------------- */\n\t\t\n\t\tvar page = $('.page').data('page');\n\n\n\t\t/* -------------------------------------------------- */\n\t\t/* HOME\n\t\t/* -------------------------------------------------- */\n\n\t\tif ( page === 'index' ) {\n\t\t\t\n\t\t\tconsole.log('Home Page');\n\t\t\t\n\t\t}\n\t \n\t\t\n\t /* -------------------------------------------------- */\n\t\t/* PRIVACY AND TERMS OF USE\n\t\t/* -------------------------------------------------- */\n\n\t\telse if ( page === 'legal' ) {\n\n\t\t\tconsole.log('Privacy and Terms of Use Page');\n\t\t\t\n\t\t}\n\t \n\t\t\n\t\t/* -------------------------------------------------- */\n\t\t/* ERROR\n\t\t/* -------------------------------------------------- */\n\n\t\telse {\n\n\t\t\tconsole.log('Error Page');\n\t\t\t\n\t\t}\n\n\t}", "function renderList(res, data, numPages, currentLetter, currentPage) {\n\tres.render('index', {\n\t\ttitle: 'iPlayer A to Z',\n\t\tletters: generateLetters(26),\n\t\tprogrammes: data,\n\t\tpages: generatePagination(numPages),\n\t\tcurrentLetter,\n\t\tcurrentPage\n\t});\n}", "function startatLoad(){\r\n\tloadNavbar(function(){\r\n\t\tgetPT1000XMLData(function(){\r\n\t\t\tshowPT1000values();\r\n\t\t});\r\n\t});\r\n}", "function loadPage() {\n addUserInfo();\n}", "function getData() \n{\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function ()\n {\n if (this.readyState == 4 && this.status == 200)\n {\n // creates a new Data() object from picalc.js\n window.data = new Data(JSON.parse (this.responseText));\n\n // this is essentially the view logic; it builds the HTML\n setup();\n }\n };\n\n xmlhttp.open(\"GET\", \"https://tspi.io/factory-planet/planetary_commodities.json\", true);\n xmlhttp.send();\n}", "function load_page(callback) {\n var page_url = window.document.location + 'page/' + page + '.yaws';\n $(\"#power_msg\").val('');\n $.get(page_url, function(data) {\n pageDiv.html(data);\n if (callback != undefined)\n callback();\n });\n}", "function RDVariableInitialize(){\n /* Get the html file name */\n var path = window.location.pathname;\n pageName = path.split(\"/\").pop();\n\n /* Create artwork array data */\n ArtworkArray = [\n new Artwork(\"media/image/Testing.jpg\", \"待更新\", \n \"標題\", \"內容\", \"https://www.youtube.com/embed/pJ_m5lDftYc\", \"HOMEPAGE:VFX\"),\n new Artwork(\"media/image/Testing.jpg\", \"待更新\", \n \"標題\", \"內容\", \"https://www.youtube.com/embed/pJ_m5lDftYc\", \"VFX\"),\n ];\n\n /* Create profile array data */\n ProfileArray = [\n new Profile(\"media/image/profile.png\", \"奇昌\", \"平面網頁工程師\"),\n new Profile(\"media/image/profile.png\", \"君昊\", \"特效合成師\"),\n new Profile(\"media/image/profile.png\", \"文杰\", \"建模與材質設計師\"),\n new Profile(\"media/image/profile.png\", \"昱安\", \"後端工程與遊戲工程師\"),\n new Profile(\"media/image/profile.png\", \"宥宇\", \"建模師\"),\n new Profile(\"media/image/profile.png\", \"冠宇\", \"角色設計師\"),\n new Profile(\"media/image/profile.png\", \"沅叡\", \"待更新\")\n ];\n\n /* Create patterm that use for index webpage animation */\n IndexArtworkPatterm = [\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"8:4\", \"flip-left:flip-right\"),\n new WorkRenderPatterm(\"4:4:4\", \"fade-up:fade-up:fade-up\"),\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"8:4\", \"flip-left:flip-right\"),\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"12\", \"fade-up\")\n ];\n\n /* Create patterm that use for work webpage animation */\n WorkArtworkPatterm = [\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"8:4\", \"flip-left:flip-right\"),\n new WorkRenderPatterm(\"4:4:4\", \"fade-up:fade-up:fade-up\"),\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"8:4\", \"flip-left:flip-right\"),\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"12\", \"fade-up\"),\n new WorkRenderPatterm(\"4:8\", \"flip-right:flip-left\"),\n new WorkRenderPatterm(\"8:4\", \"flip-left:flip-right\"),\n new WorkRenderPatterm(\"4:4:4\", \"fade-up:fade-up:fade-up\")\n ];\n\n /* Create carousel data set for about */\n MyAboutCarousel = [\n new AboutCarousel(\"media/image/TitleImage.jpg\", \"Test1\", \"Test Text\"),\n new AboutCarousel(\"media/image/TitleImage.jpg\", \"Test2\", \"Test Text\"),\n new AboutCarousel(\"media/image/TitleImage.jpg\", \"Test3\", \"Test Text\")\n ];\n\n /* Specifie the top title image or video path and type */\n IndexHomePageFilePath = \"media/video/HomeTitle.mp4\";\n AboutPageFilePath = \"media/image/TitleImage.jpg\";\n\n /* The title backgound color */\n IndexHomePageBackground = \"#000000\";\n AboutPageBackground = \"#000000\";\n\n $(\"#RDTitle\").text(\"Result\");\n $(\"#RDDescription\").html(\"我們結合了跨領域的人才 <br > 負責的項目從遊戲、 動畫, 到特效、後製合成製作\");\n $(\"#Introducing\").find('h4').html(\"Result Design 是因興趣而聚集起來創作的工作室.\");\n}", "function pagePopulate() {\n document.getElementById(\"title-text\").innerHTML = projectData.title;\n let statusHTML = \"\";\n switch (projectData.status) {\n case \"inprogress\":\n statusHTML =\n '<p>Project Status: <span class=\"inprogress\">In Progress</span></p>';\n break;\n case \"completed\":\n statusHTML =\n '<p>Project Status: <span class=\"completed\">Completed</span></p>';\n break;\n }\n document.getElementById(\"project-status\").innerHTML = statusHTML;\n document.getElementById(\"project-description\").innerHTML =\n projectData.about;\n if (projectData.projectLink != \"#\") {\n document.getElementById(\n \"project-links\"\n ).innerHTML += `<p><a href=\"${projectData.projectLink}\">VIEW PROJECT</a></p>`;\n }\n if (projectData.codeLink != \"#\") {\n document.getElementById(\n \"project-links\"\n ).innerHTML += `<p><a href=\"${projectData.codeLink}\">VIEW CODE</a></p>`;\n }\n\n for (let tag in projectData.tags) {\n document.getElementById(\n \"tags-list\"\n ).innerHTML += `<div class=\"tag\"><p>${filterIDs[projectData.tags[tag]].desc}</p></div>`;\n }\n document.getElementById(\"technoblurb\").innerHTML = projectData.techblurb;\n for (let tech in projectData.techlist) {\n document.getElementById(\n \"tech-list\"\n ).innerHTML += `<li>${projectData.techlist[tech]}</li>`;\n }\n for (let res in projectData.res) {\n document.getElementById(\"res-list\").innerHTML += projectData.res[res];\n }\n }", "function getPage(page,el){if(page===undefined){handleComing();return}fetch(page).then(function(res){return res.text()}).then(function(data){return displayFetch(el,data)});// give clicked element and the data from the server to display.\n}// if it does give the data to the function below for display.", "function servePage(data, page, title){\n setActivePage(data);\n var template = HtmlService.createTemplateFromFile(page).evaluate().setTitle(title);\n DocumentApp.getUi().showSidebar(template);\n}", "function renderMapPage() {\n /***\n * Funzione che carica la pagina della mappa nel div content,\n * richiama loadmap() che carica la mappa e vengono assegnati gli\n * on click ai pulsanti.\n */\n $(\"#content\").load(\"./pages/mappa.html\", function () {\n loadMap(); //Commentare se non va sul tablet\n $('a#btn-ranking').on('click', renderRankingPage);\n $('a#btn-profilo').on('click', renderProfilePage);\n });\n}", "function getPages()\n{\n\t//add each page to view in app\n\t//Examples:\n\t//for adding a header:\n\t////\"header\":{\n\t////\t\"url\":\"pages/general/header.html\",\n\t////\t\"left\":\"<a></a>\",\n\t////\t\"center\":\"<a></a>\",\n\t////\t\"right\":\"<a></a>\"\n\t////}\n\t//for adding a panel:\n\t////\"leftPanel\":{\n\t////\t\"id\":\"nav-panel\",\n\t////\t\"url\":\"pages/general/left_panel.html\"\n\t////}\n\t//for adding dialogs, you can add more then one\n\t////\"popup\":[\n\t//// {\n\t//// \t \"url\":\"pages/general/popup.html\",\n\t//// \t \"id\":\"dialog\", \n\t//// \t \"header\":\"myHeader\", \n\t//// \t \"title\":\"Hi Dialog!\", \n\t//// \t \"content\":\"You have to insert your own content here\", \n\t//// \t \"okButton\":{\"action\":\"alert('ok button action');\",\"location\":\"#login\",\"text\":\"OK\"}, \n\t//// \t \"cancelButton\":{\"action\":\"alert('cancel button action');\",\"location\":\"\",\"text\":\"Cancel\"}\n\t//// }\n\t//// ]\n\treturn [\n\t\t\t{\"id\":\"profile\", \"url\":\"pages/profile/user.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aUser'>User</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='validateProfile(); setSGMMDataTransaction(); saveUserMedicalData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"profileNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"mechanic\", \"url\":\"pages/profile/mechanic.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aMechanical'>Mecanico</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='saveMechanicData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"mechanicNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"medical\", \"url\":\"pages/profile/medical.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aMedical'>Medicos</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='saveUserMedicalData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"medicalNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"policiesContent\", \"url\":\"pages/policy/policiesContent.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a tag='a' lng='vehicles' onClick='backPolicy();' class='ui-btn ui-corner-all ui-icon-arrow-l ui-btn-icon-left'>Vehicles</a>\",\n\t\t\t \t\"center\":\"<h2 lng='vehicle'>Vehicle</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onClick='validPolicy();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\" \n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"showPolicies\", \"url\":\"pages/policy/showPolicies.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='vehicles'>Vehicles</h2>\",\n\t\t\t \t\"right\":\"<a onClick='validNewPolicy();' tag='a' id='save' class='ui-btn ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"policiesNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"contactsContent\", \"url\":\"pages/contacts/contactsContent.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#showContacts' tag='a' id='aContacts' class='ui-btn ui-corner-all ui-icon-arrow-l ui-btn-icon-left'>Contactos</a>\",\n\t\t\t \t\"center\":\"<h2 id='aContact'>Contacto</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='validateContact();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t }\n\t\t\t}, \n\t\t\t{\"id\":\"showContacts\", \"url\":\"pages/contacts/showContacts.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aContacts'>Contactos</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onClick='validNewContact();' class='ui-btn ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"sContactsNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t}, \n\t\t\t{\"id\":\"showInsurance\", \"url\":\"pages/contacts/insurance.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aInsurances'>Aseguradoras</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"sInsuranceNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"initial\", \"url\":\"pages/initial.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='report'>Reportar</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelInitial\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"sinDetails\", \"url\":\"pages/sinisters/details.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a lng='report' href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>Reportar</a>\",\n\t\t\t \t\"center\":\"<h2 lng='pictures'>Fotos</h2>\",\n\t\t\t \t\"right\":\"<a href='#' onclick='enviarExtras();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-left ui-btn-icon-notext'></a>\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"sinisterList\", \"url\":\"pages/sinisters/sinisterList.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='sinisters'>Siniestros</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelSinList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"theftsList\", \"url\":\"pages/sinisters/theftsList.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='thefts'>Robos</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelTheftList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"consultSinister\", \"url\":\"pages/sinisters/consultSinister.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>List</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>Details</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"signup\", \"url\":\"pages/account/signup.html\"\n\t\t\t},\n\t\t\t{\"id\":\"login\", \"url\":\"pages/account/login.html\"\n\t\t\t},\n\t\t\t{\"id\":\"signin\", \"url\":\"pages/account/signin.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_a\", \"url\":\"pages/account/features_a.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_b\", \"url\":\"pages/account/features_b.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_c\", \"url\":\"pages/account/features_c.html\"\n\t\t\t},\n\t\t\t{\"id\":\"options\", \"url\":\"pages/options/options.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='options'>Options</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelTheftList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"about\", \"url\":\"pages/options/about.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>options</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>About</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t},\n\t\t\t{\"id\":\"map\", \"url\":\"pages/sinisters/map.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>report</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>Location</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t},\n\t\t\t{\"id\":\"report\", \"url\":\"pages/sinisters/report.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a lng='report' href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>report</a>\",\n\t\t\t \t\"center\":\"<h2 id='titleReport' lng='details'>R.Type</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t}\n\t ];\n\t\n}", "function homePageLoader() {\n\n pageCreator(\"home-page\");\n navBar(\"home-page\");\n restaurantLogo();\n bookTableBtn(\"home-page\");\n socialMedia();\n}", "function loadPage() {\n getAPIData(`https://pokeapi.co/api/v2/pokemon?limit=25`).then(\n //?limit=25&offset=800\n async (data) => {\n for (const pokemon of data.results) {\n await getAPIData(pokemon.url).then((pokeData) => {\n populatePokeCard(pokeData)\n })\n }\n },\n )\n }", "function createPage() {\n init();\n generateCard();\n makeCommentsWork();\n makeCommentIconsWork();\n makeReactionsWork();\n displayCharLimit();\n}", "function loadPage() {\n var path = window.location.search,\n tab = (path.length > 0) ? path.split('?')[1].split('&') : [],\n argument1 = tab[0],\n argument2 = tab[1],\n argument3 = tab[2];\n\n $page.append(\n $('<div/>').addClass('text-center text-success').append(\n utils.fontAwesomeIcon('spinner fa-pulse fa-3x fa-fw')\n )\n );\n\n $.when(api.getApiDashboard()).then(function(args) {\n utils.setStorage('ligues', args.data.leagues);\n \n for(var l of args.data.leagues) {\n if(l.championship == 1) {\n ligne = $('<li/>').append(\n $('<a/>').attr('href', \"?championnat&\" + l.championship + \"&\" + l.id).append(\n $('<img/>').attr('src', \"images/flag-france.png\").attr('alt', l.name).addClass('icones'),\n l.name\n )\n );\n } else if(l.championship == 2) {\n ligne = $('<li/>').append(\n $('<a/>').attr('href', \"?championnat&\" + l.championship + \"&\" + l.id).append(\n $('<img/>').attr('src', \"images/flag-angleterre.png\").attr('alt', l.name).addClass('icones'),\n l.name\n )\n );\n } else {\n ligne = $('<li/>').append(\n $('<a/>').attr('href', \"?championnat&\" + l.championship + \"&\" + l.id).append(\n $('<img/>').attr('src', \"images/flag-espagne.png\").attr('alt', l.name).addClass('icones'),\n l.name\n )\n );\n }\n $('ul.liste-championnats').append(ligne);\n }\n \n if (argument1 === 'classement') {\n classement.getClassements();\n } else if (argument1 === 'transferts') {\n transferts.getTransferts();\n } else if (argument1 === 'resultats') {\n resultats.getResultats();\n } else if (argument1 === 'live') {\n live.getLive();\n } else if (argument1 === 'statistiques') {\n statistiques.getStatistiques();\n } else if (argument1 === 'equipes') {\n effectifs.getEffectifs();\n } else if (argument1 === 'match') {\n match.getMatch(argument2);\n } else if (argument1 === 'championnat') {\n utils.setStorage('championnat', argument2);\n utils.setStorage('league', argument3);\n championnat.getChampionnat();\n } else if (argument1 === 'ligue1') {\n ligue1.getLigue1();\n } else if (argument1 === 'pl') {\n pl.getPl();\n } else if (argument1 === 'liga') {\n liga.getLiga();\n } else {\n home.getHome();\n }\n });\n}", "function getAPIData_Characters(searchTerm, limit, callback){\n\t$(\".loaderTop\").toggleClass(\"hidden\");\n\t$.getJSON(MARVEL_API_URL_CHARS, q_Char(searchTerm, limit), callback, function(json){\n\t\t$(\".loaderTop\").toggleClass(\"hidden\");\n\t});\n}", "function fnGetChar() {\r\n console.log(\"fnGetChar() STARTS\");\r\n \r\n // Prepare to open the data from the JSON file, asynchronously\r\n xhr.open(\"GET\", \"characters.json\", true);\r\n // Send the request(without extra data)\r\n xhr.send(null);\r\n\r\n // loading DataCue, process it via Anonymous Function\r\n xhr.onload = function() {\r\n //Convert the JSON data to a JavaScript Objcet\r\n var charObj = JSON.parse(xhr.responseText);\r\n //Create a variable for a random character\r\n var randomChar = Math.floor(Math.random() * charObj.allChars.length);\r\n //String for the Character picture/name and stats\r\n var strName = \"\",\r\n strStats = \"\";\r\n\r\n console.log(charObj);\r\n \r\n //Add one(random)instance of a Character to the string\r\n strName += `<p><img src='./images/${charObj.allChars[randomChar].graphic}'></p>`;\r\n strName += `<p>${charObj.allChars[randomChar].name}</p>`;\r\n\r\n //Show Character on-screen, fade it in, in 2 seconds\r\n $elDivLeftCol.html(strName).hide().fadeIn(2500);\r\n\r\n strStats += `<p>Origin: ${charObj.allChars[randomChar].origin}</p>`;\r\n strStats += `<p>Powers:<br>\r\n <ul>\r\n <li>${charObj.allChars[randomChar].powers[0].p1}</li>\r\n <li>${charObj.allChars[randomChar].powers[0].p2}</li>\r\n </ul>\r\n </p>`;\r\n \r\n $elDivRightCol.html(strStats).hide().delay(250).fadeIn(1750);\r\n }; // END onload (after successful connection to the file)\r\n } // END fnGetChar()", "function characterInfoGet(incomingData, targetName){\n\tconsole.log(incomingData)\n\tconsole.log(targetName)\n\tvar characterName = targetName.replace(idCurrentSeason(),'')\n\tvar counter = 0;\n\twhile (counter != incomingData.length){\n\t\t//console.log(incomingData[counter].Name)\n\t\tif (incomingData[counter].Name == characterName){\n\t\t\tconsole.log(\"Found \" + characterName)\n\t\t\tvar infoContain = Object.entries(incomingData[counter])\n\t\t\tconsole.log(infoContain.length)\n\t\t\tvar counterTwo = 0\n\t\t\twhile (counterTwo != infoContain.length){\n\t\t\t\tif (counterTwo == 0){\n\t\t\t\t\tvar charImageLine = `\n\t\t\t\t\t<div id=\"${modalBoxElementIdSet()}\" class=\"modal-custom\">\n\t\t\t\t\t<div class=\"modal-custom-content\">\n\t\t\t\t\t\t<span id=\"${modalCloseIdSet()}\" class=\"close\">close</span>\n\t\t\t\t\t\t\n\t\t\t\t\t\t<div id=${modalInfoIdSet()}>\n\t\t\t\t\t\t\t<img src =${infoContain[1][1]} class=\"character-info-image\">\n\t\t\t\t\t\t\t<p class=\"character-info-name\">${infoContain[counterTwo][1]}</p>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t`\n\t\t\t\t\tvar targetContainer = modalElementSelect()\n\t\t\t\t\ttargetContainer.innerHTML=\"\"\n\t\t\t\t\ttargetContainer.innerHTML+= charImageLine\n\t\t\t\t}\n\t\t\t\telse if (counterTwo != 1){\n\t\t\t\t\tconsole.log(infoContain[counterTwo][0] + \": \" + infoContain[counterTwo][1])\n\t\t\t\t\tvar charInfoLine = `\n\t\t\t\t\t<p>${infoContain[counterTwo][0]}: ${infoContain[counterTwo][1]}</p>\n\t\t\t\t\t`\n\t\t\t\t\tvar targetContainer = document.getElementById(modalInfoIdSet())\n\t\t\t\t\t//var targetContainer = document.body\n\t\t\t\t\tconsole.log(\"HERE\")\n\t\t\t\t\ttargetContainer.innerHTML+= charInfoLine\n\t\t\t\t}\n\t\t\t\tcounterTwo++;\n\t\t\t}\n\t\t\tvar testSplit= infoContain[1]\n\t\t\tconsole.log(testSplit[0])\n\t\t}\n\t\tcounter++;\n\t}\n}", "function RequestLoadPersonalData() {\n\n}", "function characterPanel() {\n\t$.get(\"../php/playerPage/characterPanel.php\", {}, returnCharacterPanel);\n}", "function buildPage(){\n addItems('make', make);\n addItems('model', model);\n addItems('keywords', keywords);\n checkAll();\n}", "function loadMainPage(){\n // Loop through app sections to create button to go to section\n appSections.forEach(option => {\n if(option.section != 'home'){\n // Create Button\n mealPlanButton = document.createElement('button');\n // Apply Classes\n mealPlanButton.classList.add('main-button');\n mealPlanButton.classList.add('transition');\n // Add Text Content\n mealPlanButton.textContent = option.name;\n // Add Data Attribute (Section)\n mealPlanButton.dataset.section = option.section;\n // Add Event Listener\n mealPlanButton.addEventListener('click', goToSection)\n // Append Button to Container\n homeContainer.appendChild(mealPlanButton);\n }\n });\n }", "function go_mainpage(){\n\n object.getpage('mainpage.html');\n }", "function renderPage(renderer) { \n util.requestJSON(dataURL, function(data) {\n data.imageURLs = mainWindow.file_list;\n data.annotationURLs = getAnnotationURLs(mainWindow.directory, mainWindow.file_list, 'annotated');\n data.colormap = createColormap(params.label, data.labels);\n params.width = data.size.width;\n params.height = data.size.height;\n renderer(data, params);\n });\n }", "function setUpPage(){\r\n displayHeader();\r\n displayFooter();\r\n displaySideBar();\r\n createEventListeners();\r\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 infoTab1Info(html) {\n var featureRelId = getUrlVars()['transferId'];\n var userSiteId = getUrlVars()['touchId'];\n var featureId = getUrlVars()['mId'];\n\tvar featureName = getUrlVars()['featureName'];\n\tfeatureName = featureName.replace(/\\%20/g,' ');\n\tfeatureNameTitle(featureName);\n\t\n var url = baseUrl + 'web/web/getMenuHtml/' + featureId + '/' + featureRelId + '/' + userSiteId;\n\n var data = '';\n doAjaxCall(url, data, false, function (html) {\n if ($.isEmptyObject(html)) {\n $('#main-content').html('Sorry we have an info Tab data');\n } else {\n var backGroundColor, textColor, description;\n $.each(html, function (i, item) {\n backGroundColor = item.globalBackground;\n textColor = item.globalTextColor;\n description = item.description;\n })\n if (description == '') {\n $('#main-content').html('Sorry We Have An Empty Data');\n } else {\n $('#main-content').html(description);\n }\n $('#main-content').css({ 'background-color': '#' + backGroundColor, 'color': '#' + textColor });\n }\n getUserAppereance();\n });\n\n}", "function initializePage(response) {\n\t\t\n // read data, build arrays\n parseJSON(response);\n\n // pass object sizes to functions that build the page\n var teamLength = teamCollection.length;\n var investorsLength = investorsCollection.length;\n\n\t\t\n\t\t\n\t\t\n // sort investor data by display order\n investorsCollection.sort(\n function(a,b) {\n if (a.display_order < b.display_order) {\n return -1;\n }\n if (a.display_order > b.display_order) {\n return 0;\n }\n }\n );\n // this originally helped me to figure out which page was in the view\n\t\t// but I don't think it can help me now, since I have both staff\n\t\t// and investors on the same page\n\t\tbuildSection(teamLength,\"team\");\n\t\tbuildSection(investorsLength,\"investors\");\n\t\t\n } // end initializePage()", "function pageLoad (){\n fetch(quoteAPI)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n quoteData = data;\n renderNewQuote();\n });\n\n fetch(fontAPI)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n fontData = data;\n renderNewFont ();\n });\n}", "function pageOnLoad(){\n render(datasetInit);\n render(convertedDataSet1992);\n }", "function mr_center_piece(offset, data){\n\t//service called time to set div classes to given results\n\t//console.log(data[offset]);\n\t$('.national_widget-content-textarea-t1').html(data[offset].c_name);\n\t$('.national_widget-content-image').css('background','url(http://apifin2.synapsys.us/images/'+data[offset].c_logo+') no-repeat');\n\t//$('.mrwidget_counter').html('#' + (offset+1));\n\n\t// link to profile URL\n\t$(\".profile-link\").attr(\"href\", data[offset].c_name);\n}//END OF FUNCTION", "function startatLoad(){\r\n\tloadNavbar(function(){\r\n\t\tsetSelectMenuesValues(function(){\r\n\t\t\t\tgetXMLData(function(){\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t});\r\n}", "function setupPage() {\n getMonsters()\n setNewMonsterHandler()\n pageHandler()\n console.log('%cRan all setup functions', 'color: green')\n}", "function setupPage() {\n let keyword = window.sessionStorage.getItem('keyword')\n let start_date = window.sessionStorage.getItem('start_date')\n let start_time = window.sessionStorage.getItem('start_time')\n let end_date = window.sessionStorage.getItem('end_date')\n let end_time = window.sessionStorage.getItem('end_time')\n let category = window.sessionStorage.getItem('category')\n let location = window.sessionStorage.getItem('location')\n \n document.getElementById(\"identifiers\").innerHTML = \"\"\n \n if( keyword != \"\" ){\n document.getElementById(\"identifiers\").innerHTML += \"\\\"\" + keyword + \"\\\"\"\n }\n \n if( start_date != \"\" && end_date != \"\"){\n document.getElementById(\"identifiers\").innerHTML += start_date + \" to \" + end_date\n }\n \n if( category != \"\" ){\n document.getElementById(\"identifiers\").innerHTML += \", \" + category;\n }\n \n if( location != \"\" ){\n document.getElementById(\"identifiers\").innerHTML += \", \" + location\n }\n \n search(keyword, start_date, start_time, end_date, end_time, category, location)\n}", "function gotContent(data){\r\n let page = data.query.pages; \r\n //console.log(page);\r\n let pageID = Object.keys(data.query.pages)[0];\r\n console.log(pageID);\r\n\r\n let followUpContent = page[pageID].revisions[0][\"*\"];\r\n startOfContentChar = \"'''\"\r\n startCharIndex = followUpContent.search(startOfContentChar) + 3;\r\n console.log(startCharIndex);\r\n endCharIndex = startCharIndex + 200 + 1;\r\n secondDescription = followUpContent.substring(startCharIndex, endCharIndex) + '...'\r\n document.getElementById('secondContentDisplay').innerHTML =secondDescription; \r\n }", "function pagehtml(){\treturn pageholder();}", "function loadContent() {\n// accessing the DOM by means of id-myApp (shell HTML page)\n var contentDiv = document.getElementById(\"myApp\"),\n //remove the # symbol from location hash and store the value in fragmentId\n fragmentId = location.hash.substr(1);\n // function call to getcontent\n getContent(fragmentId, function (content) {\n // call back \n // replace the content into Shell HTML\n contentDiv.innerHTML = content;\n });\n // On Load of shopping module \n if (fragmentId === \"shop\") {\n // function call to getFurnitureData - For function body, refer to shoppingList.js\n getFurnitureData();\n }\n}", "function outputResponse(data, page) {\r\n let output = '';\r\n\r\n if (page === 'films') {\r\n data.results.forEach(item => {\r\n // Append resutls into empty output string\r\n output += `\r\n <div class=\"card m-1 p-4\" style=\"opacity:.8\">\r\n <h3 class=\"card-title text-center\" style=\"width: 18rem;\">${item.title}</h3>\r\n <div class=\"card-content\">\r\n <p class=\"card-text text-center\">Producer: ${item.producer}</p>\r\n <p class=\"card-text text-center\">Director: ${item.director}</p>\r\n <p class=\"card-text text-center\">Release date: ${item.release_date}</p>\r\n <p class=\"card-text text-center\">\r\n <span class=\"quote\">\"</span>\r\n ${item.opening_crawl}\r\n <span class=\"quote\">\"</span>\r\n </p>\r\n </div>\r\n </div>\r\n `;\r\n })\r\n }\r\n if (page === 'people') {\r\n data.results.forEach(item => {\r\n output += `\r\n <div class=\"card m-1 p-2\" style=\"opacity:.8\">\r\n <h3 class=\"card-title text-center\">${item.name}</h3>\r\n <div class=\"card-content\">\r\n <p class=\"card-text\">Gender: ${item.gender}</p>\r\n <p class=\"card-text\">Height: ${item.height}</p>\r\n <p class=\"card-text\">Weight: ${item.mass}</p>\r\n <p class=\"card-text\">Skin Colour: ${item.skin_color}</p>\r\n </div>\r\n </div>\r\n `\r\n })\r\n }\r\n\r\n if (page === 'planets') {\r\n data.results.forEach(item => {\r\n output += `\r\n <div class=\"card m-1 p-2\" style=\"opacity:.8\">\r\n <h3 class=\"card-title text-center\">${item.name}</h3>\r\n <div class=\"card-content\">\r\n <p class=\"card-text\">Diameter: ${item.diameter}</p>\r\n <p class=\"card-text\">Year Length: ${item.orbital_period} days</p>\r\n <p class=\"card-text\">Day Length: ${item.rotation_period} hours</p>\r\n <p class=\"card-text\">Terrain: ${item.terrain}</p>\r\n </div>\r\n </div>\r\n `\r\n })\r\n }\r\n\r\n if (page === 'starships') {\r\n data.results.forEach(item => {\r\n output += `\r\n <div class=\"card m-1 p-2\" style=\"opacity:.8\">\r\n <h3 class=\"card-title text-center\">${item.name}</h3>\r\n <div class=\"card-content\">\r\n <p class=\"card-text\">Crew: ${item.crew}</p>\r\n <p class=\"card-text\">Hyper Drive Class: ${item.hyperdrive_rating}</p>\r\n <p class=\"card-text\">Model: ${item.model} hours</p>\r\n <p class=\"card-text\">Passengers: ${item.passengers}</p>\r\n </div>\r\n </div>\r\n `\r\n })\r\n }\r\n // Add data to page\r\n results.innerHTML = output;\r\n}" ]
[ "0.6030265", "0.59306175", "0.58503073", "0.5833472", "0.57689327", "0.5762538", "0.5739426", "0.57318944", "0.5671519", "0.5648023", "0.5646728", "0.56364447", "0.5626266", "0.5613706", "0.5609907", "0.5597157", "0.5591554", "0.558113", "0.5580748", "0.5574665", "0.5569236", "0.55674636", "0.55632144", "0.5554993", "0.5549936", "0.5501691", "0.54989004", "0.54973245", "0.5482217", "0.54780096", "0.54779875", "0.54624426", "0.5457249", "0.5457249", "0.5445724", "0.54451656", "0.5444025", "0.5442237", "0.54420584", "0.54420286", "0.5440271", "0.54383314", "0.5437608", "0.54322386", "0.54287815", "0.54277736", "0.54269946", "0.54166764", "0.5416533", "0.54094154", "0.54092735", "0.5408772", "0.5408725", "0.53970957", "0.53947747", "0.5386816", "0.5371625", "0.5368152", "0.53639686", "0.53593904", "0.53424066", "0.5342195", "0.53413767", "0.53349185", "0.532813", "0.532431", "0.53206056", "0.5316557", "0.5310613", "0.53042644", "0.53023046", "0.5300125", "0.5297956", "0.5292922", "0.5281867", "0.5274603", "0.52718776", "0.52711093", "0.5265587", "0.52633727", "0.52633333", "0.52625924", "0.52618843", "0.5256841", "0.5252963", "0.525136", "0.52510613", "0.52504027", "0.52392715", "0.5238082", "0.5233544", "0.5232256", "0.52308494", "0.5229926", "0.5226192", "0.52223104", "0.52196306", "0.5216424", "0.52149624", "0.5213574" ]
0.5214001
99
problems with this hash function: 1. Not constant time 2. Works only with strings 3. Not unique for unique inputs at all times A slightly better hash function is as below Still the same example, but this time we are using prime numbers as th array length Prime numbers are proven to have a drastic affect on the number of collisions while storing a value in a hash map
function betterHash(str, len) { let total = 0; let value; const somePrime = 11; console.log(str.length); // limits iterations for extremely long strings for (let i = 0; i < Math.min(str.length, 100); i++) { value = str.charCodeAt(i) - 96; console.log(value); total = (total * somePrime + value) % len; } return total; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "hash(key){\n let hashedSum = 0;\n for(let i=0; i<key.length; i++){\n let hashedChar = i*(key[i].charCodeAt());\n hashedSum = hashedSum + hashedChar;\n }\n let primeHash = hashedSum*599;\n\n return primeHash%(this.size);\n }", "_hash(key) { //O(1)\n let hash = 0;\n for (let i = 0; i < key.length; i++) {//grab the length of 'grapes' (key)\n hash = (hash + key.charCodeAt(i) * i) % this.data.length;\n //charCodeAt(): returns an integer between 0 & 65535 \n //this.data.length: ensures the size stays between 0-50 (memory space for hash table)\n console.log(hash); // 0 14 8 44 48 23\n }\n return hash;\n }", "function hash(key, arraylength){\n let total=0;\n let primeNumber=31\n\n for(let i=0;i<Math.min(arraylength, 100); i++){\n //pulling the individual character of the key\n //and converting each character to an alphabetic\n //ranking and adding the prime number and diving it by the array length to get a unique out\n //put of a fixed size\n\n let char=key[i];\n let value= char.charCodeAt(0) -96\n total= (total+value+primeNumber)%arraylength\n }\n return total\n}", "function betterHash(string) {\n\tconst H = 37;\n\tvar total = 0;\n\tfor (var i = 0; i < string.length; ++i) {\n\t\ttotal += H * total + string.charCodeAt(i);\n\t}\n\ttotal = total % this.table.length;\n\tif (total < 0) {\n\t\ttotal += this.table.length-1;\n\t}\n\treturn parseInt(total);\n}", "static _hashString(string) {\n let hash = 5381;\n for (let i = 0; i < string.length; i++) {\n //Bitwise left shift with 5 0s - this would be similar to\n //hash*31, 31 being the decent prime number\n //but bit shifting is a faster way to do this\n //tradeoff is understandability\n hash = (hash << 5) + hash + string.charCodeAt(i);\n //converting hash to a 32 bit integer\n hash = hash & hash;\n }\n //making sure hash is unsigned - meaning non-negtive number. \n return hash >>> 0;\n }", "function _hash(a) {\n if (isNumber(a)) {\n return a;\n }\n\n var str = isString(a) ? a : fastJsonStableStringify(a); // short strings can be used as hash directly, longer strings are hashed to reduce memory usage\n\n if (str.length < 250) {\n return str;\n } // from http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n\n\n var h = 0;\n\n for (var i = 0; i < str.length; i++) {\n var char = str.charCodeAt(i);\n h = (h << 5) - h + char;\n h = h & h; // Convert to 32bit integer\n }\n\n return h;\n }", "_hash(key) {\n let total = 0;\n const PRIME_NUM = 31;\n for (let i = 0; i < Math.min(key.length, 100); i += 1) {\n const char = key.charAt(i);\n const value = char.charCodeAt(0) - 96;\n total = (total * PRIME_NUM + value) % this.map.length;\n }\n\n return total;\n }", "function hashV2(key,arrayLen){\n var total = 0;\n var WEIRD_PRIME = 31;\n for(var i = 0; i < Math.min(key.length, 100); i++){\n var char = key[i];\n var value = char.charCodeAt(0) - 96;\n total = (total * WEIRD_PRIME + value) % arrayLen;\n }\n return total;\n}", "_hash(key) {//Generate a hash for us between 0 and length of array - 1\n\t\t//In real life this is soooo fast that its O(1) even tho there is a loop\n\t\tlet hash = 0;\n\t\tfor (let i=0; i < key.length; i++) {\n\t\t\t//charCodeAt(i) gives character code 0-65535 UTF code\n\t\t\thash = (hash + key.charCodeAt(i) * i) % this.data.length;\n\t\t //concat //get utf code //multiply by idx for duplicate characters to get unique\n\t\t //Mod so it fits in the hash size\n\t\t}\n\t\treturn hash;\n\t}", "function hash(s) {\n let h = 1;\n for (let i = 0; i < s.length; i ++)\n h = Math.imul(h + s.charCodeAt(i) | 0, 2654435761);\n return (h ^ h >>> 17) >>> 0;\n}", "hashFunction(key){\n var hash = 0;\n for (var i = 0; i < key.length; i++){\n hash += key.charCodeAt(i);\n }\n // use modulo of prime # 37\n return hash % 37;\n }", "function hash(a) {\n if (isNumber(a)) {\n return a;\n }\n var str = isString(a) ? a : jsonStableStringify(a);\n // short strings can be used as hash directly, longer strings are hashed to reduce memory usage\n if (str.length < 100) {\n return str;\n }\n // from http://werxltd.com/wp/2010/05/13/javascript-implementation-of-javas-string-hashcode-method/\n var h = 0;\n for (var i = 0; i < str.length; i++) {\n var char = str.charCodeAt(i);\n h = ((h << 5) - h) + char;\n h = h & h; // Convert to 32bit integer\n }\n return h;\n }", "function betterHash(key, arrayLen) {\n let total = 0;\n let primeNum = 31;\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let char = key[i];\n let value = char.charCodeAt(0) - 96;\n total = (total * primeNum + value) % arrayLen;\n }\n return total;\n}", "function hashCode(s) {\n var h = 0, l = s.length, i = 0;\n if ( l > 0 )\n while (i < l)\n h = (h << 5) - h + s.charCodeAt(i++) | 0;\n return h;\n}", "function hashCode(str)//recomandation algorithm done by Zeev Feldbeine, Copy Rights\n{\n if(isNaN(str)==false)return Math.abs(str);\n var hash = 0;\n if (str.length == 0) return hash;\n for (i = 0; i < str.length; i++) {\n char = str.charCodeAt(i);\n hash = ((hash<<5)-hash)+char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return Math.abs(hash);\n}", "_hash(str, n) {\n let sum = 0;\n for (let index = 0; index < str.length; index++) {\n sum += str.charCodeAt(index) * 3;\n }\n\n return sum % n;\n }", "_hash(key) {\n let total = 0;\n let WEIRD_PRIME = 31;\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let value = key[i].charCodeAt(0) - 96;\n total = (total * WEIRD_PRIME + value) % this.keyMap.length;\n }\n return total;\n }", "function hash1(key, arrayLen) {\n let total = 7;\n let WEIRD_PRIME = 31;\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let char = key[i];\n let value = char.charCodeAt(0) - 'a'.charCodeAt(0);\n total += (total * WEIRD_PRIME + value) % arrayLen\n } \n return total;\n}", "function hashCode() {\n var hash = 0;\n if (this.length == 0) {\n return hash;\n }\n for (var i = 0; i < this.length; i++) {\n var char = this.charCodeAt(i);\n hash = (hash << 5) - hash + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return hash*100000;\n}", "_hash(r,c) {\n return (15485867 + r) * 15485867 + c;\n }", "function hash(s) {\n\tlet h = 7;\n\n\tfor (let i = 0; i < s.length; i++) {\n\t\th = h * 37 + lettresPossibles.indexOf(s[i]);\n\t}\n\n\treturn h;\n}", "hashFunc(key) {\n let total = 0;\n let WEIRD_PRIME = 31;\n\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let char = key[i];\n let value = char.charCodeAt(0) - 96;\n total = (total * WEIRD_PRIME + value) % this.keyMap.length;\n }\n //random number % size array will give you position\n return total;\n }", "hashIt3(str, size) {\n let coded = 0;\n for (let i = 0; i < str.length; i++) {\n coded += (str[i].charCodeAt() + i) * i + 1;\n }\n return Math.floor((coded * 3) % size)\n }", "hash(str) {\n const len = str.length;\n let hash = 0;\n if (len === 0) return hash;\n let i;\n // eslint-disable-next-line no-plusplus\n for (i = 0; i < len; i++) {\n hash = (hash << 5) - hash + str.charCodeAt(i);\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n }", "makeHash(str) {\n let hash = 0;\n let limit = this.limit;\n let letter;\n \n for (var i = 0; i < str.length; i++) {\n letter = str[i];\n hash = (hash << 5) + letter.charCodeAt(0);\n hash = (hash & hash) % limit;\n }\n \n return hash;\n }", "function hash(key, arrLength) {\n let total = 0;\n // less collision\n // but \"pink\" and \"cyan\" at 13 both produce 5\n let PRIME = 31;\n // reduce to be closer to constant time\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let value = key[i].charCodeAt(0) - 96;\n total = (total * PRIME + value) % arrLength;\n }\n return total;\n}", "function hash(string) {\n var key = 0;\n var tempChar;\n for (var i = 0; i < string.length; i++) {\n tempChar = string.charCodeAt(i);\n key = tempChar + (key << 6) + (key << 16) - key;\n }\n return key; \n }", "function hashCode(s) {\n // return s.split(\"\").reduce(function(a, b) { a = ((a << 5) - a) + b.charCodeAt(0);\n // return a & a }, 0);\n return s.replace(/[^\\w\\s]/gi, '');\n}", "_hash(key){\n let hash = 1\n for(let i=0;i<key.length;i++){\n hash = (hash + key.charCodeAt(i) * i) % this.data.length\n }\n return hash\n }", "function stringHashCode(input) {\n var hash = 0;\n if (input.length === 0) {\n return hash;\n }\n for (var i = 0; i < input.length; i++) {\n var char = input.charCodeAt(i);\n hash = ((hash<<5)-hash)+char;\n hash = hash & hash; \n }\n return hash\n}", "static _hashString(string) {\n let hash = 5381\n for (let i = 0; i < string.length; i++) {\n hash = (hash << 5) + hash + string.charCodeAt(i)\n hash = hash & hash\n }\n return hash >>> 0\n }", "static hashString(s)\r\n {\r\n var hash = 0, i, k = s.length;\r\n for (i = 0; i < k; i++)\r\n hash += (i + 1) * s.charCodeAt(i);\r\n return hash;\r\n }", "function simpleHash(str, tableSize) {\n var hash = 0;\n for (var i = 0; i < str.length; i++) {\n hash += str.charCodeAt(i) * (i + 1);\n }\n return hash % tableSize;\n}", "function hashFunc(str) {\n if (!str) { return str; }\n for(var r=0, i=0; i<str.length; i++) {\n r = (r<<5) - r+str.charCodeAt(i);\n r &= r;\n }\n return r;\n }", "function hash(string) {\n let h = 0;\n for (let i = 0; i < string.length; i++) {\n h = 3 * h + string.charCodeAt(i)\n }\n return h;\n}", "function hash(key, arrayLen) {\n let total = 0;\n \n //prime numbers reduce collisions - many hashes use prime numbers\n let WEIRD_PRIME = 31;\n \n // taking the min solves the speed issue (we'll take the smaller number between length of array and 100)\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let char = key[i];\n let value = char.charCodeAt(0) - 96\n \n //here we're having the two prime numbers interact which is important (BOTH the array length AND the 31 constant we defined above)\n total = (total * WEIRD_PRIME + value) % arrayLen;\n }\n return total;\n }", "function DoHash(lengths){\r\n\tvar listSize = 256;\r\n\tvar list = Array(listSize).fill(0).map((e, i) => i);\r\n\tvar curr = 0;\r\n\tvar skip = 0;\r\n\t\r\n\tif(typeof lengths == \"string\") lengths = lengths.split(\"\").map(e => e.charCodeAt(0));\r\n\tlengths = lengths.concat([17, 31, 73, 47, 23]);\r\n\t\r\n\tfunction DoRound(){\r\n\t\tvar lengs = lengths.slice();\r\n\t\twhile(lengs.length){\r\n\t\t\tvar l = lengs.shift();\r\n\t\t\t\r\n\t\t\tvar s = list.concat(list).splice(curr, l);\r\n\t\t\ts.reverse();\r\n\t\t\tlist = list.map((e, i) => ((s[listSize + i - curr] + 1) || (s[i - curr] + 1) || (e + 1)) - 1);\r\n\t\t\t\r\n\t\t\tcurr += l + skip;\r\n\t\t\tcurr = curr % listSize;\r\n\t\t\tskip++;\r\n\t\t}\r\n\t}\r\n\t\r\n\tfor(var i = 0; i < 64; i++) DoRound();\r\n\t\r\n\tvar sparse = [];\r\n\twhile(list.length) sparse.push(list.splice(0, 16));\r\n\treturn sparse.map(b => b.reduce((acc, e, i, a) => acc ^ e, 0));\r\n}", "function newHash(key, arrayLen){\n let total = 0;\n let WEIRD_PRIME = 31;\n for(let i = 0; i < Math.min(key.length, 100); i++){\n let char = key[i];\n let value = char.charCodeAt(0) - 96\n total = (total * WEIRD_PRIME + value) % arrayLen\n }\n console.log(total);\n}", "hashIt2(str, size) {\n let coded = 0;\n for (let i = 0; i < str.length; i++) {\n coded += (str[i].charCodeAt() - i) * i + 1;\n }\n return Math.floor((coded * 2) % size)\n }", "function simpleHash(str, tableSize) {\n let hash = 0;\n for (let i = 0; i < str.length; i += 1) {\n hash += str.charCodeAt(i) * (i + 1);\n }\n return hash % tableSize;\n}", "_hash(key) {\n let total = 0;\n let PRIME_NUMBER = 31;\n for (let i = 0; i < Math.min(key.length, 100); i++) {\n let char = key[i];\n let value = char.charCodeAt(0) - 96;\n total = (total * PRIME_NUMBER + value) % this.keyMap.length;\n }\n return total;\n }", "function hash(str){\n var hash = 0;\n if (str.length == 0) return hash;\n for (i = 0; i < str.length; i++) {\n char = str.charCodeAt(i);\n hash = ((hash<<5)-hash)+char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return hash;\n }", "function hash(str) {\n var hash = 5381,\n i = str.length;\n\n while(i) {\n hash = (hash * 33) ^ str.charCodeAt(--i);\n }\n\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return hash >>> 0;\n }", "function hash(s) {\n return s.split(\"\").reduce(\n function (a, b) {\n a = ((a << 5) - a) + b.charCodeAt(0); return a & a\n }, 0);\n}", "_hashed (s) {\n return s.split(\"\").reduce(function(a,b){a=((a<<5)-a)+b.charCodeAt(0);return a&a},0); \n }", "hashCode(str) { // java String#hashCode\n var hash = 0;\n for (var i = 0; i < str.length; i++) {\n hash = str.charCodeAt(i) + ((hash << 5) - hash);\n }\n return hash;\n }", "function hash(str) {\n var hash = 5381,\n i = str.length;\n\n while(i) {\n hash = (hash * 33) ^ str.charCodeAt(--i);\n }\n\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return hash >>> 0;\n}", "_hash(key) {\n let hash = 0;\n for (let i = 0; i < key.length; i++) {\n hash = (hash + key.charCodeAt(i) * i) % this.data.length;\n }\n return hash;\n }", "_hash(key) {\n let hash = 0;\n for (let i = 0; i < key.length; i++) {\n hash = (hash + key.charCodeAt(i) * i) % this.data.length;\n }\n return hash;\n }", "function hash(str) {\n var hash = 5381,\n i = str.length;\n\n while(i) {\n hash = (hash * 33) ^ str.charCodeAt(--i);\n }\n\n /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed\n * integers. Since we want the results to be always positive, convert the\n * signed int to an unsigned by doing an unsigned bitshift. */\n return hash >>> 0;\n}", "function hash_1(key, arrayLen) {\n // arrayLen should be a prime for uniform distribution of keys in the buccket\n let total = 0,\n WEIRD_PRIME = 31;\n for (let i = 0; i < Math.min(key.length, 100); i++)\n total = (total * WEIRD_PRIME + (key.charCodeAt(i) - 96)) % arrayLen;\n\n return total;\n}", "function hashCode(string) {\n var hash = 0,\n i,\n chr;\n if (string.length === 0) return hash;\n\n for (i = 0; i < string.length; i++) {\n chr = string.charCodeAt(i);\n hash = (hash << 5) - hash + chr;\n hash |= 0; // Convert to 32bit integer\n }\n\n return hash;\n}", "function stringHash(str) {\n\t var value = 5381;\n\t var i = str.length;\n\t while (i) {\n\t value = (value * 33) ^ str.charCodeAt(--i);\n\t }\n\t return (value >>> 0).toString(36);\n\t}", "function createHash(str) {\n var hash = 2166136261;\n var len = str.length;\n for (var i = 0; i < len; i++) {\n hash ^= str.charCodeAt(i);\n hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);\n }\n return hash >>> 0;\n}", "function hash(str) {\n let total = 0, i;\n for (i = str.length - 1; i >= 0; i--) {\n total += str.charCodeAt(i);\n }\n return total % 999;\n}", "hashValue(str) {\n var hash = 0;\n if (str.length === 0) return hash;\n for (var i = 0; i < str.length; i++) {\n var char = str.charCodeAt(i);\n hash = ((hash<<5)-hash)+char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return hash;\n }", "static hashInt(i)\r\n {\r\n return hashString(i.toString());\r\n }", "function caml_hash_string(str) { return caml_hash(10,100,0,str); }", "_hash(key){\r\n let hash = 0;\r\n for(let i = 0; i<key.length; i++){\r\n hash = (hash + key.charCodeAt(i) * i)%\r\n this.data.length\r\n }\r\n return hash;\r\n }", "hashCode (str) {\n return str.split('').reduce((prevHash, currVal) =>\n (((prevHash << 5) - prevHash) + currVal.charCodeAt(0)) | 0, 0)\n }", "function hash(str) {\n for (var hash = 0, len = str.length, i = 0; i < len; ++i)\n hash = hash * 31 + str.charCodeAt(i) | 0\n return hash >>> 0\n}", "function hashInteger(n) {\n // check to see if n is an integer\n if ( isNaN(n) || n % 1 !== 0 ) { return null; }\n return (n * 369) - 1;\n}", "function hashKey(str) {\n\t // 32-bit FNV-1 offset basis\n\t // See http://isthe.com/chongo/tech/comp/fnv/#FNV-param\n\t var hash = 0x811C9DC5;\n\n\t for (var i = 0; i < str.length; ++i) {\n\t hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);\n\t hash ^= str.charCodeAt(i);\n\t }\n\n\t return hash >>> 0;\n\t}", "function hashKey(str) {\n\t // 32-bit FNV-1 offset basis\n\t // See http://isthe.com/chongo/tech/comp/fnv/#FNV-param\n\t var hash = 0x811C9DC5;\n\t\n\t for (var i = 0; i < str.length; ++i) {\n\t hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);\n\t hash ^= str.charCodeAt(i);\n\t }\n\t\n\t return hash >>> 0;\n\t}", "function hashCode(str) {\n\t var i = void 0;\n\t var chr = void 0;\n\t var len = void 0;\n\t var hash = 0;\n\t if (str.length === 0) return hash;\n\t for (i = 0, len = str.length; i < len; i++) {\n\t chr = str.charCodeAt(i);\n\t hash = (hash << 5) - hash + chr;\n\t hash |= 0;\n\t }\n\t return hash;\n\t}", "static hash(str) {\n if (str.length % 32 > 0) str += Array(33 - (str.length % 32)).join('z');\n let hash = '',\n bytes = [],\n i = 0,\n j = 0,\n k = 0,\n a = 0,\n dict = [\n 'a',\n 'b',\n 'c',\n 'd',\n 'e',\n 'f',\n 'g',\n 'h',\n 'i',\n 'j',\n 'k',\n 'l',\n 'm',\n 'n',\n 'o',\n 'p',\n 'q',\n 'r',\n 's',\n 't',\n 'u',\n 'v',\n 'w',\n 'x',\n 'y',\n '1',\n '2',\n '3',\n '4',\n '5',\n '6',\n '7',\n '8',\n '9'\n ];\n for (i = 0; i < str.length; i++) {\n const ch = str.charCodeAt(i);\n bytes[j++] = ch < 127 ? ch & 0xff : 127;\n }\n var chunk_len = Math.ceil(bytes.length / 32);\n for (i = 0; i < bytes.length; i++) {\n j += bytes[i];\n k++;\n if (k == chunk_len || i == bytes.length - 1) {\n a = Math.floor(j / k);\n if (a < 32) hash += '0';\n else if (a > 126) hash += 'z';\n else hash += dict[Math.floor((a - 32) / 2.76)];\n j = k = 0;\n }\n }\n return hash;\n }", "function hashNumber(n) {\n if (n !== n || n === Infinity) {\n return 0;\n }\n var hash = n | 0;\n if (hash !== n) {\n hash ^= n * 0xffffffff;\n }\n while (n > 0xffffffff) {\n n /= 0xffffffff;\n hash ^= n;\n }\n return smi(hash);\n}", "function hashNumber(n) {\n if (n !== n || n === Infinity) {\n return 0;\n }\n var hash = n | 0;\n if (hash !== n) {\n hash ^= n * 0xffffffff;\n }\n while (n > 0xffffffff) {\n n /= 0xffffffff;\n hash ^= n;\n }\n return smi(hash);\n}", "function hashNumber(n) {\n if (n !== n || n === Infinity) {\n return 0;\n }\n var hash = n | 0;\n if (hash !== n) {\n hash ^= n * 0xffffffff;\n }\n while (n > 0xffffffff) {\n n /= 0xffffffff;\n hash ^= n;\n }\n return smi(hash);\n}", "function hashNumber(n) {\n if (n !== n || n === Infinity) {\n return 0;\n }\n var hash = n | 0;\n if (hash !== n) {\n hash ^= n * 0xffffffff;\n }\n while (n > 0xffffffff) {\n n /= 0xffffffff;\n hash ^= n;\n }\n return smi(hash);\n}", "_hash(key) {\n // the'underscore' here is a common standard which is to put 'underscore' here and the javascript world which says this is a private property\n let hash = 0;\n for (let i = 0; i < key.length; i++) {\n hash = (hash + key.charCodeAt(i) * i) % this.data.length;\n // console.log(hash)\n }\n return hash;\n }", "hash(text) {\n let hash = 0, i, chr;\n if (text.length === 0) {\n return hash;\n }\n for (i = 0; i < text.length; i++) {\n chr = text.charCodeAt(i);\n hash = ((hash << 5) - hash) + chr;\n hash |= 0; // Convert to 32bit integer\n }\n return hash;\n }", "function stringToHash(string) {\n //Escribe tu codigo aqui\n}", "function getHash (str) {\n var hash = 1,\n charCode = 0,\n idx;\n if(str){\n hash = 0;\n for(idx = str.length - 1; idx >= 0; idx--){\n charCode = str.charCodeAt(idx);\n hash = (hash << 6&268435455) + charCode+(charCode << 14);\n charCode = hash&266338304;\n hash = charCode != 0 ? hash ^ charCode>>21 : hash;\n }\n }\n return hash;\n }", "hashVal() {\n\n let asciiValue;\n let p = 3;\n let n = this.#stringVal.length;\n let returnValue = 0;\n for (let i = 0; i < n; i++) {\n asciiValue = this.#stringVal.charCodeAt(i);\n returnValue = returnValue + asciiValue * this.powerFunction(p, (n - 1) - i);\n }\n\n return returnValue;\n }", "function hashKey(str) {\n // 32-bit FNV-1 offset basis\n // See http://isthe.com/chongo/tech/comp/fnv/#FNV-param\n var hash = 0x811C9DC5;\n\n for (var i = 0; i < str.length; ++i) {\n hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);\n hash ^= str.charCodeAt(i);\n }\n\n return hash >>> 0;\n}", "function hashKey(str) {\n // 32-bit FNV-1 offset basis\n // See http://isthe.com/chongo/tech/comp/fnv/#FNV-param\n var hash = 0x811C9DC5;\n\n for (var i = 0; i < str.length; ++i) {\n hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);\n hash ^= str.charCodeAt(i);\n }\n\n return hash >>> 0;\n}", "function hashKey(str) {\n // 32-bit FNV-1 offset basis\n // See http://isthe.com/chongo/tech/comp/fnv/#FNV-param\n var hash = 0x811C9DC5;\n\n for (var i = 0; i < str.length; ++i) {\n hash += (hash << 1) + (hash << 4) + (hash << 7) + (hash << 8) + (hash << 24);\n hash ^= str.charCodeAt(i);\n }\n\n return hash >>> 0;\n}", "_hash(key) {\n let hash = 0;\n for (let i = 0; i < key.length; i++) {\n hash = (hash + key.charCodeAt(i) * i) % this.data.length;\n }\n return hash;\n }", "function weird(){\n let my_hash = []\n return function (input){\n if(my_hash[input]){\n my_hash[input]++;\n } else {\n my_hash[input] = 1;\n }\n return my_hash[input];\n }\n}", "function hash(str) {\n var hash = 0;\n if (str.length == 0) {\n return hash;\n }\n for (var i = 0; i < str.length; i++) {\n var char = str.charCodeAt(i);\n hash = ((hash << 5) - hash) + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return hash;\n}", "hash(str) {\n str = str.toLowerCase();\n\n const ALPHABET = \"qwertyuiopasdfghjklzxcvbnm\"\n let sum = 0\n for (let i = 0; i < str.length; i++) {\n sum += ALPHABET.indexOf(str.charAt(i))\n }\n return sum\n }", "hash(str) {\n str = str.toLowerCase();\n\n const ALPHABET = \"qwertyuiopasdfghjklzxcvbnm\"\n let sum = 0\n for (let i = 0; i < str.length; i++) {\n sum += ALPHABET.indexOf(str.charAt(i))\n }\n return sum\n }", "function stringHash(str) {\n var value = 5381;\n var len = str.length;\n while (len--)\n value = (value * 33) ^ str.charCodeAt(len);\n return (value >>> 0).toString(36);\n}", "function stringHash(str) {\n var value = 5381;\n var len = str.length;\n while (len--)\n value = (value * 33) ^ str.charCodeAt(len);\n return (value >>> 0).toString(36);\n}", "function computeStringHashCode(s) {\n var hashCode = 0;\n for (var i = 0;i < s.length;i++) {\n hashCode = oflw32(oflw32(31 * hashCode) + s.charCodeAt(i));\n }\n return hashCode;\n }", "function hashCode(str) {\n var hash = 0;\n if (str.length == 0) return hash;\n for (i = 0; i < str.length; i++) {\n char = str.charCodeAt(i);\n hash = ((hash << 5) - hash) + char;\n hash = hash & hash; // Convert to 32bit integer\n }\n return hash;\n }", "function _hash32_1a(str){\n \t\tvar i,l=str.length-3,s=fnvConstants[32].offset,t0=0,v0=s[1]|0,t1=0,v1=s[0]|0;\n\n \t\tfor (i = 0; i < l;) {\n \t\t\tv0^=str.charCodeAt(i++);\n \t\t\tt0=v0*403;t1=v1*403;\n \t\t\tt1+=v0<<8;\n \t\t\tv1=(t1+(t0>>>16))&65535;v0=t0&65535;\n \t\t\tv0^=str.charCodeAt(i++);\n \t\t\tt0=v0*403;t1=v1*403;\n \t\t\tt1+=v0<<8;\n \t\t\tv1=(t1+(t0>>>16))&65535;v0=t0&65535;\n \t\t\tv0^=str.charCodeAt(i++);\n \t\t\tt0=v0*403;t1=v1*403;\n \t\t\tt1+=v0<<8;\n \t\t\tv1=(t1+(t0>>>16))&65535;v0=t0&65535;\n \t\t\tv0^=str.charCodeAt(i++);\n \t\t\tt0=v0*403;t1=v1*403;\n \t\t\tt1+=v0<<8;\n \t\t\tv1=(t1+(t0>>>16))&65535;v0=t0&65535;\n \t\t}\n\n \t\twhile(i<l+3){\n \t\t\tv0^=str.charCodeAt(i++);\n \t\t\tt0=v0*403;t1=v1*403;\n \t\t\tt1+=v0<<8;\n \t\t\tv1=(t1+(t0>>>16))&65535;v0=t0&65535;\n \t\t}\n\n \t\treturn hashValInt32(((v1<<16)>>>0)+v0,32);\n \t}", "function improvedStrings(inputVal) {\n // Check input is a string\n if (inputVal === null) {\n error(\"Please enter a value to hash.\");\n // Return error\n return 1;\n }\n\n jsav.umsg(\"Attempting to insert \" + inputVal);\n\n var inputLength = inputVal.length / 4;\n var sum = 0;\n var mult;\n for (var i = 0; i < inputLength; i++) {\n // Grab the substring of size 4\n var inputsubstring = inputVal.substring(i * 4, (i * 4) + 4);\n mult = 1;\n for (var j = 0; j < inputsubstring.length; j++) {\n sum += inputsubstring.charCodeAt(j) * mult;\n mult *= 256;\n }\n }\n\n var size = $(\"#tablesize\").val();\n var pos = sum % size;\n\n jsav.umsg(\"The sum is \" + sum);\n jsav.umsg(\"Hash value: \" + sum + \" % \" + size + \" = \" + pos);\n\n // Process function with selected collision resolution\n determineResolution(inputVal, pos, false, true);\n\n // Return success\n return 0;\n }", "function caml_hash_string(s) {\n var h = caml_hash_mix_string_str(0, caml_bytes_of_string(s));\n h = FINAL_MIX(h)\n return h & 0x3FFFFFFF;\n}", "exampleHashMethod( key ) {\n let hash = 0;\n for (let i = 0; i < key.length; i++) {\n hash = (hash + key.charCodeAt(i) * i) % this.data.length;\n }\n return hash;\n }", "_hash(pt) {\n return (15485867 + pt.X) * 15485867 + pt.Y;\n }", "function hash(text) {\n\t if (!text) {\n\t return '';\n\t }\n\t\n\t var hashValue = 5381;\n\t var index = text.length - 1;\n\t\n\t while (index) {\n\t hashValue = hashValue * 33 ^ text.charCodeAt(index);\n\t index -= 1;\n\t }\n\t\n\t return (hashValue >>> 0).toString(16);\n\t}", "function hash(string, max) {\n\tlet hash = 0;\n\tfor (let i = 0; i < string.length; i++) {\n\t\thash += string.charCodeAt(i);\n\t}\n\treturn hash % max;\n}", "function caml_hash_double(num) { return caml_hash(10,100,0,num); }", "function stringHash(str) {\n let value = 5381;\n let len = str.length;\n while (len--)\n value = (value * 33) ^ str.charCodeAt(len);\n return (value >>> 0).toString(36);\n}", "function stringHash(str) {\n let value = 5381;\n let len = str.length;\n while (len--)\n value = (value * 33) ^ str.charCodeAt(len);\n return (value >>> 0).toString(36);\n}", "function hashCode(s) {\n\t//previous value, current value\n\tvar ret = '';\n\tvar sLength = s.length;\n\tfor (i = 0; i < sLength; i++) {\n\t\tret = ret + s.charCodeAt(i);\n\t}\n\n\treturn ret;\n}", "function hash (str, seed = 0) {\n str = typeof str === 'string' ? str : JSON.stringify(str)\n let h1 = 0xdeadbeef ^ seed, h2 = 0x41c6ce57 ^ seed\n for (let i = 0, ch; i < str.length; i++) {\n ch = str.charCodeAt(i)\n h1 = Math.imul(h1 ^ ch, 2654435761)\n h2 = Math.imul(h2 ^ ch, 1597334677)\n }\n h1 = Math.imul(h1 ^ (h1>>>16), 2246822507) ^ Math.imul(h2 ^ (h2>>>13), 3266489909)\n h2 = Math.imul(h2 ^ (h2>>>16), 2246822507) ^ Math.imul(h1 ^ (h1>>>13), 3266489909)\n return 4294967296 * (2097151 & h2) + (h1>>>0)\n}", "function computePublicHash(str){\n // SHA1 hash\n var sha1Hex = new jsSHA(str, \"ASCII\").getHash(\"SHA-1\", \"HEX\")\n\n // extract the first 80 bits as a string of \"1\" and \"0\"\n var sha1Bits = []; \n // 20 hex characters = 80 bits\n for(var i = 0; i < 20; i++){\n var hexDigit = parseInt(sha1Hex[i], 16)\n for(var j = 0; j < 4; j++){\n sha1Bits[i*4+3-j] = ((hexDigit%2) == 1)\n hexDigit = Math.floor(hexDigit/2)\n }\n }\n \n // encode in base-32: letters a-z, digits 2-7\n var hash = \"\"\n // 16 5-bit chars = 80 bits\n var ccA = \"a\".charCodeAt(0)\n var cc2 = \"2\".charCodeAt(0)\n for(var i = 0; i < 16; i++){\n var digit =\n sha1Bits[i*5]*16 + \n sha1Bits[i*5+1]*8 + \n sha1Bits[i*5+2]*4 + \n sha1Bits[i*5+3]*2 + \n sha1Bits[i*5+4]\n if(digit < 26){\n hash += String.fromCharCode(ccA+digit)\n } else {\n hash += String.fromCharCode(cc2+digit-26)\n }\n }\n return hash\n}" ]
[ "0.7722281", "0.746798", "0.7450668", "0.73486227", "0.732734", "0.7316222", "0.73004067", "0.728886", "0.7284191", "0.7274457", "0.72444737", "0.72107726", "0.72003573", "0.7200201", "0.7192746", "0.7192402", "0.7178286", "0.7143936", "0.7111605", "0.708699", "0.7075466", "0.7055949", "0.70533866", "0.7048495", "0.70455533", "0.70283353", "0.7018166", "0.7007197", "0.70048064", "0.69944984", "0.69876814", "0.69854885", "0.6967627", "0.69588596", "0.6940578", "0.69352007", "0.69351554", "0.6930463", "0.6917215", "0.68940043", "0.68928033", "0.6887272", "0.6880587", "0.68761027", "0.6871532", "0.6857192", "0.6851461", "0.6840362", "0.6840362", "0.6836488", "0.68314534", "0.6829081", "0.68266696", "0.67887664", "0.67886746", "0.6782161", "0.67640233", "0.675824", "0.6753079", "0.6750293", "0.6728103", "0.67247576", "0.6718341", "0.6718027", "0.6713631", "0.67086333", "0.66959226", "0.66959226", "0.66959226", "0.66959226", "0.6694714", "0.66819996", "0.6674987", "0.6674276", "0.6663216", "0.66525394", "0.66525394", "0.66525394", "0.66522455", "0.6652104", "0.6648408", "0.6645069", "0.6645069", "0.66434145", "0.66434145", "0.6630025", "0.6627761", "0.6622139", "0.66189516", "0.6611674", "0.65935683", "0.65886545", "0.65822303", "0.6576902", "0.6572381", "0.6571605", "0.6571605", "0.6569888", "0.65591735", "0.65533185" ]
0.73297846
4
inicializacion.js es un script de Controlador destinado a inicializar variables a las que se tiene que dar un valor inicial en un momento concreto y no al cargar. Esto ocurre principalmente al entrar en la escena de juego. / VISTA
function InicializarSeleccionDificultad() { const spanSingle = document.getElementById("span_single"); var btnsDif = document.getElementsByClassName("boton_dificultad"); spanSingle.innerHTML = "1 JUGADOR"; spanSingle.style.backgroundColor = "#a2feff"; spanSingle.style.color = "black"; document.getElementById("span_jugar").innerHTML = "2 JUGADORES"; document.getElementById("nombre").readOnly = false; for (var i = 0 ; i < btnsDif.length ; i++) { var lunares = btnsDif[i].getElementsByClassName("lunares")[0].getElementsByClassName("lunar"); for (var j = 0 ; j < lunares.length ; j++) { lunares[j].style.backgroundColor = "#03c4d0"; } btnsDif[i].style.backgroundColor = "#a2feff"; btnsDif[i].style.color = "black"; btnsDif[i].classList.add("clickable"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inicializar() {\n // Chequeo si en el localStorage hay token guardado.\n tokenGuardado = window.localStorage.getItem(\"AppUsuarioToken\");\n // Al chequeo de la sesión, le paso como parámetro una función anónima que dice qué hacer después.\n chequearSesion(function () {\n // Muestro lo que corresponda en base a si hay o no usuario logueado.\n if (!usuarioLogueado) {\n navegar('login', true);\n } else {\n navegar('home', false);\n }\n });\n}", "function InicializarControlador()\n{\n idPalabraActual = 0; // Id de la palabra que tiene que escribir el jugador.\n idCharActual = 0; // Id a nivel de texto del primer caracter de la palabra que tiene que escribir el jugador.\n tIni = new Date(); // Momento de inicio del juego.\n errores = 0; // Número de errores que ha tenido el jugador hasta ahora.\n subIptAnterior = \"\"; // Lo que el usuario tenía escrito antes del último refresco del input.\n\n palabras = libreria[IndexarTextoAleatorio()].match(/\\S+/gi); // Elijo un texto al azar de la librería y lo divido en un array buscando cualquier bloque de texto que no sea un \" \".\n largoTexto = CalcularLargoDelTexto(); // Número de caracteres del texto, incluyendo espacios.\n texto = ConstruirTextoRevisado(palabras);\n}", "function inicializar() {\n errorHandlerGPX = (err) => {\n console.error(err)\n }\n electron.ipcMain.on('gpx-setDate',(event,arg) => {\n if (arg.inicio == null || arg.fin == null) {\n dialog.showMessageBox(event.sender.getOwnerBrowserWindow(),{\n title: \"Algo salio mal\",\n message: \"Alguna fecha no fue seleccionada\"\n })\n } else { \n mongoConnect.infoForGraficas(arg,(tickets) => {\n if (tickets) event.reply('gpx-setDate-response',processInfoTickets(arg,tickets));\n else {\n dialog.showMessageBox(event.sender.getOwnerBrowserWindow(),{\n title: \"Vuelve a intentarlo\",\n message: \"Los rangos de fechas seleccionados no contienen tickets disponibles\"\n })\n }\n }, (platillos) => {\n let r = platillos.map(ele => {return {type:ele.familia.name, value: ele.cantidad}})\n event.reply('gpx-setDate-response-P',{puntos:r});\n }, errorHandlerGPX)\n }\n })\n}", "function muestraEjercicio(){\n document.getElementById(\"ejercicioDos\").innerHTML = \"La cadena mas larga es: \"+inicializa();\n}", "async function initVendaPadraoScript() {\n initVendaPadraoHTML();\n await setVendaPadraoQuadroTop();\n await setVendaPadraoTopVendedores();\n await setVendaPadraoTopCidade();\n await getVendaPadraoGraficoSemestral();\n}", "function InicializarHotZone()\n{\n faseActual = 0;\n cargando = true;\n idCharCarga = 0;\n idCharDescarga = 0;\n charsPorFase = Math.round(largoTexto / 4);\n charsUltimaFase = largoTexto - (charsPorFase * 3);\n tLoop = (dificultad.fases[faseActual].carga * 1000) / charsPorFase;\n}", "function initScript(){\n getMunTorreviejaData();\n insertImagesInCalendar();\n }", "reiniciarConteo() {\n this.ultimo = 0;\n this.tickets = [];\n this.grabarArchivo();\n this.ultimos4 = []\n console.log('Se ha inicializado el sistema');\n \n }", "function Inicializar() {\n $(\"input.fecha\").datepicker($.datepicker.regional[\"es\"]);\n Argumentos = searchToJSON();\n $(\"#idOperador\").val(Argumentos.idOperador);\n $(\"input.fecha\").val(AFechaMuyCorta(new Date()));\n if (Argumentos.Supervisados == 0) {\n $(\"#filaOperador\").hide();\n $(\"#Supervisado\").val(0);\n } else {\n //OperadoresSupervisados_lst(_OperadoresSupervisados_lst, Argumentos.idOperador);RA\n LlamarServicio(_OperadoresSupervisados_lst, \"OperadoresSupervisados_lst\", { idOperador: Argumentos.idOperador });\n $(\"#Supervisado\").val(1);\n }\n\n}", "function inicializar(){var v=document.getElementById(\"comprobacion\"); v.innerHTML=\"\"; nota=0.0;}", "async function setInitAtendimentoDashPadraoScript() {\n await setAtendimentoDashPadraoHTML();\n await setAtendimentoDashPadraoDepdentencias();\n}", "function InicializarAyuda(strURLBase, strDominio, IDAyuda, IDAncla)\r\n{\r\n\tsURLBase= strURLBase + \"/\" + strDominio;\r\n\tsDominio= strDominio;\r\n\tsIDAyuda= IDAyuda;\r\n\tsIDAncla = IDAncla;\r\n\tbARQAyudasContActivas= true;\r\n\tquitarIconoAyudasCont();\r\n}", "function enviataxaaula(percent_aula, id_aula, id_projeto) {\n var envio = {}\n envio.id_contato = get_data('geral').id\n envio.id_aula = id_aula\n envio.percentual = percent_aula\n envio.email = get_data('geral').email \n envio.id_projeto = id_projeto \n\n set_tempo_ondemand(envio, (stst) => {\n //console.log('inserido - ' + id_aula + ' - ' + percent_aula + ' - ' + envio.id_contato)\n })\n}", "function init(){\n\tentidades();\n ramas();\n armarArbol();\n}", "function init(){\n //console.log(\"init: fin chargement page\"); //trace d'execution\n refSaisie = document.getElementById(\"saisie\");\n refVisuel = document.getElementById(\"cadreVisuel\");\n refAutomatiquement = document.getElementById(\"automatiquement\");\n refImgLoad = document.getElementById(\"imgLoad\");\n refBulle = document.getElementById(\"infoBulle\");\n\n refButtonActu = document.getElementById(\"buttonActu\");\n refFlecheID = document.getElementById(\"flecheID\");\n //lire l'état de la case (imposer un etat initia fixe) --> pour declancher la case (partie UX question 4eme version)\n}", "inicializar() {\n this.elegirColor = this.elegirColor.bind(this);\n this.siguienteNivel = this.siguienteNivel.bind(this);\n this.toggleBotonInicio();\n this.generarSecuencia();\n this.nivel = 1;\n this.colores = {\n btnceleste,\n btnvioleta,\n btnnaranja,\n btnverde\n }\n }", "function init() \n{\n RMPApplication.debug(\"begin init\");\n c_debug(debug.init, \"=> init\");\n\n set_email_resp_inter();\n set_destinataires_pdf();\n\n form_state = RMPApplication.get(\"form_state\");\n\n if (form_state == \"Initial\") {\n register_actual_date();\n \n } else if (form_state == \"Clos\") { \n } else { // Statut à l'état \"En cours\"\n }\n\n RMPApplication.debug(\"end init\");\n}", "inicializar() {\n this.elegirColor = this.elegirColor.bind(this)\n btnEmpezar.classList.add('hide');\n\n // Nivel inicial\n this.nivel = 1;\n\n // Variables de colores\n this.colores = {\n celeste: celeste,\n violeta: violeta,\n naranja: naranja,\n verde: verde\n }\n }", "function begin() {\n const paciente = {};\n paciente.nombre = $(\"#inputName4\").val();\n paciente.edad = $(\"#inputNumber\").val();\n paciente.peso = $(\"#inputNumber2\").val();\n paciente.altura = $(\"#inputNumber3\").val();\n paciente.dia = $(\"#inputStateDia\").val();\n paciente.mes = $(\"#inputStateMes\").val();\n paciente.hora = $(\"#inputStateHora\").val();\n registrar(paciente);\n}", "inicializar() {\n this.elegirColor = this.elegirColor.bind(this);\n this.siguienteNivel = this.siguienteNivel.bind(this);\n this.toggleBtnEmpezar();\n this.nivel = 1;\n this.Ultimo_nivel = 10;\n this.colores = {\n celeste,\n violeta,\n naranja,\n verde,\n };\n }", "function inicializaCronometro() {\n\t\n\tcampo.one(\"focus\", function () { // a função one descarta eventos iguais seguintes\n//campo.on(\"focus\", function () { // a função on capta o 1º e todos os eventos posteriores\n\t\tvar tempoRestanteSPAN = $(\"#tempo-digitacao\");\n\t\tvar tempoRestante = tempoRestanteSPAN.text();\n\n\t\tdesabilitaIcon(\"#botao-reiniciar\");\n\t\t\t/*$(\"#botao-reiniciar\").attr(\"disabled\",true);\n\t\t\t$(\"#botao-reiniciar\").addClass(\"disabled\");*/\n\t\tvar cronometroID = setInterval(function () {\n\t\t\ttempoRestanteSPAN.text(--tempoRestante);\n\t\t\t// .attr(\"atributo da tag\", ?) devolve e define, como a .text(?).\n\t\t\tif( tempoRestante < 1 ) {\n\t\t\t\tclearInterval(cronometroID);\n\t\t\t\tfinalizaJogo();\n\t\t\t}\n\n\t\t}, 1000);\n\t});\n}", "function CarregamentoInicial() {\n _CarregaTabelaNormalizacaoStrings();\n _CarregaTraducoes();\n _CarregaTitulos();\n CarregaPersonagens();\n _CarregaDominios();\n _CarregaFamiliares();\n _CarregaRacas();\n _CarregaTemplates();\n _CarregaBotoesVisao();\n _CarregaAtributos();\n _CarregaTalentos();\n\n // Monta a tabela de armas e cria as opcoes dinamicamente.\n _CarregaTabelaArmasArmaduras();\n _CarregaPericias();\n _CarregaFeiticos();\n\n _CarregaHandlers();\n\n // Inicia o objeto de personagem.\n IniciaPersonagem();\n\n if (document.URL.indexOf('testes.html') != -1) {\n return;\n }\n var indice_igual = document.URL.indexOf('=');\n if (indice_igual != -1) {\n // carrega pelos parametros. Caso contrario, usara a entrada padrao.\n var json_entradas = decodeURIComponent(document.URL.slice(indice_igual + 1));\n gEntradas = JSON.parse(json_entradas);\n CorrigePericias();\n }\n AtualizaGeralSemLerEntradas();\n}", "function InicializarControles(){\t\n\tif (gListaLuz.length === 0){\n\t\tvar hidden = $(\"#hiddenDb\").val();\n\t\tgListaLuz = $.parseJSON(hidden);\n\t}\n}", "function loadInit () {\n\t//alert('loadInit'); \n\n\tif(isStorage()) {\n\t\tconsole.log(\"loadInit: LocalStorage disponible\");\n\n \t\t//Se leen los datos almacenados en el localStorage\n \tvar nombre = localStorage.getItem(\"Nombre\");\n \tvar apellido = localStorage.getItem(\"Apellido\");\n\t\tvar telefono = localStorage.getItem(\"Telefono\");\n \t\tvar email = localStorage.getItem(\"Email\");\n \t\tvar fecNac = localStorage.getItem(\"Fecha_Nac\");\n \t\tvar altura = localStorage.getItem(\"Altura\");\n \t\tvar color = localStorage.getItem(\"Color\");\n\t\tvar web =\tlocalStorage.getItem(\"Web\");\n \n \t\tif((nombre == null || nombre == '') || (apellido == null || apellido == '') || (telefono == null || telefono == '') ||\n\t\t\t(email == null || email == '') || \t(fecNac == null || fecNac == '') || (altura == null || altura == '') || \n\t\t\t(color == null || color == '') || \t(web == null || web == '')) {\n\n \t\tconsole.log(\"loadInit: No hay datos!\");\n\n \t} else {\n\n \t\tconsole.log(\"loadInit: Se cargan los datos existentes en loadStorage\");\n\n \t//Se muestran los datos en el formulario \n \tdocument.getElementById(\"idFirstName\").value = nombre;\n \tdocument.getElementById(\"idLastName\").value = apellido; \n \t\tdocument.getElementById(\"idTelephone\").value = telefono;\n\t\t\tdocument.getElementById(\"idEmail\").value = email;\n\t\t\tdocument.getElementById(\"idBirdDate\").value = fecNac;\n\t\t\tdocument.getElementById(\"idHeight\").value = altura;\n\t\t\tdocument.getElementById(\"idColor\").value = color;\n\t\t\tdocument.getElementById(\"idWeb\").value = web;\n \t}\n\t} else {\n\t\tconsole.log(\"loadInit: LocalStorage no soportado en este navegador\");\n\t}\n}", "function inicializarComponentesGlobal() {\r\n\tif (window.inicializarComponentes) {\r\n\t\tinicializarComponentes();\r\n\r\n\t}\r\n}", "function init(){ // función que se llama así misma para indicar que sea lo primero que se ejecute\n carreraCtrl.carreras = carreraService.getCarreras();\n }", "function inicializarCampos() {\r\n document.querySelector('#tipo').value = vehiculos[0].tipo;\r\n document.querySelector('#marca').value = vehiculos[0].marca;\r\n document.querySelector('#modelo').value = vehiculos[0].modelo;\r\n document.querySelector('#patente').value = vehiculos[0].patente;\r\n document.querySelector('#anio').value = vehiculos[0].anio;\r\n document.querySelector('#precio').value = vehiculos[0].precio;\r\n if (document.querySelector('#tipo').value == \"auto\") {\r\n document.querySelector('#capacidadBaul').value = vehiculos[0].capacidadBaul;\r\n }\r\n else if (document.querySelector('#tipo').value == \"camioneta\") {\r\n document.querySelector('#capacidadCarga').value = vehiculos[0].capacidadCarga;\r\n }\r\n}", "function prepararejercicio(){\n resetearimagenejercicio();\n brillo = 0;\n contraste = 0;\n saturacion = 0;\n exposicion = 0;\n ruido = 0;\n difuminacion = 0; \n elegido = prepararejerciciorandom();\n Caman(\"#canvasejercicio\", imgejercicio , function () {\n this.brightness(elegido[0]);\n this.contrast(elegido[1]);\n this.saturation(elegido[2]); \n this.exposure(elegido[3]);\n this.noise(elegido[4]);\n this.stackBlur(elegido[5]); \n this.render();\n });\n}", "function iniciar() {\n \n }", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init(){\n console.debug('Document Load and Ready');\n console.trace('init');\n initGallery();\n \n pintarLista( );\n pintarNoticias();\n limpiarSelectores();\n resetBotones();\n \n}", "function init() {\n\t\t// Loads a script\n\t\tvar loadScript = function(path) {\n\t\t var headID = document.getElementsByTagName('head')[0];\n\t\t var newScript = document.createElement('script');\n\t\t newScript.type = 'text/javascript';\n\t\t newScript.src = path;\n\t\t headID.appendChild(newScript);\n\t\t};\n\n\n\t\tMessenger.storeData('originalLocation', location.hash);\n\t Messenger.storeData('server', server);\n\t Messenger.storeData('extVersion', extVersion);\n\t Messenger.storeData('combinedPath', combinedPath);\n\t if (typeof devRealtimeServer !== 'undefined') {\n\t \tMessenger.storeData('devRealtimeServer', devRealtimeServer);\n\t }\n\n\n\t // Load the initialization script\n\t loadScript(server + combinedPath + 'combined-' + extVersion + '.js');\n\t }", "function init() {\n //corps de declaration\n // document.getElementById('jsLoaded').remove();\n\n var jsl = document.getElementById(\"jsLoaded\");\n jsl.style.backgroundColor = \"skyblue\";\n jsl.innerHTML = \"Js bien chargé\";\n initUsersData(function () {\n initSelectUsers(users);\n initNotesDatas(function () {\n initNoteModel(function () {\n refreshListMessages();\n });\n });\n });\n document.querySelector(\"form\").addEventListener(\"submit\", onsubmitnote);\n document\n .querySelector(\"#form-title\")\n .addEventListener(\"change\", onchangevalue);\n document\n .querySelector(\"#form-desc\")\n .addEventListener(\"change\", onchangevalue);\n}", "constructor() {\n this.inicializar();\n this.generarSecuencia();\n this.siguienteNivel(); \n }", "function initComponentes() {\n if (\"BASEFACTURA\" in localStorage) {\n recuperarBaseFactura();\n\n for (const factura of baseFactura) {\n mostrarFacturaRegistrado(factura);\n }\n } else {\n registrarBaseFactura();\n }\n\n //RECUPERAMOS LA BASE CLIENTE\n if (\"BASECLIENTE\" in localStorage) {\n recuperarBaseCliente();\n\n for (const cliente of baseCliente) {\n mostrarClienteRegistrado(cliente);\n }\n }\n\n //RECUPERAMOS LA BASE VEHICULO\n if (\"BASEVEHICULO\" in localStorage) {\n recuperarBaseVehiculo();\n\n for (const vehiculo of baseVehiculo) {\n mostrarVehiculoRegistrado(vehiculo);\n }\n }\n\n ///Asignamos la fecha del dia\n let txtFecha = document.getElementById(\"txtFecha\");\n\n var fecha = new Date(); //Fecha actual\n var mes = fecha.getMonth() + 1; //obteniendo mes\n var dia = fecha.getDate(); //obteniendo dia\n var ano = fecha.getFullYear(); //obteniendo año\n\n if (dia < 10)\n dia = '0' + dia; //agrega cero si el menor de 10\n if (mes < 10)\n mes = '0' + mes //agrega cero si el menor de 10\n\n txtFecha.value = ano + \"-\" + mes + \"-\" + dia;\n}", "function initialize() {\n\n neighbourpano_from_2 = localStorage.getItem(\"neighbourpano_from_2_to_1\");\n\n if (neighbourpano_from_2 != null) {\n loadSV(neighbourpano_from_2);\n } else {\n loadSV(\"pano00001\");\n }\n }", "function init() {\n console.debug(\"Document Load and Ready\");\n\n listener();\n initGallery();\n cargarAlumnos();\n\n // mejor al mostrar la modal\n // cargarCursos();\n}", "function init(){\n\tcargarControles();\n\t\n}", "function init() {\r\n alertify.parent(document.body);\r\n console.log(\"init()s'est executée\");\r\n\r\n doAjax(ajaxTarget + \"?level=\" + level + \"&red=\"+ red +\"&blue=\"+blue,ajaxCallback, 0, 0);\r\n\r\n alerteTemp();\r\n\r\n //désatvier le controller\r\n $(\".autoside\").removeClass(\"disableSide\").addClass(\"disableSide\");\r\n $(\".manuside\").removeClass(\"disableSide\").addClass(\"disableSide\");\r\n $(\".barre\").removeClass(\"disableSide\").addClass(\"disableSide\");\r\n $(\".mode\").removeClass(\"disableSide\").addClass(\"disableSide\");\r\n\r\n document.getElementById('automatiqueMode').disabled = true;\r\n document.getElementById('manualMode').disabled = true;\r\n\r\n }", "function init() {\n initVariable();\n initDatePicker();\n }", "function init() {\n headset.onloadPluginEmotiv();\n addValidLicenseDoneEvent();\n EdkDll.ELS_ValidLicense();\n // EdkDll.DebugLog = true;\n isFacial = false;\n isPerformance = false;\n sysTime = document.getElementById(\"txtInputTime\");\n sysTime.value = \"00.00\";\n }", "function inicializa_mapa()\n{\n\n estado = 1;\n\n // START PROMPT ANIMATION\n move_obj($('mapa_jogo_img'),-1000,0);\n move_obj($('mapa_jogo_flash'),-1000,0);\n move_obj($('comida_img'),-1000,0);\n limpa_pontuacaos();\n move_obj($('comida_pw_img'),-1000,0);\n for(var i=0; i<=12; i++)\n move_obj($('ecra_inicial_obj_'+i),-1000,0);\n move_obj($('ecra_inicial_obj'),-1000,0);\n move_obj($('inicializa_mapa_obj'),0,0);\n\n if (creditos > 1)\n {\n move_obj($('inicializa_mapa_obj_1'),-1000,0);\n move_obj($('inicializa_mapa_obj_2'),224,335);\n }\n else\n {\n move_obj($('inicializa_mapa_obj_1'),264,335);\n }\n}", "function loadPageVariables() {\n var tmp = JSON.parse(localStorage.getItem('autoTrimpSettings'));\n if (tmp !== null) {\n autoTrimpSettings = tmp;\n }\n}", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function init() \n{\n RMPApplication.debug(\"begin init : login = \", login);\n $(\"#id_spinner_insert\").hide();\n RMPApplication.set(\"variables.location_code\", RMPApplication.get(\"location_code\"));\n RMPApplication.set(\"last_question\", \"Aucune solution trouvée, décrivez votre problème de façon précise !\");\n\n var options = {};\n var pattern = {};\n pattern.login = RMPApplication.get(\"login\");\n c_debug(dbug.init, \"=> init: pattern = \", pattern);\n\n // CAPI for getting user information\n id_get_user_info_as_admin_api.trigger (pattern, options , get_info_ok, get_info_ko); \n RMPApplication.debug(\"end init\");\n}", "function iniciar() {\n\tcrearEscena();\n\tcrearCamara();\n\tcrearLuces();\n\tcrearMundo();\n\tcrearCohete();\n\n\tmensaje = document.getElementById('mensaje');\t\n\tciclo();\n}", "function init(){}", "function initialisationOfVariables() {\n oilDensities = [920,1260]; /** Density value of olive oil and glycerin */\n density = oilDensities[0]; /** Density of olive oil assign to density variable */ \n oilViscocity = [0.081,1.49]; /** Viscocity of olive oil and glycerin */\n viscocity = oilViscocity[0]; /** Viscocity of olive oil assign to density variable */ \n airDensity = 1; /** Density of aire */\n dropDB = []; /** Array to store data related to each drop */\n appar_dropDB = []; /** Array to store data related to each drop in apparatus that move vertically */\n currentTime = 0;\n}", "function initialize() {\n getData('LionelNanchen');\n getData('onicoleheig');\n getData('wasadigi');\n getData('paulnta');\n getData('edri');\n getData('mraheigvd');\n getData('kamkill01011');\n getData('onicole');\n }", "function InicializaGPS1vez()\n {\n\n //dni=Base64.decode( getUrlVars()[\"dni\"] );\n dni=getUrlVars()[\"dni\"] ;\n Placa= getUrlVars()[\"placa\"] ;\n //empresa_madre=Base64.decode( getUrlVars()[\"empresa\"] );\n empresa_madre= getUrlVars()[\"empresa\"] ;\n //alert(dni + \" // \" + Placa + \" // \" + empresa_madre);\n window.localStorage.setItem(\"Taxista\",dni);\n window.localStorage.setItem(\"Placa\",Placa); \n window.localStorage.setItem(\"Empresa\",empresa_madre);\n\n if (navigator.geolocation) \n { \n console.log(\"localizado ok\");\n $(\"#gpsEstado\" ).fadeIn( \"slow\", function(){\n document.getElementById(\"gpsEstado\").innerHTML=\"Su teléfono tiene GPS..\";\n animaBarra();\n\n });\n //document.getElementById(\"gpsEstado\").innerHTML=\"Su teléfono tiene GPS..\";\n llamadoGPS = navigator.geolocation.watchPosition(\n localizadoOk,\n localizadoError,\n {\n enableHighAccuracy : true,\n maximumAge : 30000,\n timeout : 5000\n }\n )\n }else{\n document.getElementById(\"gpsEstado\").innerHTML='¡Tu teléfono no permite ubicar tu localización. No puedes usar este soft!';\n } \n\n }", "function start()\r\n{\r\n\tif(0==getStorageLen())//Load Default\r\n\t{\r\n\t\tsetStorage(\"Future Import Files;\", 0);\t//getStorage returns >> : LucaMNS;\r\n\t\tsetStorage(\"20.1\", 1);\t\t//getStorage returns >> : 20.1\r\n\t\tsetStorage(\"#1e5b76\", 2);\t//getStorage returns >> : #1e5b76\r\n\t\tsetStorage(\"#85d5a1\", 3);\t//getStorage returns >> : #85d5a1\r\n\t\tsetStorage(\"#11322e\", 4);\t//getStorage returns >> : #11322e\r\n\t\tsetStorage(\"#00ffb7\", 5);\t//getStorage returns >> : #00ffb7\r\n\t\tsetStorage(\"#fa4b00\", 6);\t//getStorage returns >> : #fa4b00\r\n\t\tsetStorage(\"280\", 7);\t\t//getStorage returns >> : 200\r\n\t\tsetStorage(\"#113c37\", 8);\t//getStorage returns >> : #113c37\r\n\t\tsetStorage(\"#d1ffa3\", 9);\t//getStorage returns >> : #d1ffa3\r\n\t}\r\n\tupdateJS();\r\n\tupdateHTML();\r\n\tupdateCSS();\r\n\tconsole.log(localStorage);\r\n\t//var consol = document.getElementById(\"S_Console\");\r\n\t//Console Input Event\r\n\tvar C_Input = document.getElementsByClassName(\"S_C_Edit\")[0];\r\n\tC_Input.addEventListener(\"keyup\", function(event) {\r\n\t\t\r\n\t\tif(event.keyCode == 13)\r\n\t\t{\r\n\t\t\taddToConsole(\"User Input\", C_Input.value, \"t\");\r\n\t\t\tC_Input.value = \"\"; //Prepar for new Entry\r\n\t\t}\r\n\t});\r\n\t//\"<object data='defaultValues.json' type='application/json' class='S_C_Text'></object>\";\r\n}", "function createInitialStuff() {\n\n\t//Sniðugt að búa til alla units í Levelinu hér og svoleiðis til \n\t// allt sé loadað áðurenn hann byrjar render/update\n\t//AKA það er betra að hafa þetta sem part af \"loading\" frekar en \n\t//byrjunar laggi\n}", "function init() {\n initializeVariables();\n initializeHtmlElements();\n}", "function loadPageVariables() {\r\n \"use strict\";\r\n var tmp = JSON.parse(localStorage.getItem('TrimpzSettings'));\r\n if (tmp !== null) {\r\n trimpzSettings = tmp;\r\n }\r\n}", "function inicializar() {\n\n var modalServicio = $('#modal-form-servicio'),\n modalPersona = $('#modal-form-persona'),\n modalTipoServicio = $('#modal-form-tipo-servicio'),\n modalMarca = $('#modal-form-marca'),\n modalComponente = $('#modal-form-componente'),\n\n formServicio = modalServicio.find('form').html(),\n formPersona = modalPersona.find('form').html(),\n formTipo = modalTipoServicio.find('form').html(),\n formMarca = modalMarca.find('form').html(),\n formComponente = modalComponente.find('form').html(),\n\n wd = window || document;\n\n\n\n var compu = {\n\n initCompu: function() {\n \n this.setActionsFormServicio(); \n this.setActionsFormTipo(); \n this.setActionsFormComponente(); \n\n $('#servicio-btn').on('click',{modal:modalServicio}, this.showModal);\n\n $('#guardar-servicio-btn').on('click', this.guardarServicio);\n $('#edit-servicio-btn').on('click', {modal:modalServicio}, this.showModal);\n \n $('#guardar-persona-btn').on('click', this.guardarPersona);\n $('#guardar-tipo-servicio-btn').on('click', this.guardarTipoServicio);\n $('#guardar-marca-btn').on('click', this.guardarMarca);\n $('#guardar-componente-btn').on('click', this.guardarComponente);\n\n $('#update-btn').on('click', this.update);\n\n modalServicio.on('hidden.bs.modal', this.alHideServicio);\n modalPersona.on('hidden.bs.modal', this.alHidePersona); \n modalTipoServicio.on('hidden.bs.modal', this.alHideTipoServicio); \n modalMarca.on('hidden.bs.modal', this.alHideMarca); \n modalComponente.on('hidden.bs.modal', this.alHideComponente); \n },\n\n\n setActionsFormServicio: function() {\n $('#cliente-btn').on('click', {modal:modalPersona}, this.showModal);\n $('#tipo-btn').on('click', {modal:modalTipoServicio}, this.showModal);\n $('#marca-btn').on('click', {modal:modalMarca}, this.showModal);\n $('#componentes-btn').on('click', {modal:modalComponente}, this.showModal);\n\n $('#id_cliente,#id_tipo,#id_marca,#id_componentes').select2({\n formatNoMatches: function(m){return 'Oops, no se encontraron resultados!';}\n });\n\n $('#id_plazo').datetimepicker({\n language: 'es',\n showMeridian: true, //muestra am y pm pero si se cambia el language no funciona, se arregla add [\"AM\", \"PM\"] en el archivo localizado\n format: 'dd-mm-yyyy HH P',\n startDate: new Date(),\n autoclose: true,\n daysOfWeekDisabled: [0],\n minView: 1,\n //maxView: 3,\n todayHighlight: true,\n });\n },\n\n\n clearActionsFormServico: function() {\n $('#cliente-btn, #tipo-btn, #marca-btn').off();\n $('#id_cliente').select2(\"destroy\");\n $('#id_tipo').select2(\"destroy\");\n $('#id_marca').select2(\"destroy\");\n $('#id_componentes').select2(\"destroy\");\n }, \n \n\n setActionsFormTipo: function() {\n $('#form-tipo-servicio #id_icon').select2({\n formatResult: compu.iconFormat,\n formatSelection: compu.iconFormat,\n escapeMarkup: function(m) { return m; }\n });\n },\n\n clearActionsFormTipo: function() {\n $('#form-tipo-servicio #id_icon').select2(\"destroy\");\n },\n \n setActionsFormComponente: function() {\n $('#form-componente #id_icon').select2({\n formatResult: compu.iconFormat,\n formatSelection: compu.iconFormat,\n escapeMarkup: function(m) { return m; }\n });\n },\n\n\n clearActionsFormComponente: function() {\n $('#form-componente #id_icon').select2(\"destroy\");\n },\n \n\n iconFormat: function(state) {\n if (!state.id) return state.text; // optgroup\n return \"<i class='fa fa-fw fa-\"+state.id+\"'></i> \"+ state.text; //state.text;\n },\n \n \n showModal: function(event) { \n event.preventDefault();\n if (event.data.reset) { // si reset es true entonces reseteo el form y su id, por ahora no estoy usando esto\n var form = event.data.modal.find('form');\n compu.clearForm(form);\n };\n \n var selectedItems = $('#id_componentes').select2(\"val\");\n event.data.modal.modal('show'); \n },\n\n\n alHideServicio: function() {\n compu.clearActionsFormServico();\n $('#form-servicio').html(formServicio);\n compu.setActionsFormServicio();\n },\n\n alHidePersona: function() {\n $('#form-persona ').html(formPersona);\n }, \n\n\n alHideTipoServicio: function() {\n compu.clearActionsFormTipo();\n $('#form-tipo-servicio').html(formTipo);\n compu.setActionsFormTipo();\n },\n\n\n alHideMarca: function() {\n $('#form-marca').html(formMarca);\n },\n\n\n alHideComponente: function() {\n compu.clearActionsFormComponente()\n $('#form-componente').html(formComponente);\n compu.setActionsFormComponente();\n },\n \n\n ///////// PRINT METODOS /////////\n\n\n update: function(event) {\n\n modalUpdate = $('#modal-update').modal({backdrop: 'static'});\n\n okBtn = modalUpdate.find('.ok-btn').one('click', function(){\n \n return wd.location.reload(true);\n });\n\n okBtn.button('loading');\n\n url = $(event.currentTarget).data('url')\n \n $.get(url)\n .fail(function() {\n alert( \"error\" );\n })\n .always(function(data){\n var $content = modalUpdate.find('.content')\n var $msg = $content.find('.msg');\n\n if (!(data['success'])) { \n modalUpdate.find('.logo i').removeClass().addClass('fa fa-frown-o');\n modalUpdate.find('.logo h5').text('imposible');\n $msg.html(data.msg);\n okBtn.button('reset'); \n\n setTimeout(function(){console.log('hola despues de 10 segundos')}, 10000);\n console.log('hola soy despues del settimeout');\n \n } else {\n modalUpdate.find('.logo i').removeClass().addClass('fa fa-smile-o');\n modalUpdate.find('.logo h5').text('actualizado'); \n $msg.html(data.msg);\n\n setTimeout(function(){\n okBtn.button('reset');\n $msg.html('Servidor listo, Dale OK');\n }, 30000);\n\n var $progress = $content.find('.progress').removeClass('hidden').addClass('show');\n var $bar = $content.find('.progress-bar');\n var unidad = $bar.width();\n\n var intervalo = setInterval(function(){\n var width = $bar.width() + 3;\n \n $bar.width($bar.width() + unidad);\n \n if (okBtn.text() == \"OK\") {\n $progress.removeClass('active'); \n $bar.width('100%');\n clearInterval(intervalo); \n }\n },1000);\n }\n });\n },\n \n\n ///////// AJAX METODOS /////////\n\n guardarServicio: function(event) {\n console.log($('#form-servicio').serialize());\n var $btn = $(event.target).button('loading');\n\n compu.ajax({\n url : urlGuardarServicio,\n form : '#form-servicio',\n btn : $btn\n });\n },\n\n\n\n fadeElement: function() {\n $(document).bind('DOMNodeInserted', function(e) {\n var element = e.target;\n setTimeout(function() {\n $(element).fadeOut(1000, function() {\n $(this).remove();\n });\n }, 2000);\n }); \n },\n \n\n\n guardarPersona: function() {\n var $btn = $(event.target).button('loading');\n\n $(event.target).button('loading');\n compu.ajax({\n url : urlGuardarPersona,\n form : '#form-persona',\n btn : $btn\n });\n },\n\n\n guardarTipoServicio: function() {\n var $btn = $(event.target).button('loading');\n\n compu.ajax({\n url : urlGuardarTipoServicio,\n form : '#form-tipo-servicio',\n btn : $btn\n });\n },\n\n\n guardarMarca: function() {\n var $btn = $(event.target).button('loading');\n\n compu.ajax({\n url : urlGuardarMarca,\n form : '#form-marca',\n btn : $btn\n });\n },\n\n guardarComponente: function() {\n var $btn = $(event.target).button('loading');\n\n compu.ajax({\n url : urlGuardarComponente,\n form : '#form-componente',\n btn : $btn\n });\n },\n \n\n\n ajax: function(options) {\n \n $.ajax({\n url: options.url,\n type: \"POST\",\n data: $(options.form).serialize(),\n\n success: function(data) {\n if (!(data['success'])) {\n $(options.form).replaceWith(data['form_html']); // OJO replace mata los listener y referencias...\n \n if (options.url == urlGuardarServicio) compu.setActionsFormServicio();\n if (options.url == urlGuardarTipoServicio) compu.setActionsFormTipo(); \n if (options.url == urlGuardarComponente) compu.setActionsFormComponente(); \n }\n else {\n if (options.url == urlGuardarServicio) return window.location.href= data.url;\n \n if (options.url == urlGuardarPersona) compu.successOk('#id_cliente', data, modalPersona);\n\n if (options.url == urlGuardarTipoServicio) compu.successOk('#id_tipo', data, modalTipoServicio);\n \n if (options.url == urlGuardarMarca) compu.successOk('#id_marca', data, modalMarca); \n \n if (options.url == urlGuardarComponente) compu.successOk('#id_componentes', data, modalComponente); \n }\n\n options.btn.button('reset');\n },\n error: function () {\n console.log('tengo errores');\n $(options.form).find('.error-message').show()\n }\n });\n },\n\n\n successOk: function(selector, data, modal) {\n var select = $('#form-servicio '+selector).append('<option value=\"'+ data['value']+'\">'+data['nombre']+'</opotion>');\n if (selector == '#id_componentes') {\n var selectedItems = $(selector).select2(\"val\");\n selectedItems.push(''+data.value+'');\n $(selector).select2(\"val\", selectedItems);\n } else {\n select.val(''+data.value+''); \n select.trigger('change');\n }\n \n modal.modal('hide');\n },\n\n\n\n /////////////// UTILES ////////////////\n\n clearForm: function(form) {\n console.log(form);\n form.find('*').each(function(index,element){\n //console.log(Element.tagName.toLowerCase());\n switch(element.tagName.toLowerCase()) {\n case 'input':\n if (element.name == 'csrfmiddlewaretoken') break;\n else if ( $(element).hasClass('datetimeinput') ) {\n element.value = \"\";\n //$(element).datetimepicker('update');\n }\n else {\n element.value = \"\";\n }\n break;\n case 'textarea':\n element.value = \"\";\n //console.log(element.value);\n break;\n case 'select':\n //console.log(element.options[element.selectedIndex].text);\n //element.selectedIndex = 1;\n $(element).select2(\"val\", \"\");\n break;\n\n\n }\n\n });\n \n /*var elements = form.elements; \n \n form.reset();\n\n for(i=0; i<elements.length; i++) {\n \n field_type = elements[i].type.toLowerCase();\n \n switch(field_type) {\n \n case \"text\": \n case \"password\": \n case \"textarea\":\n case \"hidden\": \n \n elements[i].value = \"\"; \n break;\n \n case \"radio\":\n case \"checkbox\":\n if (elements[i].checked) {\n elements[i].checked = false; \n }\n break;\n\n case \"select-one\":\n case \"select-multi\":\n elements[i].selectedIndex = -1;\n break;\n\n default: \n break;\n }\n }*/\n }\n \n\n\n };\n\n return compu;\n }", "constructor() {\n this.settings = {};\n this.scripts = [];\n }", "function init() {\r\n //이메일 주소 ltalk에서 확인 ajax\r\n // checkLogin();\r\n myEmailRequest();\r\n // moment 호출\r\n moment().locale(\"ko\");\r\n // 오늘 날짜로 기본값 설정\r\n $(\"#_userDate\").val(today.short);\r\n // 시간 설정\r\n defaultTimeInit();\r\n roomNameChk(\"\", ltalk.defaultRoomTitle);\r\n startEndTimeUpdate();\r\n widthHeightChange();\r\n}", "constructor() {\n //vamos a poner un setTimeout para que no arranque ni bien el usuario pulsa el boton\n this.inicializar();\n this.generarSecuencia();\n setTimeout(this.siguienteNivel,500);\n }", "function iniciar () {\n if(miLocal.getItem('cookie') === 'true') {\n ocultarAviso();\n }\n }", "initRegistro() {\n this.registro = new _models_register__WEBPACK_IMPORTED_MODULE_7__[\"Register\"](null, // id\n 0, // lecturaAnterior\n 0, // lectura\n 0, // consumo\n this.today.getFullYear(), // year\n this.today.getMonth(), // month\n 0, // excessconsumo\n 0, // excesscosto\n 0, // excessm3\n 0, // base\n 0, // subtotal\n false, // cancelado\n false, // facturado\n '', // meter\n '' // extra\n );\n }", "function init()\n{\n\tvalid.add(\n\t[\n\t\t{ id:'z3950Config.name', type:'length', minSize :1, maxSize :200 },\n\t\t{ id:'z3950Config.host', type:'length', minSize :1, maxSize :200 },\n\t\t{ id:'z3950Config.host', type:'hostname' },\n\t\t{ id:'z3950Config.port', type:'integer', minValue :80, maxValue :65535, empty:true },\n\n\t\t{ id:'z3950Config.username', type:'length', minSize :0, maxSize :200 },\n\t\t{ id:'z3950Config.password', type:'length', minSize :0, maxSize :200 }\n\t]);\n\n\tgui.setupTooltips(loader.getNode('tips'));\n}", "function inicializarConversacionDiana(){\nprint(\"Inicializa la conversacion\");\nconversacionDiana = new ArbolConversacion(texturaCristina,texturaDiana,texturaCristinaSombreada,texturaDianaSombreada);\n\n/**\n* Nodo Raiz\n* \n*/\nvar dialogos : Array = new Array();\nvar l: LineaDialogo = new LineaDialogo(\"Tal vez usted me entienda, Diana, hay seres que nos vienen acompañando desde que se iniciaron los ataques y ahora sé qué es lo que necesitan, me lo han dicho.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Chica, voy a ser muy sincera contigo, tú no estás bien. Ese brazo necesita curaciones y la falta de droga te puede estar afectando la mente, es preciso que entres en tratamiento inmediatamente, y eso no lo conseguirás aquí adentro.\",2);\ndialogos.Push(l);\nl = new LineaDialogo(\"Nunca me he sentido mejor, lo del brazo no es tan grave y jamás he estado tan lúcida. De verdad Diana, hay seres que nos necesitan, usted podría ayudarlos mucho, no con curaciones, sino con otro tipo de cuidados.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"Bueno, si te sientes tan bien ¿Por qué no subes a auxiliar la gente que está atrapada arriba? Seguro que serás de gran ayuda.\",2);\ndialogos.Push(l);\n \nvar nodoRaiz:NodoDialogo = new NodoDialogo(dialogos);\n\nconversacionDiana.setRaiz(nodoRaiz);\n\n/**\n* Nodo Opcion 1\n* \n**/\ndialogos = new Array();\nl = new LineaDialogo(\"Por favor Diana, es verdad lo que le digo, sé que no es fácil entenderlo,\\n pero si me acompaña lo entenderá.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"No, he decidido bajar con el anciano y con Fabio. Abajo podemos conseguir ayuda profesional y tú deberías acompañarnos.\",2);\ndialogos.Push(l);\n\nvar nodo1: NodoDialogo = new NodoDialogo(dialogos, NEGACION );\n\nnodoRaiz.setHijo1(nodo1);\n\n\n\n/**\n* Nodo Opcion 2\n* \n*/\n\ndialogos = new Array();\nl = new LineaDialogo(\"Son seres que después compensarán nuestra ayuda, de verdad Diana,\\n son más importantes que los de arriba, son los otros.\",1);\ndialogos.Push(l);\nl = new LineaDialogo(\"No, he decidido subir con el doctor y con el muchacho a auxiliar a los oficinistas de arriba, Tú serías de gran ayuda, acompáñanos.\",2);\ndialogos.Push(l);\n\nvar nodo2: NodoDialogo = new NodoDialogo(dialogos);\n\nnodoRaiz.setHijo2(nodo2);\n}", "function ejercicio_1() {\n\tvar dav = new Number();\n\tvar vilm = new Number();\n\tvar port = new String();\n\tvar anio = new String();\n\tvar dato2 = new String();\n\tvar anio2 = new String();\n\tvar weezer = new Number();\n\tvar opl = new Boolean();\n\tvar logi = new Boolean();\n\tvar lco = new Boolean();\n\tvar anio = new Array(4);\n\tdav = 5;\n\tport = \"5\";\n\tdato2 = \"5\";\n\tvilm = -4;\n\tweezer = 3.156;\n\tanio[0] = \"2\";\n\tanio[1] = \"0\";\n\tanio[2] = \"1\";\n\tanio[3] = \"9\";\n\tanio2 = \"2019\";\n\topl = true;\n\tlogi = false;\n\tlco = false;\n\tdocument.write(\"Estos son las variables definidas \",'<BR/>');\n\tdocument.write(dav,'<BR/>');\n\tdocument.write(vilm,'<BR/>');\n\tdocument.write(port,'<BR/>');\n\tdocument.write(\"Esta es una variable del tipo caracter\",'<BR/>');\n\tdocument.write(anio[0],anio[1],anio[2],anio[3],'<BR/>');\n\tdocument.write(dato2,'<BR/>');\n\tdocument.write(anio2,'<BR/>');\n\tdocument.write(weezer,'<BR/>');\n\tdocument.write(opl,'<BR/>');\n\tdocument.write(logi,'<BR/>');\n\tdocument.write(lco,'<BR/>');\n}", "function inicia(){\n //console.log(\"Pagina inicializada.\");\n var arrayLocal = [];\n var varLocal = 0;\n }", "function inicializarEventos() {\n\ti = 0;\n\tdireccion = new Array();\n\tdireccion[0] = \"imagenes/home1.jpg\";\n\tdireccion[1] = \"imagenes/home2.jpg\";\n\tdireccion[2] = \"imagenes/home3.jpg\";\n\tdireccion[3] = \"imagenes/home4.jpg\";\n\tdireccion[4] = \"imagenes/home5.jpg\";\n\tcambiaIMG();\t\t\t\n}", "initialize() {\n this.settings = {};\n this.scripts = [];\n }", "function Filtros () {\n this.$tipo_equipo = $('#id_tipo_equipo')\n this.$equipo = $('#id_equipo')\n this.$equipo_texto = $('#equipo_texto')\n this.$equipo_id = $('#equipo_id')\n this.$fecha_inicio = $('#id_fecha_inicio')\n this.$fecha_fin = $('#id_fecha_fin')\n this.$tipo = $('#id_tipo')\n this.$boton_limpiar = $('#boton_limpiar')\n this.$boton_buscar = $('#boton_buscar')\n this.init()\n}", "function init() {\n console.log(\"init\");\n document.getElementById(\"comenzar\").onclick = iniciarSaludo;\n document.getElementById(\"parar\").onclick = pararSaludo;\n}", "async initialize() {\n const { headless } = this.options\n const { log } = this\n try {\n // load script content from `script` folder\n this.scriptContent = await genScriptContent()\n // Launch the browser\n this.browser = await puppeteer.launch({ headless })\n } catch (err) {\n log(err)\n }\n }", "function init() { \n SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs('domTools.js');\n }", "function inicializarProd() {\n //obtengo el html actual que navego para crear los productos correspondientes\n let htmlActual =\n document.documentURI.split(\"/\")[document.documentURI.split(\"/\").length - 1];\n if (htmlActual == \"smartphone.html\") {\n let productos = document.getElementById(\"productos\");\n createProductos(arrayOfSmartphones, productos);\n createFooter();\n createModal();\n createModalPersona();\n createModalMenor();\n createModalEmail();\n createModalSolicitudProcesada();\n } else if (htmlActual == \"tecno.html\") {\n let productos = document.getElementById(\"productos\");\n createProductos(arrayOfTecno, productos);\n createFooter();\n createModal();\n createModalPersona();\n createModalMenor();\n createModalEmail();\n createModalSolicitudProcesada();\n } else if (htmlActual == \"xp.html\") {\n let productos = document.getElementById(\"productos\");\n createProductos(arrayOfXP, productos);\n createFooter();\n createModal();\n createModalPersona();\n createModalMenor();\n createModalEmail();\n createModalSolicitudProcesada();\n }\n}", "function init() {\n\n\n\n\t}", "function _init(){\n if(mergedConfig.content && mergedConfig.button && mergedConfig.cookie_name && _util.validate.settingsConfig(mergedConfig)){\n //Add cookieValue globally if it exists.\n cookieValue = _util.validate.ifCookieNameSet(mergedConfig.cookie_name.name) ? JSON.parse(_util.getCookieValueByName(mergedConfig.cookie_name.name)) : undefined;\n // Build DOM\n _build.bannerLayout(mergedConfig);\n _build.modalLayout(mergedConfig);\n _util.toggleBanner(mergedConfig);\n };\n }", "function initValues(){\n}", "function MonInterface (){// fonction de gestion de l'information\n var princ=document.querySelector('#principale');\n const preparation= function () { \n princ.textContent='';\n princ.className='';\n if(localStorage.length==0)\n {\n princ.textContent=\"vous n'avez aucune tache\";\n princ.className='vide';\n }\n else{\n for(var i=0; i<localStorage.length; i++){\n Tache(localStorage.key(i), localStorage.getItem(localStorage.key(i)));\n }\n \n }\n };\n preparation();\n}", "function init() {\n let meiFileURL = containerNode.attr('data-mei');\n createVerovioObject(meiFileURL); // TODO: this actually loads all the views, etc. Very confusing!\n }", "materializar() {\n\t\t// Se pueden agregar comprobaciones para evitar que haya campos en blanco cuando se guarda.\n\t\tthis.guardarObjetoEnArchivo();\n\t}", "function initData() {\n initLtr_factor();\n initBosunit();\n initHero();\n initSelect25();\n initMS();\n}", "init() {\n const { hoy, tickets, ultimo, ultimos4 }/* data */ = require('../db/data.json');\n // console.log(data);\n // console.log(this.hoy);\n if ( hoy === this.hoy ) { \n this.tickets = tickets;\n this.ultimo = ultimo;\n this.ultimos4 = ultimos4;\n } else {\n /* Es otro dia _ Reescritura del Db json : es decir se rescribe encima de la data del dia anterior :\n * trabajamos asi cuando necesitemos mantener db solo un periodo de un dia o 2 o una semana : depende lo que ponemos en la condicion if( < > == || ) etc .. \n */\n this.guardarDB();\n } \n }", "limpiar() {\n this.nuevoRegistro = null;\n this.completado = false;\n this.registroAnterior = null;\n this.limites = [], [];\n this.consumo_correcto = null;\n this.lectura_actual = null;\n this.initMedidor();\n this.initRegistro();\n this.encontrado = null;\n this.isRegistered = null;\n }", "function abrirPantallaConfig() {\n\n Menu.setApplicationMenu(null);\n pantallaConfig = new BrowserWindow({\n width: 600,\n height: 400,\n icon: __dirname + \"/icons/favi.png\",\n transparent: true,\n webPreferences: {\n nodeIntegration: true\n },\n show: false\n })\n pantallaConfig.loadFile('src/frnt/views/conexiones.html')\n pantallaConfig.on('closed', () => { pantallaConfig = null })\n pantallaConfig.once('ready-to-show', () => { pantallaConfig.show() })\n /* pantallaConfig.webContents.openDevTools() */\n}", "function init() {\r\n\tdocument.querySelector( \"#idCoupSum\" ).value = coupSum \t+ \" \" + mLang.get(\"savingqty\");\t\t// 장 적립\r\n\tdocument.querySelector( \"#idPointSum\" ).value = pointSum\t+ \" \" + mLang.get(\"savingpoint\");\t// 점 적립\r\n}", "function inicializaContadores() {\n\tcampo.on(\"input\", function() {\n\t\tvar qtdPalavras = campo.val().split(/\\S+/).length - 1;\t\n\t\t$(\"#contador-palavras\").text(qtdPalavras);\n\t\t$(\"#contador-caracteres\").text(campo.val().length);\n\t});\n}", "function init() {\n tipo_venta = \"\";\n\n client_name = \"\";\n asesor_name_ticket = \"\";\n asesor_name_venta = \"\";\n\n total = dataOrder.order.total;\n cash = 0;\n card = 0;\n transfer = 0;\n change = 0;\n referencia = \"\";\n\n comentarios = \"\";\n $('#pi-comentarios').val('');\n\n $('#pi-input-cash').val('');\n $('#pi-input-cash').focus();\n $('#pi-input-card, #pi-input-transfer, #pi-input-ref').val('');\n $('#p-pi-change').text('0');\n\n $('#switch-pi-prod').prop('checked', true);\n $('#switch-pi-ticket').prop('checked', true);\n\n $('#pi-fecha').val('');\n $('#pi-hora').val('0');\n $('#pi-sucursal-prod, #pi-sucursal-deliv').val('0');\n\n enableProdOptions($('#switch-pi-prod').prop('checked'));\n enableInputs();\n\n $('#div-pi-transfer').hide();\n $('#div-pi-alert').hide();\n\n $('#btn-pi-transfer').show();\n showButtons();\n\n $('#divCalculator').show();\n $('#divPaymentOptions').show();\n $('#div-pi-cerrar').hide();\n\n $('#div-late-prod').hide();\n $('#switch-pi-late-prod').prop('checked', false);\n\n getSucursal();\n init_v2();\n}", "function inicializarHerramientas() {\n\n toastr.options = {\n \"closeButton\": false,\n \"debug\": false,\n \"newestOnTop\": false,\n \"progressBar\": false,\n //\"positionClass\": \"toast-bottom-center\",\n \"preventDuplicates\": false,\n \"onclick\": null,\n \"showDuration\": \"300\",\n \"hideDuration\": \"1000\",\n \"timeOut\": \"5000\",\n \"extendedTimeOut\": \"1000\",\n \"showEasing\": \"swing\",\n \"hideEasing\": \"linear\",\n \"showMethod\": \"fadeIn\",\n \"hideMethod\": \"fadeOut\"\n };\n\n if (utilidadesBitworks.getQueryString(\"saved\") == \"1\") {\n swal({\n title: \"Confirmación\",\n text: \"Registro Guardado Exitosamente!\",\n type: \"success\"\n });\n }\n\n //clase para desabilitar controles\n $(\".canbereadonly\").attr(\"disabled\", true);\n\n //Configuracion para los validadores de .net si es que existen\n if ($.validator) {\n $.validator.unobtrusive.parse(\"form\");\n }\n //configuracion para para levantar las ventanas de errores\n utilidadesBitworks.ConfigVal(true);\n\n\n /*\n\n //$('.i-checks').iCheck({\n // checkboxClass: 'icheckbox_square-green',\n // radioClass: 'iradio_square-green',\n //});\n\n //para la input date\n if ($('.input-group.date').length > 0)\n $('.input-group.date').datepicker({\n format: 'dd/mm/yyyy',\n todayBtn: \"linked\",\n keyboardNavigation: false,\n forceParse: false,\n calendarWeeks: true,\n autoclose: true,\n constrainInput: false\n });\n\n\n\n\n //para los input de tiempo en horas o minutos\n if ($('.clockpicker').length > 0) $('.clockpicker').clockpicker();\n $('.input-group.date input').attr('readonly', true);\n $('.input-group.clockpicker input').attr('readonly', true);\n\n */\n\n}", "function inicializacaoClasseProduto() {\r\n VETORDEPRODUTOSCLASSEPRODUTO = [];\r\n VETORDEINGREDIENTESCLASSEPRODUTO = [];\r\n VETORDECATEGORIASCLASSEPRODUTO = [];\r\n}", "function Buscar() {\n //todos objBusqueda esta en los respectivos js\n var objConf = objConfiguracionGlobal;\n var objBus = objBusquedaGlobal;\n\n //recibe el valor id cama.js\n var valor = get(objBus.id);\n\n //url absoluta y agrega el contenido de la tabla a divContenedor\n fetchGet(`${objBus.url}/?${objBus.nombreParametro}=` + valor, function (res) {\n var respuesta = generarTabla(objConf, res);\n document.getElementById(\"divContenedor\").innerHTML = respuesta;\n\n })\n\n /* fetch(`${objBus.url}/?${objBus.nombreParametro}=` + valor)\n .then(res => res.json())\n .then(res => {\n var respuesta = generarTabla(objConf, res);\n document.getElementById(\"divContenedor\").innerHTML = respuesta;\n\n })\n */\n\n //pintar({\n // //ahora cambia esta linea\n // url: `${objBus.url}/?${objBus.nombreParametro}=` + valor,\n // id: objConf.id,\n // cabeceras: objConf.cabeceras,\n // propiedades: objConf.propiedades\n\n //}, objBus)\n\n}", "function iniciar() {\n configurarBotonesMesas();\n configurarBotonesMenu();\n}", "function init() {\n\tspeechEngine = Homey.manager('speech-output');\n\tHomey.log('NU.nl news app loaded.');\n\t\n\t// Create settings variables with default values if none seem to exist\n\tif (!Homey.manager('settings').get('mode')) {\n\t\tHomey.manager('settings').set('mode', 'title');\n\t\tHomey.log('Created setting: mode');\n\t}\n\tif (!Homey.manager('settings').get('max')) {\n\t\tHomey.manager('settings').set('max', 10);\n\t\tHomey.log('Created setting: max');\n\t}\n}", "function init()\n{}", "tingoInit() {\n // create a storage directory\n var dataDir = fs.realpathSync(path.resolve(this.cm.dataDir || \".\"));\n this.storageDir = path.join(dataDir, \"user-data\");\n mkdirp.sync(this.storageDir);\n // log.debug (\"storage directory:\", this.storageDir);\n\n // create database\n var TingoDb = require(\"tingodb\")().Db;\n this.database = new TingoDb(this.storageDir, {});\n }", "function i3geo_gl_inicia(objeto_i3geo_gl_configura)\n{\n\t/*\n\tPropriedade $i3geo_gl\n\n\tCont&eacute;m o objeto $i3geo_gl com todas as propriedades e fun&ccedil;&otilde;es de controle da interface\n\t*/\n\ti3GEO.configura.sid = \"\";\n\t$i3geo_gl = objeto_i3geo_gl_configura;\n\tif(document.getElementById($i3geo_gl.buscageo))\n\t$i3geo_gl.buscageo_init();\n\t$i3geo_gl.seltema($i3geo_gl.nomeseltema);\n\ti3GEO.arvoreDeTemas.comboMenus($i3geo_gl.loc_i3geo,\"$i3geo_gl.combogrupos\",$i3geo_gl.menu,\"\",\"530\",\"1\",\"\");\n\t/*\n\t$inputText(\"paiPontos\",\"\",\"pontos\",\"\",\"\",\"\")\n\t$inputText(\"paiNometemapontos\",\"\",\"nometemapontos\",\"\",\"\",\"\")\n\t$inputText(\"paiPerfil\",\"\",\"perfil\",\"\",\"\",\"\")\n\t*/\n}" ]
[ "0.6893023", "0.68603694", "0.65422606", "0.64586025", "0.6449264", "0.6417552", "0.6379779", "0.63297594", "0.6292718", "0.6234378", "0.62272525", "0.61775774", "0.6168989", "0.6151381", "0.60886246", "0.6079902", "0.6068331", "0.60492724", "0.59986264", "0.59958535", "0.5983616", "0.59820074", "0.59750247", "0.597342", "0.59659934", "0.5962819", "0.5960974", "0.592211", "0.5877762", "0.5831011", "0.5831011", "0.5831011", "0.5831011", "0.5831011", "0.5831011", "0.5831011", "0.5831011", "0.5831011", "0.5831011", "0.5820182", "0.5813517", "0.57989234", "0.5788349", "0.57793", "0.57764465", "0.57673806", "0.5756492", "0.5753411", "0.5725739", "0.57106096", "0.5700398", "0.5694925", "0.56927925", "0.56898355", "0.5681355", "0.56715715", "0.56694555", "0.56676424", "0.5662646", "0.5640752", "0.5639782", "0.56358725", "0.56346244", "0.5628766", "0.5627086", "0.5625903", "0.5621378", "0.56200016", "0.5613041", "0.5611841", "0.5602951", "0.5600777", "0.558999", "0.5589906", "0.5582191", "0.55739135", "0.55721617", "0.5570772", "0.5567509", "0.5565348", "0.55598694", "0.55555326", "0.5552293", "0.55508935", "0.55447227", "0.5542129", "0.55358994", "0.5533", "0.55218923", "0.5521492", "0.55194986", "0.5519322", "0.55147195", "0.55143327", "0.551432", "0.5513653", "0.55122375", "0.55035007", "0.54980224", "0.5497717", "0.549225" ]
0.0
-1
/ CONTROLADOR InicializarControlador() reinicia los valores del Controlador al comienzo del juego para evitar errores cuando haya partidas consecutivas.
function InicializarControlador() { idPalabraActual = 0; // Id de la palabra que tiene que escribir el jugador. idCharActual = 0; // Id a nivel de texto del primer caracter de la palabra que tiene que escribir el jugador. tIni = new Date(); // Momento de inicio del juego. errores = 0; // Número de errores que ha tenido el jugador hasta ahora. subIptAnterior = ""; // Lo que el usuario tenía escrito antes del último refresco del input. palabras = libreria[IndexarTextoAleatorio()].match(/\S+/gi); // Elijo un texto al azar de la librería y lo divido en un array buscando cualquier bloque de texto que no sea un " ". largoTexto = CalcularLargoDelTexto(); // Número de caracteres del texto, incluyendo espacios. texto = ConstruirTextoRevisado(palabras); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "limpiar() {\n this.nuevoRegistro = null;\n this.completado = false;\n this.registroAnterior = null;\n this.limites = [], [];\n this.consumo_correcto = null;\n this.lectura_actual = null;\n this.initMedidor();\n this.initRegistro();\n this.encontrado = null;\n this.isRegistered = null;\n }", "reiniciarConteo() {\n this.ultimo = 0;\n this.tickets = [];\n this.grabarArchivo();\n this.ultimos4 = []\n console.log('Se ha inicializado el sistema');\n \n }", "function inicializarHerramientas() {\n\n toastr.options = {\n \"closeButton\": false,\n \"debug\": false,\n \"newestOnTop\": false,\n \"progressBar\": false,\n //\"positionClass\": \"toast-bottom-center\",\n \"preventDuplicates\": false,\n \"onclick\": null,\n \"showDuration\": \"300\",\n \"hideDuration\": \"1000\",\n \"timeOut\": \"5000\",\n \"extendedTimeOut\": \"1000\",\n \"showEasing\": \"swing\",\n \"hideEasing\": \"linear\",\n \"showMethod\": \"fadeIn\",\n \"hideMethod\": \"fadeOut\"\n };\n\n if (utilidadesBitworks.getQueryString(\"saved\") == \"1\") {\n swal({\n title: \"Confirmación\",\n text: \"Registro Guardado Exitosamente!\",\n type: \"success\"\n });\n }\n\n //clase para desabilitar controles\n $(\".canbereadonly\").attr(\"disabled\", true);\n\n //Configuracion para los validadores de .net si es que existen\n if ($.validator) {\n $.validator.unobtrusive.parse(\"form\");\n }\n //configuracion para para levantar las ventanas de errores\n utilidadesBitworks.ConfigVal(true);\n\n\n /*\n\n //$('.i-checks').iCheck({\n // checkboxClass: 'icheckbox_square-green',\n // radioClass: 'iradio_square-green',\n //});\n\n //para la input date\n if ($('.input-group.date').length > 0)\n $('.input-group.date').datepicker({\n format: 'dd/mm/yyyy',\n todayBtn: \"linked\",\n keyboardNavigation: false,\n forceParse: false,\n calendarWeeks: true,\n autoclose: true,\n constrainInput: false\n });\n\n\n\n\n //para los input de tiempo en horas o minutos\n if ($('.clockpicker').length > 0) $('.clockpicker').clockpicker();\n $('.input-group.date input').attr('readonly', true);\n $('.input-group.clockpicker input').attr('readonly', true);\n\n */\n\n}", "constructor()\n {\n this.unidad = 0\n this.subida1 = 0\n this.subida2 = 0\n this.subida3 = 0\n this.bajada1 = 0\n this.bajada2 = 0\n this.bajada3 = 0\n this.error = 0\n this.oContadorAjuste=new cContadorAjuste()\n }", "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }", "function inicializaContadores(){\n campo.on(\"input\", function(){\n var conteudo = campo.val();\n \n // contador de palavras\n var qtdPalavras = conteudo.split(/\\S+/).length -1; \n $(\"#contador-palavras\").text(qtdPalavras);\n // >> /\\S+/ = expressão regular que busca espço vazio\n \n // contador de letras\n var qtdCaracteres = conteudo.length\n $(\"#contador-caracteres\").text(qtdCaracteres);\n });\n }", "function inicializaContadores() {\n\tcampo.on(\"input\", function() {\n\t\tvar qtdPalavras = campo.val().split(/\\S+/).length - 1;\t\n\t\t$(\"#contador-palavras\").text(qtdPalavras);\n\t\t$(\"#contador-caracteres\").text(campo.val().length);\n\t});\n}", "function limpiarMensajesValidacion(){\n\t\tvar indexValidacion = 2; \n\t\t//tomamos la lista actual del rowset \n\t\tvar listaClientes = listado1.datos; \n\t\t//realizamos la tranformaion \n\t\tfor (var i=0; i < listaClientes.length; i++){\n\t\t\t//limpia el el mensage de validacion\n\t\t\tlistaClientes[i][indexValidacion] = \"\"; \n\t\t}\n\t\tlistado1.repinta();\n\t}", "function accionCrear()\n\t{\n\n//\t\talert(\"accionCrear\");\n\t\tif(listado1.datos.length != 0)\n\t\t{\n\t\t\tvar orden = listado1.codSeleccionados();\n//\t\t\talert(\"Linea seleccionada \" + orden);\n\t\t\tset('frmPBuscarTiposError.hidOidCabeceraMatrizSel', orden);\n\t\t\tset('frmPBuscarTiposError.accion', 'crear');\n\t\t\tenviaSICC('frmPBuscarTiposError');\n\n\t\t}else\n\t\t{\n\t\t\talert(\"no hay seleccion: \" + listado1.datos.length);\n\t\t}\n\t}", "function CamposRequeridosLogin(){\n var campos = [\n {campo:'email-username',valido:false},\n {campo:'password',valido:false}\n ];\n\n for(var i=0;i<campos.length;i++){\n campos[i].valido = validarCampoVacioLogin(campos[i].campo);\n }\n\n //Con uno que no este valido ya debe mostrar el Error-Login\n for (var i=0; i<campos.length;i++){\n if (!campos[i].valido)\n return;\n }\n //En este punto significa que todo esta bien\n guardarSesion();\n}", "function cargarCgg_res_oficial_seguimientoCtrls(){\n if(inRecordCgg_res_oficial_seguimiento){\n tmpUsuario = inRecordCgg_res_oficial_seguimiento.get('CUSU_CODIGO');\n txtCrosg_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_CODIGO'));\n txtCusu_codigo.setValue(inRecordCgg_res_oficial_seguimiento.get('NOMBRES')+' '+inRecordCgg_res_oficial_seguimiento.get('APELLIDOS'));\n chkcCrosg_tipo_oficial.setValue(inRecordCgg_res_oficial_seguimiento.get('CROSG_TIPO_OFICIAL'));\n isEdit = true;\n habilitarCgg_res_oficial_seguimientoCtrls(true);\n }}", "function chkCamposInicializa(){\r\n\t\r\n\t//Validando los campos del formulario\r\n\t/***FECHA DE PUBLICACION DEL APOYO***/\r\n\tvar fecha = $('#fechaPeticion').val();\r\n\tif(fecha==\"\" || fecha==null){\r\n\t\t$('#dialogo_1').html('Seleccione la fecha de publicación de lineamientos');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\r\n\t/***TITULO DE AVISO***/\r\n\tvar descLineamiento = $('#descLineamiento').val();\r\n\tif(descLineamiento==\"\" || descLineamiento==null){\r\n\t\t$('#dialogo_1').html('Capture el título del lineamiento del esquema de apoyos');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t\r\n\t/***ARCHIVO DE PUBLICACION DOF***/\r\n\tvar editar = $('#editar').val();\r\n\tif(editar!=3){\r\n\t\tvar archivo = $('#doc').val();\r\n\t\tif(archivo==null || archivo == \"\"){\r\n\t\t\t$('#dialogo_1').html('Seleccione el archivo de publicación DOF.');\r\n\t\t\tabrirDialogo();\r\n\t\t return false;\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t/***AREA RESPONSABLE***/\r\n\tvar idArea = $('#idArea').val();\r\n\tif(idArea==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el area responsable');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t/***TIPO COMPONENTE***/\r\n\tvar idComponente = $('#idComponente').val();\r\n\tif(idComponente==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el tipo de componente');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t\r\n\t/***DESCRIPCION CORTA***/\r\n\tvar descCorta = $('#descCorta').val();\r\n\tif(descCorta==\"\" || descCorta==null){\r\n\t\t$('#dialogo_1').html('Capture la descripción corta del esquema de apoyos');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\tvar acronimoCA = $('#acronimoCA').val();\r\n\tif(acronimoCA==\"\" || acronimoCA==null){\r\n\t\t$('#dialogo_1').html('Capture la definición del acrónimo');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\tif ($('#errorValidaAcronimo').length){\r\n\t\t\tvar errorValidaAcronimo = $('#errorValidaAcronimo').val();\r\n\t\t\tif(errorValidaAcronimo!=0){\r\n\t\t\t\t$('#dialogo_1').html('El folio de la solicitud ya se encuentra registrado, por favor verifique');\r\n\t\t \t\tabrirDialogo();\r\n\t\t \t\treturn false;\t\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar leyendaAtentaNota = $('#leyendaAtentaNota').val();\r\n\tif(leyendaAtentaNota==\"\" || leyendaAtentaNota==null){\r\n\t\t$('#dialogo_1').html('Capture la leyenda de la atenta nota');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}\r\n\t\r\n\t\r\n\t/***CICLO***/\r\n\tvar numCiclos = $('#numCiclos').val();\r\n\tif(numCiclos ==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el número de ciclo a apoyar');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\tvar i=0;\r\n\t\tvar ciclo =\"\";\r\n\t\tvar anio =\"\";\r\n\t\tvar j =0;\r\n\t\tvar tempCiclo =\"\";\r\n\t\tvar tempAnio =\"\";\r\n\t\t\r\n\t\tfor (i=1;i<parseInt(numCiclos)+1;i++){\r\n\t\t\tciclo = $('#ci'+i).val();\r\n\t\t\tanio = $('#a'+i).val();\r\n\t\t\tif(ciclo==-1 || anio==-1 ){\r\n\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' de la captura de ciclos');\r\n\t\t \t\tabrirDialogo();\r\n\t\t \t\treturn false;\r\n\t \t\t }else{\r\n\t \t\t\t/*Valida que el ciclo seleccionado por el usuario no se encuentre repetido*/\r\n\t\t \t\t\tfor (j=1;j<parseInt(numCiclos)+1;j++){\r\n\t\t \t\t\t\tif(i!=j){\r\n\t\t \t\t\t\t\ttempCiclo = $('#ci'+j).val();\r\n\t\t \t\t\t\t\ttempAnio = $('#a'+j).val();\r\n\t\t \t\t\t\t\tif(ciclo == tempCiclo && anio == tempAnio){\r\n\t\t \t\t\t\t\t\t$('#dialogo_1').html('El ciclo del registro '+i+\", se encuentra repetido, favor de verificar\");\r\n\t\t \t\t\t\t \t\tabrirDialogo();\r\n\t\t \t\t\t\t \t\treturn false;\r\n\t\t \t\t\t\t\t}\r\n\t\t \t\t\t\t}\t \t\t\t\t\r\n\t\t \t\t\t} \r\n\t \t\t }\r\n\t\t}\r\n\t}\r\n\t\t\r\n\t\r\n\t/***CRITERIO DE PAGO***/\r\n\tvar idCriterioPago = $('#idCriterioPago').val();\r\n\tif(idCriterioPago ==-1){\r\n\t\t$('#dialogo_1').html('Seleccione el criterio de pago');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\t/***VOLUMEN (1), ETAPA(2) y ETAPA/VOLUMEN (3)***/\r\n\t\tif(idCriterioPago==1 || idCriterioPago == 3){\r\n\t\t\t//valida volumen\t\t\t\r\n\t\t\t/***UNIDAD DE MEDIDA***/\r\n\t\t\tvar idUnidadMedida = $('#idUnidadMedida').val();\r\n\t\t\tif(idUnidadMedida ==-1){\r\n\t\t\t\t$('#dialogo_1').html('Seleccione la unidad de medida');\r\n\t\t\t\tabrirDialogo();\r\n\t\t\t \treturn false;\r\n\t\t\t}\r\n\t\t\t/***VOLUMEN***/\t\r\n\t\t\tvar volumen = $('#volumen').val();\r\n\t\t\tvar patron =/^\\d{1,10}((\\.\\d{1,3})|(\\.))?$/;\r\n\t\t\tif(!volumen.match(patron)){\r\n\t\t\t\t$('#dialogo_1').html('El valor del volumen máximo a apoyar es inválido, se aceptan hasta 10 dígitos a la izquierda y 3 dígitos máximo a la derecha');\r\n\t\t\t\tabrirDialogo();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\tvar volxCulVar = $('input:radio[name=volxCulVar]:checked').val();\r\n\t\t\tif(volxCulVar == 0){ //si desea agregar volumen por cultivo-variedad \r\n\t\t\t\tvar numCamposVXCV = $('#numCamposVXCV').val();\r\n\t\t\t\tif(numCamposVXCV < 1 || numCamposVXCV ==null || numCamposVXCV ==\"\"){\r\n\t\t\t\t\t$('#dialogo_1').html('Capture el número de registros para el volumen por cultivo variedad');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar cultivoVXCV =\"\";\r\n\t\t\t\t\tvar variedadVXCV =\"\";\r\n\t\t\t\t\tvar volumenVXCV =\"\";\r\n\t\t\t\t\tvar cultivoVXCVTemp =\"\";\r\n\t\t\t\t\tvar variedadVXCVTemp = \"\";\r\n\t\t\t\t\tvar totalVolumen=0;\r\n\t\t\t\t\t//Validar que los campos sean seleccionados\t\t\t\t\t\r\n\t\t\t\t\tfor (i=1;i<parseInt(numCamposVXCV)+1;i++){\r\n\t\t\t\t\t\tcultivoVXCV = $('#cultivoVXCV'+i).val();\r\n\t\t\t\t\t\tvariedadVXCV = $('#variedadVXCV'+i).val();\r\n\t\t\t\t\t\tvolumenVXCV = $('#volumenVXCV'+i).val();\t\t\t\t\t\r\n\t\t\t\t\t\tif(cultivoVXCV ==-1 || variedadVXCV ==-1 || (volumenVXCV == \"\" || volumenVXCV == null)){\r\n\t\t\t\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' volumen por cultivo variedad');\r\n\t\t\t\t\t \t\tabrirDialogo();\r\n\t\t\t\t\t \t\treturn false;\r\n\t\t\t\t \t\t }else{\t\t\r\n\t\t\t\t \t\t\tconsole.log(i);\t\t\t\t \t\t\t\r\n\t\t\t\t \t\t\t //Valida que el cultivo y variedad no se encuentren repetidos\t\t\t\t \t\t\t\r\n\t\t\t\t \t\t\tfor (j=1;j<parseInt(numCamposVXCV)+1;j++){\r\n\t\t\t\t \t\t\t\tif(i!=j){\r\n\t\t\t\t \t\t\t\t\tcultivoVXCVTemp = $('#cultivoVXCV'+j).val();\r\n\t\t\t\t\t\t\t\t\tvariedadVXCVTemp = $('#variedadVXCV'+j).val();\r\n\t\t\t\t\t\t\t\t\tcuotaTemp = $('#cuota'+j).val();\r\n\t\t\t\t\t\t\t\t\tif(cultivoVXCV == cultivoVXCVTemp && variedadVXCV == variedadVXCVTemp ){\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t$('#dialogo_1').html('El registro '+i+' en volumen por cultivo variedad se encuentra repetido, favor de verificar');\r\n\t\t\t\t\t \t\t\t \t\tabrirDialogo1();\r\n\t\t\t\t\t \t\t\t \t\treturn false;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t \t\t\t\t}\r\n\t\t\t\t \t\t\t}\r\n\t\t\t\t \t\t\t//console.log(totalVolumen);\r\n\t\t\t\t \t\t\ttotalVolumen = (totalVolumen+parseFloat(volumenVXCV));\r\n\t\t\t\t \t\t }//end es diferente de null o campos vacios\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(parseFloat(totalVolumen) > parseFloat(volumen) ){\r\n\t\t\t\t\t\t$('#dialogo_1').html('El volumen autorizado '+volumen+' debe ser mayor al volumen total '+totalVolumen+' volumen por cultivo variedad, favor de verificar');\r\n\t \t\t\t \t\tabrirDialogo();\r\n\t \t\t\t \t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}// end numCamposVXCV es dirente de vacio\t\t\t\t\t\r\n\t\t\t}// end volxCulVar si desea agregar volumen por cultivo-variedad\r\n\t\t\t\r\n\t\t}// end criterio == 1 o 3\r\n\t\r\n\t\tif(idCriterioPago==2 || idCriterioPago == 3){\r\n\t\t\t//Valida etapa\r\n\t\t\tnoEtapa = $('#noEtapa').val();\r\n\t\t\tif(noEtapa==-1){\r\n\t\t\t\t$('#dialogo_1').html('Seleccione el número de etapas');\r\n\t\t\t\tabrirDialogo();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t//Valida la captura de monto, cuota por etapa\r\n\t\t\tvar cuotaMonto = \"\";\r\n\t\t\tvar totalMonto =0;\r\n\t\t\tfor (j=1;j<parseInt(noEtapa)+1;j++){\r\n\t\t\t\tcuotaMonto = $('#cuotaMonto'+j).val();\r\n\t\t\t\tif(cuotaMonto == null || cuotaMonto ==\"\"){\t\t\t\t\t\r\n\t\t\t\t\t$('#dialogo_1').html('Capture los valores del registro '+j+' en la asignación de importe por etapa');\r\n \t\t\t \t\tabrirDialogo();\r\n \t\t\t \t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\ttotalMonto = (totalMonto+parseFloat(cuotaMonto));\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\tif(idCriterioPago==2){\r\n\t\t\t\timporte = $('#importe').val();\r\n\t\t\t\tvar patron =/^\\d{1,10}((\\.\\d{1,2})|(\\.))?$/;\r\n\t\t\t\tif(!importe.match(patron)){\r\n\t\t\t\t\t$('#dialogo_1').html('El valor del importe máximo a apoyar es inválido, se aceptan hasta 10 dígitos a la izquierda y 2 dígitos máximo a la derecha');\r\n\t\t\t\t\tabrirDialogo();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(parseFloat(importe) != parseFloat(totalMonto)){\r\n\t\t\t\t\t\t$('#dialogo_1').html('El valor del importe autorizado a apoyar '+importe+' difiere de la suma '+totalMonto+'de los montos por etapa');\r\n\t\t\t\t\t\tabrirDialogo();\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$(\".textCentrado\").removeAttr('disabled');\r\n\t\t\tconsole.log(\"desabilitando\");\r\n\t\t\t\r\n\t\t}// end criterio etapa (2) || volumen/etapa (3) \r\n\t\t\r\n\t}\r\n\t\r\n\t/***Valida los campos de los estados a apoyar***/\r\n\tvar numCampos = $('#numCampos').val();\t\r\n\tif(numCampos==0){\r\n\t\t$('#dialogo_1').html('Debe capturar los estados a apoyar');\r\n\t\tabrirDialogo();\r\n\t \treturn false;\r\n\t}else{\r\n\t\tvar cult = -1;\r\n\t\tvar edo = -1;\r\n\t\tvar variedad = -1;\r\n\t\tvar cuota =\"\";\r\n\t\tvar tempCult =\"\";\r\n\t\tvar tempEdo =\"\";\r\n\t\tvar tempVariedad =\"\";\r\n\t\tvar tempCuota =\"\";\r\n\t\tvar siCapturoPrecioPagado = 0;\r\n\t\tfor (i=1;i<parseInt(numCampos)+1;i++){\r\n\t\t\tcult = $('#c'+i).val();\r\n\t\t\tedo = $('#e'+i).val();\r\n\t\t\tvariedad = $('#va'+i).val();\r\n\t\t\tcuota = $('#cuota'+i).val();\r\n\t\t\tif(idCriterioPago == 1){\r\n\t\t\t\tif(cult==-1 || edo==-1 || variedad == -1 || (cuota == \"\" || cuota == null)){\r\n\t\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' en los estados a apoyar');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n\t\t \t\t }\r\n\t\t\t}else{\r\n\t\t\t\tif(cult==-1 || edo==-1 ){\r\n\t\t \t\t\t$('#dialogo_1').html('Capture los valores del registro '+i+' en los estados a apoyar');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\tvar precioPagado = \"\";\r\n\t \t\tfor (j=1;j<parseInt(numCampos)+1;j++){\r\n\t \t\t\tif(i!=j){\r\n\t \t\t\t\ttempCult = $('#c'+j).val();\r\n\t \t\t\t\ttempEdo = $('#e'+j).val();\r\n\t \t\t\t\ttempVariedad = $('#va'+j).val();\r\n\t \t\t\t\ttempCuota = $('#cuota'+j).val();\r\n\t \t\t\t\tprecioPagado = $('#precioPagado'+j).val();\r\n\t \t\t\t\tif(precioPagado != null && precioPagado != \"\" ){\r\n\t \t\t\t\t\tsiCapturoPrecioPagado = 1;\r\n\t \t\t\t\t}\r\n\t \t\t\t\tif(cult == tempCult && edo == tempEdo && variedad == tempVariedad && cuota == tempCuota){\r\n\t \t\t\t\t\t$('#dialogo_1').html('El registro '+i+' se encuentra repetido, favor de verificar');\r\n\t \t\t\t \t\tabrirDialogo();\r\n\t \t\t\t \t\treturn false;\r\n\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\r\n\t \t\tif(idCriterioPago == 1){\r\n\t \t\t\tpatron =/^\\d{1,13}((\\.\\d{1,2})|(\\.))?$/;\r\n\t \t\t\tif(!cuota.match(patron)){\r\n\t\t \t\t\t$('#dialogo_1').html('El valor de la cuota \"'+cuota+'\" del registro '+i+' es inválido, se aceptan hasta 13 dígitos a la izquierda y 2 dígitos máximo a la derecha');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n\t \t\t\t}\t\r\n\t \t\t}\r\n\t\t}// end for\r\n\t\t\r\n\t\tif(parseInt(siCapturoPrecioPagado) == 1){\r\n\t\t\t//Verificar que todos los campos de precio pagado sean capturados\r\n\t\t\tfor (j=1;j<parseInt(numCampos)+1;j++){\r\n\t\t\t\tprecioPagado = $('#precioPagado'+j).val();\r\n \t\t\t\tif(precioPagado == null || precioPagado == \"\" ){\r\n \t\t\t\t\t$('#dialogo_1').html('Debe capturar el precio pagado en el registro '+j+', si eligió capturar este campo todos los registros serán requeridos');\r\n\t\t\t \t\tabrirDialogo();\r\n\t\t\t \t\treturn false;\r\n \t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}// end validacion de los campos de cuotas\t\r\n\tvar dia = \"\", mes = \"\", anio = \"\";\r\n\tvar fechaInicioAcopio = $('#fechaInicioAcopio').val(); \r\n\tvar fechaFinAcopio = $('#fechaFinAcopio').val();\r\n\t\r\n\tif(fechaInicioAcopio !=null && fechaInicioAcopio != \"\"){\r\n\t\tif(fechaFinAcopio == null || fechaFinAcopio == \"\"){\r\n\t\t\t$('#dialogo_1').html('Seleccione la fecha fin del periodo de acopio');\r\n\t\t\tabrirDialogo();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(fechaFinAcopio != null && fechaFinAcopio != \"\"){\r\n\t\tif(fechaInicioAcopio == null || fechaInicioAcopio == \"\"){\r\n\t\t\t$('#dialogo_1').html('Seleccione la fecha inicio del periodo de acopio');\r\n\t\t\tabrirDialogo();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\t\r\n\t\r\n\tif(fechaInicioAcopio != null && fechaFinAcopio != null ){\r\n\t\tvar fechaInicioAcopioTmp = \"\";\r\n\t\tdia = fechaInicioAcopio.substring(0,2);\r\n\t\tmes = fechaInicioAcopio.substring(3,5);\r\n\t\tanio = fechaInicioAcopio.substring(6,10);\r\n\t\tfechaInicioAcopioTmp = anio+\"\"+\"\"+mes+\"\"+dia;\r\n\t\tvar fechaFinAcopioTmp = \"\";\r\n\t\tdia = fechaFinAcopio.substring(0,2);\r\n\t\tmes = fechaFinAcopio.substring(3,5);\r\n\t\tanio = fechaFinAcopio.substring(6,10);\r\n\t\tfechaFinAcopioTmp = anio+\"\"+\"\"+mes+\"\"+dia;\r\n\t\tif(parseInt(fechaFinAcopioTmp) < parseInt(fechaInicioAcopioTmp)){\r\n\t\t\t$('#dialogo_1').html('La fecha fin de acopio seleccionada no puede ser menor a la fecha inicio de acopio, por favor verifique');\r\n\t\t\tabrirDialogo();\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\tvar periodoDOFSI = $('#periodoDOFSI').val();\r\n\tpatron =/^\\d{1,10}$/;\r\n\tif(!periodoDOFSI.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo DOF a SI es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tvar periodoOSIROSI = $('#periodoOSIROSI').val();\r\n\tpatron =/^\\d{1,10}$/;\r\n\tif(!periodoOSIROSI.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo OOSI a ROOSI es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\tvar periodoCASP = $('#periodoCASP').val();\r\n\tif(!periodoCASP.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo CA a SP es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar periodoSPOO = $('#periodoSPOO').val();\r\n\tif(!periodoSPOO.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo SP a OO es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n\r\n\tvar periodoORPago = $('#periodoORPago').val();\r\n\tif(!periodoORPago.match(patron)){\r\n\t\t$('#dialogo_1').html('El valor del periodo OR a Pago es inválido, se aceptan hasta 10 dígitos');\r\n\t\tabrirDialogo();\r\n\t\treturn false;\r\n\t}\r\n}", "function destacaCamposComProblemaEmForms( erros ){\n\n tabela.find('.form-group').removeClass('has-error');\n\n $.each( erros, function( index, erro ){\n\n $(\"[name='\"+index+\"']\").parents(\".form-group\").addClass('has-error');\n\n });\n\n }", "function seteaValoresParaGuardar() {\n\tset(FORMULARIO + '.hDescripcionD', get(FORMULARIO + '.ValorDescripcionD') );\n\tset(FORMULARIO + '.hMarca', get(FORMULARIO + '.ValorMarca') );\n\tset(FORMULARIO + '.hCanal', get(FORMULARIO + '.ValorCanal') );\n\tset(FORMULARIO + '.hTipoCurso', get(FORMULARIO + '.ValorTipoCurso') ); \n\tset(FORMULARIO + '.hAccesoInformacion', get(FORMULARIO + '.ValorAccesoInformacion') ); \n\tset(FORMULARIO + '.hFrecuenciaDictado', get(FORMULARIO + '.ValorFrecuenciaDictado') ); \n\tset(FORMULARIO + '.hSubgerenciaVentas', get(FORMULARIO + '.ValorSubgerenciaVentas') ); \n\tset(FORMULARIO + '.hRegion', get(FORMULARIO + '.ValorRegion') ); \n\tset(FORMULARIO + '.hZona', get(FORMULARIO + '.ValorZona') ); \n\tset(FORMULARIO + '.hSeccion', get(FORMULARIO + '.ValorSeccion') ); \n\tset(FORMULARIO + '.hTerritorio', get(FORMULARIO + '.ValorTerritorio') ); \n\tset(FORMULARIO + '.hTipoCliente', get(FORMULARIO + '.ValorTipoCliente') ); \n\tset(FORMULARIO + '.hCapacitador', get(FORMULARIO + '.ValorCapacitador') ); \n\tset(FORMULARIO + '.hSubtipoCliente', get(FORMULARIO + '.ValorSubtipoCliente') ); \n\tset(FORMULARIO + '.hClasificacion', get(FORMULARIO + '.ValorClasificacion') ); \n\tset(FORMULARIO + '.hTipoClasificacion', get(FORMULARIO + '.ValorTipoClasificacion') ); \n\tset(FORMULARIO + '.hStatusCliente', get(FORMULARIO + '.ValorStatusCliente') ); \n\tset(FORMULARIO + '.hStatusCursosExigidos', get(FORMULARIO + '.ValorStatusCursosExigidos') ); \n\tset(FORMULARIO + '.hPeriodoInicio', get(FORMULARIO + '.ValorPeriodoInicio') ); \n\tset(FORMULARIO + '.hPeriodoFin', get(FORMULARIO + '.ValorPeriodoFin') ); \n\tset(FORMULARIO + '.hPeriodoInicioV', get(FORMULARIO + '.ValorPeriodoInicioV') ); \n\tset(FORMULARIO + '.hPeriodoFinV', get(FORMULARIO + '.ValorPeriodoFinV') ); \n\tset(FORMULARIO + '.hPeriodoIngreso', get(FORMULARIO + '.ValorPeriodoIngreso') ); \n\tset(FORMULARIO + '.hProductoEntregar', get(FORMULARIO + '.ValorProductoEntregar') ); \n\tset(FORMULARIO + '.hMomentoEntregar', get(FORMULARIO + '.ValorMomentoEntregar') ); \n\n\tset(FORMULARIO + '.hNombreCurso', get(FORMULARIO + '.ValorNombreCurso') ); \n\tset(FORMULARIO + '.hObjetivoCurso', get(FORMULARIO + '.ValorObjetivoCurso') ); \n\tset(FORMULARIO + '.hContenidoCurso', get(FORMULARIO + '.ValorContenidoCurso') ); \n\tset(FORMULARIO + '.hAccesoSeleccionDM', get(FORMULARIO + '.ValorAccesoSeleccionDM') ); \n\tset(FORMULARIO + '.hPathDM', get(FORMULARIO + '.ValorPathDM') ); \n\tset(FORMULARIO + '.hFechaDisponible', get(FORMULARIO + '.ValorFechaDisponible') ); \n\tset(FORMULARIO + '.hFechaLanzamiento', get(FORMULARIO + '.ValorFechaLanzamiento') ); \n\tset(FORMULARIO + '.hFechaFin', get(FORMULARIO + '.ValorFechaFin') ); \n\tset(FORMULARIO + '.hAlcanceGeografico', get(FORMULARIO + '.ValorAlcanceGeografico') ); \n\tset(FORMULARIO + '.hNOptimo', get(FORMULARIO + '.ValorNOptimo') ); \n\tset(FORMULARIO + '.hBloqueo', get(FORMULARIO + '.ValorBloqueo') ); \n\tset(FORMULARIO + '.hRelacion', get(FORMULARIO + '.ValorRelacion') ); \n\tset(FORMULARIO + '.hNOrdenes', get(FORMULARIO + '.ValorNOrdenes') ); \n\tset(FORMULARIO + '.hMonto', get(FORMULARIO + '.ValorMonto') ); \n\tset(FORMULARIO + '.hFechaIngreso', get(FORMULARIO + '.ValorFechaIngreso') ); \n\tset(FORMULARIO + '.hNCondicion', get(FORMULARIO + '.ValorNCondicion') ); \n\tset(FORMULARIO + '.hFechaUltimo', get(FORMULARIO + '.ValorFechaUltimo') ); \n\tset(FORMULARIO + '.hNRegaloParticipantes', get(FORMULARIO + '.ValorNRegaloParticipantes') ); \n\tset(FORMULARIO + '.hCondicionPedido', get(FORMULARIO + '.ValorCondicionPedido') ); \n\tset(FORMULARIO + '.hControlMorosidad', get(FORMULARIO + '.ValorControlMorosidad') ); \n\tset(FORMULARIO + '.hDescripcionD', get(FORMULARIO + '.ValorDescripcionD') );\n}", "function InicializarControles(){\t\n\tif (gListaLuz.length === 0){\n\t\tvar hidden = $(\"#hiddenDb\").val();\n\t\tgListaLuz = $.parseJSON(hidden);\n\t}\n}", "function AdministrarValidaciones() {\r\n var _a, _b, _c, _d;\r\n var Valido = true;\r\n var errorArray = [];\r\n if (!ValidarCamposVacios(\"numDni\") || !ValidarRangoNumerico(\"numDni\", 1000000, 55000000)) {\r\n console.log(\"Error en el DNI\");\r\n errorArray.push(\"DNI\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"numDni\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"numDni\", false);\r\n }\r\n if (!ValidarCamposVacios(\"txtApellido\")) {\r\n console.log(\"El apellido está vacío\");\r\n errorArray.push(\"Apellido\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"txtApellido\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"txtApellido\", false);\r\n }\r\n if (!ValidarCamposVacios(\"txtNombre\")) {\r\n console.log(\"El nombre está vacío\");\r\n errorArray.push(\"Nombre\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"txtNombre\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"txtNombre\", false);\r\n }\r\n if (!ValidarCombo(\"cboSexo\", \"--\")) {\r\n console.log(\"No se ha seleccionado sexo\");\r\n errorArray.push(\"Sexo\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"cboSexo\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"cboSexo\", false);\r\n }\r\n if (!ValidarCamposVacios(\"numLegajo\") || !ValidarRangoNumerico(\"numLegajo\", 100, 550)) {\r\n console.log(\"Error en el legajo\");\r\n errorArray.push(\"Legajo\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"numLegajo\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"numLegajo\", false);\r\n }\r\n if (!ValidarCamposVacios(\"numSueldo\") || !ValidarRangoNumerico(\"numSueldo\", 800, ObtenerSueldoMaximo(ObtenerRbSeleccionado(\"Turno\")))) {\r\n console.log(\"Error en el sueldo\");\r\n errorArray.push(\"Sueldo\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"numSueldo\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"numSueldo\", false);\r\n }\r\n if (!ValidarCamposVacios(\"Foto\")) {\r\n console.log(\"Error en la foto\");\r\n errorArray.push(\"Foto\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"Foto\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"Foto\", false);\r\n }\r\n if (ObtenerRbSeleccionado(\"Turno\") == \"\") {\r\n console.log(\"Error en el turno\");\r\n errorArray.push(\"Turno\");\r\n Valido = false;\r\n if (((_a = document.getElementsByClassName(\"turnos\")[0]) === null || _a === void 0 ? void 0 : _a.previousSibling).tagName != 'SPAN') {\r\n var newNode = document.createElement(\"span\");\r\n newNode.style.color = \"brown\";\r\n newNode.appendChild(document.createTextNode(\"*\"));\r\n (_b = document.getElementsByClassName(\"turnos\")[0].parentElement) === null || _b === void 0 ? void 0 : _b.insertBefore(newNode, document.getElementsByClassName(\"turnos\")[0]);\r\n }\r\n }\r\n else {\r\n if (((_c = document.getElementsByClassName(\"turnos\")[0]) === null || _c === void 0 ? void 0 : _c.previousSibling).tagName == 'SPAN') {\r\n ((_d = document.getElementsByClassName(\"turnos\")[0]) === null || _d === void 0 ? void 0 : _d.previousSibling).remove();\r\n }\r\n }\r\n return Valido;\r\n // if(Valido)\r\n // {\r\n // let form = (<HTMLFormElement>document.getElementById(\"frmEmpleado\"));\r\n // if(form != null)\r\n // {\r\n // form.submit();\r\n // }\r\n // }\r\n // else\r\n // {\r\n // //COMENTADO POR LA PARTE 4 DEL TP\r\n // // let errorMessage = \"Los siguientes campos están vacíos o los valores ingresados no son válidos:\"\r\n // // errorArray.forEach(element => {\r\n // // errorMessage = errorMessage.concat('\\n', '- ', element);\r\n // // });\r\n // // alert(errorMessage);\r\n // }\r\n}", "function formulario_enviar_logistica_recorrido() {\n var parametros = {};\n parametros.recorrido = $(\"#recorrido\").val();\n parametros.descripcion = $(\"#descripcion\").val();\n parametros.fechaDesde = $(\"#fecha-desde-fecha\").val();\n parametros.fechaHasta = $(\"#fecha-hasta-fecha\").val();\n parametros.horaDesde = $(\"#fecha-desde-hora\").val();\n parametros.horaHasta = $(\"#fecha-hasta-hora\").val();\n parametros.moviles = $(\"#slc-movil\").multipleSelect(\"getSelects\");\n parametros.rutas = $(\"#slc-ruta\").multipleSelect(\"getSelects\");\n parametros.repeticion = $(\"#checkbox-repeticion\").prop(\"checked\");\n\n if (parametros.repeticion) {\n parametros.repeticion_caracteristicas = {};\n\n parametros.repeticion_caracteristicas.Lunes = $('#panel-repeticion > div.panel-secundario-body .btn-dia[data-texto=\"Lunes\"]').hasClass(\"mdc-button--dia\");\n parametros.repeticion_caracteristicas.Martes = $('#panel-repeticion > div.panel-secundario-body .btn-dia[data-texto=\"Martes\"]').hasClass(\"mdc-button--dia\");\n parametros.repeticion_caracteristicas.Miercoles = $('#panel-repeticion > div.panel-secundario-body .btn-dia[data-texto=\"Miercoles\"]').hasClass(\"mdc-button--dia\");\n parametros.repeticion_caracteristicas.Jueves = $('#panel-repeticion > div.panel-secundario-body .btn-dia[data-texto=\"Jueves\"]').hasClass(\"mdc-button--dia\");\n parametros.repeticion_caracteristicas.Viernes = $('#panel-repeticion > div.panel-secundario-body .btn-dia[data-texto=\"Viernes\"]').hasClass(\"mdc-button--dia\");\n parametros.repeticion_caracteristicas.Sabado = $('#panel-repeticion > div.panel-secundario-body .btn-dia[data-texto=\"Sabado\"]').hasClass(\"mdc-button--dia\");\n parametros.repeticion_caracteristicas.Domingo = $('#panel-repeticion > div.panel-secundario-body .btn-dia[data-texto=\"Domingo\"]').hasClass(\"mdc-button--dia\");\n\n var horarios = sldHorario.noUiSlider.get();\n parametros.repeticion_caracteristicas.HorarioDesde = horarios[0];\n parametros.repeticion_caracteristicas.HorarioHasta = horarios[1].replace(\"Dia sig.\", \"\");\n }\n\n formulario_de_carga_guardar(parametros);\n}", "function inicializaEventos() {\r\n\t// Obtiene correo\r\n\tvar emailForm = $(\"#correo\").val();\r\n\t// Obtiene correo\r\n\tvar emailConfirmForm = $(\"#confirmaCorreo\").val();\r\n\r\n\t// Remueve las etiquetas de invalidate\r\n\t$(\"#correo\").removeClass(\"invalid_data\");\r\n\t$(\"#correo\").parents(\".form-group:first\").find(\"span.text_error\").remove();\r\n\t$(\"#confirmaCorreo\").removeClass(\"invalid_data\");\r\n\t$(\"#confirmaCorreo\").parents(\".form-group:first\").find(\"span.text_error\").remove();\r\n\r\n\t// Valida si el campo es vacio\r\n\tif (emailForm != \"\") {\r\n\t\t$(\"#correo\").attr(\"data-not-null\", \"0\");\r\n\t\t$(\"#correo\").attr(\"data-email\", \"0\");\r\n\t\t$(\"#correo\").attr(\"data-confirm\", \"0\");\r\n\t\t$(\"#confirmaCorreo\").attr(\"data-not-null\", \"0\");\r\n\t\t$(\"#confirmaCorreo\").attr(\"data-email\", \"0\");\r\n\r\n\t} else if (emailConfirmForm != \"\") {\r\n\t\t$(\"#correo\").attr(\"data-not-null\", \"0\");\r\n\t\t$(\"#correo\").attr(\"data-email\", \"0\");\r\n\t\t$(\"#correo\").attr(\"data-confirm\", \"0\");\r\n\t\t$(\"#confirmaCorreo\").attr(\"data-not-null\", \"0\");\r\n\t\t$(\"#confirmaCorreo\").attr(\"data-email\", \"0\");\r\n\r\n\t} else {\r\n\t\t$(\"#correo\").removeAttr(\"data-not-null\");\r\n\t\t$(\"#correo\").removeAttr(\"data-email\");\r\n\t\t$(\"#correo\").removeAttr(\"data-confirm\");\r\n\t\t$(\"#confirmaCorreo\").removeAttr(\"data-not-null\");\r\n\t\t$(\"#confirmaCorreo\").removeAttr(\"data-email\");\r\n\t}\r\n}", "function actualizaCompra(urlBase){\n //Se obtienen los valores digitados en el formulario.\n var id_compra = document.getElementById('id-compra').value;\n var proveedor = document.getElementById('compra-proveedor-id').value;\n var proveedor_idx = document.getElementById('compra-proveedor-id').selectedIndex;\n var fecha = document.getElementById('compra-fecha').value;\n var costo = document.getElementById('compra-costo').value;\n var estado = document.getElementById('compra-estado-id').value;\n var estado_idx = document.getElementById('compra-estado-id').selectedIndex;\n var descripcion = document.getElementById('compra-descripcion').value;\n \n //Se eliminan espacios en blanco al inicio y al final de los valores ingresados.\n id_compra = $.trim(id_compra);\n proveedor = $.trim(proveedor);\n fecha = $.trim(fecha);\n costo = $.trim(costo);\n estado = $.trim(estado);\n descripcion = $.trim(descripcion);\n \n //Se realizan las validaciones sobre los campos ingresados.\n try{\n if(id_compra === null || id_compra.length === 0 || /^\\s+$/.test(id_compra) ) {\n throw \"El campo Código de la Compra es obligatorio.\";\n }\n if(proveedor_idx === null){\n throw \"Debe seleccionar un Proveedor de la lista.\";\n }\n if(fecha === null || fecha.length === 0){\n throw \"El campo Fecha es obligatorio.\";\n }\n if(estado_idx === null){\n throw \"Debe seleccionar un Estado de la lista.\";\n }\n \n if(descripcion === null || descripcion.length === 0 || /^\\s+$/.test(descripcion) ) {\n throw \"El campo Descripción de la Compra es obligatorio.\";\n }\n //Se valida si la compra a registrar ya existe,\n //de lo contrario se realiza el registro\n $.ajax({\n url:urlBase+'compras/actualizarCompra',\n async:false,\n data:{\n idComp:id_compra,\n proveedorComp:proveedor,\n fechaComp:fecha,\n costoComp:costo,\n estadoComp:estado,\n descriComp:descripcion\n },\n type:'POST',\n success:function(update){\n try{\n if(update !== \"true\"){\n throw \"Falló la actualización de la Compra\";\n }\n if(update === \"true\"){\n alert(\"Compra actualizada exitosamente.\");\n }\n }\n catch(err){\n alert(err);\n }\n }\n });\n }\n catch(err){\n alert(err);\n }\n}", "function fn_procesoDetalleIndicador(url, estado) {\n $('#mensajeModalRegistrar #mensajeDangerRegistro').remove();\n var num_validar = 0;\n if (estado == 1 || estado == 0) { num_validar = 8 }\n else if (estado == 5 || estado == 6) { num_validar = 11 }\n\n if (rol_usuario != 7) {\n var mns = ValidarRevision('1', $(\"#Control\").data(\"iniciativa\"), num_validar, \"mensajeDangerRegistro\", \"El detalle de esta acción de mitigación ya fue enviada para su revisión\");\n\n if (mns != \"\") {\n if (estado == 1 || estado == 5) {\n $(\"#solicitar-revision #modalRegistrarBoton\").hide();\n $(\"#pieCorrecto\").show();\n $('#mensajeModalRegistrar').append(mns);\n $(\"#Control\").data(\"modal\", 1);\n } else if (estado == 6 || estado == 0) {\n $(\"#guardar-avance #modalAvanceBoton\").hide();\n $(\"#pieCorrectoAvance\").show();\n $('#mensajeModalAvance').append(mns);\n $(\"#Control\").data(\"modal\", 1);\n }\n return false;\n }\n }\n\n let validar_fecha_imple = false;\n if ($(\"#Control\").data(\"mitigacion\") == 4 && (estado == 1 || estado == 5)) validar_fecha_imple = verificarFecha();\n if (validar_fecha_imple) { mensajeError('Por favor, si ha confirmado la implementación de la acción de mitigación debe ingresar la fecha de implementación', '#mensajeModalRegistrar'); return; }\n\n if ($(\"#Control\").data(\"mitigacion\") == 4 && (estado == 1 || estado == 5)) validar_fecha_imple = verificarFechaVerificacion();\n if (validar_fecha_imple) { mensajeError('Por favor, si ha confirmado la verificación de la acción de mitigación debe ingresar la fecha de verificación', '#mensajeModalRegistrar'); return; }\n\n indicadores = [];\n documentos = [];\n var medida = $(\"#Control\").data(\"mitigacion\");\n var enfoque = $(\"#cbo-enfoque\").val();\n var parametros = \"\";\n var n = $(\"#tablaIndicador\").find(\"tbody\").find(\"th\").length + 1;\n var nom = \"\";\n let arrValores = []; //add 27-09-2020\n for (var fila = 1 ; fila < n; fila++) {\n var enfoque = $(\"#cbo-enfoque\").val();\n var ind = $(\"#cuerpoTablaIndicador #detalles-tr-\" + fila).data(\"ind\") == null ? \"0\" : $(\"#cuerpoTablaIndicador #detalles-tr-\" + fila).data(\"ind\") == \"\" ? \"0\" : $(\"#cuerpoTablaIndicador #detalles-tr-\" + fila).data(\"ind\");\n var filas = $(\"#tablaIndicador\").find(\"tbody\").find(\"#detalles-tr-\" + fila).find(\"[data-param]\");\n var Xfilas = $(\"#tablaIndicador\").find(\"tbody\").find(\"#detalles-tr-\" + fila).find(\"input[name=fledoc]\");\n var nomarchivo = $(\"#tablaIndicador\").find(\"tbody\").find(\"#detalles-tr-\" + fila).find(\"[data-nomarchivo]\");//add 18-04-2020 \n\n if (fn_validarCampoReg(fila)) {\n let ListaValores = [], nom_t;\n filas.each(function (index, value) {\n let enfoque_t = enfoque;\n let medida_t = medida;\n let parametro_t = $(value).attr(\"data-param\");\n let m = $(value).attr(\"id\").substring(0, 3);\n let valor = m == \"txt\" ? $(\"#\" + $(value).attr(\"id\")).val().replace(/,/gi, '') : $(\"#\" + $(value).attr(\"id\")).val();\n valor = valor == \"0\" ? \"\" : valor;\n let objValores = {\n ID_ENFOQUE: enfoque_t,\n ID_MEDMIT: medida_t,\n ID_PARAMETRO: parametro_t,\n VALOR: valor\n }\n ListaValores.push(objValores);\n });\n\n nomarchivo.each(function (index, value) {\n nom = $(\"#\" + $(value).attr(\"id\")).val();\n });\n\n if (Xfilas != null && Xfilas != undefined)\n nom_t = Xfilas[0].files.length > 0 ? Xfilas[0].files[0].name : nom != \"\" ? nom : \"\";\n else\n nom_t = \"\";\n\n arrValores.push({\n ID_INDICADOR: ind,\n ADJUNTO: nom_t,\n listaInd: ListaValores,\n objAIV: arrAIV[fila - 1],\n });\n }\n }\n\n for (var i = 0, len = storedFiles.length; i < len; i++) {\n var sux = {\n ID_INICIATIVA: $(\"#Control\").data(\"iniciativa\"),\n ADJUNTO_BASE: storedFiles[i].name,\n FLAG_ESTADO: \"1\"\n }\n documentos.push(sux);\n }\n\n //===========================================\n var terminos = $(\"#chk-publicar\").prop(\"checked\");\n var inversion = $(\"#chk-publicar-monto-inversion\").prop(\"checked\");\n var privacidad = '0';\n var privacidad_monto = '0';\n if (terminos) {\n privacidad = '1'; //0 - PRIVADO : 1 - PUBLICO\n }\n if (inversion) {\n privacidad_monto = '1'; //0 - PRIVADO : 1 - PUBLICO\n }\n //===========================================\n\n var archivos = \"\";\n for (var i = 0, len = storedFiles.length; i < len; i++) {\n archivos += storedFiles[i].name + \"|\";\n }\n if (archivos == \"\") archivos = \"|\";\n\n\n var id_delete = \"\";\n if ($(\"#cuerpoTablaIndicador\").data(\"delete\") != \"\") {\n id_delete = $(\"#cuerpoTablaIndicador\").data(\"delete\");\n id_delete = id_delete.substring(0, id_delete.length - 1);\n }\n\n var id_eliminar = \"\";\n if ($(\"#total-documentos\").data(\"eliminarfile\") != \"\") {\n id_eliminar = $(\"#total-documentos\").data(\"eliminarfile\");\n id_eliminar = id_eliminar.substring(0, id_eliminar.length - 1);\n }\n\n let arrInversion = [];\n $('.anio').each((x, y) => {\n let anio = $(y).data('valor');\n let moneda = $(`#ms-${anio}`).val();\n let inversion = $(`#m-${anio}`).val() == '' ? 0 : $(`#m-${anio}`).val().replace(/,/gi, '');\n arrInversion.push({\n ID_INICIATIVA: $(\"#Control\").data(\"iniciativa\"),\n ANIO: anio,\n MONEDA: moneda,\n INVERSION: inversion,\n USUARIO_REGISTRO: $(\"#Control\").data(\"usuario\"),\n });\n });\n\n var item = {\n ID_INICIATIVA: $(\"#Control\").data(\"iniciativa\"),\n ID_USUARIO: $(\"#Control\").data(\"usuario\"),\n NOMBRE_INICIATIVA: $(\"#txa-nombre-iniciativa\").val(),\n ID_INDICADOR_DELETE: id_delete,\n ID_INDICADOR_ELIMINAR: id_eliminar,\n ID_ESTADO: estado,\n ID_ENFOQUE: enfoque,\n ID_MEDMIT: medida,\n TOTAL_GEI: parseFloat($(\"#total-detalle\").html()),\n ID_TIPO_INGRESO: 1,\n PRIVACIDAD_INICIATIVA: privacidad,\n PRIVACIDAD_INVERSION: privacidad_monto,\n ListaSustentos: documentos,\n extra: archivos,\n ListaIndicadoresData: arrValores,\n SECTOR_INST: medida == 4 ? $('#cbo-sector').val() : '',\n INSTITUCION_AUDITADA: medida == 4 ? $('#txt-institucion').val() : '',\n TIPO_AUDITORIA: medida == 4 ? $('#cbo-tipo_auditoria').val() : '',\n DESCRIPCION_TIPO_AUDITORIA: medida == 4 ? $('#txt-descripcion-tipo-auditoria').val() : '',\n AUDITOR_AUDITORIA: medida == 4 ? $('#txt-auditor').val() : '',\n NOMBRE_INSTITUCION: medida == 4 ? $('#txt-institucion-auditor').val() : '',\n FECHA_AUDITORIA: medida == 4 ? $('#fch-fecha-auditoria').val() : '',\n listaMonto: arrInversion,\n };\n\n var options = {\n type: \"POST\",\n dataType: \"json\",\n contentType: false,\n //async: false, // add 040620\n url: url,\n processData: false,\n data: item,\n xhr: function () { // Custom XMLHttpRequest\n var myXhr = $.ajaxSettings.xhr();\n if (myXhr.upload) { // Check if upload property exists\n //myXhr.upload.addEventListener('progress', progressHandlingFunction, false); // For handling the progress of the upload\n }\n return myXhr;\n },\n resetForm: false,\n beforeSubmit: function (formData, jqForm, options) {\n return true;\n },\n success: function (response, textStatus, myXhr) {\n if (response.success) {\n arrAIV = [];\n //CargarDetalleDatos(); \n if (estado == 0 || estado == 6) CargarArchivosGuardados();\n if (estado == 0 || estado == 6) CargarDatosGuardados();\n $(\"#cuerpoTablaIndicador\").data(\"delete\", \"\");\n $(\"#total-documentos\").data(\"eliminarfile\", \"\");\n $(\"#fledocumentos\").val(\"\");\n if (estado == 0 || estado == 6) {\n $(\"#mensajeModalAvance #mensajeDangerAvance\").remove();\n //var msj = ' <div class=\"col-sm-12 col-md-12 col-lg-12\" id=\"mensajeWarningAvance\">';\n //msj = msj + ' <div class=\"alert alert-warning d-flex align-items-stretch\" role=\"alert\">';\n //msj = msj + ' <div class=\"alert-wrap mr-3\">';\n //msj = msj + ' <div class=\"sa\">';\n //msj = msj + ' <div class=\"sa-warning\">';\n //msj = msj + ' <div class=\"sa-warning-body\"></div>';\n //msj = msj + ' <div class=\"sa-warning-dot\"></div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' <div class=\"alert-wrap\">';\n //msj = msj + ' <h6>Sus avances fueron guardados</h6>';\n //msj = msj + ' <hr>Recuerde, podrá solicitar una revisión una vez complete todos los campos obligatorios.';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n var msj = mensajeCorrecto(\"mensajeWarningAvance\", \"Bien\", \"Usted a guardado correctamente su avance.\");\n\n $(\"#guardar-avance #modalAvanceBoton\").hide();\n $(\"#pieCorrectoAvance\").show();\n $('#mensajeModalAvance').append(msj);\n } else if (estado == 1 || estado == 5) {\n $('#mensajeModalRegistrar #mensajeGoodRegistro').remove();\n $('#mensajeModalRegistrar #mensajeDangerRegistro').remove();\n //var msj = ' <div class=\"alert alert-success d-flex align-items-stretch\" role=\"alert\" id=\"mensajeGoodRegistro\">';\n //msj = msj + ' <div class=\"alert-wrap mr-3\">';\n //msj = msj + ' <div class=\"sa\">';\n //msj = msj + ' <div class=\"sa-success\">';\n //msj = msj + ' <div class=\"sa-success-tip\"></div>';\n //msj = msj + ' <div class=\"sa-success-long\"></div>';\n //msj = msj + ' <div class=\"sa-success-placeholder\"></div>';\n //msj = msj + ' <div class=\"sa-success-fix\"></div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n //msj = msj + ' <div class=\"alert-wrap\">';\n //msj = msj + ' <h6>Felicitaciones</h6>';\n //msj = msj + ' <hr><a class=\"float-right\" href=\"#\" target=\"_blank\"><img src=\"./images/sello_new.svg\" width=\"120\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Ir a la web del sello\"></a>';\n //msj = msj + ' <small class=\"mb-0\">Usted a completado el envío de detalle de su iniciativa de mitigación que será verificada por uno de nuestros especialistas. También, le recordamos que puede ingresar a nuestra plataforma del <b>Sello de Energía Sostenible</b></small>';\n //msj = msj + ' </div>';\n //msj = msj + ' </div>';\n $(\"#solicitar-revision #modalRegistrarBoton\").hide();\n $(\"#pieCorrecto\").show();\n $(\"#mensajeSuccess\").removeAttr(\"hidden\");\n //$('#mensajeModalRegistrar').append(msj);\n $(\"#Control\").data(\"modal\", 1);\n if (response.extra == \"1\") {\n //if (ws != null) ws.send(response.extra);\n }\n }\n } else {\n if (estado == 0) {\n $(\"#mensajeModalAvance #mensajeDangerAvance\").remove();\n var msj = ' <div class=\"col-sm-12 col-md-12 col-lg-12\" id=\"mensajeDangerAvance\">';\n msj = msj + ' <div class=\"alert alert-danger d-flex align-items-stretch\" role=\"alert\">';\n msj = msj + ' <div class=\"alert-wrap mr-3\">';\n msj = msj + ' <div class=\"sa\">';\n msj = msj + ' <div class=\"sa-error\">';\n msj = msj + ' <div class=\"sa-error-x\">';\n msj = msj + ' <div class=\"sa-error-left\"></div>';\n msj = msj + ' <div class=\"sa-error-right\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"sa-error-placeholder\"></div>';\n msj = msj + ' <div class=\"sa-error-fix\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"alert-wrap\">';\n msj = msj + ' <h6>Error al guardar</h6>';\n msj = msj + ' <hr><small class=\"mb-0\">Verifique que los datos e intente otra vez.</small>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n $('#mensajeModalAvance').append(msj);\n } else {\n $('#mensajeModalRegistrar #mensajeGoodRegistro').remove();\n $('#mensajeModalRegistrar #mensajeDangerRegistro').remove();\n var msj = ' <div class=\"alert alert-danger d-flex align-items-stretch\" role=\"alert\" id=\"mensajeDangerRegistro\">';\n msj = msj + ' <div class=\"alert-wrap mr-3\">';\n msj = msj + ' <div class=\"sa\">';\n msj = msj + ' <div class=\"sa-error\">';\n msj = msj + ' <div class=\"sa-error-x\">';\n msj = msj + ' <div class=\"sa-error-left\"></div>';\n msj = msj + ' <div class=\"sa-error-right\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"sa-error-placeholder\"></div>';\n msj = msj + ' <div class=\"sa-error-fix\"></div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n msj = msj + ' <div class=\"alert-wrap\">';\n msj = msj + ' <h6>Error de registro</h6>';\n msj = msj + ' <hr><small class=\"mb-0\">Verifique que los datos sean correctamente ingresados, complete todos los campos obligatorios e intente otra vez.</small>';\n msj = msj + ' </div>';\n msj = msj + ' </div>';\n $('#mensajeModalRegistrar').append(msj);\n }\n }\n },\n error: function (myXhr, textStatus, errorThrown) {\n console.log(myXhr);\n console.log(textStatus);\n console.log(errorThrown);\n if (estado == 0 || estado == 6) {\n $(\"#carga-preload-avance\").html(\"\");\n $(\"#titulo-carga-avance\").addClass(\"d-none\");\n } else {\n $(\"#carga-preload\").html(\"\");\n $(\"#titulo-carga\").addClass(\"d-none\");\n }\n },\n beforeSend: function () { //add 28-09-2020\n console.log('before send');\n if (estado == 0 || estado == 6) {\n $(\"#carga-preload-avance\").html(\"<i Class='fas fa-spinner fa-spin px-1 fa-2x'></i>\");\n $(\"#titulo-carga-avance\").removeClass(\"d-none\");\n } else {\n $(\"#carga-preload\").html(\"<i Class='fas fa-spinner fa-spin px-1 fa-2x'></i>\");\n $(\"#titulo-carga\").removeClass(\"d-none\");\n }\n //$(\"#carga-preload\").html(\"<i Class='fas fa-spinner fa-spin px-1 fa-2x'></i>\");\n //$(\"#titulo-carga\").removeClass(\"d-none\");\n $('#modal-carga').show();\n },\n complete: function () {\n console.log('complete send');\n if (estado == 0 || estado == 6) {\n $(\"#carga-preload-avance\").html(\"\");\n $(\"#titulo-carga-avance\").addClass(\"d-none\");\n } else {\n $(\"#carga-preload\").html(\"\");\n $(\"#titulo-carga\").addClass(\"d-none\");\n }\n //$(\"#carga-preload\").html(\"\");\n //$(\"#titulo-carga\").addClass(\"d-none\");\n $('#modal-carga').hide();\n }\n };\n\n $(\"#formRegistrar\").ajaxForm(options);\n $(\"#formRegistrar\").submit();\n\n}", "function registro(){ \r\n limpiarMensajesError();//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombre = document.querySelector(\"#txtNombre\").value;\r\n let nombreUsuario = document.querySelector(\"#txtNombreUsuario\").value;\r\n let clave = document.querySelector(\"#txtContraseña\").value;\r\n let perfil = Number(document.querySelector(\"#selPerfil\").value); //Lo convierto a Number directo del html porque yo controlo qu'e puede elegir el usuario\r\n let recibirValidacion = validacionesRegistro (nombre, nombreUsuario, clave); //\r\n if(recibirValidacion && perfil != -1){ \r\n crearUsuario(nombre, nombreUsuario, clave, perfil);\r\n if(perfil === 2){\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n alumnoIngreso();\r\n }else{\r\n usuarioLoggeado = nombreUsuario; //Guardo en la variable global el nombre de usuario ingresado\r\n docenteIngreso();//Guardo en la variable global el nombre de usuario ingresado (tiene que ir antes de ejecutar la funcion alumno ingreso)\r\n }\r\n }\r\n if(perfil === -1){\r\n document.querySelector(\"#errorPerfil\").innerHTML = \"Seleccione un perfil\";\r\n }\r\n}", "function initComponentes() {\n if (\"BASEFACTURA\" in localStorage) {\n recuperarBaseFactura();\n\n for (const factura of baseFactura) {\n mostrarFacturaRegistrado(factura);\n }\n } else {\n registrarBaseFactura();\n }\n\n //RECUPERAMOS LA BASE CLIENTE\n if (\"BASECLIENTE\" in localStorage) {\n recuperarBaseCliente();\n\n for (const cliente of baseCliente) {\n mostrarClienteRegistrado(cliente);\n }\n }\n\n //RECUPERAMOS LA BASE VEHICULO\n if (\"BASEVEHICULO\" in localStorage) {\n recuperarBaseVehiculo();\n\n for (const vehiculo of baseVehiculo) {\n mostrarVehiculoRegistrado(vehiculo);\n }\n }\n\n ///Asignamos la fecha del dia\n let txtFecha = document.getElementById(\"txtFecha\");\n\n var fecha = new Date(); //Fecha actual\n var mes = fecha.getMonth() + 1; //obteniendo mes\n var dia = fecha.getDate(); //obteniendo dia\n var ano = fecha.getFullYear(); //obteniendo año\n\n if (dia < 10)\n dia = '0' + dia; //agrega cero si el menor de 10\n if (mes < 10)\n mes = '0' + mes //agrega cero si el menor de 10\n\n txtFecha.value = ano + \"-\" + mes + \"-\" + dia;\n}", "function funAtualizarConta(parametros,callbackf) {\n var query = \"\";\n var queryItens = \"\";\n var parcela = 0;\n\tvar totalParcelas = 0;\n var resposta = null;\n\tvar conexao = null;\n\tvar dataEmissao = null;\n\tvar dataVencimento = null;\n\n resposta = {\n status: 1,\n mensagem: [],\n titulo: null\n }\n\n try{\n if(parametros.idEntidade == \"\" || parametros.idEntidade == \"undefined\"){\n resposta.status = 0;\n resposta.mensagem.push(\"O cliente não foi informado.\");\n }\n\n if(parametros.nrTitulo == \"\" || parametros.nrTitulo == \"undefined\"){\n resposta.status = 0;\n resposta.mensagem.push(\"O documento não foi informado.\");\n }\n\n if(!parametros.idParcelamento){\n resposta.status = 0;\n resposta.mensagem.push(\"A forma de parcelamento não foi informada.\");\n }\n\n if(parametros.emissao == \"\" || parametros.emissao.indexOf(\"undefined\") >= 0){\n resposta.status = 0;\n resposta.mensagem.push(\"A data de emissão não foi informada.\");\n }\n\n if(parametros.valor == \"\" || parametros.valor == \"undefined\" || isNaN(parametros.valor)){\n resposta.status = 0;\n resposta.mensagem.push(\"Valor do documento é inválido ou não foi informado.\");\n }\n\n if(!(parametros.hasOwnProperty(\"parcelas\")) || parametros.parcelas.length == 0){\n resposta.status = 0;\n resposta.mensagem.push(\"As parcelas não foram informadas.\");\n }\n else{\n dataEmissao = new Date(parametros.emissao.substring(0,4),parseInt(parametros.emissao.substring(5,7)) - 1,parametros.emissao.substring(8,10));\n for(parcela = 0; parcela < parametros.parcelas.length; parcela++){\n if(parametros.parcelas[parcela].documento == \"\" || parametros.parcelas[parcela].documento == \"undefined\"){\n resposta.status = 0;\n resposta.mensagem.push(\"A parcela \" + (parcela + 1).toString().trim() + \" não possui o documento.\");\n }\n if(parametros.parcelas[parcela].parcela == \"\" || parametros.parcelas[parcela].parcela == \"undefined\"){\n resposta.status = 0;\n resposta.mensagem.push(\"A parcela \" + (parcela + 1).toString().trim() + \" não possui o número informado.\");\n }\n if(parametros.parcelas[parcela].vencimento == \"\" || parametros.parcelas[parcela].vencimento == \"undefined\"){\n resposta.status = 0;\n resposta.mensagem.push(\"A parcela \" + (parcela + 1).toString().trim() + \" não possui a data de vencimento.\");\n }\n\t\t\t\telse{\n\t\t\t\t\tdataVencimento = new Date(parametros.parcelas[parcela].vencimento.substring(0,4),parseInt(parametros.parcelas[parcela].vencimento.substring(5,7)) - 1,parametros.parcelas[parcela].vencimento.substring(8,10));\n\t\t\t\t\tif(dataVencimento.getTime() < dataEmissao.getTime()){\n\t\t\t\t\t\tresposta.status = 0;\n\t\t\t\t\t\tresposta.mensagem.push(\"A data de vencimento da parcela \" + (parcela + 1).toString().trim() + \" é anterior à data de emissão do documento.\");\n\t\t\t\t\t}\n\t\t\t\t}\n if(parametros.parcelas[parcela].valor == \"\" || parametros.parcelas[parcela].valor == \"undefined\" || isNaN(parametros.parcelas[parcela].valor)){\n resposta.status = 0;\n resposta.mensagem.push(\"A parcela \" + (parcela + 1).toString().trim() + \" não possui valor.\");\n }\n\t\t\t\telse{\n\t\t\t\t\ttotalParcelas += parseFloat(parametros.parcelas[parcela].valor);\n\t\t\t\t}\n }\n\t\t\tif(resposta.status == 1){\n\t\t\t\tconsole.log(parametros);\n\t\t\t\tif(parseFloat(parametros.valor) != totalParcelas){\n\t\t\t\t\tresposta.status = 0;\n\t\t\t\t\tresposta.mensagem.push(\"A soma dos valores das parcelas difere do total do documento.\")\n\t\t\t\t}\n\t\t\t}\n }\n\n if(resposta.status == 1){\n if(parametros.idTitulo == \"\"){\n parametros.idTitulo = general.guid();\n query = \"insert into contas_receber (id,id_empresa,id_entidade,id_venda,id_notafiscal,id_parcelamento,id_plano_contas_financeiro,id_origem,nm_documento,dt_emissao,nm_competencia,vl_valor,sn_dre,nm_observacao) values(\"\n query += \"'\" + parametros.idTitulo + \"',\";\n query += \"'\" + EnterpriseID + \"',\";\n query += \"'\" + parametros.idEntidade + \"',\";\n query += (!parametros.idPedido ? \"null\" : \"'\" + parametros.idPedido + \"'\") + \",\";\n query += (!parametros.idNotaFiscal ? \"null\" : \"'\" + parametros.idNotaFiscal + \"'\") + \",\";\n query += \"'\" + parametros.idParcelamento + \"',\";\n query += (!parametros.idContaFinanceira ? \"null\" : \"'\" + parametros.idContaFinanceira + \"'\") + \",\";\n query += (!parametros.idOrigem ? \"null\" : \"'\" + parametros.idOrigem + \"'\") + \",\";\n query += \"'\" + parametros.nrTitulo + \"',\";\n query += \"'\" + parametros.emissao + \"',\";\n query += \"'\" + parametros.competencia + \"',\";\n query += parametros.valor.toString().trim() + \",\";\n query += parametros.dre.toString().trim() + \",\";\n query += \"'\" + parametros.observacao + \"'\";\n query += \"); \";\n\n query += \"insert into contas_receber_parcelas (id,id_empresa,id_contas_receber,id_Banco,id_forma_pagamento,id_configuracao_cnab,id_plano_contas_financeiro,nr_parcela,nm_documento,sn_fluxocaixa,dt_data_vencimento,vl_valor)\";\n query += \" values \";\n\t\t\t\t\n for(parcela = 0; parcela < parametros.parcelas.length; parcela++){\n parametros.parcelas[parcela].idParcela = general.guid();\n\t\t\t\t\tif(parcela > 0)\n\t\t\t\t\t\tquery += \",\";\n query += \"(\";\n query += \"'\" + parametros.parcelas[parcela].idParcela + \"',\";\n query += \"'\" + EnterpriseID + \"',\";\n query += \"'\" + parametros.idTitulo + \"',\";\n query += (!parametros.parcelas[parcela].idBanco ? \"null\" : \"'\" + parametros.parcelas[parcela].idBanco + \"'\") + \",\"; \n query += (!parametros.parcelas[parcela].idFormaPagamento ? \"null\" : \"'\" + parametros.parcelas[parcela].idFormaPagamento + \"'\") + \",\";\n query += (!parametros.parcelas[parcela].idConfCNAB ? \"null\" : \"'\" + parametros.parcelas[parcela].idConfCNAB + \"'\") + \",\";\n query += (!parametros.parcelas[parcela].idContaFinanceira ? \"null\" : \"'\" + parametros.parcelas[parcela].idContaFinanceira + \"'\") + \",\";\n query += \"'\" + parametros.parcelas[parcela].parcela + \"',\";\n query += \"'\" + parametros.parcelas[parcela].documento + \"',\";\n query += parametros.parcelas[parcela].fluxoCaixa + \",\";\n query += \"'\" + parametros.parcelas[parcela].vencimento + \"',\";\n query += parametros.parcelas[parcela].valor.toString().trim()\n query += \")\";\n }\n\t\t\t\t\n\t\t\t\tconexao = new sql.ConnectionPool(config,function (err) {\n\t\t\t\t\tif (err){\n\t\t\t\t\t\tresposta.status = -2;\n\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\trespsota.titulo = null;\n\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tvar transacao = conexao.transaction();\n\t\t\t\t\t\t\ttransacao.begin(err =>{\n\t\t\t\t\t\t\t\tvar request = transacao.request();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\trequest.query(query, function (err, recordset) {\n\t\t\t\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\t\t\t\tresposta.status = -3;\n\t\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\t\t\t\ttransacao.rollback();\n\t\t\t\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\tresposta.status = 1;\n\t\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"ok\"];\n\t\t\t\t\t\t\t\t\t\tresposta.titulo = parametros;\n\t\t\t\t\t\t\t\t\t\ttransacao.commit();\n\t\t\t\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(err){\n\t\t\t\t\t\t\tresposta.status = -4;\n\t\t\t\t\t\t\trespsosta.mensagem = [\"ok\"];\n\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n }\n else{\n\t\t\t\tquery = \"select sum(vl_valor) totalbaixas from contas_receber_baixas where id_empresa = '\" + EnterpriseID + \"' and id_contas_receber_parcela in (select id from contas_receber_parcelas where id_contas_receber = \";\n\t\t\t\tquery += \"(select id from contas_receber where id_empresa = '\" + EnterpriseID + \"' and id = '\" + parametros.idTitulo + \"'))\";\n\t\t\t\t\n conexao = new sql.ConnectionPool(config,function (err) {\n\t\t\t\t\tif (err){\n\t\t\t\t\t\tresposta.status = -5;\n\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tvar request = conexao.request();\n\t\t\t\t\t\t\trequest.query(query, function (err, recordset) {\n\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\t\t\t\tresposta.status = -6;\n\t\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\tif(recordset.recordsets[0][0].totalbaixas == null){\n\t\t\t\t\t\t\t\t\t\t\tqueryItens = \"delete contas_receber_parcelas where id_empresa = '\" + EnterpriseID + \"' and id_contas_receber = '\" + parametros.idTitulo + \"'; \"\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"update contas_receber set \"\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_parcelamento = '\" + parametros.idParcelamento + \"',\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_plano_contas_financeiro = \" + (!parametros.idContaFinanceira ? \"null\" : \"'\" + parametros.idContaFinanceira + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"nm_competencia = '\" + parametros.competencia + \"',\"\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"nm_observacao = '\" + parametros.observacao + \"'\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" where id = '\" + parametros.idTitulo + \"'\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" and id_empresa = '\" + EnterpriseID + \"'; \";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"insert into contas_receber_parcelas (id,id_empresa,id_contas_receber,id_Banco,id_forma_pagamento,id_plano_contas_financeiro,nr_parcela,nm_documento,sn_fluxocaixa,dt_data_vencimento,vl_valor)\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" values \";\n\t\t\t\t\t\t\t\t\t\t\tfor(parcela = 0; parcela < parametros.parcelas.length; parcela++){\n\t\t\t\t\t\t\t\t\t\t\t\tif(parcela > 0)\n\t\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \",\";\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tparametros.parcelas[parcela].idParcela = general.guid();\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"(\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + parametros.parcelas[parcela].idParcela + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + EnterpriseID + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + parametros.idTitulo + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += (!parametros.parcelas[parcela].idBanco ? \"null\" : \"'\" + parametros.parcelas[parcela].idBanco + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += (!parametros.parcelas[parcela].idFormaPagamento ? \"null\" : \"'\" + parametros.parcelas[parcela].idFormaPagamento + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += (!parametros.parcelas[parcela].idContaFinanceira ? \"null\" : \"'\" + parametros.parcelas[parcela].idContaFinanceira + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + parametros.parcelas[parcela].parcela + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + parametros.parcelas[parcela].documento + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += parametros.parcelas[parcela].fluxoCaixa + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + parametros.parcelas[parcela].vencimento + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += parametros.parcelas[parcela].valor.toString().trim();\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \")\";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tqueryItens = \"update contas_receber set \"\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_plano_contas_financeiro = \" + (!parametros.idContaFinanceira ? \"null\" : \"'\" + parametros.idContaFinanceira + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"nm_competencia = '\" + parametros.competencia + \"',\"\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"nm_observacao = '\" + parametros.observacao + \"'\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" where id = '\" + parametros.idTitulo + \"'\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" and id_empresa = '\" + EnterpriseID + \"'\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tfor(parcela = 0; parcela < parametros.parcelas.length; parcela++){\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"; \";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"update contas_receber_parcelas set \";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_banco = \" + (!parametros.parcelas[parcela].idBanco ? \"null\" : \"'\" + parametros.parcelas[parcela].idBanco + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_forma_pagamento = \" + (!parametros.parcelas[parcela].idFormaPagamento ? \"null\" : \"'\" + parametros.parcelas[parcela].idFormaPagamento + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_plano_contas_financeiro = \" + (!parametros.parcelas[parcela].idContaFinanceira ? \"null\" : \"'\" + parametros.parcelas[parcela].idContaFinanceira + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"nm_documento = '\" + parametros.parcelas[parcela].documento + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"sn_fluxocaixa = \" + parametros.parcelas[parcela].fluxoCaixa + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"dt_data_vencimento = '\" + parametros.parcelas[parcela].vencimento + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"vl_valor = \" + parametros.parcelas[parcela].valor.toString().trim();\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" where id_empresa = '\" + EnterpriseID + \"'\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" and id = '\" + parametros.parcelas[parcela].idParcela + \"'\";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvar transacao = conexao.transaction();\n\t\t\t\t\t\t\t\t\t\ttransacao.begin(err =>{\n\t\t\t\t\t\t\t\t\t\t\tvar request = transacao.request();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\trequest.query(queryItens, function (err, recordset) {\n\t\t\t\t\t\t\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.status = -7;\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\ttransacao.rollback();\n\t\t\t\t\t\t\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.status = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"ok\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.titulo = parametros;\n\t\t\t\t\t\t\t\t\t\t\t\t\ttransacao.commit();\n\t\t\t\t\t\t\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch(err){\n\t\t\t\t\t\t\t\t\tresposta.status = -8;\n\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(err){\n\t\t\t\t\t\t\tresposta.status = -9;\n\t\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n }\n else{\n resposta.titulo == null;\n callbackf(resposta);\n }\n }\n catch(erro){\n resposta.status = -1;\n resposta.mensagem = [];\n resposta.mensagem.push(\"f: \" + erro);\n resposta.titulo = null;\n callbackf(resposta);\n }\n}", "function IniciarElegirBD() {\n\tvar campoHostVacio = true;\n\tvar campoUserVacio = true;\n\n\tinitB();\n\n\tfunction initB() {\n\t\tconsole.debug('Pagina Actual : ElegirBD');\n\n\t\t$('.cajaMain').load('template/templateFormularioElegirBD.php', function(){\n $('#labelNombreBD').tooltip({\n\t\t\ttitle: 'Si se deja vacio se creará con el nombre openblog'\n });\n $(\".content\").css({\"margin-left\":\"auto\"});\n cargarListeners();\n }).attr('id', 'cajaElegirBD'); // Cargamos la ruta y le añadimos el id\n\n\t\t$('#botonAnterior').attr(\"href\", \"#bienvenida\"); // Actualizamos la url de los botones, estos botones no exisitiran en la version final!!\n\n\t\t$('#botonSiguiente').attr(\"href\", \"#creaciontablas\");\n\n\t\t\n\n\t\t\n\n\t};\n\n\tfunction cargarListeners() {\n\t\t$('#campoHost').keyup(function() {\n\t\t\tif ($(this).val() !== \"\") {\n\t\t\t\tcampoHostVacio = false;\n\t\t\t} else {\n\t\t\t\tcampoHostVacio = true;\n\t\t\t}\n\t\t});\n\n\t\t$('#campoUser').keyup(function() {\n\t\t\tif ($(this).val() !== \"\") {\n\t\t\t\tcampoUserVacio = false;\n\t\t\t} else {\n\t\t\t\tcampoUserVacio = true;\n\t\t\t}\n\t\t});\n\n\t\t$('.botonValidar').click(function() {\n\t\t\tif (!campoUserVacio && !campoHostVacio) {\n\t\t\t\t$(this).hide();\n\t\t\t\t$('.spinner').show();\n\t\t\t\tiniciarComprobacionBD();\n\t\t\t} else {\n\t\t\t\tmostrarAlertaError('Ha de completar los campos de Host y Usuario', 3000);\n\t\t\t}\n\t\t})\n\t}\n\n\tfunction comprobarCamposVacios(campo, vacio) {\n\t\tif ($(campo).val() !== \"\") {\n\t\t\tvacio = false;\n\t\t} else {\n\t\t\tvacio = true;\n\t\t}\n\t}\n\n\tfunction iniciarComprobacionBD() {\n\t\tvar user = $('#campoUser').val();\n\t\tvar pass = $('#campoPass').val();\n\t\tvar host = $('#campoHost').val();\n\t\tvar bd = $('#campoBD').val();\n\n\t\tvar datos = {\n\t\t\tuser: user,\n\t\t\tpass: pass,\n\t\t\thost: host,\n\t\t\tbd : bd\n\t\t};\n\n\t\t$.post('src/comprobacionBaseDatos.php', datos, function(data) {\n\t\t\tvar respuesta = JSON.parse(data);\n\t\t\tif (respuesta.codigo == 2) {\n\t\t\t\tmostrarAlertaExito('Se ha conectado exitosamente a la Base de Datos', 3000);\n\t\t\t\t$('.spinner').toggle();\n\t\t\t\tvar botonSiguiente = \"<a href='#creaciontablas' class='btn btn-big'> Siguiente </a> \";\n\t\t\t\t$('.cajaBotonValidar').append(botonSiguiente)\n\t\t\t} else {\n\t\t\t\tvar tipoError = respuesta.mensaje;\n\t\t\t\tmostrarAlertaError('No se ha podido establecer una conexión con el servidor, <b>' + tipoError + '</b>', 3000);\n\t\t\t\t$('.spinner').toggle();\n\t\t\t\t$('.botonValidar').toggle();\n\t\t\t}\n\t\t});\n\t}\n\n}", "function Inicializar() {\n $(\"input.fecha\").datepicker($.datepicker.regional[\"es\"]);\n Argumentos = searchToJSON();\n $(\"#idOperador\").val(Argumentos.idOperador);\n $(\"input.fecha\").val(AFechaMuyCorta(new Date()));\n if (Argumentos.Supervisados == 0) {\n $(\"#filaOperador\").hide();\n $(\"#Supervisado\").val(0);\n } else {\n //OperadoresSupervisados_lst(_OperadoresSupervisados_lst, Argumentos.idOperador);RA\n LlamarServicio(_OperadoresSupervisados_lst, \"OperadoresSupervisados_lst\", { idOperador: Argumentos.idOperador });\n $(\"#Supervisado\").val(1);\n }\n\n}", "function CorroborarCampoVacio(corroborado){\n TipoCultivo =$(\"#tipocultivo\"),\n FechaPlan =$(\"#feplantacion\"),\n FechaCosecha=$(\"#fechacosecha\");\n allFields = $( [] ).add(TipoCultivo).add(FechaPlan).add(FechaCosecha);\n\t \t\tallFields.removeClass( \"ui-state-error\" ); //reseteamos los campos marcados\n\t\t\t\ttips = $( \".validateTips\" );\n\n\t\t\t\tvar bValid = true;\n\t\t\t\tbValid = bValid && comprobar_longitud(TipoCultivo, \"campo Tipo de cultivo\", 3, 30);\n\t\t\t\tbValid = bValid && comprobar_longitud(FechaPlan, \"Fecha de plantacion \", 01, 31);\n\t\t\t\tbValid = bValid && comprobar_longitud(FechaCosecha, \"Fecha de cosecha\", 01, 31);\n if ( bValid ) {\n\t\t\t\t\t\tcorroborado = true;\n\t\t\t\t\t\treturn corroborado;\n\t\t\t\t\t\tallFields.val( \"\" ).removeClass( \"ui-state-error\" );\n\t\t\t\t\t}\n}", "function limpiarControles(){ //REVISAR BIEN ESTO\n clearControls(obtenerInputsIdsProducto());\n clearControls(obtenerInputsIdsTransaccion());\n htmlValue('inputEditar', 'CREACION');\n htmlDisable('txtCodigo', false);\n htmlDisable('btnAgregarNuevo', true);\n}", "function rellenarErrorByField(valor) {\n //valor = array con 'nombreCanal' => 'Error:Ya existe'\n //valor[0] = 'nombreCanal' (nombre del campo)\n //valor [1] = 'Error: Ya existe' => error perteneciente al campo\n console.log(\"RELLENAR VALOR BY FIELD\");\n console.log(valor[0]);\n if(valor[1] != '') {\n var divError = document.getElementById(''+valor[0]);\n divError.classList.remove(\"d-none\");\n divError.classList.add(\"d-block\",\"alert\", \"alert-danger\");\n divError.innerHTML = valor[1];\n console.log(divError);\n setTimeout(function() {\n divError.classList.add(\"d-none\");\n divError.classList.remove(\"d-block\", \"alert\", \"alert-danger\");\n },5000);\n }\n }", "function mostrar_errores_registro(data){\n // Procesa respuesta\n var errores = JSON.parse(data);\n\n // Imprime descripcion errores\n $('#error-perfil').text(errores[0]);\n $('#error-nombre_completo').text(errores[1]);\n $('#error-email').text(errores[2]);\n $('#error-celular').text(errores[3]);\n $('#error-contrasena').text(errores[4]);\n\n // Aniade contornos de colores a campos\n if( ! errores[1])\n marcar_elemento_valido('#nombre_completo');\n else\n marcar_elemento_no_valido('#nombre_completo');\n\n if( ! errores[2])\n marcar_elemento_valido('#email');\n else\n marcar_elemento_no_valido('#email');\n\n if( ! errores[3])\n marcar_elemento_valido('#celular');\n else\n marcar_elemento_no_valido('#celular');\n\n if( ! errores[4]){\n marcar_elemento_valido('#contrasena');\n marcar_elemento_valido('#confirmacion_contrasena');\n }\n else{\n marcar_elemento_no_valido('#contrasena');\n marcar_elemento_no_valido('#confirmacion_contrasena');\n }\n}", "function GuardarContenido() {\n //Crear la parte principal del formulario\n var mensaje = { \"IdMensajeEducacional\": \"\", \"SemanaEmbarazo\": \"\", \"Contenido\": [] };\n //Crear la parte secundaria\n var mensajeContenido = { \"IdMensajeEducacional\": \"\", \"DiaSemana\": \"\", \"Contenido\": \"\" };\n //Asignar el contenido principal\n var ul;\n if ($(\"#SemanaEmbarazo\").val() === \"\") {\n ul = $(\".validation-summary-valid ul\");\n ul.html(\"\");\n ul.append(\"<li>\" + \"Debe ingresar una semana de embarazo para los mensajes.\" + \"</li>\");\n return false;\n }\n mensaje.IdMensajeEducacional = \"0\";\n mensaje.SemanaEmbarazo = $(\"#SemanaEmbarazo\").val();\n //Obtener los datos de la tabla conteniendo los registros secundarios\n var oTable = $(\".tbl\").dataTable().fnGetData();\n\n if (oTable.length < 3) {\n ul = $(\".validation-summary-valid ul\");\n ul.html(\"\");\n ul.append(\"<li>\" + \"Debe registrar al menos 3 mensajes para la semana.\" + \"</li>\");\n return false;\n }\n\n for (var i = 0; i < oTable.length; i++) {\n //Asignar valores de mensajes educacionales\n mensajeContenido.IdMensajeEducacional = 0;\n mensajeContenido.DiaSemana = ObtenerDia(oTable[i][0]);\n mensajeContenido.Contenido = oTable[i][1];\n //Añadir elementos a la lista\n mensaje.Contenido.push(mensajeContenido);\n mensajeContenido = { \"IdMensajeEducacional\": \"\", \"DiaSemana\": \"\", \"Contenido\": \"\" };\n }\n\n //Enviar la informacion al servidor para salvar\n $.ajax({\n url: \"Crear\",\n data: JSON.stringify(mensaje),\n type: \"POST\",\n contentType: \"application/json;\",\n dataType: \"json\",\n success: function (result) {\n\n if (result.Success == \"1\") {\n window.location.href = \"index\";\n }\n else {\n alert(result.ex);\n }\n }\n });\n return false;\n}", "function init(){ // función que se llama así misma para indicar que sea lo primero que se ejecute\n carreraCtrl.carreras = carreraService.getCarreras();\n }", "function muestraError(cadena) {\n self.ErrorEnviar = cadena;\n self.showErrorForm = true;\n cfpLoadingBar.complete();\n }", "function validarCampos() {\n var resultado = {\n zValidacion: true,\n sMensaje: 'Correcto',\n zErrorOcurrido: false\n };\n if (resultado.zErrorOcurrido == false && document.querySelector('#nomEvento').value == '') {\n resultado.zValidacion = false;\n resultado.sMensaje = \"El nombre no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n if (resultado.zErrorOcurrido == false && document.querySelector('#precioEntradas').value == '') {\n resultado.zValidacion = false;\n resultado.sMensaje = \"El precio no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n if (resultado.zErrorOcurrido == false && document.querySelector('#fechaInicio').value == '') {\n resultado.zValidacion = false;\n resultado.sMensaje = \"La fecha no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n if (resultado.zErrorOcurrido == false && isValidEmail(document.querySelector('#lugarTorneo').value) == false) {\n resultado.zValidacion = false;\n resultado.sMensaje = \"La fecha no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n if (resultado.zErrorOcurrido == false && document.querySelector('#orgTorneo').value == '') {\n resultado.zValidacion = false;\n resultado.sMensaje = \"la sOrganizacion no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n if (resultado.zErrorOcurrido == false && document.querySelector('#patrocinadorTorneo').value == '') {\n resultado.zValidacion = false;\n resultado.sMensaje = \"el patrocinador no puede estar vacio\";\n resultado.zErrorOcurrido = true;\n }\n return resultado;\n}", "function valor_conexion(conexion) {\n if (conexion==1) {\n //alert(\"Hay conexion conexión a internet!\");\n abrirVentanaCarga();\n crearBD_local();//primero creamos algunas tablas necesarias de la app\n llenarTablaAscensorItemsCabina();\n comprobarExistenciaTablaAscensorItemsFoso();\n comprobarExistenciaTablaAscensorItemsMaquinas();\n comprobarExistenciaTablaAscensorItemsPozo();\n comprobarExistenciaTablaAscensorItemsPreliminar();\n comprobarExistenciaTablaAscensorItemsProteccion();\n comprobarExistenciaTablaAscensorItemsElementos();\n\n comprobarExistenciaTablaEscalerasItemsPreliminar();\n comprobarExistenciaTablaEscalerasItemsProteccion();\n comprobarExistenciaTablaEscalerasItemsElementos();\n comprobarExistenciaTablaEscalerasItemsDefectos();\n\n comprobarExistenciaTablaPuertasItemsPreliminar();\n comprobarExistenciaTablaPuertasItemsProteccion();\n comprobarExistenciaTablaPuertasItemsElementos();\n comprobarExistenciaTablaPuertasItemsMecanicos();\n comprobarExistenciaTablaPuertasItemsElectrica();\n comprobarExistenciaTablaPuertasItemsManiobras();\n comprobarExistenciaTablaPuertasItemsMotorizacion();\n comprobarExistenciaTablaPuertasItemsOtras();\n } else {\n alert(\"No tiene conexión a internet!\");\n location.href=\"./index.html\";\n }\n}", "function initFormularioCargaMasivaConfirmacion(){\n\n\t\tvar $mainForm = $('#autogestion-form-confirmar');\n\n\t\tvar tipoIngreso = null;\n\n\t\tinitActions();\n\t\tvalidateMainForm();\n\n\t\tfunction validateMainForm(){\n\n\t\t\tdisableSumbitButton($mainForm, true);\n\n\t\t\telementsForm['validator'] = \n\t\t\t\t$mainForm.validate({\n\t\t\t\t\t rules: {\n\t\t\t\t\t\tarchivo: {\n\t\t\t\t\t\t\trequired : {\n\t\t\t\t\t\t\t\tdepends: function(element) {\n\t\t\t\t\t\t\t\t\tvar motivo = $mainForm.find('.motivo-autogestion:checked').val();\n\n\t\t\t\t \treturn motivo == 'estructura-nueva';\n\t\t\t\t }\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\textension: \"xls\",\n\t\t\t\t\t\t\tfilesize: 10000000\n\t\t\t\t\t\t},\n\t\t\t\t\t\tmotivoAutogestion: {\n\t\t\t\t\t\t\trequired: true\n\t\t\t\t\t\t}\n\t\t\t\t\t },\n\t\t\t\t\t messages: {\n\t\t\t\t\t\t archivo: {\n\t\t\t\t\t\t required: \"Ingresa un archivo de 10 MB máximo.\",\n\t\t\t\t\t\t extension: \"Ingresa un archivo con extensión: .xls\",\n\t\t\t\t\t\t filesize: \"Ingresa un archivo de 10 MB máximo.\"\n\t\t\t\t\t\t },\n\t\t\t\t\t\t motivoAutogestion: {\n\t\t\t\t\t\t required: \"Selecciona un motivo.\",\n\t\t\t\t\t\t }\n\t\t\t\t\t },\n\t\t\t\t\t\terrorClass : \"error-dd error\",\n\t\t\t\t\t\terrorElement : 'div',\n\t\t\t\t\t\terrorPlacement: function(error, element) {\n\t\t\t\t\t\t\tvar elementInput = element[0];\n\t\t\t\t\t\t\tif(element[0]['id']==='archivo'){\n\t\t\t\t\t\t\t\t$('.lineas-archivo .extra-info').hide();\n\t\t\t\t\t\t\t\terror.appendTo( $('.lineas-archivo .add-lines-ge-mod' ));\n\t\t\t\t\t\t\t\telement.parent().addClass('error');\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsuccess: function ($error) {\n\t\t\t\t\t\t\tif($error.length>0 && $('#archivo').val() != ''){\n\t\t\t\t\t\t\t\t$('.lineas-archivo .extra-info').hide();\n\t\t\t\t\t\t\t\t$('.lineas-archivo .file.error' ).removeClass('error');\n\t\t\t\t \t\t\t\t$error.remove();\n\t\t\t\t\t\t\t}\n\t\t\t\t },\n\t\t\t\t highlight : function(element, errorClass){\n\t\t\t\t \tvar $element = $(element);\n\t\t\t\t \tif($element.attr('id')==='archivo' && $element.val() == ''){\n\t\t\t\t \t\t$('.lineas-archivo .extra-info').hide();\n\t\t\t\t\t\t\t\t$element.parent().addClass('error');\n\t\t\t\t \t}\n\t\t\t\t },\n\t\t\t\t submitHandler: function(form) {\n\t\t\t\t\t\t\tif(!elementsForm['sending']){\n\t\t\t\t\t\t\t\tsendFormData(form);\n\t\t\t\t\t \t\t}\n\t\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\tcheckGeneralValidForm($mainForm);\n\n\t\t\t\tfunction sendFormData(form){\n\t\t\t\t\telementsForm['sending'] = true;\n\t\t\t\t\t$(form).find('button[type=\"submit\"]').prop('disabled', true);\n\n\t\t\t\t\tvar self = $(form).serialize();\n\n\t\t\t\t\tvar urlPOST = ( $(form).prop('action') == '' ? postURL : $(form).prop('action') ) ;\n\t\t\t\t\t\n\t\t\t\t\t/**Quitar una vez en producción y aqui solo checamos si es una línea en development para mandar a otra liga**/\n\t\t\t\t\tvar sendTo = urlPOST;\n\t\t\t\t\turlPOST = checkDevelopmentPostHTML(urlPOST);\n\n\t\t\t\t\t$.post( urlPOST , self )\n\t\t\t\t\t.done(function( data ) {\n\t\t\t\t\t \tServices.gestionGrupos.cargaMasivaCallSuccess(data, form, sendTo, showInvalidErrorArchivo );\n\t\t\t\t\t\telementsForm['sending'] = false;\n\t\t\t\t\t })\n\t\t\t\t\t.fail(function( jqxhr, textStatus, error ) {\n\t\t\t\t\t \t//Mensaje de error del sistema\n\t\t\t\t\t \tServices.gestionGrupos.cargaMasivaCallFail(error, form);\n\t\t\t\t\t \telementsForm['sending'] = false;\n\t\t\t\t\t});\n\t\t\t\t}\t\n\t\t}\n\n\n\t\tfunction initActions(){\n\n\t\t\t/**\n\t\t\t\tSetea la info del Motivo\n\t\t\t**/\n\t\t\tvar $lastStep = $('.carga-masiva-last-step');\n\t\t\t$('.motivo-autogestion').change(function() {\n\t\t\t\tvar $checkbox = $(this);\n\t\t\t\tif(typeof ingresarLineasComponent != 'undefined')\n\t\t\t\t\tingresarLineasComponent.reset();\n\n\t\t\t\tif($('.motivo-autogestion:checked').length>0){\n\t\t\t\t\tvar current = $checkbox.val(),\n\t\t\t\t\tbtntext = (typeof $checkbox.data('btn') != 'undefined' ? $checkbox.data('btn') : 'Subir archivo');\n\n\t\t\t\t\tif(current=='continuar-con-lineas')\n\t\t\t\t\t\t$lastStep.addClass('revertir-estructura');\n\t\t\t\t\telse\n\t\t\t\t\t\t$lastStep.removeClass('revertir-estructura');\n\n\t\t\t\t\t$('#autogestion-btn').html(btntext);\n\t\t\t\t\t$lastStep.addClass('active');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\t$lastStep.removeClass('active');\n\n\n\n\t\t\t});\n\n\t\t}\n\n\t\tfunction resetMainForm(){\n\n\t\t\t$mainForm.find(\"input[type=text], input[type=email], input[type=password], select\").val(\"\");\n\t\t\t$mainForm.find(\"input[type=checkbox], input[type=radio]\").prop(\"checked\", false);\n\t\t\t$mainForm.find('button[type=\"submit\"]').prop('disabled', true);\n\t\t\t\n\t\t\tif(elementsForm['validator']){\n\t\t\t\telementsForm['validator'].resetForm();\n\t\t\t}\n\t\t}\n\n\t}", "function GuardarContenidoEdit() {\n //Crear la parte principal del formulario\n var mensaje = { \"IdMensajeEducacional\": \"\", \"SemanaEmbarazo\": \"\", \"Contenido\": [] };\n //Crear la parte secundaria\n var mensajeContenido = { \"IdMensajeEducacional\": \"\", \"IdContenidoMensajeEducacional\": \"\", \"DiaSemana\": \"\", \"Contenido\": \"\" };\n //Asignar el contenido principal\n var ul;\n if ($(\"#SemanaEmbarazo\").val() === \"\") {\n ul = $(\".validation-summary-valid ul\");\n ul.html(\"\");\n ul.append(\"<li>\" + \"Debe ingresar una semana de embarazo para los mensajes.\" + \"</li>\");\n return false;\n }\n mensaje.IdMensajeEducacional = $(\"#IdMensajeEducacional\").val();\n mensaje.SemanaEmbarazo = $(\"#SemanaEmbarazo\").val();\n\n //Obtener los datos de la tabla conteniendo los registros secundarios\n var oTable = $(\".tbl\").dataTable().fnGetData();\n\n if (oTable.length < 3) {\n ul = $(\".validation-summary-valid ul\");\n ul.html(\"\");\n ul.append(\"<li>\" + \"Debe registrar al menos 3 mensajes para la semana.\" + \"</li>\");\n return false;\n }\n\n for (var i = 0; i < oTable.length; i++) {\n //Asignar valores de mensajes educacionales\n mensajeContenido.IdMensajeEducacional = $(\"#IdMensajeEducacional\").val();\n mensajeContenido.IdContenidoMensajeEducacional = oTable[i][0];\n mensajeContenido.DiaSemana = ObtenerDia(oTable[i][1]);\n mensajeContenido.Contenido = oTable[i][2];\n //Añadir elementos a la lista\n mensaje.Contenido.push(mensajeContenido);\n mensajeContenido = { \"IdMensajeEducacional\": \"\", \"IdContenidoMensajeEducacional\": \"\", \"DiaSemana\": \"\", \"Contenido\": \"\" };\n }\n\n //Enviar la informacion al servidor para salvar\n $.ajax({\n url: getControllerURL(\"MensajeEducacional\") + \"/Edit\",\n data: JSON.stringify(mensaje),\n type: \"POST\",\n contentType: \"application/json;\",\n dataType: \"json\",\n success: function (result) {\n\n if (result.Success == \"1\") {\n window.location.href = getControllerURL(\"MensajeEducacional\") + \"/index\";\n } else {\n alert(result.ex);\n }\n }\n });\n return false;\n}", "initUsuarios() {\n this.userService.showRaw().subscribe(response => {\n this.usuarios = response.Usuarios;\n }, error => {\n console.log(error);\n this.errorCatched.description = error.toString();\n this.errorCatched.table = 'User';\n this.errorCatched.action = 'getUsers';\n this.errorCatched.title = 'Error en la Obtencion de Usuarios';\n this.errorCatched.zone = 'addRegister';\n this.errorCatched.code = this.errorCatched.zone + '-' + this.errorCatched.action + '-' + this.errorCatched.table;\n this.errorCatcherService.saveError(this.errorCatched).subscribe(response => {\n this.launchAlert('error', 'Error en la Carga', 'Se ha producido un error a la hora de cargar los datos de los Usuarios' + response.Message, '<a href=\"/reportes\" target=\"blank\">Ir a la Ventana de Errores de Sistema? <a>', true, null, null, null, null, null);\n });\n });\n }", "function cadastrarDespesa() {\n\n let ano = document.getElementById('ano')\n let mes = document.getElementById('mes')\n let dia = document.getElementById('dia')\n let tipo = document.getElementById('tipo')\n let descricao = document.getElementById('descricao')\n let valor = document.getElementById('valor')\n\n //atruir os valores dos inputs instanciando o objeto Despesa\n let despesa = new Despesa(\n ano.value,\n mes.value,\n dia.value,\n tipo.value,\n descricao.value,\n valor.value\n )\n\n //Validacão\n if(despesa.validarDados()) {\n //Executar o método de gravação na instancia do objeto bd\n bd.gravar(despesa) \n\n //cor do header\n let header = document.getElementById('headerRegistro')\n header.classList.add(\"text-success\")\n\n //Conteudo do cabeçalho\n document.getElementById('tituloRegistro').innerHTML = 'Registrado com sucesso!'\n\n //Conteudo do corpo\n document.getElementById('corpoRegistro').innerHTML = 'Seus dados foram salvos.'\n\n //Botão cor\n let btn = document.getElementById('btnRegistro')\n btn.classList.add(\"btn-success\")\n\n //Botao Conteudo\n btn.innerHTML = 'Finalizar'\n\n //dialog de sucesso\n $('#registraDespesa').modal('show')\n\n //reset\n ano.value = ''\n mes.value = ''\n dia.value = ''\n tipo.value = ''\n descricao.value = ''\n valor.value = ''\n \n } else {\n //dialog de erro\n $('#registraDespesa').modal('show')\n \n //Cabeçalho cor\n let header = document.getElementById('headerRegistro')\n header.classList.add(\"text-danger\")\n\n //Conteudo do cabeçalho\n document.getElementById('tituloRegistro').innerHTML = 'Erro no registro!'\n\n //Conteudo do corpo\n document.getElementById('corpoRegistro').innerHTML = 'Dados vazios ou incorretos.'\n\n //Botão cor\n let btn = document.getElementById('btnRegistro')\n btn.classList.add(\"btn-danger\")\n\n //Botao Conteudo\n btn.innerHTML = 'Refazer'\n \n }\n\n}", "function validarForm () {\n\n if (!formRegistro.checkValidity()) { \n const campos = [nombre, apellidos, tel, email, username, username, api_key, pass, pass2]\n //console.dir(campos)\n \n\n try {\n const error = new Error()\n\n // comprobamos los radio\n if (!genero[0].checkValidity()) {\n error.code = 'genero'\n throw error\n }\n if (!nacionalidad[0].checkValidity()) {\n error.code = 'nacionalidad'\n throw error\n }\n\n // comprobamos la provincia\n if ((nacionalidad.filter(item => item.checked)[0].value) == 'Española') {\n if (!provincias.checkValidity()){\n error.code = 'provincias'\n throw error\n }\n }\n \n // comprobamos los input texto\n campos.forEach((item) => { \n if(!item.value) {\n error.code = item.id\n throw error\n }\n }) \n\n //comprobamos que se han aceptado las condiciones\n if (!condiciones.checked) {\n error.code = 'condiciones'\n throw error\n }\n\n return true \n\n } catch (error) {\n let errorMsg\n \n switch (error.code) {\n case 'genero':\n errorMsg = 'Marca el género al que perteneces'\n break;\n case 'nombre':\n errorMsg = 'Introduce tu nombre'\n break;\n case 'apellidos':\n errorMsg = 'Introduce tus apellidos'\n break;\n case 'nacionalidad':\n errorMsg = 'Selecciona tu nacionalidad'\n break;\n case 'provincias':\n errorMsg = 'Selecciona tu provincia'\n break\n case 'mobile':\n errorMsg = 'Introduce tu número de teléfono'\n break;\n case 'email':\n errorMsg = 'Introduce tu dirección de correo'\n break\n case 'username':\n errorMsg = 'Introduce tu nombre de usuario'\n break\n case 'api_key':\n errorMsg = 'Introduce tu api_key'\n break\n case 'pass':\n errorMsg = 'Introduce tu contraseña'\n break\n case 'pass2':\n errorMsg = 'Repite tu contraseña'\n break\n case 'condiciones':\n errorMsg = 'Es necesario que aceptes las condiciones'\n break\n default:\n errorMsg = 'Se ha produido un error'\n break;\n } \n \n formRegistro.querySelector('p.error').innerHTML = errorMsg\n return false\n }\n \n }\n\n // comprobamos que las contraseñas coinciden\n if (pass.value !== pass2.value) {\n console.log('contraseñas distintas')\n formRegistro.querySelector('p.error').innerHTML = 'Es necesario que las contraseñas coincidan'\n return false\n }\n\n\n return true\n }", "function modificarInspeccion(){\n Concurrent.Thread.create(obtenerValoresIniciales);\n Concurrent.Thread.create(obtenerValoresPreliminar);\n Concurrent.Thread.create(obtenerValoresProteccion);\n Concurrent.Thread.create(obtenerValoresElementos);\n Concurrent.Thread.create(obtenerValoresMecanicos);\n Concurrent.Thread.create(obtenerValoresElectrica);\n Concurrent.Thread.create(obtenerValoresMotorizacion);\n Concurrent.Thread.create(obtenerValoresOtras);\n Concurrent.Thread.create(obtenerValoresManiobras);\n Concurrent.Thread.create(obtenerValoresObservacionFinal);\n Concurrent.Thread.create(obtenerValoresAudios);\n Concurrent.Thread.create(obtenerValoresFotografias);\n}", "function accionModificar() {\n\tvar opcionMenu = get(\"formulario.opcionMenu\");\n\tvar oidPlantilla = null;\n\tvar numPlantilla = null;\n\tvar oidParamGrales = null;\n\tvar filaMarcada = null;\n\tvar codSeleccionados = null;\n\tvar datos = null;\t\n\n\tlistado1.actualizaDat();\n\tdatos = listado1.datos;\n\tcodSeleccionados = listado1.codSeleccionados();\n\n\tif (codSeleccionados.length > 1) {\n GestionarMensaje('8');\n\t\treturn;\n\t}\n\n\tif ( codSeleccionados.length < 1)\t{\n GestionarMensaje('4');\n\t\treturn;\n\t}\n\n\t// Obtengo el índice de la fila marcada (en este punto, solo una estará marcada)\n\tvar filaMarcada = listado1.filaSelecc;\n\n\t// Obtengo el oid de Param. Generales (oid del valor seleccionado, está al final de la lista por el tema del ROWNUM)\n\toidParamGrales = datos[filaMarcada][9]; \n\n\t// Obtengo Oid de la Entidad PlantillaConcurso (AKA Numero de Plantilla);\n\tnumPlantilla = datos[filaMarcada][3];\n\n\tvar oidVigenciaConcurso = datos[filaMarcada][10]; \n\tvar oidEstadoConcurso = datos[filaMarcada][11]; \n\tvar noVigencia = get(\"formulario.noVigencia\");\n\tvar estConcuAprobado = get(\"formulario.estConcuAprobado\");\n\n\tif((parseInt(oidVigenciaConcurso) == parseInt(noVigencia)) && \t\t\n\t(parseInt(oidEstadoConcurso)!=parseInt(estConcuAprobado))) {\n\t\tvar obj = new Object();\n\t\t// Seteo los valores obtenidos. \n\t\tobj.oidConcurso = oidParamGrales;\n\t\tobj.oidPlantilla = numPlantilla;\n\t\tobj.opcionMenu = opcionMenu;\n\t\tvar retorno = mostrarModalSICC('LPMantenerParametrosGenerales', '', obj);\n\t\taccionBuscar();\n\t}\n\telse {\n\t\tvar indDespacho = datos[filaMarcada][12];\n\t\tif (oidVigenciaConcurso == '1' && parseInt(indDespacho) == 0) {\n\t\t\tif (GestionarMensaje('3385')) {\n\t\t\t\tvar obj = new Object();\n\t\t\t\t// Seteo los valores obtenidos. \n\t\t\t\tobj.oidConcurso = oidParamGrales;\n\t\t\t\tobj.oidPlantilla = numPlantilla;\n\t\t\t\tobj.opcionMenu = opcionMenu;\n\t\t\t\tobj.oidVigenciaConcurso = oidVigenciaConcurso;\n\t\t\t\tvar retorno = mostrarModalSICC('LPMantenerParametrosGenerales', '', obj);\n\t\t\t\taccionBuscar();\n\t\t\t}\t\n\t\t}\n\t\telse {\n\t\t\t//El concurso seleccionado no puede ser modificado\n\t\t\tGestionarMensaje('INC052');\n\t\t}\n\t}\n}", "function continuaEscriure ()\r\n{\r\n this.borra ();\r\n this.actual=\"\";\r\n this.validate=0;\r\n}", "function buscaOrdenesDeCompraPendientesDeAprobacion(tipo_busqueda){\n\tvar error = 0;\n\tvar idSucursal = $(\"#select-sucursal\").find(\"option:selected\").val();\n\tvar idUsuarioSolicitante = $(\"#select-usuario-solicitante\").find(\"option:selected\").val();\n\tvar fecha_inicio = $(\"#fechadel\").val();\n\tvar fecha_fin = $(\"#fechaal\").val();\n\tvar idOrdenCompra = $(\"#idordencompra\").val();\n\t//var FechaInicioConv = convierteFechaJava(fecha_inicio);\n\t//var FechaFinConv = convierteFechaJava(fecha_fin);\n\t\n\t\n\tif(tipo_busqueda==1){\n\t\tif((idSucursal == '-1')&&(idUsuarioSolicitante == '-1')&&(fecha_inicio == '')&&(fecha_fin=='')){\n\t\t\talert('Debe elgir un crierio');\n\t\t\terror = 1;\n\t\t}\n\t\tif(fecha_inicio > fecha_fin){\n\t\t\talert(\"La fecha incial no puede ser mayor a la fecha final\");\n\t\t\terror = 1;\n\t\t}\n\t}else if(tipo_busqueda==2){\n\t\tif(idOrdenCompra==''){\n\t\t\talert('Debe introducir una orden de compra');\n\t\t\terror = 1;\n\t\t}\n\t}\n\tif(error == 0){\n\t\tvar FechaInicioConv = cambiarFormatoFecha(fecha_inicio,'ymd','-');\n\t\tvar FechaFinConv = cambiarFormatoFecha(fecha_fin,'ymd','-');\n\n\t\t$(\".detalle tbody tr\").remove();\n\t\tvar ruta = \"llenaTablaDetalle.php\";\n\t\tvar envio = \"idSucursal=\" + idSucursal + \"&idUsuarioSolicitante=\" + idUsuarioSolicitante + \"&fecini=\" + FechaInicioConv + \"&fecfin=\" + FechaFinConv + \"&idOrdenCompra=\"+idOrdenCompra+\"&proceso=ordenes_compra_pendientes_de_aprobacion\";\n\t\tvar respuesta = ajaxN(ruta, envio);\n\t\t$(\".detalle tbody\").append(respuesta);\n\t}\n}", "function enviar() {\n if (validar()) {\n removeError();\n //Se envia la información por ajax\n $.ajax({\n url: 'VehiculosServlet',\n data: {\n accion: $(\"#vehiculosAction\").val(),\n ano: $(\"#ano\").val(),\n modelo: $(\"#modelo\").val(),\n placa: $(\"#placa\").val(),\n color: $(\"#color\").val(),\n puntuacion: $(\"#puntuacion\").val(),\n estado: $(\"#estado\").val(),\n ubicacionActualX: $(\"#ubicacionActualX\").val(),\n ubicacionActualY: $(\"#ubicacionActualY\").val(),\n cedula: $(\"#cedula\").val(),\n fecha: $(\"#fecha\").data('date'),\n ultimoUsuario: 'Linsey'\n },\n error: function () { //si existe un error en la respuesta del ajax\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador (Error del ajax)\", \"Error!\");\n },\n success: function (data) { //si todo esta correcto en la respuesta del ajax, la respuesta queda en el data\n var respuestaTxt = data.substring(2);\n var tipoRespuesta = data.substring(0, 2);\n if (tipoRespuesta === \"C~\") {\n mostrarMensaje(\"alert alert-success\", respuestaTxt, \"Correcto!\");\n $(\"#myModalFormulario\").modal(\"hide\");\n consultarVehiculos();\n } else {\n if (tipoRespuesta === \"E~\") {\n mostrarMensaje(\"alert alert-danger\", respuestaTxt, \"Error!\");\n } else if (tipoRespuesta == \"F~\") {\n mostrarMensaje(\"alert alert-danger\", \"El vehiculo ya existe en la base de datos placa duplicada\", \"Error!\");\n $(\"#groupPlaca\").addClass(\"has-error\");\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Se genero un error, contacte al administrador\", \"Error!\");\n }\n }\n \n\n },\n type: 'POST'\n });\n } else {\n mostrarMensaje(\"alert alert-danger\", \"Debe digitar correctamente los campos del formulario\", \"Error!\");\n }\n}", "function carga_logica_informe_anatomia_coronaria() {\r\n\tinicializar_variables_anatomia_coronaria();\r\n\tactualizarDibujoCanvasAnatomiaCoronaria();\r\n\treiniciar_control_seleccion_lesion();\r\n\tcargar_areas_de_seleccion_arterias();\r\n\tcargar_coordenadas_de_lesiones();\r\n}", "function recargaContactos() {\n\n if ( get(FORMULARIO + '.oidCliente')!=null && get(FORMULARIO + '.oidCliente')!='' &&\n get(FORMULARIO + '.pais')!=null && get(FORMULARIO + '.pais')!='' &&\n get(FORMULARIO + '.idioma')!=null && get(FORMULARIO + '.idioma')!=''\n )\n {\n var oidCliente = get(FORMULARIO + '.oidCliente');\n var oidPais = get(FORMULARIO + '.pais');\n var oidIdioma = get(FORMULARIO + '.idioma');\n\n var DTOCliente = 'es.indra.sicc.dtos.cal.DTOCliente';\n configurarPaginado(mipgndo3, \"CALObtenerContactos\", \"ConectorObtenerContactos\", DTOCliente, \n [[\"oidCliente\", oidCliente],\n [\"oidPais\", oidPais],\n [\"oidIdioma\", oidIdioma]] );\n }\n else\t{\n setTimeout( recargaContactos(), 1000);\n }\n }", "function alIniciar(){\n usuario.email = localStorage.getItem(\"email\");\n modalContacto.usuarioEmail = localStorage.getItem(\"email\");\n modalContacto.usuarioRol = localStorage.getItem(\"rol\");\n if(modalContacto.usuarioRol == \"Periodista\"){\n usuario.rol = 1;\n } else{\n usuario.rol = 2;\n }\n modalContacto.usuarioNombre = localStorage.getItem(\"nombre\");\n modalContacto.usuarioApellido = localStorage.getItem(\"apellido\");\n modalContacto.usuarioPuntos = localStorage.getItem(\"puntaje\");\n}", "function cargarValoresIniciales(textCliente,cliente_direccion,textEquipo,textEmpresaMantenimiento,text_desc_puerta,\n text_tipoPuerta,text_motorizacion,text_acceso,text_accionamiento,\n text_operador,text_hoja,text_transmision,text_identificacion,\n textFecha,text_ultimo_mto,text_inicio_servicio,text_ultima_inspec,text_ancho,text_alto,consecutivo){\n $(\"#text_cliente\").val(textCliente);\n $(\"#text_dir_cliente\").val(cliente_direccion);\n $(\"#text_equipo\").val(textEquipo);\n $(\"#text_empresaMantenimiento\").val(textEmpresaMantenimiento);\n $(\"#text_desc_puerta\").val(text_desc_puerta);\n $(\"#text_tipoPuerta\").val(text_tipoPuerta);\n $(\"#text_motorizacion\").val(text_motorizacion);\n $(\"#text_acceso\").val(text_acceso);\n $(\"#text_accionamiento\").val(text_accionamiento);\n $(\"#text_operador\").val(text_operador);\n $(\"#text_hoja\").val(text_hoja);\n $(\"#text_transmision\").val(text_transmision);\n $(\"#text_identificacion\").val(text_identificacion);\n $(\"#text_fecha\").val(textFecha);\n $(\"#text_ultimo_mto\").val(text_ultimo_mto);\n $(\"#text_inicio_servicio\").val(text_inicio_servicio);\n $(\"#text_ultima_inspec\").val(text_ultima_inspec);\n $(\"#text_ancho\").val(text_ancho);\n $(\"#text_alto\").val(text_alto);\n $(\"#text_consecutivo\").val(consecutivo);\n}", "function reiniciarDatos(){\r\n document.getElementById(\"formulario\").reset();\r\n \r\n $(document.getElementById(\"apellido_paterno\")).trigger(\"input\");\r\n $(document.getElementById(\"apellido_materno\")).trigger(\"input\");\r\n $(document.getElementById(\"nombre\")).trigger(\"input\");\r\n $(document.getElementById(\"correo\")).trigger(\"input\");\r\n aplicar_cambio_contrasena();\r\n \r\n if(document.getElementById(\"datos_jugador\") !== null){\r\n $(document.getElementById(\"nacimiento\")).trigger(\"change\");\r\n $(document.getElementById(\"telefono\")).trigger(\"input\");\r\n $(document.getElementById(\"ch_otras_enf\")).trigger(\"change\");\r\n $(document.getElementById(\"ch_otras_alg\")).trigger(\"change\");\r\n $(document.getElementById(\"tx_otras_enf\")).trigger(\"input\");\r\n $(document.getElementById(\"tx_otras_alg\")).trigger(\"input\");\r\n $(document.getElementById(\"sangre\")).trigger(\"change\");\r\n $(document.getElementById(\"facebook\")).trigger(\"input\");\r\n $(document.getElementById(\"twitter\")).trigger(\"input\");\r\n $(document.getElementById(\"instagram\")).trigger(\"input\");\r\n }\r\n}", "function comprovarEscriu () {\r\n this.validate=1;\r\n index=cerca(this.paraules,this.actual);\r\n this.capa.innerHTML=\"\";\r\n if (index != -1) {\r\n paraula = this.paraules[index];\r\n this.putImg (this.dirImg+\"/\"+paraula.imatge);\r\n this.capa.innerHTML += \"<br>\" + this.paraules[index].paraula.toUpperCase();\r\n this.putSound (paraula.so);\r\n this.ant = this.actual;\r\n this.actual = \"\";\r\n }\r\n else {\r\n this.putImg (\"imatges/error.gif\");\r\n this.putSound (\"so/error.wav\");\r\n this.actual = \"\";\r\n }\r\n}", "function formUsuario() {\n $('#fecha_nacimientoDiv').datetimepicker({format: 'DD-MM-YYYY',maxDate:fechaMayorEdad(15),minDate:fechaMayorEdad(130),locale:'es'});\n $('#fecha_nacimiento').prop('value','');\n \n $(\"#fecha_nacimiento\").on(\"click\",function(e){\n e.preventDefault();\n $(\"#glyph_nacimiento\").click();\n });\n \n var url = \"herramientas/funciones/combos.php?consulta=\";\n llenaCombo(url+\"14\",\"#rol\");\n llenaCombo(url+\"9\",\"#sexo\");\n llenaCombo(url+\"5\",\"#pais\");\n llenaCombo(url+\"17\",\"#estatus\");\n \n $('#pais').on('change', function(){\n var val = $(this).val();\n $(\"#estado, #ciudad\").val('').attr(\"disabled\",false).find(\"option\").remove(); \n if (val > 0) {\n if (val == 1) {\n llenaCombo(url+\"6&pa=\"+val,\"#estado\");\n }else if (val == 2) {\n llenaCombo(url+\"6&pa=\"+val,\"#estado\");\n $(\"#ciudad\").attr('disabled',true);\n }else {\n $(\"#estado,#ciudad\").attr('disabled',true);\n }\n }\n });\n \n $('#estado').on('change',function(){\n var val = $(this).val();\n $(\"#ciudad\").val('').find(\"option\").remove(); \n if (val > 0) {\n if ($('#pais').val() == 1) {\n llenaCombo(url+\"7&es=\"+val,\"#ciudad\");\n }\n }\n });\n \n $(\"#rol\").on('change', function(){\n if ($(this).val() == 2) {\n llenaCombo(url+\"16\",\"#asignado\");\n }else if($(this).val() == 1 || $(this).val() == 5){\n llenaCombo(url+\"21\",\"#asignado\");\n }else if($(this).val() == 0 || $(this).val() == ''){\n $('#asignado').html('');\n }else{\n llenaCombo(url+\"15\",\"#asignado\");\n }\n $('#permisos').html('');\n $.ajax({\n dataType: \"html\",\n type: 'POST',\n url: 'herramientas/funciones/usuario.php',\n data: {'opcion':3, 'rol':$(this).val()},\n success: function(permisos){\n $('#permisos').html(permisos);\n if ($('#id').val() == '') {\n $(\"input[type=checkbox]\").prop(\"checked\",true);\n }else{\n $.ajax({\n dataType: \"html\",\n type: 'POST',\n url: 'herramientas/funciones/usuario.php',\n data: {'opcion':5, 'usuario':$('#id').val(),'editar':1},\n success: function(permisosUsu){\n $('#permisos').append(permisosUsu);\n }\n });\n }\n \n }\n });\n });\n $('#userForm').validate({\n errorElement: 'span',\n errorClass: 'error-message',\n rules:{\n nombre:{required:true,textocomun:true,maxlength: 40},\n paterno:{required:true,textocomun:true,maxlength: 40},\n materno:{required:true,textocomun:true,maxlength: 40},\n sexo:{required:true},\n correo:{email: true,maxlength: 50},\n usuario:{required:true, alphanumeric:true,minlength: 6,maxlength: 15},\n clave:{ pas: true,required: true ,minlength: 6,maxlength: 15,},\n confirmacion:{ pas: true,required:true,equalTo: \"#clave\",minlength: 6,maxlength: 15},\n rol:{required:true},\n asignado:{required:true},\n estatus:{required:true}\n },\n messages:{\n nombre:{required:'Campo obligatorio *',textocomun:'S&oacute;lo letras',maxlength: 'M&aacute;ximo de caracteres alcanzado'},\n paterno:{required:'Campo obligatorio *',textocomun:'S&oacute;lo letras',maxlength: 'M&aacute;ximo de caracteres alcanzado'},\n materno:{required:'Campo obligatorio *',textocomun:'S&oacute;lo letras',maxlength: 'M&aacute;ximo de caracteres alcanzado'},\n sexo:{required:'Campo obligatorio *'},\n correo:{email:'Ingrese un correo valido',maxlength: 'M&aacute;ximo de caracteres alcanzado'},\n usuario:{required:'Campo obligatorio *',alphanumeric:'S&oacute;lo alfanumericos',maxlength: 'M&aacute;ximo 15 caracteres'},\n clave:{required: 'Campo obligatorio *',minlength: 'M&iacute;nimo 6 caracteres', maxlength: 'M&aacute;ximo 15 caracteres'},\n confirmacion:{ required:'Campo obligatorio *',equalTo: \"No coincide con la contrase&ntilde;a\",minlength: 'M&iacute;nimo 6 caracteres', maxlength: 'M&aacute;ximo 15 caracteres'},\n rol:{required:'Campo obligatorio *'},\n asignado:{required:'Campo obligatorio *'},\n estatus:{required:'Campo obligatorio *'}\n }\n \n });\n \n $('#agregar_usuario').click(function(){\n if($('#userForm').valid()){\n $('#opcion').attr('value',7);\n $(\"#agregar_usuario\").attr(\"disabled\",true);\n var form = $('#userForm');\n var datos = new FormData(document.getElementById(\"userForm\"));\n var tipo = form.attr(\"method\");\n var url = form.attr(\"action\");\n $.ajax({\n dataType: \"json\",\n type : tipo,\n url: url,\n data: datos,\n cache: false,\n contentType: false,\n processData: false,\n success: function(datos) {\n if (datos.estado == 1) {\n $('#usuarioMen').fadeIn(500).removeClass(\"alert alert-warning\").addClass(\"alert alert-success\").html(datos.men);\n $('#usuarioCo').slideUp('slow',function(){});\n \n }else {\n $('#usuarioMen').fadeIn(500).removeClass(\"alert alert-success\").addClass(\"alert alert-warning\").html(datos.men);\n }\n $('html,body').animate({\n scrollTop: $(\"#contP\").offset().top\n }, 500);\n \n setTimeout(function() {\n $(\"#usuarioMen\").fadeOut(1500);\n },3000);\n $(\"#agregar_usuario\").attr(\"disabled\",false);\n },\n });\n \n \n }else{\n //alert(\"Capture correctamente los campos\");\n $(\"#modal-header\").html('').append('<button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button><h4 class=\"modal-title\" style=\"color:#577492;\">¡Atenci&oacute;n!</h4>');\n $(\"#modal-body\").html('').append('<p>¡Verifique la informaci&oacute;n ingresada, a&uacute;n no es correcta!.</p>');\n $(\"#modal-footer\").html('').append('<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">OK</button>');\n $(\"#ModalGral\").modal({backdrop: \"static\"});\n $(\"#ModalGral\").modal(\"show\");\n //alert(\"¡Verifique la informaci\\u00f3n ingresada, a\\u00fan no es correcta!\");\n $(\"#agregar_usuario\").attr(\"disabled\",false);\n return false;\n }\n return false;\n });\n $('#regresar').on('click',function(){\n $('#usuarioCo').slideUp('slow',function(){});\n return false;\n });\n \n $('#formUedita').on('click',function(){\n if($('#userForm').valid()){\n $('#opcion').attr('value',8);\n $(\"#formUedita\").attr(\"disabled\",true);\n var form = $('#userForm');\n var datos = new FormData(document.getElementById(\"userForm\"));\n var tipo = form.attr(\"method\");\n var url = form.attr(\"action\");\n $.ajax({\n dataType: \"json\",\n type : tipo,\n url: url,\n data: datos,\n cache: false,\n contentType: false,\n processData: false,\n success: function(datos) {\n //alert('ya entro');\n if (datos.estado == 1) {\n $('#usuarioMen').fadeIn(500).removeClass(\"alert alert-warning\").addClass(\"alert alert-success\").html(datos.men);\n //$('#usuarioCo').slideUp('slow',function(){});\n }else {\n $('#usuarioMen').fadeIn(500).removeClass(\"alert alert-success\").addClass(\"alert alert-warning\").html(datos.men);\n }\n $('html,body').animate({\n scrollTop: $(\"#contP\").offset().top\n }, 500);\n \n setTimeout(function() {\n $(\"#usuarioMen\").fadeOut(1500);\n },3000);\n },\n });\n $(\"#formUedita\").attr(\"disabled\",false);\n \n }else{\n $(\"#modal-header\").html('').append('<button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button><h4 class=\"modal-title\" style=\"color:#577492;\">¡Atenci&oacute;n!</h4>');\n $(\"#modal-body\").html('').append('<p>¡Verifique la informaci&oacute;n ingresada, a&uacute;n no es correcta!.</p>');\n $(\"#modal-footer\").html('').append('<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">OK</button>');\n $(\"#ModalGral\").modal({backdrop: \"static\"});\n $(\"#ModalGral\").modal(\"show\");\n //alert(\"¡Verifique la informaci\\u00f3n ingresada, a\\u00fan no es correcta!\");\n return false;\n }\n return false;\n });\n \n $('#formUelimina').on('click',function(){\n $(\"#usuarioMen\").fadeIn(200).css('padding-bottom','45px').removeClass(\"alert alert-success\").addClass(\"alert alert-warning\").html('<center><div class=\"col-lg-10 text-left\" style=\"padding-top:10px;font-size:20px;\">&iquest;Est&aacute; seguro que desea eliminar este usuario? &nbsp;</div><div class=\"col-lg-2\"><button name=\"eleminarRegF\" id=\"eleminarRegF\" class=\"btn btn-danger\" cual=\"'+$(\"#id\").val()+'\"><span class=\"glyphicon glyphicon-trash\"></span>&nbsp;Si</button>&nbsp;&nbsp;<button name=\"noeli\" id=\"noeli\" class=\"btn btn-primary\" ><span class=\"glyphicon glyphicon-floppy-disk\"></span>&nbsp;No</button></div></center>');\n $('html,body').animate({\n scrollTop: $(\"#usuarioMen\").offset().top\n }, 500);\n \n $('#eleminarRegF').on('click',function(){\n $(\"#usuarioMen\").css('padding-bottom','10px')\n if($('#userForm').valid()){\n $('#opcion').attr('value',9);\n $(\"#agregar_usuario\").attr(\"disabled\",true);\n var form = $('#userForm');\n var datos = new FormData(document.getElementById(\"userForm\"));\n var tipo = form.attr(\"method\");\n var url = form.attr(\"action\");\n $.ajax({\n dataType: \"json\",\n type : tipo,\n url: url,\n data: datos,\n cache: false,\n contentType: false,\n processData: false,\n success: function(datos) {\n \n if (datos.estado == 1) {\n $('#usuarioMen').fadeIn(500).removeClass(\"alert alert-warning\").addClass(\"alert alert-success\").html(datos.men);\n $('#usuarioCo').slideUp('slow',function(){});\n \n }else {\n $('#usuarioMen').fadeIn(500).removeClass(\"alert alert-success\").addClass(\"alert alert-warning\").html(datos.men);\n }\n $('html,body').animate({\n scrollTop: $(\"#contP\").offset().top\n }, 500);\n \n setTimeout(function() {\n $(\"#usuarioMen\").fadeOut(1500);\n },3000);\n },\n });\n $(\"#agregar_usuario\").attr(\"disabled\",false);\n \n }else{\n $(\"#modal-header\").html('').append('<button type=\"button\" class=\"close\" data-dismiss=\"modal\">&times;</button><h4 class=\"modal-title\" style=\"color:#577492;\">¡Atenci&oacute;n!</h4>');\n $(\"#modal-body\").html('').append('<p>¡Verifique la informaci&oacute;n ingresada, a&uacute;n no es correcta!.</p>');\n $(\"#modal-footer\").html('').append('<button type=\"button\" class=\"btn btn-default\" data-dismiss=\"modal\">OK</button>');\n $(\"#ModalGral\").modal({backdrop: \"static\"});\n $(\"#ModalGral\").modal(\"show\");\n // alert(\"¡Verifique la informaci\\u00f3n ingresada, a\\u00fan no es correcta!\");\n return false;\n }\n return false;\n });\n $('#noeli').on('click',function(){\n $('#eleminarRegF').attr(\"disabled\",true);\n setTimeout(function() {\n $('#usuarioMen').fadeOut(1500).removeClass(\"alert alert-success alert-warning\").html('').css('padding-bottom','10px');\n },1000);\n \n \n return false;\n });\n \n });\n \n \n $(\"#usuario\").on('keyup',function(){\n validaUsuario();\n });\n \n}", "function listando_todos_os_contatos_001(){ \n try{ \n \n var linha_recebida = lista_de_contatos.split(\"@\"); \n for( var i = ( linha_recebida.length - 1 ); i >= 0; i-- ) {\n if( linha_recebida[i].includes(\"-\") ){\n var web_id;\n var web_comando;\n var web_usuario_logado;\n \n var web_contato_email;\n var web_contato_nome;\n var web_contato_nome_meio;\n var web_contato_ultimo_nome;\n\n var argumentos = linha_recebida[i].split(\"j\");\n for( var j = 0; j < argumentos.length; j++ ) {\n if(j === 0){ \n web_id = argumentos[j];\n }\n else if(j === 1){\n web_comando = argumentos[j];\n }\n else if(j === 2){\n web_usuario_logado = argumentos[j];\n }\n else if(j === 3){\n web_contato_email = argumentos[j];\n }\n else if(j === 4){\n web_contato_nome = argumentos[j];\n }\n else if(j === 5){\n web_contato_nome_meio = argumentos[j];\n }\n else if(j === 6){\n web_contato_ultimo_nome = argumentos[j];\n }\n }\n\n //Verificar se este contato é deste usuário\n var nome_principal = \"\"; try{ nome_principal = converter_base64(web_contato_nome).trim(); }catch(Exception){}\n var web_contato_email_str = importar_Para_Alfabeto_JM( web_contato_email ).trim().toUpperCase();\n \n percorrer_todas_as_conversas( web_id, web_contato_email_str, nome_principal );\n }\n } \n }catch(Exception){\n \n document.getElementById(\"ul_meus_contatos\").innerHTML = \"consultar_contato_antes_de_cadastrar_003 -- \" + Exception;\n }finally { \n \n //alert(\"Acabou\");\n setTimeout(function(){ \n \n //alert(\"Reiniciando\");\n if( carregado === 1 ){\n \n _01_controle_loop_sem_fim();\n }\n else if( carregado === 0 ){\n \n carregado = 0;\n document.getElementById(\"ul_meus_contatos\").style.display = 'block';\n \n document.getElementById(\"contato_tabela_xy_01\").style.display = 'none';\n document.getElementById(\"contato_tabela_xy_01\").innerHTML = \"\";\n \n _01_controle_loop_sem_fim();\n }\n \n }, 1000);\n }\n \n }", "function limpiar() {\n\n $('#nit').val(null);\n $('#nombre').val(null);\n $('#razon').val(null);\n $('#telefono').val(null);\n $('#direccion').val(null);\n $('#id').val(0);\n $('#departamento').val(0);\n $('#municipio').html('<option value=\"0\">Seleccione Una Opción</option>');\n $('#actividad').val(0);\n $('#tipoPago').val(0);\n $('#numeroest').val(null);\n $('#numeroreg').val(null);\n $('#fechaRegistro').val(null);\n $('#fechaConstitucion').val(null);\n\n\n var nit = $('#nit');\n var nombre = $('#nombre');\n var nombrecomercial = $('#razon');\n var telefono = $('#telefono');\n var direccion = $('#direccion');\n var departamento = $('#departamento');\n var municipio = $('#municipio');\n var actividad = $('#actividad');\n var tipoPago = $('#tipoPago');\n var numeroest = $('#numeroest');\n var numeroreg = $('#numeroreg');\n var fechaRegistro = $('#fechaRegistro');\n var fechaConstitucion = $('#fechaConstitucion');\n\n\n nit.removeClass('is-invalid');\n nit.removeClass('is-valid');\n\n nombre.removeClass('is-invalid');\n nombre.removeClass('is-valid');\n\n nombrecomercial.removeClass('is-invalid');\n nombrecomercial.removeClass('is-valid');\n\n telefono.removeClass('is-invalid');\n telefono.removeClass('is-valid');\n\n direccion.removeClass('is-invalid');\n direccion.removeClass('is-valid');\n\n departamento.removeClass('is-invalid');\n departamento.removeClass('is-valid');\n\n municipio.removeClass('is-invalid');\n municipio.removeClass('is-valid');\n\n actividad.removeClass('is-invalid');\n actividad.removeClass('is-valid');\n\n tipoPago.removeClass('is-invalid');\n tipoPago.removeClass('is-valid');\n\n numeroest.removeClass('is-invalid');\n numeroest.removeClass('is-valid');\n\n numeroreg.removeClass('is-invalid');\n numeroreg.removeClass('is-valid');\n\n fechaRegistro.removeClass('is-invalid');\n fechaRegistro.removeClass('is-valid');\n\n fechaConstitucion.removeClass('is-invalid');\n fechaConstitucion.removeClass('is-valid');\n\n\n $('#bt-guardar').removeAttr('disabled', true);\n $('#bt-cancelar').removeAttr('disabled', true);\n $('#bt-guardar').html('<i class=\"material-icons\">add</i>Guardar');\n $('#bt-guardar').removeClass('btn-info');\n $('#bt-guardar').removeClass('btn-warning');\n $('#bt-guardar').addClass('btn-success');\n}", "function desbloquearCamposHU(){\n\t\tif(tieneRol(\"cliente\")){//nombre, identificador, prioridad, descripcion y observaciones puede modificar, el boton crear esta activo para el\n\t\t\n\t\t}\n\t\tif(tieneRol(\"programadror\")){// modificar:estimacion de tiempo y unidad dependencia responsables, todos los botones botones \n\t\t\n\t\t}\n\t}", "function cargarValoresIniciales(textCliente,textEquipo,textEmpresaMantenimiento,text_desc_puerta,\n text_tipoPuerta,text_motorizacion,text_acceso,text_accionamiento,\n text_operador,text_hoja,text_transmision,text_identificacion,\n textFecha,text_ultimo_mto,text_inicio_servicio,text_ultima_inspec,text_ancho,text_alto,consecutivo){\n $(\"#text_cliente\").val(textCliente);\n $(\"#text_equipo\").val(textEquipo);\n $(\"#text_empresaMantenimiento\").val(textEmpresaMantenimiento);\n $(\"#text_desc_puerta\").val(text_desc_puerta);\n $(\"#text_tipoPuerta\").val(text_tipoPuerta);\n $(\"#text_motorizacion\").val(text_motorizacion);\n $(\"#text_acceso\").val(text_acceso);\n $(\"#text_accionamiento\").val(text_accionamiento);\n $(\"#text_operador\").val(text_operador);\n $(\"#text_hoja\").val(text_hoja);\n $(\"#text_transmision\").val(text_transmision);\n $(\"#text_identificacion\").val(text_identificacion);\n $(\"#text_fecha\").val(textFecha);\n $(\"#text_ultimo_mto\").val(text_ultimo_mto);\n $(\"#text_inicio_servicio\").val(text_inicio_servicio);\n $(\"#text_ultima_inspec\").val(text_ultima_inspec);\n $(\"#text_ancho\").val(text_ancho);\n $(\"#text_alto\").val(text_alto);\n $(\"#text_consecutivo\").val(consecutivo);\n}", "function nuevoAnuncio_validarCampos_inmueble() {\n\tif (!vacio($(\"#crearAnuncio_titulo\").val(), $(\"#crearAnuncio_titulo\").attr(\"placeholder\"))) {\n\t\tif (!vacio(($(\"#crearAnuncio_categoria\").val() != -1 ? $(\"#crearAnuncio_categoria\").val() : \"\"), $(\"#crearAnuncio_categoria option[value='-1']\").text())) {\n\t\t\tif (!vacio(($(\"#crearAnuncio_tipo\").val() != -1 ? $(\"#crearAnuncio_tipo\").val() : \"\"), $(\"#crearAnuncio_tipo option[value='-1']\").text())) {\n\t\t\t\tif (!vacio(($(\"#crearAnuncio_transaccion\").val() != -1 ? $(\"#crearAnuncio_transaccion\").val() : \"\"), $(\"#crearAnuncio_transaccion option[value='-1']\").text())) {\n\t\t\t\t\tif (!vacio($(\"#crearAnuncio_precio\").val(), $(\"#crearAnuncio_precio\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t_precio = $(\"#crearAnuncio_precio\").val().replace(/\\$/g, \"\").replace(/,/g, \"\");\n\t\t\t\t\t\t$(\"#crearAnuncio_precio\").val(_precio);\n\t\t\t\t\t\tif (flotante($(\"#crearAnuncio_precio\").val(), $(\"#crearAnuncio_precio\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\tif (!vacio($(\"#crearAnuncio_calleNumero\").val(), $(\"#crearAnuncio_calleNumero\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\tif (!vacio(($(\"#crearAnuncio_estado\").val() != -1 ? $(\"#crearAnuncio_estado\").val() : \"\"), $(\"#crearAnuncio_estado option[value='-1']\").text())) {\n\t\t\t\t\t\t\t\t\tif (!vacio(($(\"#crearAnuncio_ciudad\").val() != -1 ? $(\"#crearAnuncio_ciudad\").val() : \"\"), $(\"#crearAnuncio_ciudad option[value='-1']\").text())) {\n\t\t\t\t\t\t\t\t\t\tif (!vacio(($(\"#crearAnuncio_colonia\").val() != -1 ? $(\"#crearAnuncio_colonia\").val() : \"\"), $(\"#crearAnuncio_colonia option[value='-1']\").text())) {\n\t\t\t\t\t\t\t\t\t\t\tif ($(\"#_crearAnuncioLatitud\").val() != \"\") {\n\t\t\t\t\t\t\t\t\t\t\t\tif (!vacio($(\"#crearAnuncio_descripcion\").val(), $(\"#crearAnuncio_descripcion\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!vacio(($(\"#crearAnuncio_usuario\").val() != -1 ? $(\"#crearAnuncio_usuario\").val() : \"\"), $(\"#crearAnuncio_usuario option[value='-1']\").text())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar continuar = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (parseInt($(\"#idInmueble2\").val()) == -1) {//nuevo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($(\"#imagenesTemporales .bloqueImagen\").length == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"Ingrese al menos una imágen para el inmueble\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($(\"input[name='radioImagenPrincipal']:checked\").length == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"Selecciona una imágen como la principal\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {//modificar\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($(\"input[name='radioImagenPrincipal']:checked\").length == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"Selecciona una imágen como la principal\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_dimesionTotal\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!flotante($(\"#crearAnuncio_dimesionTotal\").val(), $(\"#crearAnuncio_dimesionTotal\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_dimensionConstruida\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!flotante($(\"#crearAnuncio_dimensionConstruida\").val(), $(\"#crearAnuncio_dimensionConstruida\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_cuotaMantenimiento\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t_precio = $(\"#crearAnuncio_cuotaMantenimiento\").val().replace(/\\$/g, \"\").replace(/,/g, \"\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#crearAnuncio_cuotaMantenimiento\").val(_precio);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!flotante($(\"#crearAnuncio_cuotaMantenimiento\").val(), $(\"#crearAnuncio_cuotaMantenimiento\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_elevador\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!entero($(\"#crearAnuncio_elevador\").val(), $(\"#crearAnuncio_elevador\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_estacionamientoVisitas\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!entero($(\"#crearAnuncio_estacionamientoVisitas\").val(), $(\"#crearAnuncio_estacionamientoVisitas\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_numeroOficinas\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!entero($(\"#crearAnuncio_numeroOficinas\").val(), $(\"#crearAnuncio_numeroOficinas\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_metrosFrente\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!flotante($(\"#crearAnuncio_metrosFrente\").val(), $(\"#crearAnuncio_metrosFrente\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_metrosFondo\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!flotante($(\"#crearAnuncio_metrosFondo\").val(), $(\"#crearAnuncio_metrosFondo\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_cajonesEstacionamiento\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!entero($(\"#crearAnuncio_cajonesEstacionamiento\").val(), $(\"#crearAnuncio_cajonesEstacionamiento\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//solo para casas y departamentos: wcs y recamaras son obligatorios\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ((parseInt($(\"#crearAnuncio_tipo\").val()) == 1) || (parseInt($(\"#crearAnuncio_tipo\").val()) == 2)) {//casa o departamento\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!vacio(($(\"#crearAnuncio_wcs\").val() != -1 ? $(\"#crearAnuncio_wcs\").val() : \"\"), $(\"#crearAnuncio_wcs option[value='-1']\").text())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (vacio(($(\"#crearAnuncio_recamaras\").val() != -1 ? $(\"#crearAnuncio_recamaras\").val() : \"\"), $(\"#crearAnuncio_recamaras option[value='-1']\").text()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_codigo\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: \"lib_php/updInmueble.php\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid: $(\"#idInmueble2\").val(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidarCodigo: 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tusuario: $(\"#crearAnuncio_usuario\").val(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcodigo: $(\"#crearAnuncio_codigo\").val()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}).always(function(respuesta_json){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnuevoAnuncio_save();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(respuesta_json.mensaje);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (continuar) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnuevoAnuncio_save();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\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\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\talert(\"Agrege la posición del inmueble en el mapa.\");\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function calGuiasInitComponents(){\n\t//Deshabilitamos la limpieza gen?rica del formulario\n\tvarNoLimpiarSICC = false;\n\n\t//Inicalizamos el estado del men? secundario\n\tconfigurarMenuSecundario('calGuiasFrm');\n \t \n\t if (window.dialogArguments) { // Si es modal (se abrió mediante showModalDialog) DBLG500000915\n btnProxy(2,1); // boton 'volver', habilitado\n btnProxy(3,0); // boton 'Ir a pantalla de inicio', deshabilitado\n }\n\n\t//Encogemos las capas de resultados y botones\n\tminimizeLayers();\n\t\n\t//Guardamos los valores de los campos para poder recuperarlos tras una operaci?n de limpiar\n\tpopulateForm2Js();\n\t\n\t//Simplemente analiza el tipo de acci?n a realizar y llama a la funci?n correspondiente\n\tswitch(get('calGuiasFrm.accion')){\n\t\tcase \"query\": calGuiasQueryInitComponents(); break;\n\t\tcase \"view\": calGuiasViewInitComponents(); break;\n\t\tcase \"create\": calGuiasCreateInitComponents(); break;\n\t\tcase \"update\": calGuiasUpdateInitComponents(); break;\n\t\tcase \"remove\": calGuiasRemoveInitComponents(); break;\n\t\tcase \"lov\": calGuiasLovInitComponents(); break;\n\t}\n\t//alert('accion :' + get('calGuiasFrm.accion'));\n\t\n\t//Ponemos el foco en el primer campo\n\t//focusFirstField('calGuiasFrm', true);\n\t\n\t//Si hay que hacer requery lo realizamos\n\tif(isPerformRequery('calGuias')) calGuiasCmdRequery();\n}", "setInitialValues(data) {\n //publicoAlvo\n if(data.publicoAlvoSim === 1){\n this.publicoAlvoSim = 1\n this.hasSavedValues = true\n } else {\n this.publicoAlvoSim= 0\n }\n if(data.publicoAlvoNao === 1){\n this.publicoAlvoNao= 1\n this.hasSavedValues = true\n } else {\n this.publicoAlvoNao= 0\n }\n if(data.publicoAlvoALVA === 1){\n this.publicoAlvoALVA= 1\n this.hasSavedValues = true\n } else {\n this.publicoAlvoALVA= 0\n } \n //sistemaResponsavel\n if(data.XER === 1){\n this.XER= 1\n this.hasSavedValues = true\n } else {\n this.XER= 0\n }\n if(data.COP === 1){\n this.COP= 1\n this.hasSavedValues = true\n } else {\n this.COP= 0\n }\n //listaPrefixosGecor\n for(let e of data.listaPrefixos){\n this.listaPrefixos.push(e)\n this.hasSavedValues = true\n }\n //situacaoVinculoDaOperacao\n if(data.operacaoNaoVinculada === 1){\n this.operacaoNaoVinculada= 1\n this.hasSavedValues = true\n } else {\n this.operacaoNaoVinculada= 0\n }\n if(data.operacaoVinculada === 1){\n this.operacaoVinculada= 1\n this.hasSavedValues = true\n } else {\n this.operacaoVinculada= 0\n }\n if(data.operacaoVinculadaEmOutroNPJ === 1){\n this.operacaoVinculadaEmOutroNPJ= 1\n this.hasSavedValues = true\n } else {\n this.operacaoVinculadaEmOutroNPJ= 0\n }\n //acordoRegistradoNoPortal\n if(data.acordoRegPortalSim === 1){\n this.acordoRegPortalSim= 1\n this.hasSavedValues = true\n } else {\n this.acordoRegPortalSim= 0\n }\n if(data.acordoRegPortalNao === 1){\n this.acordoRegPortalNao= 1\n this.hasSavedValues = true\n } else {\n this.acordoRegPortalNao= 0\n }\n // if(data.acordoRegPortalDuplicados === 1){\n // this.acordoRegPortalDuplicados= 1\n // this.hasSavedValues = true\n // } else {\n // this.acordoRegPortalDuplicados= 0\n // }\n if(data.duplicadoSimNao===1){\n this.duplicadoSimNao =1 \n this.hasSavedValues = true\n }\n if(data.analisadoSimNao===1){\n this.analisadoSimNao = 1\n this.hasSavedValues = true\n }\n //totalRegistrosComFiltro\n this.totaisEstoque = data.est\n this.totaisFluxo = data.flu\n //quantidade de registros a gerar\n if(data.estoqueNumber > 0){\n this.estoqueNumber = data.estoqueNumber\n this.hasSavedValues = true\n }\n if(data.fluxoNumber > 0){\n this.fluxoNumber = data.fluxoNumber\n this.hasSavedValues = true\n }\n }", "function SetearDatosLibro(_transaccion, _codigo_prestamo) {\n if (_transaccion == 'devolver' && _codigo_prestamo != '') {\n var prestamo = ObtenerDatosPrestamo(_codigo_prestamo);\n if (prestamo == undefined) return false;\n var indice = ObtenerLibroIndex(prestamo.libro_id);\n var autor = ObtenerInfoAutor(Libros[indice].autor_id);\n var tema = ObtenerInfoTema(Libros[indice].tema_id);\n $('#txt_codigo_prestamo').val(_codigo_prestamo);\n $('#td_libro_titulo').html(Libros[indice].titulo);\n $('#td_libro_autor').html(autor.nombres + ' ' + autor.apellidos);\n $('#td_libro_tema').html(tema.tema);\n $('#td_libro_ubicacion').html(Libros[indice].ubicacion);\n $('#td_libro_disponibles').html(Libros[indice].disponibles);\n $('#td_libro_prestamo').html(prestamo.fecha_prestamo);\n $('#td_libro_devolucion').html(prestamo.fecha_devolucion);\n return true;\n } else {\n var id_libro = localStorage.getItem('editar_libro');\n var indice = ObtenerLibroIndex(id_libro);\n $('#txt_titulo_libro_editar').val(Libros[indice].titulo);\n $('#slc_autor_libro_editar').val(Libros[indice].autor_id);\n $('#slc_tema_libro_editar').val(Libros[indice].tema_id);\n $('#txt_existencia_editar').val(Libros[indice].disponibles);\n $('#txt_ubicacion_editar').val(Libros[indice].ubicacion);\n $('#txt_fecha_registro_libro_editar').val(Libros[indice].fecha_ingreso);\n return true;\n }\n}", "function ValidarRegistroNuevoLibro() {\n var titulo = $('#txt_titulo_libro').val();\n var autor = $('#slc_autor_libro').val();\n var tema = $('#slc_tema_libro').val();\n var existencia = $('#txt_existencia').val();\n var ubicacion = $('#txt_ubicacion').val();\n var fecha_ingreso = $('#txt_fecha_registro_libro').val();\n var mensaje = '';\n var error = false;\n if (titulo == '') {\n mensaje += 'Debe ingresar el titulo del libro\\n';\n error = true;\n }\n if (autor == '') {\n mensaje += 'Debe seleccionar el autor del libro\\n';\n error = true;\n }\n if (tema == '') {\n mensaje += 'Debe seleccionar el tema del libro\\n';\n error = true;\n }\n if (existencia == '') {\n mensaje += 'Debe la cantidad de libros existentes\\n';\n error = true;\n }\n if (ubicacion == '') {\n mensaje += 'Debe ingresar la ubicacion del libro\\n';\n error = true;\n }\n error ? alert(mensaje) : AgregarNuevoLibro(titulo, tema, autor, existencia, ubicacion, fecha_ingreso);\n}", "function cargarCgg_res_beneficiarioCtrls(){\n if(inRecordCgg_res_beneficiario!== null){\n if(inRecordCgg_res_beneficiario.get('CRPER_CODIGO'))\n {\n txtCrben_codigo.setValue(inRecordCgg_res_beneficiario.get('CRPER_CODIGO'));\n txtCrben_nombres.setValue(inRecordCgg_res_beneficiario.get('CRPER_NOMBRES'));\n txtCrben_apellido_paterno.setValue(inRecordCgg_res_beneficiario.get('CRPER_APELLIDO_PATERNO'));\n txtCrben_apellido_materno.setValue(inRecordCgg_res_beneficiario.get('CRPER_APELLIDO_MATERNO'))\n txtCrben_num_doc_identific.setValue(inRecordCgg_res_beneficiario.get('CRPER_NUM_DOC_IDENTIFIC'));\n cbxCrben_genero.setValue(inRecordCgg_res_beneficiario.get('CRPER_GENERO'));\n cbxCrdid_codigo.setValue(inRecordCgg_res_beneficiario.get('CRDID_CODIGO'));\n cbxCrecv_codigo.setValue(inRecordCgg_res_beneficiario.get('CRECV_CODIGO'));\n cbxCpais_nombre_nacimiento.setValue(inRecordCgg_res_beneficiario.get('CPAIS_CODIGO'));\n var tmpFecha = null;\n if(inRecordCgg_res_beneficiario.get('CRPER_FECHA_NACIMIENTO')== null || inRecordCgg_res_beneficiario.get('CRPER_FECHA_NACIMIENTO').trim().length ==0){\n tmpFecha = new Date();\n }else{\n tmpFecha = Date.parse(inRecordCgg_res_beneficiario.get('CRPER_FECHA_NACIMIENTO'));\n }\n dtCrper_fecha_nacimiento.setValue(tmpFecha);\n }\n if(inRecordCgg_res_beneficiario.get('CRPER_REQUISITOS_JSON')){\n gsCgg_res_solicitud_requisito.loadData(Ext.util.JSON.decode(inRecordCgg_res_beneficiario.get('CRPER_REQUISITOS_JSON')),true);\n }else{\n gsCgg_res_solicitud_requisito.reload({\n params:{\n inCrtra_codigo:null, \n inCrtst_codigo:INRECORD_TIPO_SOLICITUD.get('CRTST_CODIGO'),\n format:TypeFormat.JSON\n }\n });\n }\n }\n }", "function optenerValoresFormularioRegistrar() {\r\n\r\n\tentering(\"optenerValoresFormulario\");\r\n\tvar nombre = optenerValorCampo(\"nombre\");\r\n var apellido = optenerValorCampo(\"apellido\");\r\n\tvar sexo= optenerValorRadioButton(\"sexo\");\r\n//\tvar fechaNacimiento= optenerValorCampo(\"fechaNacimiento\");\t\t\t\t\r\n\tvar email= optenerValorCampo(\"email\");\t\t\t\t\t\r\n\tvar codigoUsuario= optenerValorCampo(\"codigoUsuario\");\t\t\t\t\t\t\r\n\t\r\n\tvar passwordValida = validarCoincidenciaPassword(\"password\", \"password-2\");\r\n\tconsole.log(\"Las password son valida : \"+passwordValida );\r\n\tif (passwordValida) {\r\n\t\tvar password = document.getElementById(\"password\").value;\t\t\t\t\r\n\t\tvar password2 = document.getElementById(\"password-2\").value;\r\n\t}\r\n\t\r\n\t//datos opcionales \r\n\tvar emailAlternativa = document.getElementById(\"emailAlternativa\");\r\n\tif (emailAlternativa.value.length > 1 && emailAlternativa != undefined && emailAlternativa.value != null){\r\n\t\temailAlternativa = optenerValorCampo(\"emailAlternativa\");\r\n\t}\r\n\t\r\n\tvar direccion= document.getElementById(\"direccion\");\r\n\tif (direccion.value.length > 1 && direccion.value !='' && direccion != undefined && direccion.value != null){\r\n\t\tdireccion= optenerValorCampo(\"direccion\");\r\n\t}\r\n\t\t\t\t\t\t\r\n\tvar telefono= document.getElementById(\"telefono\");\r\n\tif (telefono.value.length > 1 && telefono.value !='' && telefono != undefined && telefono.value != null){\r\n\t\ttelefono= optenerValorCampo(\"direccion\");\r\n\t}\r\n\t\r\n\tvar celular= document.getElementById(\"celular\");\r\n\tif (celular.value.length > 1 && celular.value !='' && celular != undefined && celular.value != null){\r\n\t\tcelular= optenerValorCampo(\"celular\");\r\n\t}\r\n\t\r\n\tconsole.log(\"nombre\"+ nombre);\r\n\tconsole.log(\"apellido\"+ apellido);\r\n\tconsole.log(\"email\"+ email);\r\n\tconsole.log(\"codigoUsuario\"+ codigoUsuario);\r\n\tconsole.log(\"sexo: \"+ sexo);\r\n\tconsole.log(\"email: \"+ email);\r\n\tconsole.log(\"password1: \"+ password);\r\n\tconsole.log(\"password2: \"+ password2);\r\n\t\r\n\talert(\"terminando regitrar usuario.\");\r\n}", "function LeEntradas() {\n // Modo mestre ligado ou nao.\n gEntradas.modo_mestre = Dom('input-modo-mestre').checked;\n\n // nome\n gEntradas.nome = Dom('nome').value;\n // raca\n gEntradas.raca = ValorSelecionado(Dom('raca'));\n // template\n gEntradas.template = ValorSelecionado(Dom('template'));\n // tamanho\n gEntradas.tamanho = ValorSelecionado(Dom('tamanho')) || tabelas_raca[gEntradas.raca].tamanho;\n // alinhamento\n gEntradas.alinhamento = ValorSelecionado(Dom('alinhamento'));\n // divindade\n gEntradas.divindade = Dom('divindade-patrona').value;\n // classes.\n gEntradas.classes.length = 0;\n var div_classes = Dom('classes');\n for (var i = 0; i < div_classes.childNodes.length; ++i) {\n var elemento = div_classes.childNodes[i];\n if (elemento.tagName == \"DIV\") {\n var select = elemento.getElementsByTagName(\"SELECT\")[0];\n var input = elemento.getElementsByTagName(\"INPUT\")[0];\n gEntradas.classes.push({\n classe: ValorSelecionado(select),\n nivel: parseInt(input.value)});\n }\n }\n // Dominios de clerigo.\n _LeDominios();\n // Familiares.\n _LeFamiliar();\n _LeCompanheiroAnimal();\n gEntradas.niveis_negativos = parseInt(Dom('niveis-negativos').value) || 0;\n // pontos de vida e ferimentos.\n gEntradas.pontos_vida = parseInt(Dom('pontos-vida-dados').value) || 0;\n gEntradas.pontos_vida_temporarios = parseInt(Dom('pontos-vida-temporarios').value) || 0;\n gEntradas.ferimentos = Math.abs(parseInt(Dom('ferimentos').textContent)) || 0;\n gEntradas.ferimentos_nao_letais = Math.abs(parseInt(Dom('ferimentos-nao-letais').textContent)) || 0;\n // Experiencia.\n gEntradas.experiencia = parseInt(Dom('pontos-experiencia').value) || 0;\n // atributos\n var span_bonus_atributos = Dom('pontos-atributos-gastos');\n if (span_bonus_atributos.textContent.length > 0) {\n var array_bonus = span_bonus_atributos.textContent.split(',');\n for (var i = 0; i < array_bonus.length; ++i) {\n // Trim direita.\n var nome_atributo = AjustaString(array_bonus[i]);\n array_bonus[i] = tabelas_atributos_invertidos[nome_atributo];\n }\n gEntradas.bonus_atributos = array_bonus;\n } else {\n gEntradas.bonus_atributos = [];\n }\n var atributos = [\n 'forca', 'destreza', 'constituicao', 'inteligencia', 'sabedoria', 'carisma' ];\n for (var i = 0; i < atributos.length; ++i) {\n gEntradas[atributos[i]] =\n parseInt(Dom(atributos[i] + '-valor-base').value);\n }\n\n // Estilos de luta.\n gEntradas.estilos_luta = [];\n var div_estilos_luta = Dom('div-estilos-luta');\n for (var i = 0; i < div_estilos_luta.childNodes.length; ++i) {\n gEntradas.estilos_luta.push(\n _LeEntradaEstiloLuta(div_estilos_luta.childNodes[i]));\n }\n\n _LeHabilidadesEspeciais();\n\n _LeEquipamentos();\n\n _LeTalentos();\n\n // Pericias.\n _LePericias();\n\n // Feiticos.\n _LeFeiticos();\n\n gEntradas.notas = Dom('text-area-notas').value;\n}", "function LeEntradas() {\n // Modo mestre ligado ou nao.\n gEntradas.modo_mestre = Dom('input-modo-mestre').checked;\n\n // nome\n gEntradas.nome = Dom('nome').value;\n // raca\n gEntradas.raca = ValorSelecionado(Dom('raca'));\n // template\n gEntradas.template = ValorSelecionado(Dom('template'));\n // tamanho\n gEntradas.tamanho = ValorSelecionado(Dom('tamanho')) || tabelas_raca[gEntradas.raca].tamanho;\n // alinhamento\n gEntradas.alinhamento = ValorSelecionado(Dom('alinhamento'));\n // divindade\n gEntradas.divindade = Dom('divindade-patrona').value;\n // classes.\n gEntradas.classes.length = 0;\n var div_classes = Dom('classes');\n for (var i = 0; i < div_classes.childNodes.length; ++i) {\n var elemento = div_classes.childNodes[i];\n if (elemento.tagName == \"DIV\") {\n var select = elemento.getElementsByTagName(\"SELECT\")[0];\n var input = elemento.getElementsByTagName(\"INPUT\")[0];\n gEntradas.classes.push({\n classe: ValorSelecionado(select),\n nivel: parseInt(input.value)});\n }\n }\n // Dominios de clerigo.\n _LeDominios();\n // Familiares.\n _LeFamiliar();\n _LeCompanheiroAnimal();\n gEntradas.niveis_negativos = parseInt(Dom('niveis-negativos').value) || 0;\n // pontos de vida e ferimentos.\n gEntradas.pontos_vida = parseInt(Dom('pontos-vida-dados').value) || 0;\n gEntradas.pontos_vida_temporarios = parseInt(Dom('pontos-vida-temporarios').value) || 0;\n gEntradas.ferimentos = Math.abs(parseInt(Dom('ferimentos').textContent)) || 0;\n gEntradas.ferimentos_nao_letais = Math.abs(parseInt(Dom('ferimentos-nao-letais').textContent)) || 0;\n // Experiencia.\n gEntradas.experiencia = parseInt(Dom('pontos-experiencia').value) || 0;\n // atributos\n var span_bonus_atributos = Dom('pontos-atributos-gastos');\n if (span_bonus_atributos.textContent.length > 0) {\n var array_bonus = span_bonus_atributos.textContent.split(',');\n for (var i = 0; i < array_bonus.length; ++i) {\n // Trim direita.\n var nome_atributo = AjustaString(array_bonus[i]);\n array_bonus[i] = tabelas_atributos_invertidos[nome_atributo];\n }\n gEntradas.bonus_atributos = array_bonus;\n } else {\n gEntradas.bonus_atributos = [];\n }\n var atributos = [\n 'forca', 'destreza', 'constituicao', 'inteligencia', 'sabedoria', 'carisma' ];\n for (var i = 0; i < atributos.length; ++i) {\n gEntradas[atributos[i]] =\n parseInt(Dom(atributos[i] + '-valor-base').value);\n }\n\n // Estilos de luta.\n gEntradas.estilos_luta = [];\n var div_estilos_luta = Dom('div-estilos-luta');\n for (var i = 0; i < div_estilos_luta.childNodes.length; ++i) {\n gEntradas.estilos_luta.push(\n _LeEntradaEstiloLuta(div_estilos_luta.childNodes[i]));\n }\n\n _LeHabilidadesEspeciais();\n\n _LeEquipamentos();\n\n _LeTalentos();\n\n // Pericias.\n _LePericias();\n\n // Feiticos.\n _LeFeiticos();\n\n gEntradas.notas = Dom('text-area-notas').value;\n}", "function iniciar(){\n for(let i = 1; i <= 31; i ++){\n let dezena = diaSorteService.montaDezena(i);\n vm.dezenas.push(dezena);\n }\n vm.selecaoAtual = -1;\n }", "function meu_callback(conteudo) {\r\r\n if (!(\"erro\" in conteudo)) {\r\r\n //Atualiza os campos com os valores.\r\r\n document.getElementById('logradouro').value=(conteudo.logradouro);\r\r\n document.getElementById('bairro').value=(conteudo.bairro);\r\r\n document.getElementById('cidade').value=(conteudo.localidade);\r\r\n document.getElementById('uf').value=(conteudo.uf);\r\r\n } //end if.\r\r\n else {\r\r\n //CEP não Encontrado.\r\r\n limpa_formulário_cep();\r\r\n alert(\"CEP não encontrado.\");\r\r\n }\r\r\n}", "function validarFormPerfil(){\n\tvar error = false;\n\tvar seccion = \"\";\n\t//SECCION DATOS PERSONALES\n\tif (error == false){\n\t\tif ($('#dat_Nombre').val().trim() == ''){\n\t\t\talerta('Ingrese su nombre', 'error');\n\t\t\tsetInputInvalid('#dat_Nombre');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_Apellido').val().trim() == ''){\n\t\t\talerta('Ingrese su apellido', 'error');\n\t\t\tsetInputInvalid('#dat_Apellido');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_CUIL').val().trim() == ''){\n\t\t\talerta('Ingrese su CUIL/CUIL', 'error');\n\t\t\tsetInputInvalid('#dat_CUIL');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_FechaNac').val().trim() == ''){\n\t\t\talerta('Ingrese su fecha de nacimiento', 'error');\n\t\t\tsetInputInvalid('#dat_FechaNac');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_Sexo').val().trim() == ''){\n\t\t\talerta('Seleccione su sexo', 'error');\n\t\t\tsetInputInvalid('#dat_Sexo');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_EstadoCivil').val().trim() == ''){\n\t\t\talerta('Seleccione su estado civil', 'error');\n\t\t\tsetInputInvalid('#dat_EstadoCivil');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_TipoDoc').val().trim() == ''){\n\t\t\talerta('Seleccione tipo de documento', 'error');\n\t\t\tsetInputInvalid('#dat_TipoDoc');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_Nacionalidad').val().trim() == ''){\n\t\t\talerta('Seleccione su nacionalidad', 'error');\n\t\t\tsetInputInvalid('#dat_Nacionalidad');\n\t\t\tmoverSeccion(\"#tabDatosPersonales\");\n\t\t\terror = true;\n\t\t}\n\t}\n\t\n\t//VALIDAR EL DOMICILIO \n\tif (error == false){\n\t\tif ($(\"#postal_code\").val() == \"\"){\n\t\t\talerta(\"Debe completar el código postal\", 'error');\n\t\t\tsetInputInvalid('#postal_code');\n\t\t\tmoverSeccion(\"#tabDomicilio\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($(\"#locality\").val() == \"\"){\n\t\t\talerta(\"Debe completar la localidad\", 'error');\n\t\t\tsetInputInvalid('#locality');\n\t\t\tmoverSeccion(\"#tabDomicilio\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif (($(\"#administrative_area_level_2\").val() == \"\") || ($(\"#administrative_area_level_1\").val() == \"\")){\n\t\t\talerta(\"Debe completar el partido y provincia\", 'error');\n\t\t\tsetInputInvalid('#administrative_area_level_2');\n\t\t\tsetInputInvalid('#administrative_area_level_1');\n\t\t\tmoverSeccion(\"#tabDomicilio\");\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif (($(\"#route\").val() == \"\") || ($(\"#street_number\").val() == \"\")){\n\t\t\talerta(\"Debe completar la calle y el número de su domicilio personal\", 'error');\n\t\t\tsetInputInvalid('#route');\n\t\t\tsetInputInvalid('#street_number');\n\t\t\tmoverSeccion(\"#tabDomicilio\");\n\t\t\terror = true;\n\t\t}\n\t}\n\n\n\t//FIN VALIDAR DOMICILIO \n\t// VALIDAR CONTACTO \n\tif (error == false){\n\t\tif ($('#dat_Email').val().trim() == ''){\n\t\t\talerta('Ingrese su email', 'error');\n\t\t\tmoverSeccion(\"#tabContacto\");\n\t\t\tsetInputInvalid('#dat_Email');\t\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif (!validarMail($('#dat_Email').val().trim())){\n\t\t\talerta('Formato de email invalido', 'error');\n\t\t\tvalidarTuMail('dat_Email');\n\t\t\tmoverSeccion(\"#tabContacto\");\n\t\t\tsetInputInvalid('#dat_Email');\t\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif ($('#dat_TelCelular').val().trim() == ''){\n\t\t\talerta('Ingrese su número de celular', 'error');\n\t\t\tmoverSeccion(\"#tabContacto\");\n\t\t\tsetInputInvalid('#dat_TelCelular');\t\n\t\t\treturn false;\n\t\t}\n\t\telse{\n\t\t\tif(!validarTelefono($('#dat_TelCelular').val())){\n\t\t\t\talerta('Formato de teléfono no válido', 'error');\n\t\t\t\tmoverSeccion(\"#tabContacto\");\n\t\t\t\tsetInputInvalid('#dat_TelCelular');\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\t// FIN VALIDACIÖN CONTACTO \n\n\t//VALIDAR LOS FAMILIARES \n\t//VALIDA LOS APELLIDOS DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"input[name^=field_apellido]\").each(\n\t\t\tfunction(){\t\t\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Ingrese el apellido de su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$(this).addClass('invalid');\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t}\n\t\t);\n\t}\n\t//VALIDA LOS NOMBRES DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"input[name^=field_nombre]\").each(\n\t\t\tfunction(){\t\t\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Ingrese el nombre de su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$(this).addClass('invalid');\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t);\n\t}\n\t\n\t//VALIDA LOS TIPOS DE DOCUMENTOS DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"select[name^=field_tipo]\").each(\n\t\t\tfunction(){\t\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Seleccione el tipo de documento de su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\t$(this).addClass('invalid');\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t//VALIDA LOS DOCUMENTOS DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"input[name^=field_documento]\").each(\n\t\t\tfunction(){\t\t\t\n\t\t\t\tif ((error == false) && ((this.value.length > 8) || (this.value.length < 7))){\n\t\t\t\t\talerta(\"El documento del familiar es incorrecto\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\t\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$(this).addClass('invalid');\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t\tif ((error == false) && ($.isNumeric(this.value) == false)){\n\t\t\t\t\talerta(\"El documento del familiar es incorrecto\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\tsetInputInvalid(\"#field_documento\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$(this).addClass('invalid');\t\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t);\n\t}\n\n\t//VALIDA EL PARENTESCO CON LOS FAMILIARES\n\tif (error == false){\n\t\t\n\t\t$(\"select[name^=field_parentesco]\").each(\n\t\t\tfunction(){\t\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Seleccione el parentesco con su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t//VALIDA EL SEXO DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"select[name^=field_sexo]\").each(\n\t\t\tfunction(){\t\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Seleccione sexo de su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}\n\n\t//VALIDAR LAS FECHAS DE NACIMIENTO DE LOS FAMILIARES\n\tif (error == false){\n\t\t$(\"input[name^=field_nacimiento]\").each(\n\t\t\tfunction(){\t\t\t\n\t\t\t\tif ((error == false) && (this.value == \"\")){\n\t\t\t\t\talerta(\"Ingrese la fecha de nacimiento de su familiar\", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\t\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t$(this).addClass('invalid');\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\n\t\t\t}\n\t\t);\n\t}\n\t//DISCAPACIDAD\n\tif (error == false){\n\t\t\n\t\t$(\"select[name^=field_discapacitado]\").each(\n\t\t\t\n\t\t\tfunction(){\t\n\t\t\t\tif ((error == false) && (this.value == '')){\n\t\t\t\t\talerta(\"Seleccione si tiene discapacidad su familiar \", 'error');\n\t\t\t\t\tthis.focus();\n\t\t\t\t\tmoverSeccion(\"#tabFamiliares\");\n\t\t\t\t\t$(this).parents('li').each(\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tif(!$(this).children('.collapsible-header').hasClass('active')){\n\t\t\t\t\t\t\t\t$(this).children('.collapsible-header').click();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\terror = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t);\n\t}\n\t//FIN VALIDACIÖN FAMILIARES\n\n\t//VALIDAR RELACION LABORAL \n\n\tif (error == false){\n\t\t//VALIDA LA RELACIÓN LABORAL \n\t\tif (($(\"#lab_rel\").val() == \"\")){\n\t\t\talerta(\"Complete la relación laboral de su cargo actual\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\tsetInputInvalid('#lab_rel');\t\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (error == false){\n\t\t//validar que seleccione organismo y estructura\n\t\tif (($(\"#lab_organismo\").val() == \"\") || ($(\"#lab_estructura_id\").val() == \"\")){\n\t\t\t$(\"#lab_estructura\").focus();\n\t\t\talerta(\"Complete el organismo y estructura donde posee cargo de revista\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\tsetInputInvalid('#lab_estructura');\n\t\t\treturn false;\n\t\t}\n\t}\n\tif (error == false){\n\t\tif (($(\"#lab_organismo2\").val() == \"\") || ($(\"#lab_estructura2_id\").val() == \"\")){\n\t\t\t$(\"#lab_estructura2\").focus();\n\t\t\talerta(\"Complete el organismo y estructura donde presta servicio\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\tsetInputInvalid('#lab_estructura2');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (error == false){\n\t\tif ($(\"#postal_code2\").val() == \"\"){\n\t\t\talerta(\"Debe completar el código postal\", 'error');\n\t\t\tsetInputInvalid('#postal_code2');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\terror = true;\n\t\t}\n\t}\n\t\n\tif (error == false){\n\t\tif ($(\"#locality2\").val() == \"\"){\n\t\t\talerta(\"Debe completar la localidad\", 'error');\n\t\t\tsetInputInvalid('#locality2');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\terror = true;\n\t\t}\n\t}\n\n\t\n\tif (error == false){\n\t\tif (($(\"#route2\").val() == \"\") || ($(\"#street_number2\").val() == \"\")){\n\t\t\talerta(\"Debe completar la calle y el número de su domicilio laboral\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\tsetInputInvalid('#route2');\n\t\t\tsetInputInvalid('#street_number2');\n\t\t\terror = true;\n\t\t}\n\t}\n\tif (error == false){\n\n\t\tif (($(\"#administrative_area_level_2\").val() == \"\") || ($(\"#administrative_area_level_1\").val() == \"\")){\n\t\t\talerta(\"Debe completar el partido y provincia\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\tsetInputInvalid('#administrative_area_level_2');\n\t\t\tsetInputInvalid('#administrative_area_level_1');\n\t\t\terror = true;\n\t\t}\n\t}\n\t\n\tif (error == false){\n\t\tif ($(\"#pais_dom\").val() == 0){\n\t\t\talerta(\"El domicilio seleccionado no es de Argentina\", 'error');\n\t\t\tmoverSeccion(\"#tabDomicilio\");\n\t\t\terror = true;\n\t\t}\n\t}\n\t\n\tif (error == false){\n\t\tif ($(\"#pais_dom2\").val() == 0){\n\t\t\talerta(\"El domicilio laboral seleccionado no es de Argentina\", 'error');\n\t\t\tmoverSeccion(\"#tabRelacionLaboral\");\n\t\t\terror = true;\n\t\t}\n\t}\n\t\n\tif(error == false ){\n\t\t$('#dat_NroDocumento').attr('disabled', false);\n\t\t$('#route').attr('disabled', false);\n\t\t$('#street_number').attr('disabled', false);\n\t\t$('#locality').attr('disabled', false);\n\t\t$('#administrative_area_level_2').attr('disabled', false);\n\t\t$('#administrative_area_level_1').attr('disabled', false);\n\t\t$('#route2').attr('disabled', false);\n\t\t$('#street_number2').attr('disabled', false);\n\t\t$('#locality2').attr('disabled', false);\n\t\t$('#administrative_area_level_22').attr('disabled', false);\n\t\t$('#administrative_area_level_12').attr('disabled', false);\n\t\t$('#postal_code').attr('disabled', false);\n\t\t$('#postal_code2').attr('disabled', false);\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n\t\n\t\n\t\n\t\n}", "function leerSiPulsadoresActivados() {\n /**\n * Simular pulsador en intro_cotas\n */\n let b_i_c = cogerVariable(\"./variables/intro_cotas.html\");\n if (b_i_c == 1) {\n //volver a poner el boton en false porque es un pulsador\n $(\"#boton_intro_cotas\").val(\"0\");\n\n $('#boton_cota').css(\"background-color\",\"white\");\n $('#boton_parada').css(\"background-color\",\"white\");\n $('#boton_cota').removeAttr(\"disabled\");\n $('#boton_parada').removeAttr(\"disabled\");\n\n $(\"#form_cotas\").submit();\n }\n /**\n * Simular pulsador en intro_paradas\n */\n let b_i_p = cogerVariable(\"./variables/intro_paradas.html\");\n if (b_i_p == 1) {\n //volver a poner el boton en false porque es un pulsador\n $(\"#boton_intro_paradas\").val(\"0\");\n\n $('#boton_cota').css(\"background-color\",\"white\");\n $('#boton_parada').css(\"background-color\",\"white\");\n $('#boton_cota').removeAttr(\"disabled\");\n $('#boton_parada').removeAttr(\"disabled\");\n\n $(\"#form_paradas\").submit();\n }\n\n let b_i_o = cogerVariable(\"./variables/origen.html\");\n if (b_i_o == 1) {\n //volver a poner el boton en false porque es un pulsador\n $(\"#boton_intro_origen\").val(\"0\");\n $(\"#origen_form\").submit();\n }\n\n let b_i_r = cogerVariable(\"./variables/reset.html\");\n if (b_i_r == 1) {\n //volver a poner el boton en false porque es un pulsador\n $(\"#boton_intro_reset\").val(\"0\");\n $(\"#reset_form\").submit();\n }\n\n}", "constructor(){\n this.hasSavedValues = false\n this.publicoAlvoSim= 0,\n this.publicoAlvoNao= 0,\n this.publicoAlvoALVA= 0,\n this.XER= 0,\n this.COP= 0,\n this.listaPrefixos= [],\n this.operacaoNaoVinculada= 0,\n this.operacaoVinculada= 0,\n this.operacaoVinculadaEmOutroNPJ= 0,\n this.acordoRegPortalSim= 0,\n this.acordoRegPortalNao= 0,\n //this.acordoRegPortalDuplicados= 0,\n this.totaisEstoque = 0,\n this.totaisFluxo = 0,\n this.estoqueNumber= 0,\n this.fluxoNumber= 0,\n this.duplicadoSimNao = 0,\n this.analisadoSimNao = 0\n }", "function evalRegistro(){\n msjClean();\n\n let id = $(\"#usuario\").val();\n let pass = $(\"#pass\").val();\n let pass2 = $(\"#repetir-pass\").val();\n let nombre = $(\"#nombre\").val();\n let departamento = $(\"#departamento\").val();\n let nivel = $(\"#nivel\").val();\n\n let errores = validateRegistro(id, pass, pass2, nombre, departamento);\n\n if(errores.length == 0){ loginManager.getLogin(id, '', 'checkExistLogin'); }\n else {\n let msjError = \"\";\n for(let i = 0; i < errores.length; i++){\n msjError += errores[i];\n }\n msjDanger('Registro', msjError);\n }\n}", "function asociarCursosCarrera() {\n let codigoCarrera = guardarCarreraAsociar();\n\n let carrera = buscarCarreraPorCodigo(codigoCarrera);\n\n let cursosSeleccionados = guardarCursosAsociar();\n\n\n\n let listaCarrera = [];\n\n let sCodigo = carrera[0];\n let sNombreCarrera = carrera[1];\n let sGradoAcademico = carrera[2];\n let nCreditos = carrera[3];\n let sVersion = carrera[4];\n let bAcreditacion = carrera[5]\n let bEstado = carrera[6];\n let cursosAsociados = cursosSeleccionados;\n let sedesAsociadas = carrera[8];\n\n if (cursosAsociados.length == 0) {\n swal({\n title: \"Asociación inválida\",\n text: \"No se le asignó ningun curso a la carrera.\",\n buttons: {\n confirm: \"Aceptar\",\n },\n });\n } else {\n listaCarrera.push(sCodigo, sNombreCarrera, sGradoAcademico, nCreditos, sVersion, bAcreditacion, bEstado, cursosAsociados, sedesAsociadas);\n actualizarCarrera(listaCarrera);\n\n swal({\n title: \"Asociación registrada\",\n text: \"Se le asignaron cursos a la carrera exitosamente.\",\n buttons: {\n confirm: \"Aceptar\",\n },\n });\n limpiarCheckbox();\n }\n}", "function logitudRespuestas(){\n\t\tdatalong=[];\n\t\tfor(var _i=0;_i<longitudEncuesta.length;_i++){\n\t\t\tdatalong.push(\"\");\n\t\t}\n\t\tAlloy.Globals.respuestasUsuario=datalong;\n\t}", "function pensiones_sobreviviente(accion) {\r\n\t$(\".div-progressbar\").css(\"display\", \"block\");\r\n\t\r\n\t//\tvalores\r\n\tvar NomDependencia = changeUrl($(\"#CodDependencia option:selected\").text());\r\n\tvar DescripCargo = changeUrl($(\"#CodCargo option:selected\").text());\r\n\tvar AniosServicio = $(\"#AniosServicio\").val();\r\n\tvar SueldoBase = parseFloat(setNumero($(\"#SueldoBase\").val()));\r\n\tvar MontoJubilacion = parseFloat(setNumero($(\"#MontoJubilacion\").val()));\r\n\tvar Coeficiente = parseFloat(setNumero($(\"#Coeficiente\").val()));\r\n\tvar TotalSueldo = parseFloat(setNumero($(\"#TotalSueldo\").val()));\r\n\tvar TotalPrimas = parseFloat(setNumero($(\"#TotalPrimas\").val()));\r\n\t\t\r\n\t//\tvalido\r\n\tvar error = \"\";\r\n\tif ($(\"#CodPersona\").val() == \"\") error = \"Debe seleccionar el Empleado a Procesar\";\r\n\telse if ($(\"#FlagCumple\").val() != \"S\") error = \"El Empleado NO cumple con los requisitos para optar a la Jubilaci&oacute;n\";\r\n\telse if (Coeficiente <= 0 || isNaN(Coeficiente)) error = \"Coeficiente Incorrecto\";\r\n\telse if (TotalSueldo <= 0 || isNaN(TotalSueldo)) error = \"Total de Sueldos Incorrecto\";\r\n\telse if (TotalPrimas <= 0 || isNaN(TotalPrimas)) error = \"Total de Primas de Antiguedad Incorrecto\";\r\n\telse if (MontoJubilacion <= 0 || isNaN(MontoJubilacion)) error = \"Monto de Jubilaci&oacute;n Incorrecto\";\r\n\tif (accion == \"nuevo\" || accion == \"modificar\") {\r\n\t\tif ($(\"#CodTipoNom\").val() == \"\") error = \"Debe seleccionar el Tipo de N&oacute;mina\";\r\n\t\telse if ($(\"#CodTipoTrabajador\").val() == \"\") error = \"Debe seleccionar el Tipo de Trabajador\";\r\n\t\telse if ($(\"#Fegreso\").val() == \"\") error = \"Debe ingresar la Fecha de Egreso\";\r\n\t\telse if (!valFecha($(\"#Fegreso\").val())) error = \"Formato de Fecha de Egreso Incorrecta\";\r\n\t\telse if ($(\"#CodMotivoCes\").val() == \"\") error = \"Debe seleccionar el Motivo del Cese\";\r\n\t}\r\n\t\r\n\t//\tdetalles\r\n\tif (error == \"\") {\r\n\t\t//\tantecedentes\r\n\t\tvar detalles_antecedentes = \"\";\r\n\t\tvar frm = document.getElementById(\"frm_antecedentes\");\r\n\t\tfor(var i=0; n=frm.elements[i]; i++) {\r\n\t\t\tif (n.name == \"Organismo\") detalles_antecedentes += changeUrl(n.value) + \";char:td;\";\r\n\t\t\telse if (n.name == \"FIngreso\") detalles_antecedentes += formatFechaAMD(n.value) + \";char:td;\";\r\n\t\t\telse if (n.name == \"FEgreso\") detalles_antecedentes += formatFechaAMD(n.value) + \";char:td;\";\r\n\t\t\telse if (n.name == \"Anios\") detalles_antecedentes += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"Meses\") detalles_antecedentes += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"Dias\") detalles_antecedentes += n.value + \";char:tr;\";\r\n\t\t}\r\n\t\tvar len = detalles_antecedentes.length; len-=9;\r\n\t\tdetalles_antecedentes = detalles_antecedentes.substr(0, len);\r\n\t\t\r\n\t\t//\tsueldos\r\n\t\tvar detalles_sueldos = \"\";\r\n\t\tvar frm = document.getElementById(\"frm_sueldos\");\r\n\t\tfor(var i=0; n=frm.elements[i]; i++) {\r\n\t\t\tif (n.name == \"Secuencia\") detalles_sueldos += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"Periodo\") detalles_sueldos += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"CodConcepto\") detalles_sueldos += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"Monto\") detalles_sueldos += setNumero(n.value) + \";char:tr;\";\r\n\t\t}\r\n\t\tvar len = detalles_sueldos.length; len-=9;\r\n\t\tdetalles_sueldos = detalles_sueldos.substr(0, len);\r\n\t\tif (detalles_sueldos == \"\") error = \"El Empleado debe tener por lo menos 24 cotizaciones en la Ficha de Relaci&oacute;n de Sueldos\";\r\n\t\t\r\n\t\t//\tbeneficiarios\r\n\t\tvar detalles_beneficiarios = \"\";\r\n\t\tvar frm = document.getElementById(\"frm_beneficiarios\");\r\n\t\tfor(var i=0; n=frm.elements[i]; i++) {\r\n\t\t\tif (n.name == \"NroDocumento\") detalles_beneficiarios += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"NombreCompleto\") detalles_beneficiarios += changeUrl(n.value) + \";char:td;\";\r\n\t\t\telse if (n.name == \"FlagPrincipal\") {\r\n\t\t\t\tif (n.checked) detalles_beneficiarios += \"S;char:td;\";\r\n\t\t\t\telse detalles_beneficiarios += \"N;char:td;\";\r\n\t\t\t}\r\n\t\t\telse if (n.name == \"Parentesco\") detalles_beneficiarios += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"FechaNacimiento\") detalles_beneficiarios += formatFechaAMD(n.value) + \";char:td;\";\r\n\t\t\telse if (n.name == \"Sexo\") detalles_beneficiarios += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"FlagIncapacitados\") detalles_beneficiarios += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"FlagEstudia\") detalles_beneficiarios += n.value + \";char:tr;\";\r\n\t\t}\r\n\t\tvar len = detalles_beneficiarios.length; len-=9;\r\n\t\tdetalles_beneficiarios = detalles_beneficiarios.substr(0, len);\r\n\t}\r\n\t\r\n\t//\tvalido errores\r\n\tif (error != \"\") {\r\n\t\tcajaModal(error, \"error\", 400);\r\n\t} else {\r\n\t\t//\tgeneral\r\n\t\tvar post_general = getForm(document.getElementById('frmgeneral'));\r\n\t\t\r\n\t\t//\tjubilacion\r\n\t\tvar post_jubilacion = getForm(document.getElementById('frmjubilacion'));\r\n\t\t\r\n\t\t//\tajax\r\n\t\t$.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: \"lib/form_ajax.php\",\r\n\t\t\tdata: \"modulo=pensiones_sobreviviente&accion=\"+accion+\"&NomDependencia=\"+NomDependencia+\"&DescripCargo=\"+DescripCargo+\"&AniosServicio=\"+AniosServicio+\"&detalles_antecedentes=\"+detalles_antecedentes+\"&detalles_sueldos=\"+detalles_sueldos+\"&detalles_beneficiarios=\"+detalles_beneficiarios+\"&Coeficiente=\"+Coeficiente+\"&TotalSueldo=\"+TotalSueldo+\"&TotalPrimas=\"+TotalPrimas+\"&MontoJubilacion=\"+MontoJubilacion+\"&SueldoBase=\"+SueldoBase+\"&\"+post_general+\"&\"+post_jubilacion,\r\n\t\t\tasync: false,\r\n\t\t\tsuccess: function(resp) {\r\n\t\t\t\tvar datos = resp.split(\"|\");\r\n\t\t\t\tif (datos[0].trim() != \"\") cajaModal(datos[0], \"error\", 400);\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (accion == \"nuevo\") {\r\n\t\t\t\t\t\tvar funct = \"document.getElementById('frmgeneral').submit();\";\r\n\t\t\t\t\t\tcajaModal(\"Proceso de Jubilaci&oacute;n <strong>Nro. \"+datos[1]+\"</strong> generado exitosamente\", \"exito\", 400, funct);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse document.getElementById('frmgeneral').submit();;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\treturn false;\r\n}", "function revisarCamposVaciosPrescripcion(){\n //Declaracion de atributos\n var categoria_farmacologica = $('#categoria_farmacologica').val();\n var medico = $('#select_medicamento').val();\n var dosis = $('#input_dosis').val();\n var unidad = $('#select_unidad').val();\n var via = $('#via').val();\n var frecuencia = $('#frecuencia').val();\n var horaAplicacion = $('#aplicacion').val();\n var fechaInicio = $('#fechaInicio').val();\n var duracion = $('#duracion').val();\n var fechaFin = $('#fechaFin').val();\n var validacion = false;\n\n //Condicion en caso de no seleccionar un medicamento o categoria farmacologica\n //if(categoria_farmacologica){\n\n //}\n if(medico === '0'){\n $('#borderMedicamento').css(\"border\",\"2px solid red\");\n }else if(dosis === ''){\n $('#borderDosis').css(\"border\",\"2px solid red\");\n }else if(unidad === '0'){\n $('#borderUnidad').css(\"border\",\"2px solid red\");\n }\n else if(via === '0'){\n $('#borderVia').css(\"border\",\"2px solid red\");\n }\n else if(frecuencia === '0'){\n $('#borderFrecuencia').css(\"border\",\"1px solid red\");\n }else if(horaAplicacion === ''){\n $('#borderAplicacion').css(\"border\",\"1px solid red\");\n }else if(fechaInicio === ''){\n $('#borderFechaInicio').css(\"border\",\"1px solid red\");\n }else if(duracion === ''){\n $('#borderDuracion').css(\"border\",\"1px solid red\");\n }else if(fechaFin === ''){\n $('#borderFechaFin').css(\"border\",\"1px solid red\");\n }else{\n $('#borderMedicamento').css(\"border\",\"1px solid white\");\n $('#borderDosis').css(\"border\",\"1px solid white\");\n $('#borderUnidad').css(\"border\",\"1px solid white\");\n $('#borderVia').css(\"border\",\"2px solid white\");\n $('#borderFrecuencia').css(\"border\",\"1px solid white\");\n $('#borderAplicacion').css(\"border\",\"1px solid white\");\n $('#borderFechaInicio').css(\"border\",\"1px solid white\");\n $('#borderDuracion').css(\"border\",\"1px solid white\");\n $('#borderFechaFin').css(\"border\",\"1px solid white\");\n validacion = true;\n }\n return validacion;\n\n}", "function desarrollo_carreras(form, accion) {\r\n\t//\tvalido\r\n\tvar error = \"\";\r\n\tif ($(\"#CodPersona\").val().trim() == \"\" || $(\"#CodOrganismo\").val() == \"\" || $(\"#CodDependencia\").val() == \"\" || $(\"#Secuencia\").val() == \"\" || $(\"#TipoEvaluacion\").val() == \"\" || $(\"#TipoEvaluacion\").val() == \"\" || $(\"#TipoEvaluacion\").val() == \"\" || $(\"#TipoEvaluacion\").val() == \"\" || $(\"#TipoEvaluacion\").val() == \"\") error = \"Debe ingresar los campos obligatorios\";\r\n\t\r\n\t//\tformulario\r\n\tvar DescripCargo = $(\"#DescripCargo option:selected\").text();\r\n\tvar post = \"\";\r\n\tfor(var i=0; n=form.elements[i]; i++) {\r\n\t\tif (n.type == \"hidden\" || n.type == \"text\" || n.type == \"password\" || n.type == \"select-one\" || n.type == \"textarea\") {\r\n\t\t\tpost += n.id + \"=\" + n.value.trim() + \"&\";\r\n\t\t} else {\r\n\t\t\tif (n.type == \"checkbox\") {\r\n\t\t\t\tif (n.checked) post += n.id + \"=S\" + \"&\"; else post += n.id + \"=N\" + \"&\";\r\n\t\t\t}\r\n\t\t\telse if (n.type == \"radio\" && n.checked) {\r\n\t\t\t\tpost += n.name + \"=\" + n.value.trim() + \"&\";\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t//\tcapacitacion tecnica\r\n\tvar detalles_captecnica = \"\";\r\n\tvar frm = document.getElementById(\"frm_captecnica\");\r\n\tfor(var i=0; n=frm.elements[i]; i++) {\r\n\t\tif (n.name == \"Descripcion\") detalles_captecnica += n.value + \";char:tr;\";\r\n\t}\r\n\tvar len = detalles_captecnica.length; len-=9;\r\n\tdetalles_captecnica = detalles_captecnica.substr(0, len);\r\n\t\r\n\t//\thabilidades\r\n\tvar detalles_habilidad = \"\";\r\n\tvar frm = document.getElementById(\"frm_habilidad\");\r\n\tfor(var i=0; n=frm.elements[i]; i++) {\r\n\t\tif (n.name == \"Tipo\") detalles_habilidad += n.value + \";char:td;\";\r\n\t\telse if (n.name == \"Descripcion\") detalles_habilidad += n.value + \";char:tr;\";\r\n\t}\r\n\tvar len = detalles_habilidad.length; len-=9;\r\n\tdetalles_habilidad = detalles_habilidad.substr(0, len);\r\n\t\r\n\t//\tevaluaciones\r\n\tvar detalles_evaluacion = \"\";\r\n\tvar frm = document.getElementById(\"frm_evaluacion\");\r\n\tfor(var i=0; n=frm.elements[i]; i++) {\r\n\t\tif (n.name == \"Descripcion\") detalles_evaluacion += n.value + \";char:tr;\";\r\n\t}\r\n\tvar len = detalles_evaluacion.length; len-=9;\r\n\tdetalles_evaluacion = detalles_evaluacion.substr(0, len);\r\n\t\r\n\t//\tmetas\r\n\tvar detalles_metas = \"\";\r\n\tvar frm = document.getElementById(\"frm_metas\");\r\n\tfor(var i=0; n=frm.elements[i]; i++) {\r\n\t\tif (n.name == \"Descripcion\") detalles_metas += n.value + \";char:tr;\";\r\n\t}\r\n\tvar len = detalles_metas.length; len-=9;\r\n\tdetalles_metas = detalles_metas.substr(0, len);\r\n\t\r\n\t//\tvalido errores\r\n\tif (error != \"\") {\r\n\t\tcajaModal(error, \"error\", 400);\r\n\t} else {\r\n\t\t//\tajax\r\n\t\t$.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: \"lib/form_ajax.php\",\r\n\t\t\tdata: \"modulo=desarrollo_carreras&accion=\"+accion+\"&detalles_captecnica=\"+detalles_captecnica+\"&detalles_habilidad=\"+detalles_habilidad+\"&detalles_evaluacion=\"+detalles_evaluacion+\"&detalles_metas=\"+detalles_metas+\"&\"+post,\r\n\t\t\tasync: false,\r\n\t\t\tsuccess: function(resp) {\r\n\t\t\t\tvar datos = resp.split(\"|\");\r\n\t\t\t\tif (datos[0].trim() != \"\") cajaModal(datos[0], \"error\", 400);\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (accion == \"nuevo\") {\r\n\t\t\t\t\t\tvar funct = \"document.getElementById('frmentrada').submit();\";\r\n\t\t\t\t\t\tcajaModal(\"Plan de Carreras <strong>Nro. \"+datos[1]+\"</strong> se cre&oacute; con &eacute;xito\", \"exito\", 400, funct);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if (accion == \"terminar\") {\r\n\t\t\t\t\t\t$(\"#imprimir\").val(\"si\")\r\n\t\t\t\t\t\tform.submit();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse form.submit();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\treturn false;\r\n}", "function controllaDati() {\r\n\t\tvar err=false;\r\n\t\tvar check=true;\r\n\t\tvar elem = document.getElementById(\"nomeRicetta\");\r\n\t\tif(elem.value.length == 0) {\r\n\t\t\t\tdocument.getElementById(\"nomeRicettaErr\").innerHTML= \"Inserisci il titolo\";\r\n\t\t\t\terr=true;\r\n\t\t\t\tcheck=false;\r\n\t\t} else {\r\n\t\t\t\tdocument.getElementById(\"nomeRicettaErr\").innerHTML= \"\";\r\n\t\t}\r\n\t\telem = document.getElementById(\"nomeAutore\");\r\n\t\tif( elem.value.length==0 ) {\r\n\t\t\t\tdocument.getElementById(\"nomeAutoreErr\").innerHTML= \"Inserisci il nome dell'autore\";\r\n\t\t\t\terr=true;\r\n\t\t\t\tcheck=false;\r\n\t\t} else {\r\n\t\t\t\tdocument.getElementById(\"nomeAutoreErr\").innerHTML= \"\";\r\n\t\t}\r\n\t\telem = document.getElementById(\"areaProcedimento\");\r\n\t\tif( elem.value.length==0 ) {\r\n\t\t\t\tdocument.getElementById(\"areaProcedimentoErr\").innerHTML= \"Inserisci il procedimento\";\r\n\t\t\t\terr=true;\r\n\t\t\t\tcheck=false;\r\n\t\t} else {\r\n\t\t\t\tdocument.getElementById(\"areaProcedimentoErr\").innerHTML= \"\";\r\n\t\t}\r\n\t\telem = document.getElementById(\"ingrediente0\");\r\n\t\tif( elem.value.length==0 ) {\r\n\t\t\t\tdocument.getElementById(\"ingrediente0Err\").innerHTML= \"<p>Inserisci almeno il primo ingrediente</p>\";\r\n\t\t\t\terr=true;\r\n\t\t\t\tcheck=false;\r\n\t\t} else {\r\n\t\t\t\tdocument.getElementById(\"ingrediente0Err\").innerHTML= \"\";\r\n\t\t}\r\n\t\telem = document.getElementById(\"quantita0\");\r\n\t\tif( isNaN(elem.value) || parseInt(elem.value)<0 || parseInt(elem.value) > 9999) {\r\n\t\t\t\tdocument.getElementById(\"quantitaN0Err\").innerHTML= \"La quantità deve essere numerica\";\r\n\t\t\t\terr=true;\r\n\t\t\t\tcheck=false;\r\n\t\t} else {\r\n\t\t\t\tdocument.getElementById(\"quantitaN0Err\").innerHTML= \"\";\r\n\t\t}\r\n\t\tif (check==false) {\r\n\t\t\treturn !err;\r\n\t\t}\r\n\t\t\r\n}", "function etapa8() {\n \n //verifica se o usuário já inseriu as formas de pagamento corretamente\n if(valorTotalFestaLocal == 0 && countPrimeiraVezAdd !== 0){\n //recebendo H3 e setando nela o texto com o nome do cliente\n var tituloDaEtapa = document.querySelector(\"#tituloDaEtapa\");\n tituloDaEtapa.textContent = \"8º Etapa - Horários do Evento\";\n\n document.getElementById('inserirHorarios').style.display = ''; //habilita a etapa 8\n document.getElementById('valoresEformaPagamento').style.display = 'none'; //desabilita a etapa 7\n \n msgTratamentoEtapa7.innerHTML = \"\";\n \n //DEFINI O TEXTO DE CONFIRMAÇÃO DO VALOR A PEGAR COM CONTRATANTE\n \n //apaga o paragrafo do valor a pegar com contratante , pois vai criar outro\n if(criouPegarContratante > 0){\n document.getElementById('pValorPegarContratante').remove();\n }\n criouPegarContratante++;\n \n //recebe o elemento html da ultima etapa (confirmação) e salva em uma variavel \n var confirmacaoInfValoresFinais = document.querySelector(\"#valoresFinalInf\");\n \n //cria os elementos <h6> para todos os valores\n var paragrafoValorPegarContratante = document.createElement(\"h5\");\n\n //define o atributo\n paragrafoValorPegarContratante.class = \"card-title\"; \n paragrafoValorPegarContratante.id = \"pValorPegarContratante\"; \n \n //define o texto\n paragrafoValorPegarContratante.textContent = \"Receber com contrante: R$\"+valorPegarContratante; \n \n //coloca os <p> criados dentro do elemento html da etapa de confirmação\n confirmacaoInfValoresFinais.appendChild(paragrafoValorPegarContratante);\n \n //DEFINI O VALOR DO INPUT DO PEGAR COM CONTRATANTE\n document.getElementById('valorReceberContratante').value = valorPegarContratante;\n \n }else{\n msgTratamentoEtapa7.textContent = \"Não foi possível seguir para a 8º Etapa! Para seguir o valor total adicionado deve ser igual ao Valor Total. =)\"\n }\n \n }", "function agregarPrescripcion(){\n var validar = revisarCamposVaciosPrescripcion();\n //var validar = true;\n if (validar === true){\n var categoria_farmacologica = $(\"#categoria_farmacologica\").text();\n var periodo = \"\";\n\n\n // tomar valor del formulario y asignar variable\n var idMedicamento = $('#select_medicamento').val();\n var medicamento = (idMedicamento != '1')? $('#select_medicamento option:selected').text() : $('#input_otro_medicamento').val();\n var interaccion_amarilla = $('#interaccion_amarilla option:selected').text();\n var dosis = $('#input_dosis').val();\n var unidad = $('#select_unidad').val();\n var interaccion_roja = $('#interaccion_roja option:selected').text();\n var arrayInteraccionAmarilla = interaccion_amarilla.split(',');\n var arrayInteraccionRoja = interaccion_roja.split(',');\n var via = $('#via option:selected').text();\n var frecuencia = $('#frecuencia').val();\n var horaAplicacion = $('#aplicacion').val();\n var fechaInicio = $('#fechaInicio').val();\n var duracion = $('#duracion').val();\n var fechaFin = $('#fechaFin').val();\n var observacion = $('#observacion').val();\n var periodo = \"Dias\";\n var categoria_safe = $('#categoria_safe').val();\n //Datos NPT\n //si su valor es indfinido, por defecto sera 0\n var aminoacido = ($('.aminoacido').val() != \"\" ) ? $('.aminoacido').val(): 0 ;\n var dextrosa = ($('.dextrosa').val() != \"\" ) ? $('.dextrosa').val(): 0 ;\n var lipidos_intravenosos = ($('.lipidos-intravenosos').val() != \"\" ) ? $('.lipidos-intravenosos').val(): 0 ;\n var agua_inyectable = ($('.agua-inyectable').val() != \"\" ) ? $('.agua-inyectable').val(): 0 ;\n var cloruro_sodio = ($('.cloruro-sodio').val() != \"\" ) ? $('.cloruro-sodio').val(): 0 ;\n var sulfato_magnesio = ($('.sulfato-magnesio').val() != \"\" ) ? $('.sulfato-magnesio').val(): 0 ;\n var cloruro_potasio = ($('.cloruro-potasio').val() != \"\" ) ? $('.cloruro-potasio').val(): 0 ;\n var fosfato_potasio = ($('.fosfato-potasio').val() != \"\" ) ? $('.fosfato-potasio').val(): 0 ;\n var gluconato_calcio = ($('.gluconato-calcio').val() != \"\" ) ? $('.gluconato-calcio').val(): 0 ;\n var albumina = ($('.albumina').val() != \"\" ) ? $('.albumina').val(): 0 ;\n var heparina = ($('.heparina').val() != \"\" ) ? $('.heparina').val(): 0 ;\n var insulina_humana = ($('.insulina-humana').val() != \"\" ) ? $('.insulina-humana').val(): 0 ;\n var zinc = ($('.zinc').val() != \"\" ) ? $('.zinc').val(): 0 ;\n var mvi_adulto = ($('.mvi-adulto').val() != \"\" ) ? $('.mvi-adulto').val(): 0 ;\n var oligoelementos = ($('.oligoelementos').val() != \"\" ) ? $('.oligoelementos').val(): 0 ;\n var vitamina = ($('.vitamina').val() != \"\" ) ? $('.vitamina').val(): 0 ;\n var total_npt = ($('.total-npt').val() != \"\" ) ? $('.total-npt').val(): 0 ;\n\n //Datos Antimicrobiano u Oncologico\n var diluyente = ($('.diluyente').val() != \"\" ) ? $('.diluyente').val(): 0 ;\n var vol_diluyente = ($('.vol_diluyente').val() != \"\" ) ? $('.vol_diluyente').val(): 0 ;\n\n //Oculatar botones para antibioticos\n $('#btn-form-npt').attr('hidden',true);\n $('#btn-form-onco-anti').attr('hidden',true);\n if(categoria_safe == \"npt\"){\n\n arrayAntibiotico = {\n aminoacido : aminoacido,\n dextrosa : dextrosa,\n lipidos_intravenosos : lipidos_intravenosos,\n agua_inyectable : agua_inyectable,\n cloruro_sodio : cloruro_sodio,\n sulfato_magnesio : sulfato_magnesio,\n cloruro_potasio : cloruro_potasio,\n fosfato_potasio : fosfato_potasio,\n gluconato_calcio : gluconato_calcio,\n albumina : albumina,\n heparina : heparina,\n insulina_humana : insulina_humana,\n zinc : zinc,\n mvi_adulto : mvi_adulto,\n oligoelementos : oligoelementos,\n vitamina : vitamina,\n total_npt : total_npt\n };\n\n }else if(categoria_safe == \"antimicrobiano\" || categoria_safe == \"oncologico\"){\n\n arrayAntibiotico = {\n diluyente: diluyente,\n vol_diluyente : vol_diluyente\n }\n\n }\n\n\n\n\n if(observacion === ''){\n observacion = \"Sin observaciones\";\n }\n if(categoria_farmacologica.toLowerCase() != 'antibiotico'){\n periodo = $(\"#periodo\").val();\n\n }\n //se hace condicion en caso de existir npt y asi tomar los datos del modal\n\n\n var arrayLongitud = arrayPrescripcion.length;\n // verifica si el arreglo esta vacio y determinar si el registro es directo o inicia la comparacion\n if(arrayLongitud > 0){\n var interaccionA;\n var interaccionB;\n var comparaMedicamento;\n var resultadoComparacion;\n var x;\n var longitudInteracciones;\n for(x = 0; x < arrayLongitud; x++){\n comparaMedicamento = arrayPrescripcion[x]['medicamento'];\n longitudInteracciones = arrayInteracciones[x]['arrayInteraccionAmarilla'].length;\n for (var y = 0; y < longitudInteracciones; y++){\n interaccionA = arrayInteracciones[x]['arrayInteraccionAmarilla'][y];\n if(arrayInteracciones[x]['arrayInteraccionAmarilla'][y] == idMedicamento ){\n $('#fila'+x).css(\"background-color\",\"rgb(252, 255, 124)\");// Amarillo para efectos grabes, solo requiere observación\n alert(arrayPrescripcion[x]['medicamento']+\" y \"+medicamento+\" pueden generar efectos adversos. Favor de modificar la prescripción o notificar al área de Farmacovigilancia\");\n\n //break;\n }\n }\n for (var y = 0; y < longitudInteracciones; y++){\n interaccionA = arrayInteracciones[x]['arrayInteraccionRoja'][y];\n if(arrayInteracciones[x]['arrayInteraccionRoja'][y] == idMedicamento ){\n $('#fila'+x).css(\"background-color\",\"rgb(255, 170, 170)\");//color rojo para efectos muy grabes\n alert(arrayPrescripcion[x]['medicamento']+\" y \"+medicamento+\" son medicamentos contraindicados\"+\n \". \"+\n \"Favor de modificar la prescripción o notificar al área de Farmacovigilancia\");\n //break;\n }\n }\n if(comparaMedicamento == medicamento){\n alert(\"El medicamento ya fue ingresado, indique uno nuevo, modifque el existente o eliminelo\");\n resultadoComparacion = 1;\n $('#fila'+x).css(\"border-bottom\",\"2px solid rgb(42, 70, 255)\");\n break;\n }else{\n resultadoComparacion = 0;\n }\n }\n if(resultadoComparacion == 0){\n for(x = 0; x < arrayLongitud; x++){\n $('#fila'+x).css(\"border-bottom\",\"1px solid #ddd\");\n }\n arrayInteracciones[arrayLongitud] = {\n idMedicamento: idMedicamento,\n arrayInteraccionAmarilla: arrayInteraccionAmarilla,\n arrayInteraccionRoja: arrayInteraccionRoja\n }\n arrayPrescripcion[arrayLongitud] = {\n idMedicamento:idMedicamento,\n medicamento:medicamento,\n categoria_farmacologica:categoria_farmacologica,\n dosis:dosis,\n unidad:unidad,\n via:via,\n frecuencia:frecuencia,\n horaAplicacion:horaAplicacion,\n fechaInicio:fechaInicio,\n duracion:duracion,\n periodo:periodo,\n fechaFin:fechaFin,\n observacion:observacion,\n safe:categoria_safe,\n antibiotico:arrayAntibiotico\n }\n agregarFilaPrescripcion(arrayPrescripcion);\n }\n }else{\n arrayInteracciones[arrayLongitud] = {\n idMedicamento: idMedicamento,\n arrayInteraccionAmarilla: arrayInteraccionAmarilla,\n arrayInteraccionRoja: arrayInteraccionRoja\n }\n arrayPrescripcion[arrayLongitud] = {\n idMedicamento:idMedicamento,\n medicamento:medicamento,\n categoria_farmacologica:categoria_farmacologica,\n dosis:dosis,\n unidad:unidad,\n via:via,\n frecuencia:frecuencia,\n horaAplicacion:horaAplicacion,\n fechaInicio:fechaInicio,\n duracion:duracion,\n periodo:periodo,\n fechaFin:fechaFin,\n observacion:observacion,\n safe:categoria_safe,\n antibiotico:arrayAntibiotico\n }\n agregarFilaPrescripcion(arrayPrescripcion);\n }\n }\n\n}", "function iniciar() {\n\tcrearEscena();\n\tcrearCamara();\n\tcrearLuces();\n\tcrearMundo();\n\tcrearCohete();\n\n\tmensaje = document.getElementById('mensaje');\t\n\tciclo();\n}", "function llenar_tabla_res() {\n //modal\n $(\"#dialog\").show();\n\n remover_datos_tabla();\n\n //checamos si hay fechas seleccionadas\n if ($(\"#fecha_inicio\").val() != \"\" && $(\"#fecha_termino\").val() != \"\") {\n //si el valor es el de por defecto\n if ($(\"#sect_Establecimientos\").val() == 0) {\n alert(\"¡seleccione Establecimiento(s)!\");\n }//fin if\n //si en valor es numerico y mayor al de por defecto\n else if ($(\"#sect_Establecimientos\").val() > 0) {\n //funcion para obtener por establecimiento\n obtener_datos_por_establecimiento()\n }//fin if\n //si el valor no es numerico y es igual a 'todos'\n else if ($(\"#sect_Establecimientos\").val() == \"todos\") {\n // alert(\"usted selecciono reporte de todos los establecimientos\");\n \n obtener_datos_todos_establecimiento();\n }//fin\n }//fin fechas\n else\n alert(\"seleccione fechas\");\n $(\"#dialog\").hide();\n}//fin", "materializar() {\n\t\t// Se pueden agregar comprobaciones para evitar que haya campos en blanco cuando se guarda.\n\t\tthis.guardarObjetoEnArchivo();\n\t}", "function realizarFormulario(codFormulario) {\r\n\tswitch (codFormulario) {\r\n\tcase 1: // se escogio el formulario de la ventriculografia\r\n\t\tif (verEstadoCheckbox('ventriculografia_activacion')) {\r\n\t\t\taparecerElemento('informe_ventriculografia');\r\n\t\t\tcarga_logica_informe_ventriculografia();\r\n\t\t} else {\r\n\t\t\treiniciar_Elementos_Formulario_Ventriculografia();\r\n\t\t\tdesaparecerElemento('informe_ventriculografia');\r\n\t\t}\r\n\t\t\r\n\t\t recopilarInformeVentriculografia(); \r\n\t\tbreak;\r\n\r\n\tcase 2: // se escogio el formulario del aortograma\r\n\t\tif (verEstadoCheckbox('aortograma_activacion')) {\r\n\t\t\taparecerElemento('informe_aortograma');\r\n\t\t\tcarga_logica_informe_aortograma();\r\n\r\n\t\t} else {\r\n\t\t\treiniciar_elementos_Formulario_Aortograma();\r\n\t\t\tdesaparecerElemento('informe_aortograma');\r\n\t\t}\r\n\t\trecopilarInformeAortograma(); \r\n\t\tbreak;\r\n\r\n\t\t\r\n\tcase 3:\r\n\t\t\r\n\t\tif (verEstadoCheckbox('bypass_activacion')) {\r\n\t\t\taparecerElemento('informe_bypass');\r\n\t\t\tcarga_logica_informe_bypass();\r\n\r\n\t\t} else {\r\n\t\t\treiniciar_elementos_Formulario_Bypass();\r\n\t\t\tdesaparecerElemento('informe_bypass');\r\n\t\t}\r\n\t\trecopilarInformeBypass(); \r\n\r\n\t\tbreak;\r\n\t\t\r\n\tcase 4: // se escogio el formulario de anatomia coronaria\r\n\t\t\r\n\t//\talert(verEstadoCheckbox('anatomia_coronaria_activacion'));\r\n\t\tif (verEstadoCheckbox('anatomia_coronaria_activacion')) {\r\n\t\t\taparecerElemento('informe_anatomia_coronaria');\r\n\t\t\r\n\t\t\t/*if (tipo_lesiones_arterias_general.length == 0 || arterias_bifurcadas.length == 0 ){\r\n\t\t\t\tconsultarlesionesbifurcaciones();\r\n\t\t\t}*/\r\n\t\t\t//else{\r\n\t\t\t\tcarga_logica_informe_anatomia_coronaria();\r\n\t\t\t\tseleccionAnalisisArteria();\r\n\t\t//\t}\r\n\t\t\r\n\t\t} else {\r\n\t\t\treiniciar_Elementos_Formulario_Anatomia_Coronaria();\r\n\t\t\tdesaparecerElemento('informe_anatomia_coronaria');\r\n\t\t}\r\n\t\trecopilarInformeAnatomiaCoronaria();\r\n\t\tbreak;\r\n\t}\r\n\t ActivacionDesactivacionEnvioInformes();\r\n\r\n\t if(tamanoinfotextbox(\"contenido_informe_ventriculografia\")==0){\r\n\t\t recopilarInformeVentriculografia(); \r\n\t }\r\n\t if(tamanoinfotextbox(\"contenido_informe_aortograma\")==0){\r\n\t\t\trecopilarInformeAortograma(); \r\n\t }\r\n\t \r\n\t if(tamanoinfotextbox(\"contenido_informe_bypass\")==0){\r\n\t\t\trecopilarInformeBypass(); \r\n\t }\r\n\t \r\n\t if(tamanoinfotextbox(\"contenido_informe_analisis_anatomia_coronaria\")==0){\r\n\t \trecopilarInformeAnatomiaCoronaria();\r\n\t }\r\n\t\r\n}", "function actualizarRegistos() {\n\n /* Obtiene el texto y lo modifica */\n var registros = document.getElementById(\"registros\").textContent;\n registros = contador_registros + \" de \" + agenda.length;\n document.getElementById(\"registros\").textContent = registros;\n\n /* Impide aumentar los registos si no existen en la Agenda */\n var max = document.getElementById(\"ver\");\n max.setAttribute(\"max\", agenda.length);\n\n /* Si nos movemos entre los diferentes registros, tambien cambiamos el valor del Imput 'ver' */\n ver.value = contador_registros;\n\n /* Al cargar la Agenda muestra por defecto e contacto indicado en la variable contador, en este caso la posicion 0 */\n document.getElementById(\"nombre\").value = agenda[contador_registros].nombre;\n document.getElementById(\"apellidos\").value = agenda[contador_registros].apellidos;\n document.getElementById(\"telefono\").value = agenda[contador_registros].telefono;\n document.getElementById(\"fecha\").value = agenda[contador_registros].fecha;\n}", "function initusuario() {\n q = {};\n q.ke = _ucode;\n q.lu = _ulcod;\n q.ti = _utval;\n nombre = $(\"#nombre\");\n allFields = $([]).add(nombre);\n tips = $(\".validateTips\");\n\n $('#dynamictable').dataTable({\n\t\"sPaginationType\": \"full_numbers\"\n });\n\n $(\"#crearusuario\").button().click(function() {\n\tq.id = 0;\n\t$(\"#dialog-form\").dialog(\"open\");\n });\n\n $(\"#dialog-form\").dialog({\n\tautoOpen: false, \n\theight: 580, \n\twidth: 900, \n\tmodal: true,\n\tbuttons: {\n\t \"Guardar\": function() {\n\t\tvar bValid = true;\n\t\tallFields.removeClass(\"ui-state-error\");\n\t\tbValid = bValid && checkLength(nombre, \"nombre\", 3, 16);\n\t\tif (\"seleccione\" == $(\"#idcli\").val()){\n\t\t bValid = false;\n\t\t updateTips('Seleccione el cliente al cual pertenece el usuario.');\n\t\t}\n\t\tif (bValid) {\n\t\t USUARIO.savedata();\n\t\t//$(this).dialog(\"close\");\n\t\t}\n\t },\n\t \"Cancelar\": function() {\n\t\tUTIL.clearForm('formcreate1');\n\t\tUTIL.clearForm('formcreate2');\n\t\t$(this).dialog(\"close\");\n\t }\n\t},\n\tclose: function() {\n\t UTIL.clearForm('formcreate1');\n\t UTIL.clearForm('formcreate2');\n\t updateTips('');\n\t}\n });\n \n $(\"#dialog-permission\").dialog({\n\tautoOpen: false, \n\theight: 530, \n\twidth: 230, \n\tmodal: true,\n\tbuttons: {\n\t \"Guardar\": function() {\n\t\tvar bValid = true;\n\t\tallFields.removeClass(\"ui-state-error\");\n\n\t\tif (bValid) {\n\t\t USUARIO.savepermission();\n\t\t//$(this).dialog(\"close\");\n\t\t}\n\t },\n\t \"Cancelar\": function() {\n\t\tUTIL.clearForm('formpermission');\n\t\t$(this).dialog(\"close\");\n\t }\n\t},\n\tclose: function() {\n\t UTIL.clearForm('formpermission');\n\t updateTips('');\n\t}\n });\n \n USUARIO.getcustomer();\n}", "function inicializarCampos() {\r\n document.querySelector('#tipo').value = vehiculos[0].tipo;\r\n document.querySelector('#marca').value = vehiculos[0].marca;\r\n document.querySelector('#modelo').value = vehiculos[0].modelo;\r\n document.querySelector('#patente').value = vehiculos[0].patente;\r\n document.querySelector('#anio').value = vehiculos[0].anio;\r\n document.querySelector('#precio').value = vehiculos[0].precio;\r\n if (document.querySelector('#tipo').value == \"auto\") {\r\n document.querySelector('#capacidadBaul').value = vehiculos[0].capacidadBaul;\r\n }\r\n else if (document.querySelector('#tipo').value == \"camioneta\") {\r\n document.querySelector('#capacidadCarga').value = vehiculos[0].capacidadCarga;\r\n }\r\n}", "function crearDatosInspector(){\n\tprobar_conexion_red();\n\tvar codigo=$('#txt_codigo').val();\n\tvar nombre_usuario=$('#txt_nombre_usuario').val();\n\tvar cedula=$('#txt_cedula').val();\n\tvar nombre=$('#txt_nombre').val();\n\tvar apellido=$('#txt_apellido').val();\n\tvar correo=$('#txt_correo').val();\n\tvar rol=$('#txt_rol').val();\n\t\n\tif (cedula!=\"\" && nombre!=\"\" && apellido!=\"\" && correo!=\"\" && rol!=\"\"){\n\t\tif (codigo != \"Procesando, espere por favor...\") {\n\t\t\t$.post('http://www.montajesyprocesos.com/inspeccion/servidor/php/crear_inspector.php',{\n\t\t\t\tCaso:'Crear',\n\t\t\t\tId: codigo,\n\t\t\t\tUsuario: nombre_usuario,\n\t\t\t\tCedula: cedula,\n\t\t\t\tNombre: nombre,\n\t\t\t\tApellido: apellido,\n\t\t\t\tCorreo: correo,\n\t\t\t\tRol: rol\n\t\t\t},function(e){\t\t\t\t\t\t\n window.localStorage.setItem('codigo_inspector', codigo); //se crea la variable persistente del codigo del inspector\n crearTablaUsuario(codigo,nombre_usuario,cedula,nombre,apellido,correo,rol);\n addItemUsuario(codigo,nombre_usuario,cedula,nombre,apellido,correo,rol); //agregamos el usario a la BD\n crearTablaConsecutivoAscensores();\n addItemConsecutivoAscensores(codigo, 0);\n crearTablaConsecutivoEscalerasAndenes();\n addItemConsecutivoEscalerasAndenes(codigo, 0);\n crearTablaConsecutivoPuertas();\n addItemConsecutivoPuertas(codigo, 0);\n\t\t\t});\t\n\t\t} else {\n if (numeroUsuarios > 0) {\n if(navigator.notification && navigator.notification.alert){\n navigator.notification.alert(\"Error = No tiene conexión a la base de datos. Contacte al administrador del sistema!\", null, \"Montajes & Procesos M.P SAS\", \"Ok :)\");\n location.href='../websites/crear_inspector.html';\n }else{\n alert(\"Error = No tiene conexión a la base de datos. Contacte al administrador del sistema! :)\");\n location.href='../websites/crear_inspector.html';\n } \n }\n\t\t}\t\n\t}\n}", "function BuscarFicha() {\n // var idusuario = IdUsuarioActualizacion;\n //Validar \n\tvar institucion = $(\"#cmbInstitucion\").val(); // document.getElementById(\"cmbInstitucion\").value;\n\tvar proyecto = $(\"#cmbProyecto\").val(); // document.getElementById(\"cmbProyecto\").value;\n\tvar rutnino = $(\"#txtRutnino\").val(); // document.getElementById(\"txtRutnino\").value;\n\tvar codnino = $(\"#txtCodnino\").val();\n\tvar nombnino = $(\"#txtNombnino\").val(); // document.getElementById(\"txtNombnino\").value;\n var apellidonino = $(\"#txtApellidopatnino\").val(); // document.getElementById(\"txtApellidopatnino\").value;\n var contadorFiltro = 5;\n\tif ($(\"#cmbInstitucion\").val() == \"0\") {\n institucion = 0;\n contadorFiltro--;\n\t}\n\tif ($(\"#cmbProyecto\").val() == \"0\") {\n proyecto = 0;\n contadorFiltro--;\n\t}\n\tif ($(\"#txtCodnino\").val() == \"\") {\n codnino = 0;\n contadorFiltro--;\n }\n if ($(\"#txtNombnino\").val() == \"\") {\n contadorFiltro--;\n }\n if ($(\"#txtApellidopatnino\").val() == \"\") {\n contadorFiltro--;\n }\n\n\tvar sexonino = \"\";\n\tif ($(\"#optFemenino\").is(':checked')) {\n\t\tsexonino = \"F\";\n\t}\n\tif ($(\"#optMasculino\").is(':checked')) {\n\t\tsexonino = \"M\";\n\t}\n /** Exigir al menos dos criterios de búsqueda **/\n if (contadorFiltro < 2) { \n $(\"#lblMensaje\").text(\"Ingrese al menos dos de los valores anteriores\");\n $('.modal').modal('hide');\n $(\"#divMsjError\").show();\n }\n\telse {\n\t\t$(\"#divMsjError\").hide();\n //Realizar la consulta a nivel de Base de datos\n\t\tListarNinosConsulta(institucion, proyecto, rutnino, codnino, nombnino, apellidonino, sexonino);\n }\n \n}", "function llenar_modal_cuestionarios(fecha, cuestionario) {\n //deshabilitamos los textbox\n $(\"#cuadro_resultado_total_si\").prop(\"disabled\", true);\n $(\"#cuadro_resultado_total_no\").prop(\"disabled\", true);\n $(\"#cuadro_resultado_total_na\").prop(\"disabled\", true);\n $(\"#cuadro_resultado_total_porcentual\").prop(\"disabled\", true);\n\n $(\"#cuadro_resultado_total_si\").val(\"\");\n $(\"#cuadro_resultado_total_no\").val(\"\");\n $(\"#cuadro_resultado_total_na\").val(\"\");\n $(\"#cuadro_resultado_total_porcentual\").val(\"\");\n //mostramos la modal\n $(\"#respuestas\").show();\n //llama al cuestionario por fecha\n var cuestionario_dat = conexion_reultados_ckl_parcial(fecha, cuestionario);\n //creamos el contenedor de datos\n var datos_a_tabla = \"\";\n //damos evento a btn cerrar\n $(\"#btn_cancelar_respuestas\").on('click', function () {\n $(\"#respuestas\").hide();\n $(\".datos_cuestionario_m\").remove();\n });\n var total,indice_zona=1,sum_si=0,sum_no=0,sum_na=0;\n var nombre= nombres_cuestionarios_por_folio(cuestionario)\n\n datos_a_tabla = \" <tr class='datos_cuestionario_m'><th style='width:50px' >#</th><th class='nombre' >\" + nombre + \"</th><th style='width:50px'>SI</th><th style='width:50px'>NO</th><th style='width:50px'>NA</th> </tr>\";\n //recorremos el cuestionario\n $.each(cuestionario_dat, function (index, item) {\n var si=\"\", no=\"\", na=\"\";\n if (item.respuesta==1)\n si = item.respuesta,sum_si++;\n else if (item.respuesta==0)\n no = item.respuesta,sum_no++;\n else if (item.respuesta==2)\n na = \"N/A\",sum_na++;\n\n datos_a_tabla += \"<tr class='datos_cuestionario_m dato'><td style='width:50px' >\" + item.criterio_cuestion + \"</td> <td class='nombre'>\" + item.datos_pregunta + \"</td><td>\" + si + \"</td><td>\" + no + \"</td><td>\" + na + \"</td></tr>\";\n indice_zona++;\n });\n $(\"#tablaRespuestas\").append(datos_a_tabla);\n\n $(\"#cuadro_resultado_total_si\").val(parseInt ( sum_si));\n $(\"#cuadro_resultado_total_no\").val(parseInt (sum_no));\n $(\"#cuadro_resultado_total_na\").val(parseInt (sum_na));\n total = sum_si / (sum_si + sum_no);\n total = total * 1000;\n total = Math.round(total);\n $(\"#cuadro_resultado_total_porcentual\").val(total/10);\n\n}//fin", "function nuevoEsquemaComision(cuadroOcultar, cuadroMostrar){\n\t\tcuadros(\"#cuadro1\", \"#cuadro2\");\n\t\tlimpiarFormularioRegistrar(\"#form_esquema_comision_registrar\");\n\t\t$(\"#id_vendedor_registrar\").focus();\n\t}", "function CarregamentoInicial() {\n _CarregaTabelaNormalizacaoStrings();\n _CarregaTraducoes();\n _CarregaTitulos();\n CarregaPersonagens();\n _CarregaDominios();\n _CarregaFamiliares();\n _CarregaRacas();\n _CarregaTemplates();\n _CarregaBotoesVisao();\n _CarregaAtributos();\n _CarregaTalentos();\n\n // Monta a tabela de armas e cria as opcoes dinamicamente.\n _CarregaTabelaArmasArmaduras();\n _CarregaPericias();\n _CarregaFeiticos();\n\n _CarregaHandlers();\n\n // Inicia o objeto de personagem.\n IniciaPersonagem();\n\n if (document.URL.indexOf('testes.html') != -1) {\n return;\n }\n var indice_igual = document.URL.indexOf('=');\n if (indice_igual != -1) {\n // carrega pelos parametros. Caso contrario, usara a entrada padrao.\n var json_entradas = decodeURIComponent(document.URL.slice(indice_igual + 1));\n gEntradas = JSON.parse(json_entradas);\n CorrigePericias();\n }\n AtualizaGeralSemLerEntradas();\n}", "function validarCampos(objeto){\n var formulario = objeto.form;\n emailRegex = /^[-\\w.%+]{1,64}@(?:[A-Z0-9-]{1,63}\\.){1,125}[A-Z]{2,63}$/i; //Comprueba el formato del correo electronico\n passRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[$@$!%*?&.,])[A-Za-z\\d$@$!%*?&.,]{8,15}/; //comprueba el formato de la password\n\n //comprueba cada campo y si no cumple los requisitos muestra un aviso\n for (var i=0; i<formulario.elements.length; i++){\n\tif (formulario.elements[i].id==\"nombre\"){\n if(formulario.elements[i].id==\"nombre\" && formulario.elements[i].value==\"\"){\n document.getElementById(\"labelnombre\").innerHTML=\" *Esta vacio\";\n document.getElementById(\"labelnombre\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else {\n document.getElementById(\"labelnombre\").innerHTML=\" *Correcto\";\n document.getElementById(\"labelnombre\").style.color=\"GREEN\";\n }\n\t}else if(formulario.elements[i].id==\"apellidos\"){\n if(formulario.elements[i].id==\"apellidos\" && formulario.elements[i].value==\"\"){\n document.getElementById(\"labelapellidos\").innerHTML=\" *Esta vacio\";\n document.getElementById(\"labelapellidos\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else {\n document.getElementById(\"labelapellidos\").innerHTML=\" *Correcto\";\n document.getElementById(\"labelapellidos\").style.color=\"GREEN\";\n }\n }else if(formulario.elements[i].id==\"correo\"){\n if(formulario.elements[i].id==\"correo\" && formulario.elements[i].value==\"\"){\n document.getElementById(\"labelcorreo\").innerHTML=\" *Esta vacio\";\n document.getElementById(\"labelcorreo\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else if(emailRegex.test(document.getElementById(\"correo\").value)) {\n document.getElementById(\"labelcorreo\").innerHTML=\" *Correo valido\";\n document.getElementById(\"labelcorreo\").style.color=\"GREEN\";\n }else if(emailRegex.test(document.getElementById(\"correo\").value)==false){\n document.getElementById(\"labelcorreo\").innerHTML=\" *Correo no valido\";\n document.getElementById(\"labelcorreo\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }\n }else if(formulario.elements[i].id==\"password\"){\n if(formulario.elements[i].id==\"password\" && formulario.elements[i].value==\"\"){\n document.getElementById(\"labelpassword\").innerHTML=\" *Esta vacio\";\n document.getElementById(\"labelpassword\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else if(passRegex.test(document.getElementById(\"password\").value)){\n document.getElementById(\"labelpassword\").innerHTML=\" *Correcto\";\n document.getElementById(\"labelpassword\").style.color=\"GREEN\";\n }else if(passRegex.test(document.getElementById(\"password\").value)==false){\n document.getElementById(\"labelpassword\").innerHTML=\" *No es segura debe tener al menos un caracter especial, un digito, una minuscula y una mayuscula\";\n document.getElementById(\"labelpassword\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else if(passRegex.test(document.getElementById(\"password\").value)){\n document.getElementById(\"labelpassword\").innerHTML=\" *Correcto\";\n document.getElementById(\"labelpassword\").style.color=\"GREEN\";\n }\n }else if(formulario.elements[i].id==\"password2\"){\n if(formulario.elements[i].id==\"password2\" && formulario.elements[i].value==\"\"){\n document.getElementById(\"labelpassword2\").innerHTML=\" *Esta vacio\";\n document.getElementById(\"labelpassword2\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else if(document.getElementById(\"password2\").value != document.getElementById(\"password\").value){\n document.getElementById(\"labelpassword2\").innerHTML=\" *Las contraseñas son diferentes\";\n document.getElementById(\"labelpassword2\").style.color=\"RED\";\n formulario.elements[i].focus();\n return false;\n }else {\n document.getElementById(\"labelpassword2\").innerHTML=\" *Correcto\";\n document.getElementById(\"labelpassword2\").style.color=\"GREEN\";\n formulario.elements[i].focus();\n }\n }\n \n }\n return true;\t // Si sale de la función es que todos los campos obligatorios son validos.\n}", "function dadosCadastro() {\n\tif (localStorage.cont) {\n localStorage.cont = Number(localStorage.cont)+1;\n } else {\n localStorage.cont = 1;\n }\n var nomeCompleto=document.getElementById(\"nomeCompleto\").value;\n var cpf=document.getElementById(\"cpf\").value;\n var rg=document.getElementById(\"rg\").value;\n var orgaoEmissor=document.getElementById(\"orgaoEmissor\").value;\n\n //formatação da data\n var dtNascimento=document.getElementById(\"dtNascimento\").value;\n var data = new Date(dtNascimento);\n\t var dataFormatada = data.toLocaleDateString('pt-br', {timeZone: 'UTC'});\n\t//final formatação\n\n var rua=document.getElementById(\"rua\").value;\n var numeroDaCasa=document.getElementById(\"numeroDaCasa\").value;\n \tvar bairro=document.getElementById(\"bairro\").value;\n \tvar cidade=document.getElementById(\"cidade\").value;\n \tvar estado=document.getElementById(\"estado\").value;\n \tvar cep=document.getElementById(\"cep\").value;\n \tvar telefone=document.getElementById(\"telefone\").value;\n \tvar celular=document.getElementById(\"celular\").value;\n \tvar celular2=document.getElementById(\"celular2\").value;\n \tvar materiaParaEnsinar=Number(document.getElementById(\"materiaParaEnsinar\").value);\n \tvar totalMaterias=[\"matematica\",\"portugues\",\"geo\"];\n \tvar anosEnsinando=document.getElementById(\"anosEnsinando\").value;\n \tvar cadastroEmail=document.getElementById(\"cadastroEmail\").value;\n var cadastroSenha=document.getElementById(\"cadastroSenha\").value;\n localStorage.setItem(\"nomeCompleto_\"+localStorage.cont,nomeCompleto);\n\t localStorage.setItem(\"cpf_\"+localStorage.cont,cpf);\n localStorage.setItem(\"rg_\"+localStorage.cont,rg);\n\t localStorage.setItem(\"orgaoEmissor_\"+localStorage.cont,orgaoEmissor);\n\t localStorage.setItem(\"dtNascimento_\"+localStorage.cont,dtNascimento);\n\t localStorage.setItem(\"rua_\"+localStorage.cont,rua);\n\t localStorage.setItem(\"numeroDaCasa_\"+localStorage.cont,numeroDaCasa);\n\t localStorage.setItem(\"bairro_\"+localStorage.cont,bairro);\n\t localStorage.setItem(\"cidade_\"+localStorage.cont,cidade);\n\t localStorage.setItem(\"estado_\"+localStorage.cont,estado);\n\t localStorage.setItem(\"cep_\"+localStorage.cont,cep);\n\t localStorage.setItem(\"telefone_\"+localStorage.cont,telefone);\n\t localStorage.setItem(\"celular_\"+localStorage.cont,celular);\n\t localStorage.setItem(\"celular2_\"+localStorage.cont,celular2); \n \tlocalStorage.setItem(\"materiaParaEnsinar_\"+localStorage.cont,totalMaterias[0]);\n\t localStorage.setItem(\"anosEnsinando_\"+localStorage.cont,anosEnsinando);\n\t localStorage.setItem(\"email_\"+localStorage.cont,cadastroEmail);\n\t localStorage.setItem(\"senha_\"+localStorage.cont,cadastroSenha);\n}", "valiDate() {\n console.log('validando...');\n this.dateMessage = null;\n this.dateDanger = null;\n if (this.nuevoRegistro === true || this.registros == null) {\n this.registroAnterior = null;\n }\n if (this.registro && this.registroAnterior != null) {\n const fecha1 = moment__WEBPACK_IMPORTED_MODULE_5__(this.isRegistered);\n const fecha2 = moment__WEBPACK_IMPORTED_MODULE_5__(this.isSelect);\n const Diferencia = fecha2.diff(fecha1, 'months');\n if (Diferencia === 1) {\n console.log('todo correcto');\n this.dateMessage = null;\n this.dateDanger = null;\n }\n else if (Diferencia === 2) {\n this.launchAlert('error', 'Error de Registros', 'La Fecha ingresada se ha saltado un mes en el ingreso, por favor Verifiquela!', null, true, null, null, 'top-end', 'row', true);\n // alert('No se han realizado registros del mes Anterior');\n this.dateDanger = false;\n this.dateMessage = 'No se han realizado registros del mes Anterior';\n }\n else if (Diferencia < 1) {\n this.launchAlert('error', 'Error de Registros', 'Ya se ha registrado esta fecha!!', null, true, null, true, 'center', null, null);\n this.dateMessage = 'ya se ha registrado esta fecha';\n this.dateDanger = true;\n }\n else if (Diferencia > 2) {\n // alert('No se han realizado registros desde hace ' + (Diferencia - 1) + ' Meses');\n this.launchAlert('error', 'Error de Registros', 'No se han Realizado registros desde hace ' + (Diferencia - 1) + ' mes(es)', null, true, null, true, 'center', null, false);\n this.dateDanger = false;\n this.dateMessage = 'No se han realizado registros desde hace ' + (Diferencia - 1) + ' Meses';\n }\n }\n }", "function limpiarErrorCampo(index, campo) {\n // JQuery referencia al campo\n let $jqCampo = $(campo);\n let $container = $jqCampo.closest(\"div.form-group\");\n let $jqMensajes = $container.find(\"div.validate-errors ul\");\n let $jqIcono = $container.children(\"span.glyphicon\");\n\n $container[0].className = \"form-group\";\n if ($jqIcono.length > 0) {\n $jqIcono[0].className = \" glyphicon form-control-feedback \";\n $container[0].className += \" has-feedback\";\n }\n\n $jqMensajes.html(\"\");\n\n }", "function establecerTextos(){\n //Empezamos a establecer el idioma en los elementos de la aplicación\n \n //Para el titulo de la pagina\n document.getElementById(\"titulo-pagina\").innerHTML = MyLove.titulo;\n\n //Para los elementos del login\n document.getElementById(\"lab-acceso-nombre\").innerHTML = MyLove.acceso_usuario;\n document.getElementById(\"lab-acceso-contra\").innerHTML = MyLove.acceso_contra;\n document.getElementById(\"btn-submit-inicio-sesion\").value = MyLove.acceso_boton;\n document.getElementById(\"lab-acceso-olvido\").innerHTML = MyLove.acceso_olvpass;\n document.getElementById(\"lab-acceso-activar\").innerHTML = MyLove.acceso_activacion;\n document.getElementById(\"btn-registrarse\").innerHTML = MyLove.acceso_registrar;\n \n //Para los elementos del registro\n document.getElementById(\"registrar-usando-opcion-1\").innerHTML = MyLove.registro_info_1;\n document.getElementById(\"registrar-usando-opcion-2\").innerHTML = MyLove.registro_opcion_correo;\n document.getElementById(\"registrar-usando-opcion-3\").innerHTML = MyLove.registro_opcion_telefono;\n\n document.getElementById(\"lab-registro-correo\").innerHTML = MyLove.registro_correo;\n document.getElementById(\"pais-primero\").value = MyLove.registro_pais_1;\n document.getElementById(\"pais-primero\").innerHTML = MyLove.registro_pais_1;\n document.getElementById(\"lab-registro-telefono\").innerHTML = MyLove.registro_telefono;\n document.getElementById(\"lab-registro-contra\").innerHTML = MyLove.registro_contra;\n document.getElementById(\"lab-registro-terminos\").innerHTML = MyLove.registro_aceptar_terminos;\n document.getElementById(\"lab-registro-leer-terminos\").innerHTML = MyLove.registro_leer_terminos;\n document.getElementById(\"btn-submit-registro\").value = MyLove.registro_boton;\n document.getElementById(\"btn-salir-registro\").innerHTML = MyLove.registro_volver_atras;\n\n document.getElementById(\"activacion_info_1_1\").innerHTML = MyLove.activacion_1_info_1;\n document.getElementById(\"activacion_info_2_1\").innerHTML = MyLove.activacion_1_info_2; \n $(\"#activacion_codigo\").prop(\"placeholder\", \"\" + MyLove.activacion_1_lab_codigo);\n document.getElementById(\"btn-submit-enviar-codigo-1\").value = MyLove.activacion_1_boton_enviar;\n document.getElementById(\"btn-activacion-reenviar-codigo-1\").innerHTML = MyLove.activacion_1_boton_reenviar;\n document.getElementById(\"btn-activacion-cancelar-activacion-1\").innerHTML = MyLove.activacion_1_boton_cancelar;\n\n document.getElementById(\"activacion_info_1_2\").innerHTML = MyLove.activacion_2_info_1;\n document.getElementById(\"activacion_info_2_2\").innerHTML = MyLove.activacion_2_info_2;\n document.getElementById(\"activacion_info_3_2\").innerHTML = MyLove.activacion_2_info_3;\n $(\"#activacion_forma_que_uso\").prop(\"placeholder\", \"\" + MyLove.activacion_2_lab_forma_activacion);\n document.getElementById(\"btn-submit-enviar-forma-activacion-2\").value = MyLove.activacion_2_enviar_forma;\n document.getElementById(\"btn-activacion-cancelar-activacion-2\").innerHTML = MyLove.activacion_2_candelar;\n\n \n\n}//Fin de la fincion establecerTextos", "function validarpago(){\n\n var pago = document.getElementById(\"textmontopago\").value;\n var rutcli = document.getElementById(\"txtrutcliente\").value;\n var mes = document.getElementById(\"mes\").value;\n var ani = document.getElementById(\"anio\").value;\n var cont = 0;\n\n if(isNaN(pago)){\n document.getElementById(\"textmontopago\").style.background=\"#EDF98E\";\n document.getElementById(\"textmontopago\").style.borderColor=\"#000000\";\n } else if(pago==null || pago.length==0 || pago.length >=9){\n \n document.getElementById(\"textmontopago\").style.background=\"#EDF98E\";\n document.getElementById(\"textmontopago\").style.borderColor=\"#000000\";\n }else {\n document.getElementById(\"textmontopago\").style.background=\"#ffffff\";\n document.getElementById(\"textmontopago\").style.borderColor=\"#9A9797\";\n cont++;\n }\n\n\n if (rutcli==null || rutcli.length==0 || rutcli.length >10){\n document.getElementById(\"txtrutcliente\").style.background=\"#EDF98E\";\n document.getElementById(\"txtrutcliente\").style.borderColor=\"#000000\";\n }else {\n document.getElementById(\"txtrutcliente\").style.background=\"#ffffff\";\n document.getElementById(\"txtrutcliente\").style.borderColor=\"#9A9797\";\n cont++;\n }\n\n if(mes == 0){\n document.getElementById(\"mes\").style.background=\"#EDF98E\";\n document.getElementById(\"mes\").style.borderColor=\"#000000\";\n }else {\n document.getElementById(\"mes\").style.background=\"#ffffff\";\n document.getElementById(\"mes\").style.borderColor=\"#9A9797\";\n cont++;\n }\n\n if(ani == 0){\n document.getElementById(\"anio\").style.background=\"#EDF98E\";\n document.getElementById(\"anio\").style.borderColor=\"#000000\";\n }else {\n document.getElementById(\"anio\").style.background=\"#ffffff\";\n document.getElementById(\"anio\").style.borderColor=\"#9A9797\";\n cont++;\n }\n\n if(cont==4){\n alert(\"Sus Datos Son validos\");\n } \n}", "function acceder(){\r\n limpiarMensajesError()//Limpio todos los mensajes de error cada vez que corro la funcion\r\n let nombreUsuario = document.querySelector(\"#txtUsuario\").value ;\r\n let clave = document.querySelector(\"#txtClave\").value;\r\n let acceso = comprobarAcceso (nombreUsuario, clave);\r\n let perfil = \"\"; //variable para capturar perfil del usuario ingresado\r\n let i = 0;\r\n while(i < usuarios.length){\r\n const element = usuarios[i].nombreUsuario.toLowerCase();\r\n if(element === nombreUsuario.toLowerCase()){\r\n perfil = usuarios[i].perfil;\r\n usuarioLoggeado = usuarios[i].nombreUsuario;\r\n }\r\n i++\r\n }\r\n //Cuando acceso es true \r\n if(acceso){\r\n if(perfil === \"alumno\"){\r\n alumnoIngreso();\r\n }else if(perfil === \"docente\"){\r\n docenteIngreso();\r\n }\r\n }\r\n}", "async function setDependencia() {\n //VALIDATE\n $('#cardEditorForm').validate().destroy();\n $('#cardEditorForm').validate({\n ignore: \"\",\n errorClass: \"error\",\n errorElement: 'label',\n errorPlacement: function (error, element) {\n if (element.parent('.input-group').length) {\n error.insertAfter(element.parent());\n } else {\n error.insertAfter(element);\n }\n },\n onError: function () {\n $('.input-group.error-class').find('.help-block.form-error').each(function () {\n $(this).closest('.form-group').addClass('error').append($(this));\n });\n },\n success: function (element) {\n $(element).parent('.form-group').removeClass('error');\n $(element).remove();\n },\n rules: {}\n });\n //EMPRESAS\n const empresa = await getEmpresaAJAX();\n if (empresa.length > 0) {\n $('#cardEditorEmpresa').html('');\n for (var i = 0; i < empresa.length; i++) {\n var registro = empresa[i];\n $('#cardListaPrateleiraPesquisaEmpresa').append('<option value=\"' + registro['id'] + '\">' + registro['nomeFantasia'] + '</option>');\n $('#cardEditorEmpresa').append('<option value=\"' + registro['id'] + '\">' + registro['nomeFantasia'] + '</option>');\n }\n }\n}", "function actualizar_esquema_comision(){\n\t\tenviarFormulario(\"#form_esquema_comision_actualizar\", 'EsquemaComision/actualizar_esquema_comision', '#cuadro4');\n\t}", "generaValidacionControles(){\n let validacion = 0;\n validacion = aplicaValidacion(\"txtNombre\",this.state.objetoCliente.nombre,false);\n validacion = aplicaValidacion(\"txtApPaterno\",this.state.objetoCliente.appaterno,false);\n validacion = aplicaValidacion(\"txtApMaterno\",this.state.objetoCliente.apmaterno,false);\n validacion = aplicaValidacion(\"txtRFC\",this.state.objetoCliente.rfc,false);\n return validacion;\n }" ]
[ "0.66760385", "0.64826405", "0.63222337", "0.60635513", "0.60360783", "0.60349274", "0.60219884", "0.6016846", "0.6011117", "0.60095567", "0.58734006", "0.58419883", "0.58302593", "0.580676", "0.5778656", "0.5744", "0.57327557", "0.57308525", "0.5728416", "0.57138455", "0.56999093", "0.56856894", "0.5678396", "0.5671191", "0.56619257", "0.56440294", "0.5633088", "0.5628408", "0.56257176", "0.5625491", "0.56177336", "0.56142896", "0.5611874", "0.5610764", "0.56105655", "0.5604457", "0.56026155", "0.55993074", "0.55889577", "0.558291", "0.5571463", "0.55602133", "0.55583256", "0.5556971", "0.5548983", "0.55482125", "0.55459625", "0.55436844", "0.5534078", "0.5531918", "0.5527042", "0.5526884", "0.5514025", "0.5510173", "0.5509453", "0.5504603", "0.55037206", "0.549706", "0.54951125", "0.5488802", "0.54854876", "0.54620993", "0.5457212", "0.5457212", "0.5455486", "0.5453949", "0.54504186", "0.54438496", "0.5439456", "0.5435508", "0.5427484", "0.5424787", "0.54213715", "0.5420077", "0.5409794", "0.540843", "0.54065126", "0.5406235", "0.5402975", "0.53997165", "0.5397378", "0.53948116", "0.53937477", "0.5390432", "0.5382105", "0.5380421", "0.53779966", "0.5377896", "0.53748703", "0.5373233", "0.53691894", "0.5361441", "0.53612846", "0.53496224", "0.5341055", "0.5340208", "0.53391594", "0.53385425", "0.5329569", "0.5326907" ]
0.6801298
0
/ HOT ZONE InicializarHotZone() reinicia los valores de la tormenta al comienzo del juego para evitar errores cuando haya partidas consecutivas.
function InicializarHotZone() { faseActual = 0; cargando = true; idCharCarga = 0; idCharDescarga = 0; charsPorFase = Math.round(largoTexto / 4); charsUltimaFase = largoTexto - (charsPorFase * 3); tLoop = (dificultad.fases[faseActual].carga * 1000) / charsPorFase; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addQuietZone() {\n let quietZone = QuietZone.All;\n let w = this.mNoOfModules + 2 * quietZone;\n let h = this.mNoOfModules + 2 * quietZone;\n let tempValue1 = [];\n let tempValue2 = [];\n for (let i = 0; i < w; i++) {\n // tslint:disable-next-line:no-any\n tempValue1.push([0]);\n // tslint:disable-next-line:no-any\n tempValue2.push([0]);\n for (let j = 0; j < h; j++) {\n tempValue1[i][j] = new ModuleValue();\n tempValue2[i][j] = new ModuleValue();\n }\n }\n // Top quietzone.\n for (let i = 0; i < h; i++) {\n tempValue1[0][i] = new ModuleValue();\n tempValue1[0][i].isBlack = false;\n tempValue1[0][i].isFilled = false;\n tempValue1[0][i].isPdp = false;\n tempValue2[0][i] = new ModuleValue();\n tempValue2[0][i].isBlack = false;\n tempValue2[0][i].isFilled = false;\n tempValue2[0][i].isPdp = false;\n }\n for (let i = quietZone; i < w - quietZone; i++) {\n // Left quietzone.\n tempValue1[i][0] = new ModuleValue();\n tempValue1[i][0].isBlack = false;\n tempValue1[i][0].isFilled = false;\n tempValue1[i][0].isPdp = false;\n tempValue2[i][0] = new ModuleValue();\n tempValue2[i][0].isBlack = false;\n tempValue2[i][0].isFilled = false;\n tempValue2[i][0].isPdp = false;\n for (let j = quietZone; j < h - quietZone; j++) {\n tempValue1[i][j] = this.mModuleValue[i - quietZone][j - quietZone];\n tempValue2[i][j] = this.mDataAllocationValues[i - quietZone][j - quietZone];\n }\n // Right quietzone.\n tempValue1[i][h - quietZone] = new ModuleValue();\n tempValue1[i][h - quietZone].isBlack = false;\n tempValue1[i][h - quietZone].isFilled = false;\n tempValue1[i][h - quietZone].isPdp = false;\n tempValue2[i][h - quietZone] = new ModuleValue();\n tempValue2[i][h - quietZone].isBlack = false;\n tempValue2[i][h - quietZone].isFilled = false;\n tempValue2[i][h - quietZone].isPdp = false;\n }\n //Bottom quietzone.\n for (let i = 0; i < h; i++) {\n tempValue1[w - quietZone][i] = new ModuleValue();\n tempValue1[w - quietZone][i].isBlack = false;\n tempValue1[w - quietZone][i].isFilled = false;\n tempValue1[w - quietZone][i].isPdp = false;\n tempValue2[w - quietZone][i] = new ModuleValue();\n tempValue2[w - quietZone][i].isBlack = false;\n tempValue2[w - quietZone][i].isFilled = false;\n tempValue2[w - quietZone][i].isPdp = false;\n }\n this.mModuleValue = tempValue1;\n this.mDataAllocationValues = tempValue2;\n }", "setInitialValues(data) {\n //publicoAlvo\n if(data.publicoAlvoSim === 1){\n this.publicoAlvoSim = 1\n this.hasSavedValues = true\n } else {\n this.publicoAlvoSim= 0\n }\n if(data.publicoAlvoNao === 1){\n this.publicoAlvoNao= 1\n this.hasSavedValues = true\n } else {\n this.publicoAlvoNao= 0\n }\n if(data.publicoAlvoALVA === 1){\n this.publicoAlvoALVA= 1\n this.hasSavedValues = true\n } else {\n this.publicoAlvoALVA= 0\n } \n //sistemaResponsavel\n if(data.XER === 1){\n this.XER= 1\n this.hasSavedValues = true\n } else {\n this.XER= 0\n }\n if(data.COP === 1){\n this.COP= 1\n this.hasSavedValues = true\n } else {\n this.COP= 0\n }\n //listaPrefixosGecor\n for(let e of data.listaPrefixos){\n this.listaPrefixos.push(e)\n this.hasSavedValues = true\n }\n //situacaoVinculoDaOperacao\n if(data.operacaoNaoVinculada === 1){\n this.operacaoNaoVinculada= 1\n this.hasSavedValues = true\n } else {\n this.operacaoNaoVinculada= 0\n }\n if(data.operacaoVinculada === 1){\n this.operacaoVinculada= 1\n this.hasSavedValues = true\n } else {\n this.operacaoVinculada= 0\n }\n if(data.operacaoVinculadaEmOutroNPJ === 1){\n this.operacaoVinculadaEmOutroNPJ= 1\n this.hasSavedValues = true\n } else {\n this.operacaoVinculadaEmOutroNPJ= 0\n }\n //acordoRegistradoNoPortal\n if(data.acordoRegPortalSim === 1){\n this.acordoRegPortalSim= 1\n this.hasSavedValues = true\n } else {\n this.acordoRegPortalSim= 0\n }\n if(data.acordoRegPortalNao === 1){\n this.acordoRegPortalNao= 1\n this.hasSavedValues = true\n } else {\n this.acordoRegPortalNao= 0\n }\n // if(data.acordoRegPortalDuplicados === 1){\n // this.acordoRegPortalDuplicados= 1\n // this.hasSavedValues = true\n // } else {\n // this.acordoRegPortalDuplicados= 0\n // }\n if(data.duplicadoSimNao===1){\n this.duplicadoSimNao =1 \n this.hasSavedValues = true\n }\n if(data.analisadoSimNao===1){\n this.analisadoSimNao = 1\n this.hasSavedValues = true\n }\n //totalRegistrosComFiltro\n this.totaisEstoque = data.est\n this.totaisFluxo = data.flu\n //quantidade de registros a gerar\n if(data.estoqueNumber > 0){\n this.estoqueNumber = data.estoqueNumber\n this.hasSavedValues = true\n }\n if(data.fluxoNumber > 0){\n this.fluxoNumber = data.fluxoNumber\n this.hasSavedValues = true\n }\n }", "function nuevoAnuncio_validarCampos_inmueble() {\n\tif (!vacio($(\"#crearAnuncio_titulo\").val(), $(\"#crearAnuncio_titulo\").attr(\"placeholder\"))) {\n\t\tif (!vacio(($(\"#crearAnuncio_categoria\").val() != -1 ? $(\"#crearAnuncio_categoria\").val() : \"\"), $(\"#crearAnuncio_categoria option[value='-1']\").text())) {\n\t\t\tif (!vacio(($(\"#crearAnuncio_tipo\").val() != -1 ? $(\"#crearAnuncio_tipo\").val() : \"\"), $(\"#crearAnuncio_tipo option[value='-1']\").text())) {\n\t\t\t\tif (!vacio(($(\"#crearAnuncio_transaccion\").val() != -1 ? $(\"#crearAnuncio_transaccion\").val() : \"\"), $(\"#crearAnuncio_transaccion option[value='-1']\").text())) {\n\t\t\t\t\tif (!vacio($(\"#crearAnuncio_precio\").val(), $(\"#crearAnuncio_precio\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t_precio = $(\"#crearAnuncio_precio\").val().replace(/\\$/g, \"\").replace(/,/g, \"\");\n\t\t\t\t\t\t$(\"#crearAnuncio_precio\").val(_precio);\n\t\t\t\t\t\tif (flotante($(\"#crearAnuncio_precio\").val(), $(\"#crearAnuncio_precio\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\tif (!vacio($(\"#crearAnuncio_calleNumero\").val(), $(\"#crearAnuncio_calleNumero\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\tif (!vacio(($(\"#crearAnuncio_estado\").val() != -1 ? $(\"#crearAnuncio_estado\").val() : \"\"), $(\"#crearAnuncio_estado option[value='-1']\").text())) {\n\t\t\t\t\t\t\t\t\tif (!vacio(($(\"#crearAnuncio_ciudad\").val() != -1 ? $(\"#crearAnuncio_ciudad\").val() : \"\"), $(\"#crearAnuncio_ciudad option[value='-1']\").text())) {\n\t\t\t\t\t\t\t\t\t\tif (!vacio(($(\"#crearAnuncio_colonia\").val() != -1 ? $(\"#crearAnuncio_colonia\").val() : \"\"), $(\"#crearAnuncio_colonia option[value='-1']\").text())) {\n\t\t\t\t\t\t\t\t\t\t\tif ($(\"#_crearAnuncioLatitud\").val() != \"\") {\n\t\t\t\t\t\t\t\t\t\t\t\tif (!vacio($(\"#crearAnuncio_descripcion\").val(), $(\"#crearAnuncio_descripcion\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (!vacio(($(\"#crearAnuncio_usuario\").val() != -1 ? $(\"#crearAnuncio_usuario\").val() : \"\"), $(\"#crearAnuncio_usuario option[value='-1']\").text())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar continuar = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (parseInt($(\"#idInmueble2\").val()) == -1) {//nuevo\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ($(\"#imagenesTemporales .bloqueImagen\").length == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"Ingrese al menos una imágen para el inmueble\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($(\"input[name='radioImagenPrincipal']:checked\").length == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"Selecciona una imágen como la principal\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {//modificar\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif($(\"input[name='radioImagenPrincipal']:checked\").length == 0) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(\"Selecciona una imágen como la principal\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_dimesionTotal\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!flotante($(\"#crearAnuncio_dimesionTotal\").val(), $(\"#crearAnuncio_dimesionTotal\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_dimensionConstruida\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!flotante($(\"#crearAnuncio_dimensionConstruida\").val(), $(\"#crearAnuncio_dimensionConstruida\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_cuotaMantenimiento\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t_precio = $(\"#crearAnuncio_cuotaMantenimiento\").val().replace(/\\$/g, \"\").replace(/,/g, \"\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$(\"#crearAnuncio_cuotaMantenimiento\").val(_precio);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!flotante($(\"#crearAnuncio_cuotaMantenimiento\").val(), $(\"#crearAnuncio_cuotaMantenimiento\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_elevador\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!entero($(\"#crearAnuncio_elevador\").val(), $(\"#crearAnuncio_elevador\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_estacionamientoVisitas\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!entero($(\"#crearAnuncio_estacionamientoVisitas\").val(), $(\"#crearAnuncio_estacionamientoVisitas\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_numeroOficinas\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!entero($(\"#crearAnuncio_numeroOficinas\").val(), $(\"#crearAnuncio_numeroOficinas\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_metrosFrente\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!flotante($(\"#crearAnuncio_metrosFrente\").val(), $(\"#crearAnuncio_metrosFrente\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_metrosFondo\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!flotante($(\"#crearAnuncio_metrosFondo\").val(), $(\"#crearAnuncio_metrosFondo\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_cajonesEstacionamiento\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!entero($(\"#crearAnuncio_cajonesEstacionamiento\").val(), $(\"#crearAnuncio_cajonesEstacionamiento\").attr(\"placeholder\"))) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t//solo para casas y departamentos: wcs y recamaras son obligatorios\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif ((parseInt($(\"#crearAnuncio_tipo\").val()) == 1) || (parseInt($(\"#crearAnuncio_tipo\").val()) == 2)) {//casa o departamento\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!vacio(($(\"#crearAnuncio_wcs\").val() != -1 ? $(\"#crearAnuncio_wcs\").val() : \"\"), $(\"#crearAnuncio_wcs option[value='-1']\").text())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (vacio(($(\"#crearAnuncio_recamaras\").val() != -1 ? $(\"#crearAnuncio_recamaras\").val() : \"\"), $(\"#crearAnuncio_recamaras option[value='-1']\").text()))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (!isVacio($(\"#crearAnuncio_codigo\").val())) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: \"lib_php/updInmueble.php\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdataType: \"json\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdata: {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid: $(\"#idInmueble2\").val(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalidarCodigo: 1,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tusuario: $(\"#crearAnuncio_usuario\").val(),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcodigo: $(\"#crearAnuncio_codigo\").val()\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}).always(function(respuesta_json){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnuevoAnuncio_save();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\talert(respuesta_json.mensaje);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (continuar) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tnuevoAnuncio_save();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\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\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t\t\t\talert(\"Agrege la posición del inmueble en el mapa.\");\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function iniciar(){\n for(let i = 1; i <= 31; i ++){\n let dezena = diaSorteService.montaDezena(i);\n vm.dezenas.push(dezena);\n }\n vm.selecaoAtual = -1;\n }", "function mantenerPosicion()\n{\n if(vaca.cargaOK)\n {\n for(var i=0; i < cantidadVacas; i++)\n {\n var x = aleatorio(0, 25);\n var y = aleatorio(0, 25);\n var x = x * 30;\n var y = y * 20;\n xVaca[i] = x;\n yVaca[i] = y;\n }\n if(cerdo.cargaOK)\n {\n for(var i=0; i < cantidadCerdos; i++)\n {\n var x = aleatorio(0, 25);\n var y = aleatorio(0, 25);\n var x = x * 30;\n var y = y * 20;\n xCerdo[i] = x;\n yCerdo[i] = y;\n }\n }\n if(pollo.cargaOK)\n {\n for(var i=0; i < cantidadPollos; i++)\n {\n var x = aleatorio(0, 25);\n var y = aleatorio(0, 25);\n var x = x * 30;\n var y = y * 20;\n xPollo[i] = x;\n yPollo[i] = y;\n }\n }\n }\n dibujar();\n}", "constructor(){\n this.hasSavedValues = false\n this.publicoAlvoSim= 0,\n this.publicoAlvoNao= 0,\n this.publicoAlvoALVA= 0,\n this.XER= 0,\n this.COP= 0,\n this.listaPrefixos= [],\n this.operacaoNaoVinculada= 0,\n this.operacaoVinculada= 0,\n this.operacaoVinculadaEmOutroNPJ= 0,\n this.acordoRegPortalSim= 0,\n this.acordoRegPortalNao= 0,\n //this.acordoRegPortalDuplicados= 0,\n this.totaisEstoque = 0,\n this.totaisFluxo = 0,\n this.estoqueNumber= 0,\n this.fluxoNumber= 0,\n this.duplicadoSimNao = 0,\n this.analisadoSimNao = 0\n }", "function crearCampoJuego(ancho, alto, minasTotales) {\n var campoActual = hacerTablaJuego(ancho, alto);\n var contadorMinas = 0;\n\n while (contadorMinas < minasTotales) {\n var minaDinamica = aleatorio(0, 1);\n var posicionDinamica = [aleatorio(0, ancho - 1), aleatorio(0, alto - 1)];\n\n if (!campoActual[posicionDinamica[0]][posicionDinamica[1]]) {\n contadorMinas += (minaDinamica) ? 1 : 0;\n if (minaDinamica) {\n campoActual[posicionDinamica[0]][posicionDinamica[1]] = 'BOOM!!';\n\n for (var posicionX = (posicionDinamica[0] - 1); posicionX <= (posicionDinamica[0] + 1); posicionX++) {\n for (var posicionY = (posicionDinamica[1] - 1); posicionY <= (posicionDinamica[1] + 1); posicionY++) {\n //Busque porque al generar todo aleatorio para algunos numeros me creaba un error y encontre que para poder realizar acciones debemos decirle a la computadora vuelve a ejecutar el evento\n try { //Las sentencias que serán ejecutadas\n campoActual[posicionX][posicionY] += (campoActual[posicionX][posicionY] != 'BOOM!!') ? 1 : '';\n } catch (e) {} //Sentencias que son ejecutadas si una excepción es lanzada en el bloque try.\n };\n };\n };\n };\n };\n return campoActual;\n}", "limpiar() {\n this.nuevoRegistro = null;\n this.completado = false;\n this.registroAnterior = null;\n this.limites = [], [];\n this.consumo_correcto = null;\n this.lectura_actual = null;\n this.initMedidor();\n this.initRegistro();\n this.encontrado = null;\n this.isRegistered = null;\n }", "setZonePCEs() {\r\n\t\t\t\r\n for (var record = 0; record < this._config_arr.length; record++) {\r\n var route = this._config_arr[record][0];\r\n if (this._config_arr[record][1] == 0) {\r\n var masterDirection = this._config_arr[record][2];\r\n var masterMovement = this._config_arr[record][3];\r\n var volume = PROJECT.getMasterPCETable().getDirectionByIndex(masterDirection).getMovementByIndex(masterMovement);\r\n }\r\n else if (this._config_arr[record][1] == -1) {\r\n 1 == 1;\r\n }\r\n else {\r\n var subjectZone = this._config_arr[record][1];\r\n var subjectDirection = this._config_arr[record][2];\r\n var subjectMovement = this._config_arr[record][3];\r\n this.getZoneByIndex(subjectZone - 1).addPCEtoZone(volume, subjectDirection, subjectMovement);\r\n //this.getZoneByIndex(subjectZone - 1).setEnabled(true);\r\n }\r\n }\r\n if (!this._constructing) {\r\n updateInfoSwitcherData();\r\n }\r\n }", "function inicializarEmpleados() {\n\tmonitor = new Monitor(\"Pedro\", \"123A\", \"678\", \"Zumba - Yoga\", 10, 20);\n\taniadirEmpleadoTabla(monitor);\n\tvectorEmpleados.push(monitor);\n\n\tfisio = new Fisioterapeuta(\"Marina\", \"123B\", \"692\", 8);\n\taniadirEmpleadoTabla(fisio);\n\tvectorEmpleados.push(fisio);\n}", "function calcularTolerancia(dataHoras) {\n var toleranciaAMais = toMinutes(jornadaCertPonto + ':00') + tolerancia;\n var toleranciaAMenos = toMinutes(jornadaCertPonto + ':00') - tolerancia;\n for (i in dataHoras) {\n var minRealizadas = toMinutes(dataHoras[i].horas);\n if (minRealizadas >= toleranciaAMenos && minRealizadas <= toleranciaAMais) {\n dataHoras[i].horas = jornadaCertPonto + ':00';\n }\n }\n return dataHoras;\n}", "function nuevoAnuncio_encontrarUbicacion() {\n\tif (!vacio($(\"#crearAnuncio_calleNumero\").val(), $(\"#crearAnuncio_calleNumero\").attr(\"placeholder\"))) {\n\t\tif (!vacio(($(\"#crearAnuncio_estado\").val() != -1 ? $(\"#crearAnuncio_estado\").val() : \"\"), $(\"#crearAnuncio_estado option[value='-1']\").text())) {\n\t\t\tif (!vacio(($(\"#crearAnuncio_ciudad\").val() != -1 ? $(\"#crearAnuncio_ciudad\").val() : \"\"), $(\"#crearAnuncio_ciudad option[value='-1']\").text())) {\n\t\t\t\tdireCalle = \"\";\n\t\t\t\tdireNumero = \"\";\n\t\t\t\tpartes = $(\"#crearAnuncio_calleNumero\").val().replace(/#/g, \"\");\n\t\t\t\tpartes = partes.replace(/-/g, \" \");\n\t\t\t\tpartes = partes.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (var x = 0; x < partes.length; x++) {\n\t\t\t\t\tif (isEntero(partes[x])) {\n\t\t\t\t\t\tdireNumero = partes[x];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tdireCalle += (x != 0 ? \" \" : \"\") + partes[x];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdireccionBusqueda = (direNumero != \"\" ? direNumero+\"+\" : \"\")+direCalle+\"+\"+$(\"#crearAnuncio_ciudad option:selected\").text()+\",+\"+$(\"#crearAnuncio_estado option:selected\").text();\n\t\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: \"http://maps.googleapis.com/maps/api/geocode/json?address=\"+direccionBusqueda+\"&sensor=true_or_false\",\n\t\t\t\t\tdataType: \"json\"\n\t\t\t\t}).always(function(respuesta_json){\n\t\t\t\t\tif (respuesta_json.results.length > 0) {\n\t\t\t\t\t\tvar obtenerPosicion = respuesta_json.results[0].geometry.location;\n\t\t\t\t\t\ttempPosicion = new google.maps.LatLng(obtenerPosicion.lat, obtenerPosicion.lng);\n\t\t\t\t\t\tmap.setCenter(tempPosicion);\n\t\t\t\t\t\tmapDefinirMarca2({latLng: tempPosicion});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\talert(\"No se encontro una posición en el mapa.\");\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}", "function ControladorDeEscenas(){\n //contiene el controlador de elementos visuales\n var controladorHospitales;\n var currentCategoria;\n\n this.iniciaControl = function(_controladorHospitales,_controaldorGrupoHospitales,_controladorLineChart,_controladorC3linechart,_controladorParallelChart){\n controladorHospitales = _controladorHospitales;\n controladorGrupoHospitales = _controaldorGrupoHospitales;\n controladorLineChart = _controladorLineChart;\n controladorC3linechart = _controladorC3linechart;\n controladorParallelChart = _controladorParallelChart;\n }\n\n\n this.setEscena1 = function(){\n \n //esconde line charts\n //controladorGrupoHospitales.hideLineCharts(); \n //controladorGrupoHospitales.resetPosicionDeDOMSGrupos();\n \n //define el diametro de los hexagonos\n //y el radio de los circulos\n controladorHospitales.controladorDeHexCharts.setDiameter(80);\n controladorHospitales.controladorDeHexCharts.setRadius(2);\n //pon las lineas Contadoras de un lado \n controladorHospitales.controladorDeLineasContadoras.movePosicionLineasContadoras(75,90);\n controladorHospitales.controladorDeLineasContadoras.setLargoLinea(50);\n controladorHospitales.controladorDeLineasContadoras.hideLineasContadoras();\n\n \n //inserta los hospitales al wrapper-all-hospitals\n //el contador es para darle tiempo a que los otros \n //g contenedores de hospitales regresen a la posición (0,0)\n //y no se vea un brinco.\n setTimeout(function(){\n controladorHospitales.insertHospitalesToWrapper();\n }, 1000); \n \n\n //pon los hospitales en grid\n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaPanal(40,300,150,hospitalesids));\n controladorGrupoHospitales.setPosicionToAllDOMSGrupos(0,0);\n controladorHospitales.resetListeners();\n controladorHospitales.resetHospitalUI();\n //controladorHospitales.addTooltipListeners();\n controladorC3linechart.hideDom();\n }\n\n //en la escena dos se ordenan los hospitales por delegacion o por tipo de hospital\n this.setEscena2 = function(categoria,anio){\n currentCategoria = categoria;\n\n var hospitalesPorTipo = categoria==\"Tipo\" ? mapHospitalesPorTipo : mapHospitalesPorZona; \n \n //controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaClustersDePosicionesPorTipo(0,0,800,400,80,150,arregloPorTipo,50));\n var arreglo_hospitalesPorTipo = createObjectToArray(hospitalesPorTipo);\n controladorGrupoHospitales.createGrupoDoms(categoria,arreglo_hospitalesPorTipo,anio);\n controladorGrupoHospitales.insertHospitalesToGroupWrapper(arreglo_hospitalesPorTipo);\n controladorGrupoHospitales.hideLineCharts();\n controladorGrupoHospitales.setPosicionToAllDOMSGrupos(450,0);\n //controladorGrupoHospitales.showLineCharts(categoria);\n \n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaPanalPorTipo(categoria,hospitalesPorTipo));\n\n controladorHospitales.addChangeOpacityListeners(categoria);\n controladorHospitales.addSelectGroupListeners(categoria);\n\n controladorC3linechart.loadDataAllHospitales(anio,categoria);\n controladorC3linechart.showDom();\n\n controladorParallelChart.hideDOM();\n }\n\n\n //en la escena tres se muestra un parallel chart comparando totales anuales\n this.setEscena3 = function(){\n controladorHospitales.resetListeners();\n controladorHospitales.addChangeOpacityListeners(currentCategoria);\n\n controladorC3linechart.loadParallelLinesAllHospitalsData(currentCategoria);\n }\n}", "function inicializarHerramientas() {\n\n toastr.options = {\n \"closeButton\": false,\n \"debug\": false,\n \"newestOnTop\": false,\n \"progressBar\": false,\n //\"positionClass\": \"toast-bottom-center\",\n \"preventDuplicates\": false,\n \"onclick\": null,\n \"showDuration\": \"300\",\n \"hideDuration\": \"1000\",\n \"timeOut\": \"5000\",\n \"extendedTimeOut\": \"1000\",\n \"showEasing\": \"swing\",\n \"hideEasing\": \"linear\",\n \"showMethod\": \"fadeIn\",\n \"hideMethod\": \"fadeOut\"\n };\n\n if (utilidadesBitworks.getQueryString(\"saved\") == \"1\") {\n swal({\n title: \"Confirmación\",\n text: \"Registro Guardado Exitosamente!\",\n type: \"success\"\n });\n }\n\n //clase para desabilitar controles\n $(\".canbereadonly\").attr(\"disabled\", true);\n\n //Configuracion para los validadores de .net si es que existen\n if ($.validator) {\n $.validator.unobtrusive.parse(\"form\");\n }\n //configuracion para para levantar las ventanas de errores\n utilidadesBitworks.ConfigVal(true);\n\n\n /*\n\n //$('.i-checks').iCheck({\n // checkboxClass: 'icheckbox_square-green',\n // radioClass: 'iradio_square-green',\n //});\n\n //para la input date\n if ($('.input-group.date').length > 0)\n $('.input-group.date').datepicker({\n format: 'dd/mm/yyyy',\n todayBtn: \"linked\",\n keyboardNavigation: false,\n forceParse: false,\n calendarWeeks: true,\n autoclose: true,\n constrainInput: false\n });\n\n\n\n\n //para los input de tiempo en horas o minutos\n if ($('.clockpicker').length > 0) $('.clockpicker').clockpicker();\n $('.input-group.date input').attr('readonly', true);\n $('.input-group.clockpicker input').attr('readonly', true);\n\n */\n\n}", "function intialisation() {\n console.log(\"Reintialisation\");\n initialiser = 1;\n fin = 0;\n tabPlaying = [0,0,0,0,0]; //Tableau à 0 quand le son est stoppé\n enCours = false; //Si les numéros sont entrain de tourner\n selectMatricule; //Matricule sélectionné\n pointsFixes = []; //Tableau comportant les coordonées des pastilles\n seuil = 1; //Seuil pour la fusion de détections trop proches\n suppresion = 0; //Variable pour compter le nombre de détections fusionées\n nbMatricule = 14; //Nombre de matricule\n numPrecedent = 10; //Retient le dernier nombre d'occurence\n //Scanne les tâches pour initialiser\n initialiserPointsFixes();\n if(debutCache) {\n debutCache = 0;\n setTimeout(function() {\n startNumber();\n cacheGomettes();\n }, 3000);\n }\n}", "ajuste_potencia(){\n if (this.energia_disponible()){\n let danio_total = this.calcular_danio_total();\n let inyect_total = this.inyectores_disponibles();\n let plasma_inyector = (danio_total+this._plasma_requerido - inyect_total * limit_plasma)/this.inyectores_disponibles();\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i]._danio_por!==100){\n if (plasma_inyector<0){\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder()+plasma_inyector;\n } else {\n this._injectores[i].set_plasma = this._injectores[i].calcular_poder();\n this._injectores[i].set_extra_plasma = plasma_inyector;\n\n }\n }\n }\n this._potencia_disponible = true;\n } else {\n this._potencia_disponible = false;\n\n }\n }", "function nuevoFin(){\n let previo = fin;\n fin = mapa[inputFinalX.value()][inputFinalY.value()];\n fin.obstaculo = false;\n fin.corrienteFuerte = false;\n fin.corriente = false;\n fin.pintar(0);\n previo.pintar(255);\n}", "function caricaRitardi(fermate) {\n var timeRange= leggiCookie('timeRange');\n if(timeRange==null){\n timeRange=40;//il delayRange di default è 40m\n }\n var min=timeRange%60;\n var hrs=(timeRange-min)/60;\n if(min<10){\n min=\"0\"+min;\n }\n if(hrs<10){\n hrs=\"0\"+hrs;\n }\n delayRange=hrs+\":\"+min+\":00\";\n console.log(delayRange);\n stops = fermate;\n console.log(stops);\n for(var i = 0; i < stops.length; i++) {\n stops[i].lineeRitardi = [];\n }\n\n for(var i = 0; i < fermate.length; i++) {\n\n fetch(nodeLocation + \"ritardi/?idFermata=\" + fermate[i].idFermata + \"&rangeTempo=\\'\"+delayRange+\"\\'\") // get the list of bus and their delay\n .then((response) => {\n data = response.json();\n return data;\n }).then(function (data) {\n if(data.lineeRitardi[0]!=null){\n for(var j = 0; j < stops.length; j++) {\n if(stops[j].idFermata == data.lineeRitardi[0].idFermata) {\n stops[j].lineeRitardi = data.lineeRitardi;\n stops[j].idCorsa = data.lineeRitardi[0].idCorsa;\n }\n }\n }\n\n visualize();\n\n }).catch(error => console.error(error));\n\n }\n\n}", "reiniciarConteo() {\n this.ultimo = 0;\n this.tickets = [];\n this.grabarArchivo();\n this.ultimos4 = []\n console.log('Se ha inicializado el sistema');\n \n }", "function revisarCamposVaciosPrescripcion(){\n //Declaracion de atributos\n var categoria_farmacologica = $('#categoria_farmacologica').val();\n var medico = $('#select_medicamento').val();\n var dosis = $('#input_dosis').val();\n var unidad = $('#select_unidad').val();\n var via = $('#via').val();\n var frecuencia = $('#frecuencia').val();\n var horaAplicacion = $('#aplicacion').val();\n var fechaInicio = $('#fechaInicio').val();\n var duracion = $('#duracion').val();\n var fechaFin = $('#fechaFin').val();\n var validacion = false;\n\n //Condicion en caso de no seleccionar un medicamento o categoria farmacologica\n //if(categoria_farmacologica){\n\n //}\n if(medico === '0'){\n $('#borderMedicamento').css(\"border\",\"2px solid red\");\n }else if(dosis === ''){\n $('#borderDosis').css(\"border\",\"2px solid red\");\n }else if(unidad === '0'){\n $('#borderUnidad').css(\"border\",\"2px solid red\");\n }\n else if(via === '0'){\n $('#borderVia').css(\"border\",\"2px solid red\");\n }\n else if(frecuencia === '0'){\n $('#borderFrecuencia').css(\"border\",\"1px solid red\");\n }else if(horaAplicacion === ''){\n $('#borderAplicacion').css(\"border\",\"1px solid red\");\n }else if(fechaInicio === ''){\n $('#borderFechaInicio').css(\"border\",\"1px solid red\");\n }else if(duracion === ''){\n $('#borderDuracion').css(\"border\",\"1px solid red\");\n }else if(fechaFin === ''){\n $('#borderFechaFin').css(\"border\",\"1px solid red\");\n }else{\n $('#borderMedicamento').css(\"border\",\"1px solid white\");\n $('#borderDosis').css(\"border\",\"1px solid white\");\n $('#borderUnidad').css(\"border\",\"1px solid white\");\n $('#borderVia').css(\"border\",\"2px solid white\");\n $('#borderFrecuencia').css(\"border\",\"1px solid white\");\n $('#borderAplicacion').css(\"border\",\"1px solid white\");\n $('#borderFechaInicio').css(\"border\",\"1px solid white\");\n $('#borderDuracion').css(\"border\",\"1px solid white\");\n $('#borderFechaFin').css(\"border\",\"1px solid white\");\n validacion = true;\n }\n return validacion;\n\n}", "function zerarEixos (){\n eixoTransladar[0] = 0;\n eixoTransladar[1] = 0;\n eixoTransladar[2] = 0;\n eixoEscalar[0] = 0;\n eixoEscalar[1] = 0;\n eixoEscalar[2] = 0;\n}", "function acu_fondosolidaridadredistribucioningresos_cargardatostemporal(){\n\t\n\t\tif(acu_fsri_panel_datanuevo)\n\t\t{\n\t\t\tacu_fsri_panel_dataviejo=acu_fsri_panel_datanuevo;\n\t\t}\n\t\tacu_fsri_panel_datanuevo=new Array();\n\t\tacu_fsri_panel_datanuevo['acu_fsi_sol_tranferencia_recursos'] = Ext.getCmp('acu_fsi_sol_tranferencia_recursos').getValue().getGroupValue();\n\t\t\n\t\tacu_fsri_panel_datanuevo['acu_fsi_recibo_recursos'] =Ext.getCmp('acu_fsi_recibo_recursos').getValue().getGroupValue();\n\t\tacu_fsri_panel_datanuevo['acu_fsi_recibo_recursos_valor_recib'] = Ext.getCmp('acu_fsi_recibo_recursos_valor_recib').getValue();\n\t\tacu_fsri_panel_datanuevo['acu_fsi_aporte_recursos'] = Ext.getCmp('acu_fsi_aporte_recursos').getValue().getGroupValue();\n\t\tacu_fsri_panel_datanuevo['acu_fsi_aporte_recursos_valor_apor'] = Ext.getCmp('acu_fsi_aporte_recursos_valor_apor').getValue();\n\t\tacu_fsri_panel_datanuevo['acu_vas_suscripcion_contrato'] = Ext.getCmp('acu_vas_suscripcion_contrato').getValue().getGroupValue();\n\t\t\n\t\t\n\t}", "function inizializzaDati(oggetto){\r\n \"use strict\";\r\n\tsessionStorage.numTurnoP = Number(sessionStorage.numTurnoP) + 1;\r\n\tnomeGruppo = oggetto.group.name;\r\n //Prelevo i dati dal server, e salvo i dati\r\n\r\n //Variabile per il numero di camion\r\n var numeroCamion = oggetto.group.transportPawns.length;\r\n\r\n caricaPillsCamion(numeroCamion);\r\n \r\n \r\n for(var j=0; j<numeroCamion; j++){\r\n var camion = new Object();\r\n\t camion.pawnID = oggetto.group.transportPawns[j].pawnID;\r\n\t for(var i=0; i<oggetto.pawnLocations.length; i++){\r\n\t\t if(oggetto.pawnLocations[i].pawnID===camion.pawnID){\r\n\t\t\t camion.origine=oggetto.pawnLocations[i].location.name;\r\n\t\t }\r\n\t }\r\n\t camion.risorseTrasportate = oggetto.group.transportPawns[j].payload.length;\r\n\t camion.quantità = [];\r\n\t camion.tipologia = [];\r\n\t\tfor(var risorse=0; risorse<camion.risorseTrasportate; risorse++){\r\n\t\t\tcamion.quantità.push(oggetto.group.transportPawns[j].payload[risorse].quantity) ;\r\n \t\tcamion.tipologia .push(oggetto.group.transportPawns[j].payload[risorse].resource) ;\r\n\t\t}\r\n \r\n camion.spostamenti= oggetto.pawnMoves[j].remainingMoves;\r\n arrCamion.push(camion);\r\n\t\t\r\n }\r\n \r\n creaTabProduzione(arrCamion);\r\n\t\r\n\tfor(var i=0; i<arrCamion.length; i++){\r\n\t\taggiornaListaDestinazioni(arrCamion, i);\r\n\t}\r\n}", "function inmueble_encontrarUbicacion() {\n\tif (!vacio($(\"#calleNumero\").val(), $(\"#calleNumero\").attr(\"placeholder\"))) {\n\t\tif (!vacio(($(\"#estado\").val() != -1 ? $(\"#estado\").val() : \"\"), $(\"#estado option[value='-1']\").text())) {\n\t\t\tif (!vacio(($(\"#ciudad\").val() != -1 ? $(\"#ciudad\").val() : \"\"), $(\"#ciudad option[value='-1']\").text())) {\n\t\t\t\tdireCalle = \"\";\n\t\t\t\tdireNumero = \"\";\n\t\t\t\tpartes = $(\"#calleNumero\").val().replace(/#/g, \"\");\n\t\t\t\tpartes = partes.replace(/-/g, \" \");\n\t\t\t\tpartes = partes.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (var x = 0; x < partes.length; x++) {\n\t\t\t\t\tif (isEntero(partes[x])) {\n\t\t\t\t\t\tdireNumero = partes[x];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tdireCalle += (x != 0 ? \" \" : \"\") + partes[x];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdireccionBusqueda = (direNumero != \"\" ? direNumero+\"+\" : \"\")+direCalle+\"+\"+$(\"#ciudad option:selected\").text()+\",+\"+$(\"#estado option:selected\").text();\n\t\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: \"http://maps.googleapis.com/maps/api/geocode/json?address=\"+direccionBusqueda+\"&sensor=true_or_false\",\n\t\t\t\t\tdataType: \"json\"\n\t\t\t\t}).always(function(respuesta_json){\n\t\t\t\t\tif (respuesta_json.results.length > 0) {\n\t\t\t\t\t\tvar obtenerPosicion = respuesta_json.results[0].geometry.location;\n\t\t\t\t\t\ttempPosicion = new google.maps.LatLng(obtenerPosicion.lat, obtenerPosicion.lng);\n\t\t\t\t\t\tmap.setCenter(tempPosicion);\n\t\t\t\t\t\tmapDefinirMarca({latLng: tempPosicion});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\talert(\"No se encontro una posición en el mapa.\");\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}", "function inmueble_encontrarUbicacion() {\n\tif (!vacio($(\"#calleNumero\").val(), $(\"#calleNumero\").attr(\"placeholder\"))) {\n\t\tif (!vacio(($(\"#estado\").val() != -1 ? $(\"#estado\").val() : \"\"), $(\"#estado option[value='-1']\").text())) {\n\t\t\tif (!vacio(($(\"#ciudad\").val() != -1 ? $(\"#ciudad\").val() : \"\"), $(\"#ciudad option[value='-1']\").text())) {\n\t\t\t\tdireCalle = \"\";\n\t\t\t\tdireNumero = \"\";\n\t\t\t\tpartes = $(\"#calleNumero\").val().replace(/#/g, \"\");\n\t\t\t\tpartes = partes.replace(/-/g, \" \");\n\t\t\t\tpartes = partes.split(\" \");\n\t\t\t\t\n\t\t\t\tfor (var x = 0; x < partes.length; x++) {\n\t\t\t\t\tif (isEntero(partes[x])) {\n\t\t\t\t\t\tdireNumero = partes[x];\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tdireCalle += (x != 0 ? \" \" : \"\") + partes[x];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdireccionBusqueda = (direNumero != \"\" ? direNumero+\"+\" : \"\")+direCalle+\"+\"+$(\"#ciudad option:selected\").text()+\",+\"+$(\"#estado option:selected\").text();\n\t\t\t\t\n\t\t\t\t$.ajax({\n\t\t\t\t\turl: \"http://maps.googleapis.com/maps/api/geocode/json?address=\"+direccionBusqueda+\"&sensor=true_or_false\",\n\t\t\t\t\tdataType: \"json\"\n\t\t\t\t}).always(function(respuesta_json){\n\t\t\t\t\tif (respuesta_json.results.length > 0) {\n\t\t\t\t\t\tvar obtenerPosicion = respuesta_json.results[0].geometry.location;\n\t\t\t\t\t\ttempPosicion = new google.maps.LatLng(obtenerPosicion.lat, obtenerPosicion.lng);\n\t\t\t\t\t\tmap.setCenter(tempPosicion);\n\t\t\t\t\t\tmapDefinirMarca({latLng: tempPosicion});\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\talert(\"No se encontro una posición en el mapa.\");\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n}", "function getValues() {\n jornadaCertPonto = parseInt(document.getElementById('jornadaCertPonto').value);\n almoco = parseInt(document.getElementById('almoco').value);\n tolerancia = parseInt(document.getElementById('tolerancia').value);\n semAlmoco = parseInt(document.getElementById('semAlmoco').value);\n horasAbonadas = document.getElementById('horasAbonadas').value;\n\n if (isNaN(jornadaCertPonto)) {\n jornadaCertPonto = 9;\n }\n if (isNaN(almoco)) {\n almoco = 1;\n }\n if (isNaN(tolerancia)) {\n tolerancia = 10;\n }\n if (isNaN(semAlmoco)) {\n semAlmoco = 4;\n }\n if (horasAbonadas === '') {\n horasAbonadas = '00:00';\n }\n\n setValues();\n // trata horas incluídas com segundos HH:mm:ss\n if (horasAbonadas.length == 8) {\n horasAbonadas = horasAbonadas.split(':')[0] + ':' + horasAbonadas.split(':')[1];\n }\n\n jornadaSap = jornadaCertPonto - almoco;\n document.getElementById('jornadaSap').value = jornadaSap;\n}", "function prestigeChanging2(){\n //find out the equipment index of the prestige we want to hit at the end.\n var maxPrestigeIndex = document.getElementById('Prestige').selectedIndex;\n // Cancel dynamic prestige logic if maxPrestigeIndex is less than or equal to 2 (dagger)\n if (maxPrestigeIndex <= 2)\n return;\n \n //find out the last zone (checks custom autoportal and challenge's portal zone)\n var lastzone = checkSettings() - 1; //subtract 1 because the function adds 1 for its own purposes.\n \n //if we can't figure out lastzone (likely Helium per Hour AutoPortal setting), then use the last run's Portal zone.\n if (lastzone < 0)\n lastzone = game.global.lastPortal;\n \n // Find total prestiges needed by determining current prestiges versus the desired prestiges by the end of the run\n var neededPrestige = 0;\n for (i = 1; i <= maxPrestigeIndex ; i++){\n var lastp = game.mapUnlocks[autoTrimpSettings.Prestige.list[i]].last;\n if (lastp <= lastzone){\n var addto = Math.ceil((lastzone + 1 - lastp)/5);\n // For Scientist IV bonus, halve the required prestiges to farm\n if (game.global.sLevel > 3)\n addto += Math.ceil(addto/2);\n neededPrestige += addto; \n }\n }\n // For Lead runs, we hack this by doubling the neededPrestige to acommodate odd zone-only farming. This might overshoot a bit\n if (game.global.challengeActive == 'Lead') \n neededPrestige *= 2;\n \n // Determine the number of zones we want to farm. We will farm 4 maps per zone, then ramp up to 9 maps by the final zone\n var zonesToFarm = 0;\n if (neededPrestige == 0){\n autoTrimpSettings.Prestige.selected = \"Dagadder\";\n return;\n }\n else if (neededPrestige <= 9)//next 9\n zonesToFarm = 1;\n else if (neededPrestige <= 17)//next 8\n zonesToFarm = 2;\n else if (neededPrestige <= 24)//next 7\n zonesToFarm = 3;\n else if (neededPrestige <= 30)//next 6\n zonesToFarm = 4;\n else if (neededPrestige <= 35)//next 5\n zonesToFarm = 5;\n else\n zonesToFarm = 6 + Math.ceil((neededPrestige - 35)/5);\n \n //If we are in the zonesToFarm threshold, kick off the prestige farming\n if(game.global.world > (lastzone-zonesToFarm) && game.global.lastClearedCell < 79){\n // Default map bonus threshold\n var mapThreshold = 4;\n var zonegap = lastzone - game.global.world;\n if (zonegap <= 4)// Would be +5 but the map repeat button stays on for 1 extra.\n mapThreshold += zonegap;\n\n if (game.global.mapBonus < mapThreshold)\n autoTrimpSettings.Prestige.selected = \"GambesOP\";\n else if (game.global.mapBonus >= mapThreshold)\n autoTrimpSettings.Prestige.selected = \"Dagadder\";\n }\n \n //If we are not in the prestige farming zone (the beginning of the run), use dagger:\n if (game.global.world <= lastzone-zonesToFarm || game.global.mapBonus == 10) \n autoTrimpSettings.Prestige.selected = \"Dagadder\";\n}", "function ActualiserPointsVie(){\n\t//les PDV diminuent si le joueur s'eloigne des artefacts (zoneSure) sans lumiere (torcheJoueur)\n\tif(transform.Find(\"torcheJoueur(Clone)\") == null && !zoneSure){\n\t\tif(vitesseCorruption < 0){\n\t\t\tvitesseCorruption = 0;\n\t\t}else{\n\t\t\tvitesseCorruption += Time.deltaTime/2;\n\t\t}\n\t\tpointsVie -= vitesseCorruption*Time.deltaTime;\n\t} else{\n\t\t//la vitesse de reduction des PDV diminue jusqu'a 0\n\t\tif(vitesseCorruption > 0){\n\t\t\tvitesseCorruption -= Time.deltaTime*2;\n\t\t}else{\n\t\t\tvitesseCorruption = 0;\n\t\t\t//soigne si la vitesse de corruption est 0 et le joueur a obtenu la potion\n\t\t\tif(Joueur.powerUpPotion){\n\t\t\t\tpointsVie += Time.deltaTime;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t}\n\t//actualise l'element visuel\n\tbarreVie.fillAmount = pointsVie/pointsVieMax;\n}", "function seteaValoresParaGuardar() {\n\tset(FORMULARIO + '.hDescripcionD', get(FORMULARIO + '.ValorDescripcionD') );\n\tset(FORMULARIO + '.hMarca', get(FORMULARIO + '.ValorMarca') );\n\tset(FORMULARIO + '.hCanal', get(FORMULARIO + '.ValorCanal') );\n\tset(FORMULARIO + '.hTipoCurso', get(FORMULARIO + '.ValorTipoCurso') ); \n\tset(FORMULARIO + '.hAccesoInformacion', get(FORMULARIO + '.ValorAccesoInformacion') ); \n\tset(FORMULARIO + '.hFrecuenciaDictado', get(FORMULARIO + '.ValorFrecuenciaDictado') ); \n\tset(FORMULARIO + '.hSubgerenciaVentas', get(FORMULARIO + '.ValorSubgerenciaVentas') ); \n\tset(FORMULARIO + '.hRegion', get(FORMULARIO + '.ValorRegion') ); \n\tset(FORMULARIO + '.hZona', get(FORMULARIO + '.ValorZona') ); \n\tset(FORMULARIO + '.hSeccion', get(FORMULARIO + '.ValorSeccion') ); \n\tset(FORMULARIO + '.hTerritorio', get(FORMULARIO + '.ValorTerritorio') ); \n\tset(FORMULARIO + '.hTipoCliente', get(FORMULARIO + '.ValorTipoCliente') ); \n\tset(FORMULARIO + '.hCapacitador', get(FORMULARIO + '.ValorCapacitador') ); \n\tset(FORMULARIO + '.hSubtipoCliente', get(FORMULARIO + '.ValorSubtipoCliente') ); \n\tset(FORMULARIO + '.hClasificacion', get(FORMULARIO + '.ValorClasificacion') ); \n\tset(FORMULARIO + '.hTipoClasificacion', get(FORMULARIO + '.ValorTipoClasificacion') ); \n\tset(FORMULARIO + '.hStatusCliente', get(FORMULARIO + '.ValorStatusCliente') ); \n\tset(FORMULARIO + '.hStatusCursosExigidos', get(FORMULARIO + '.ValorStatusCursosExigidos') ); \n\tset(FORMULARIO + '.hPeriodoInicio', get(FORMULARIO + '.ValorPeriodoInicio') ); \n\tset(FORMULARIO + '.hPeriodoFin', get(FORMULARIO + '.ValorPeriodoFin') ); \n\tset(FORMULARIO + '.hPeriodoInicioV', get(FORMULARIO + '.ValorPeriodoInicioV') ); \n\tset(FORMULARIO + '.hPeriodoFinV', get(FORMULARIO + '.ValorPeriodoFinV') ); \n\tset(FORMULARIO + '.hPeriodoIngreso', get(FORMULARIO + '.ValorPeriodoIngreso') ); \n\tset(FORMULARIO + '.hProductoEntregar', get(FORMULARIO + '.ValorProductoEntregar') ); \n\tset(FORMULARIO + '.hMomentoEntregar', get(FORMULARIO + '.ValorMomentoEntregar') ); \n\n\tset(FORMULARIO + '.hNombreCurso', get(FORMULARIO + '.ValorNombreCurso') ); \n\tset(FORMULARIO + '.hObjetivoCurso', get(FORMULARIO + '.ValorObjetivoCurso') ); \n\tset(FORMULARIO + '.hContenidoCurso', get(FORMULARIO + '.ValorContenidoCurso') ); \n\tset(FORMULARIO + '.hAccesoSeleccionDM', get(FORMULARIO + '.ValorAccesoSeleccionDM') ); \n\tset(FORMULARIO + '.hPathDM', get(FORMULARIO + '.ValorPathDM') ); \n\tset(FORMULARIO + '.hFechaDisponible', get(FORMULARIO + '.ValorFechaDisponible') ); \n\tset(FORMULARIO + '.hFechaLanzamiento', get(FORMULARIO + '.ValorFechaLanzamiento') ); \n\tset(FORMULARIO + '.hFechaFin', get(FORMULARIO + '.ValorFechaFin') ); \n\tset(FORMULARIO + '.hAlcanceGeografico', get(FORMULARIO + '.ValorAlcanceGeografico') ); \n\tset(FORMULARIO + '.hNOptimo', get(FORMULARIO + '.ValorNOptimo') ); \n\tset(FORMULARIO + '.hBloqueo', get(FORMULARIO + '.ValorBloqueo') ); \n\tset(FORMULARIO + '.hRelacion', get(FORMULARIO + '.ValorRelacion') ); \n\tset(FORMULARIO + '.hNOrdenes', get(FORMULARIO + '.ValorNOrdenes') ); \n\tset(FORMULARIO + '.hMonto', get(FORMULARIO + '.ValorMonto') ); \n\tset(FORMULARIO + '.hFechaIngreso', get(FORMULARIO + '.ValorFechaIngreso') ); \n\tset(FORMULARIO + '.hNCondicion', get(FORMULARIO + '.ValorNCondicion') ); \n\tset(FORMULARIO + '.hFechaUltimo', get(FORMULARIO + '.ValorFechaUltimo') ); \n\tset(FORMULARIO + '.hNRegaloParticipantes', get(FORMULARIO + '.ValorNRegaloParticipantes') ); \n\tset(FORMULARIO + '.hCondicionPedido', get(FORMULARIO + '.ValorCondicionPedido') ); \n\tset(FORMULARIO + '.hControlMorosidad', get(FORMULARIO + '.ValorControlMorosidad') ); \n\tset(FORMULARIO + '.hDescripcionD', get(FORMULARIO + '.ValorDescripcionD') );\n}", "function crearEmpleado() {\n\tvar name = document.getElementById(\"inputNombreEmpleado\").value;\n\tvar dni = document.getElementById(\"inputDniEmpleado\").value;\n\tvar telefono = document.getElementById(\"inputTelefono\").value;\n\tvar horasConsulta = document.getElementById(\"inputHorasConsulta\").value;\n\tvar actividades = document.getElementById(\"inputActividades\").value;\n\tvar horasClase = document.getElementById(\"inputHorasClase\").value;\n\tvar horasComun = document.getElementById(\"inputHorasComun\").value;\n\tvar empleado;\n\n\t//Validamos que haya rellenado todos los datos, con form y input required mejor..\n\tif (name == \"\" || dni == \"\" || telefono == \"\"){\n\t\talert(\"El nombre, Dni, y telefono del empleado son campos obligatorios. Asegurese de rellenarlos\");\n\t\treturn false;\n\t}\n\n\tif (horasConsulta == \"\" && (actividades == \"\" || horasClase == \"\" || horasComun == \"\")) {\n\t\talert(\"Introduzca las horas de consulta para crear un fisio o las actividades y horas de clase y de sala comun para crear un monitor\");\n\t\treturn false;\n\t}\n\n\tif (horasConsulta != \"\"){\n\t\templeado = new Fisioterapeuta(name, dni, telefono, horasConsulta);\n\t}else{\n\t\templeado = new Monitor(name, dni, telefono, actividades, horasClase, horasComun);\n\t}\n\n\tvectorEmpleados.push(empleado);\n\taniadirEmpleadoTabla(empleado);\n\n}", "function setInvalid() {\n gregDate = moment.utc({'year': 0, 'month': 0, 'date': 0});\n badiYear = -1;\n badiMonth = -1;\n badiDay = -1;\n ayyamiHaLength = -1;\n nawRuz = moment.utc('0000-00-00');\n valid = false;\n }", "function iniciarCronometro(){\n \n intervaloTempo = setInterval(function(){\n\n tempoJogo.segundos++;\n \n if(tempoJogo.segundos < 10){\n tempoJogo.segundos = '0'+tempoJogo.segundos;\n }\n if(tempoJogo.segundos < 60 && tempoJogo.minutos === 0){\n tempoJogo.minutos=0;\n tempoJogo.minutos = '0'+tempoJogo.minutos;\n }\n \n if(tempoJogo.segundos === 60){\n tempoJogo.minutos++;\n tempoJogo.segundos = '0'+0;\n if(tempoJogo.minutos < 10){\n tempoJogo.minutos = '0'+tempoJogo.minutos;\n }\n }\n\n if(tempoJogo.minutos === 60){\n tempoJogo.minutos = 0;\n tempoJogo.horas++;\n if(tempoJogo.horas < 10){\n tempoJogo.horas = '0'+tempoJogo.horas;\n }\n }\n\n if(tempoJogo.horas == 24){\n tempoJogo.horas = 0;\n tempoJogo.dias++\n }\n\n //Ganho de estamina por tempo\n if(tempoJogo.minutos % 5 == 0 && tempoJogo.segundos == 0 && jogador1.estamina < 100){\n jogador1.estamina++;\n gravarLS('estaminaJ', jogador1.estamina);\n mostraInfoJogador();\n }\n\n //Tempo referente ao rendimento no banco\n if(tempoJogo.horas % 1 == 0 && tempoJogo.minutos == 0 && tempoJogo.segundos == 0){\n jogador1.saldoConta += jogador1.rendimento;\n jogador1.saldoConta = parseInt(jogador1.saldoConta);\n console.log(`saldo: ${jogador1.saldoConta}`)\n gravarLS('saldo', jogador1.saldoConta);\n mostraInfoJogador(); \n }\n\n //Ganhos diários do cabaré\n if(tempoJogo.horas % 6 == 0 && tempoJogo.minutos == 0 && tempoJogo.segundos == 0){\n if(cabareG1.pagamentoDia == null){\n return\n }else{\n cabareG1.ganhos = parseInt(cabareG1.ganhos)\n cabareG1.ganhos += (cabareG1.pagamentoDia);\n localStorage.setItem('meuCabare', JSON.stringify(cabareG1))\n mostraMeuCabare()\n } \n }\n \n gravarLS('min', tempoJogo.minutos);\n gravarLS('horas', tempoJogo.horas);\n gravarLS('dias', tempoJogo.dias);\n \n $horas.innerHTML = `<i class=\"far fa-clock\"></i> ${tempoJogo.horas} : ${tempoJogo.minutos}`;\n $dias.innerHTML = `<i class=\"far fa-calendar-alt\"></i> Dia: ${tempoJogo.dias}` ;\n },100) \n}", "restart_values() {\n this.initialize_values();\n this.model.restart();\n this.view.restart();\n this.client.restart();\n this.deselectCurrentPiece();\n this.view.marker.indicatorFlag = true;\n this.scene.reset = false;\n }", "function contadorRegressivo(){\n\tsegundos--;\n\n\tif(segundos==-1){ // reinicia a contagem regressiva do segundos\n\t\tsegundos=59;\n\t\tif(minutos ==1){ // tratamento para os minutos ficarem com duas casas sempre\n\t\t\tminutos=\"0\" + 0;\n\n\t\t} else if (minutos == \"00\") { // verifica se o tempo esgotou!!\n\t\t\talert(\"Tempo Esgotado! :(\");\n\t\t\tavancar(true); // parametro de controle. Ele sendo true pode avancar mesmo q o botao esteja desabilitado\n\n\t\t}else { // se nada disse acontecer continua a contagem regressiva.\n\t\t\tminutos = \"0\" + --minutos;\n\t\t}\n\t}\n\n\tif(segundos<=9)segundos=\"0\"+segundos; // decrementa sempre os segundos\t\n\t\n\tatualizaTempoNaPagina();\n\tsetTimeout('contadorRegressivo()',1000); // chama a funcao a cada segundo\n\n}", "function resetarVariaveis() {\r\n tabuleiro = ['', '', '', '', '', '', '', '', ''];\r\n jogadorAtual = 0;\r\n jogadorAnterior;\r\n estadosJogo.empate = false;\r\n estadosJogo.vitoria = false;\r\n}", "function nuevoInicio(){\n let previo = inicio;\n inicio = mapa[inputInicioX.value()][inputInicioY.value()];\n inicio.obstaculo = false;\n inicio.corrienteFuerte = false;\n inicio.corriente = false;\n inicio.pintar(0);\n previo.pintar(255);\n}", "function setTimers(){\n\t\t// Calcula cada cuantos segundos debe actualizar cada contador de recursos restantes para \n\t\t// aprovechar el temporizador del resto de relojes\n\t\tvar frecuencia = new Array(4);\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tfrecuencia[i] = (1 / produccion[i]) * 1000;\n\t\t\tif (!isFinite(frecuencia[i]) || frecuencia[i] < 0) frecuencia[i] = Number.POSITIVE_INFINITY;\n if (total[i] - actual[i] == 0) frecuencia[i] = Number.POSITIVE_INFINITY;\n\t\t\tsetInterval(crearTemporizadorRecurso(i), Math.floor(frecuencia[i]));\n\t\t}\n\n\t\tsetInterval(function () {\n\t\t\t/*\n\t\t\t * Se distinguen dos tipos de temporizadores, timeout y timeouta. Solo los primeros \n\t\t\t * provocan que la pagina se actualice al llegar a 0.\n\t\t\t */\n\t\t\tvar relojes = find(\"//*[@id='timeout' or @id='timeouta']\", XPList);\n\t\t\tfor (var i = 0; i < relojes.snapshotLength; i++){\n\t\t\t\tvar tiempo = calcular_segundos(relojes.snapshotItem(i).innerHTML) - 1;\n\t\t\t\tif (tiempo >= 0) relojes.snapshotItem(i).innerHTML = formatear_tiempo(tiempo);\n\t\t\t\telse if (relojes.snapshotItem(i).id == 'timeout') document.location.reload();\n\t\t\t}\n\t\t},1000);\n\n\t}", "function CorroborarCampoVacio(corroborado){\n TipoCultivo =$(\"#tipocultivo\"),\n FechaPlan =$(\"#feplantacion\"),\n FechaCosecha=$(\"#fechacosecha\");\n allFields = $( [] ).add(TipoCultivo).add(FechaPlan).add(FechaCosecha);\n\t \t\tallFields.removeClass( \"ui-state-error\" ); //reseteamos los campos marcados\n\t\t\t\ttips = $( \".validateTips\" );\n\n\t\t\t\tvar bValid = true;\n\t\t\t\tbValid = bValid && comprobar_longitud(TipoCultivo, \"campo Tipo de cultivo\", 3, 30);\n\t\t\t\tbValid = bValid && comprobar_longitud(FechaPlan, \"Fecha de plantacion \", 01, 31);\n\t\t\t\tbValid = bValid && comprobar_longitud(FechaCosecha, \"Fecha de cosecha\", 01, 31);\n if ( bValid ) {\n\t\t\t\t\t\tcorroborado = true;\n\t\t\t\t\t\treturn corroborado;\n\t\t\t\t\t\tallFields.val( \"\" ).removeClass( \"ui-state-error\" );\n\t\t\t\t\t}\n}", "function inicializa_mapa()\n{\n\n estado = 1;\n\n // START PROMPT ANIMATION\n move_obj($('mapa_jogo_img'),-1000,0);\n move_obj($('mapa_jogo_flash'),-1000,0);\n move_obj($('comida_img'),-1000,0);\n limpa_pontuacaos();\n move_obj($('comida_pw_img'),-1000,0);\n for(var i=0; i<=12; i++)\n move_obj($('ecra_inicial_obj_'+i),-1000,0);\n move_obj($('ecra_inicial_obj'),-1000,0);\n move_obj($('inicializa_mapa_obj'),0,0);\n\n if (creditos > 1)\n {\n move_obj($('inicializa_mapa_obj_1'),-1000,0);\n move_obj($('inicializa_mapa_obj_2'),224,335);\n }\n else\n {\n move_obj($('inicializa_mapa_obj_1'),264,335);\n }\n}", "initialize_values() {\n this.lastResponse = [];\n this.tmpPiece = null;\n this.numberOfTries = 0;\n }", "valiDate() {\n console.log('validando...');\n this.dateMessage = null;\n this.dateDanger = null;\n if (this.nuevoRegistro === true || this.registros == null) {\n this.registroAnterior = null;\n }\n if (this.registro && this.registroAnterior != null) {\n const fecha1 = moment__WEBPACK_IMPORTED_MODULE_5__(this.isRegistered);\n const fecha2 = moment__WEBPACK_IMPORTED_MODULE_5__(this.isSelect);\n const Diferencia = fecha2.diff(fecha1, 'months');\n if (Diferencia === 1) {\n console.log('todo correcto');\n this.dateMessage = null;\n this.dateDanger = null;\n }\n else if (Diferencia === 2) {\n this.launchAlert('error', 'Error de Registros', 'La Fecha ingresada se ha saltado un mes en el ingreso, por favor Verifiquela!', null, true, null, null, 'top-end', 'row', true);\n // alert('No se han realizado registros del mes Anterior');\n this.dateDanger = false;\n this.dateMessage = 'No se han realizado registros del mes Anterior';\n }\n else if (Diferencia < 1) {\n this.launchAlert('error', 'Error de Registros', 'Ya se ha registrado esta fecha!!', null, true, null, true, 'center', null, null);\n this.dateMessage = 'ya se ha registrado esta fecha';\n this.dateDanger = true;\n }\n else if (Diferencia > 2) {\n // alert('No se han realizado registros desde hace ' + (Diferencia - 1) + ' Meses');\n this.launchAlert('error', 'Error de Registros', 'No se han Realizado registros desde hace ' + (Diferencia - 1) + ' mes(es)', null, true, null, true, 'center', null, false);\n this.dateDanger = false;\n this.dateMessage = 'No se han realizado registros desde hace ' + (Diferencia - 1) + ' Meses';\n }\n }\n }", "function trataColisoes()\n{\n //lateral esquerda - 1\n if(esfera.posicao[0] - esfera.raio < parametrosMesa.xMin)\n {\n if(ultimaColisao != 1)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 1;\n } \n }\n\n //lateral direita - 2\n if(esfera.posicao[0] + esfera.raio > parametrosMesa.xMax)\n {\n if(ultimaColisao != 2)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 2;\n } \n }\n\n //cima - 3\n if(esfera.posicao[1] - esfera.raio < parametrosMesa.zMax)\n {\n if(ultimaColisao != 3)\n {\n veloc[2] = -parametrosMesa.coeficienteRestituicao * veloc[2];\n ultimaColisao = 3; \n }\n \n }\n\n //corredor direito - 4\n if(esfera.posicao[1] - esfera.raio > -30)\n { \n if( ( (esfera.posicao[0] - esfera.raio < -19.75) && (esfera.posicao[0] + esfera.raio > -17.75) ) || \n ( (esfera.posicao[0] + esfera.raio > -18.75) && (esfera.posicao[0] - esfera.raio < -20.75) ) )\n {\n if(ultimaColisao != 4)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 4;\n } \n }\n \n\n //corredor esquerdo - 5\n if( (esfera.posicao[0] + esfera.raio > 19.04) && (esfera.posicao[0] - esfera.raio < 21.04) || \n (esfera.posicao[0] - esfera.raio < 20.04) && (esfera.posicao[0] + esfera.raio > 18.04) )\n {\n if(ultimaColisao != 5)\n {\n veloc[0] = -parametrosMesa.coeficienteRestituicao * veloc[0];\n ultimaColisao = 5;\n } \n }\n }\n\n /*//corner direito - 6\n if(esfera.posicao[0] - esfera.posicao[1] >= 50)\n {\n if(ultimaColisao != 6)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 6;\n }\n }\n\n //corner esquerdo - 7\n if(-esfera.posicao[0] + esfera.posicao[1] >= 50){\n if(ultimaColisao != 7)\n {\n //TODO \n var normal = [-0.7, 0, -0.7];\n var normalx2 = [-1.4, 0, -1.4];\n var cosseno = mult(normal, normalize(veloc));\n var quase = mult(normalx2, cosseno);\n var vetorRefletido = subtract(quase, normalize(veloc) );\n veloc[0] = vetorRefletido[0]; veloc[2] = vetorRefletido[2];\n ultimaColisao = 7;\n }\n }*/\n}", "function InicializaGPS1vez()\n {\n\n //dni=Base64.decode( getUrlVars()[\"dni\"] );\n dni=getUrlVars()[\"dni\"] ;\n Placa= getUrlVars()[\"placa\"] ;\n //empresa_madre=Base64.decode( getUrlVars()[\"empresa\"] );\n empresa_madre= getUrlVars()[\"empresa\"] ;\n //alert(dni + \" // \" + Placa + \" // \" + empresa_madre);\n window.localStorage.setItem(\"Taxista\",dni);\n window.localStorage.setItem(\"Placa\",Placa); \n window.localStorage.setItem(\"Empresa\",empresa_madre);\n\n if (navigator.geolocation) \n { \n console.log(\"localizado ok\");\n $(\"#gpsEstado\" ).fadeIn( \"slow\", function(){\n document.getElementById(\"gpsEstado\").innerHTML=\"Su teléfono tiene GPS..\";\n animaBarra();\n\n });\n //document.getElementById(\"gpsEstado\").innerHTML=\"Su teléfono tiene GPS..\";\n llamadoGPS = navigator.geolocation.watchPosition(\n localizadoOk,\n localizadoError,\n {\n enableHighAccuracy : true,\n maximumAge : 30000,\n timeout : 5000\n }\n )\n }else{\n document.getElementById(\"gpsEstado\").innerHTML='¡Tu teléfono no permite ubicar tu localización. No puedes usar este soft!';\n } \n\n }", "function setTimers(){\r\n\t\t// Calcula cada cuantos segundos debe actualizar cada contador de recursos restantes para\r\n\t\t// aprovechar el temporizador del resto de relojes\r\n\t\tvar frecuencia = new Array(4);\r\n\t\tfor (var i = 0; i < 4; i++){\r\n\t\t\tfrecuencia[i] = (1 / produccion[i]) * 1000;\r\n\t\t\tif (!isFinite(frecuencia[i]) || frecuencia[i] < 0) frecuencia[i] = Number.POSITIVE_INFINITY;\r\n\t\t\t\t\t\tif (total[i] - actual[i] == 0) frecuencia[i] = Number.POSITIVE_INFINITY;\r\n\t\t\tsetInterval(crearTemporizadorRecurso(i), Math.floor(frecuencia[i]));\r\n\t\t}\r\n\r\n\t\tsetInterval(function () {\r\n\t\t\t/*\r\n\t\t\t * Se distinguen dos tipos de temporizadores, timeout y timeouta. Solo los primeros\r\n\t\t\t * provocan que la pagina se actualice al llegar a 0.\r\n\t\t\t */\r\n\t\t\tvar relojes = find(\"//*[@id='timeout' or @id='timeouta']\", XPList);\r\n\t\t\tfor (var i = 0; i < relojes.snapshotLength; i++){\r\n\t\t\t\tvar tiempo = calcular_segundos(relojes.snapshotItem(i).innerHTML) - 1;\r\n\t\t\t\tif (tiempo >= 0) relojes.snapshotItem(i).innerHTML = formatear_tiempo(tiempo);\r\n//\t\t\t\telse if (relojes.snapshotItem(i).id == 'timeout') document.location.reload();\r\n\t\t\t\telse if (relojes.snapshotItem(i).id == 'timeout' && relojes.snapshotItem(i).getAttribute('noreload') != 1) document.location.reload();\r\n\t\t\t}\r\n\t\t},1000);\r\n\r\n\t}", "function IA_Actualizador() {\n IA.call(this);\n\n //\n this.actualizacion = function() {\n\n // Mientras la serpiente este viva el juego seguira.\n if(!victoria) clearInterval(jugando);\n\n Tablero.prototype.limpiar(tablero);\n muros.dibujarTodo();\n\n // Dibujo la serpiente.\n for(var i=0; i<serpiente.obtenerCant();i++) {\n if(i==0) {\n\n if(!serpiente.obtenerPos(0).giro) serpiente.obtenerPos(i).movimiento();\n\n // Verificamos la nueva posicion.\n var puntoi = serpiente.obtenerPos(0).obtenerPI();\n var pos_actual = esc.obtenerPos(puntoi.obtenerX()/esc.multiplicador, puntoi.obtenerY()/esc.multiplicador);\n\n if(victoria && pos_actual.obtenerPared()) victoria=false;\n else if(victoria && pos_actual.obtenerManzana()) {\n // Removemos la posicion actual de la manzana.\n var pos = pos_actual.obtenerObjManzana();\n pos_actual.desactivarManzana();\n pos_actual.establecerManzana(null);\n manzanas.obtenerPos(pos).posAleatoria();\n\n serpiente.extender(serpiente);\n\n // Agregamos la nueva posicion.\n var x = manzanas.obtenerPos(pos).obtenerCentro().obtenerX();\n var y = manzanas.obtenerPos(pos).obtenerCentro().obtenerY();\n esc.obtenerPos(x/esc.multiplicador, y/esc.multiplicador).activarManzana();\n esc.obtenerPos(x/esc.multiplicador, y/esc.multiplicador).establecerManzana(pos);\n }\n }\n else {\n\n var puntoi = serpiente.obtenerPos(i-1).obtenerPF().clone();\n var puntof = serpiente.obtenerPos(i).obtenerPI().clone();\n\n serpiente.obtenerPos(i).establecerPI(puntoi);\n serpiente.obtenerPos(i).establecerPF(puntof);\n }\n serpiente.obtenerPos(i).dibujar();\n }\n\n // Verficamos que la cabeza de la serpiente no coma su propio cuerpo.\n var puntoi = serpiente.obtenerPos(0).obtenerPI();\n var j=1;\n while(j<serpiente.obtenerCant() && victoria) {\n if(serpiente.obtenerPos(j).obtenerPF().equals(puntoi)) victoria=false;\n j++;\n }\n\n\n serpiente.obtenerPos(0).giro = false;\n\n // Dibujo de manzanas.\n for(var i=0; i<manzanas.obtenerCant(); i++) {\n manzanas.obtenerPos(i).dibujar();\n }\n\n }\n}", "function AdministrarValidaciones() {\r\n var _a, _b, _c, _d;\r\n var Valido = true;\r\n var errorArray = [];\r\n if (!ValidarCamposVacios(\"numDni\") || !ValidarRangoNumerico(\"numDni\", 1000000, 55000000)) {\r\n console.log(\"Error en el DNI\");\r\n errorArray.push(\"DNI\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"numDni\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"numDni\", false);\r\n }\r\n if (!ValidarCamposVacios(\"txtApellido\")) {\r\n console.log(\"El apellido está vacío\");\r\n errorArray.push(\"Apellido\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"txtApellido\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"txtApellido\", false);\r\n }\r\n if (!ValidarCamposVacios(\"txtNombre\")) {\r\n console.log(\"El nombre está vacío\");\r\n errorArray.push(\"Nombre\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"txtNombre\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"txtNombre\", false);\r\n }\r\n if (!ValidarCombo(\"cboSexo\", \"--\")) {\r\n console.log(\"No se ha seleccionado sexo\");\r\n errorArray.push(\"Sexo\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"cboSexo\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"cboSexo\", false);\r\n }\r\n if (!ValidarCamposVacios(\"numLegajo\") || !ValidarRangoNumerico(\"numLegajo\", 100, 550)) {\r\n console.log(\"Error en el legajo\");\r\n errorArray.push(\"Legajo\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"numLegajo\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"numLegajo\", false);\r\n }\r\n if (!ValidarCamposVacios(\"numSueldo\") || !ValidarRangoNumerico(\"numSueldo\", 800, ObtenerSueldoMaximo(ObtenerRbSeleccionado(\"Turno\")))) {\r\n console.log(\"Error en el sueldo\");\r\n errorArray.push(\"Sueldo\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"numSueldo\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"numSueldo\", false);\r\n }\r\n if (!ValidarCamposVacios(\"Foto\")) {\r\n console.log(\"Error en la foto\");\r\n errorArray.push(\"Foto\");\r\n Valido = false;\r\n ManageAsteriskBeforeElement(\"Foto\", true);\r\n }\r\n else {\r\n ManageAsteriskBeforeElement(\"Foto\", false);\r\n }\r\n if (ObtenerRbSeleccionado(\"Turno\") == \"\") {\r\n console.log(\"Error en el turno\");\r\n errorArray.push(\"Turno\");\r\n Valido = false;\r\n if (((_a = document.getElementsByClassName(\"turnos\")[0]) === null || _a === void 0 ? void 0 : _a.previousSibling).tagName != 'SPAN') {\r\n var newNode = document.createElement(\"span\");\r\n newNode.style.color = \"brown\";\r\n newNode.appendChild(document.createTextNode(\"*\"));\r\n (_b = document.getElementsByClassName(\"turnos\")[0].parentElement) === null || _b === void 0 ? void 0 : _b.insertBefore(newNode, document.getElementsByClassName(\"turnos\")[0]);\r\n }\r\n }\r\n else {\r\n if (((_c = document.getElementsByClassName(\"turnos\")[0]) === null || _c === void 0 ? void 0 : _c.previousSibling).tagName == 'SPAN') {\r\n ((_d = document.getElementsByClassName(\"turnos\")[0]) === null || _d === void 0 ? void 0 : _d.previousSibling).remove();\r\n }\r\n }\r\n return Valido;\r\n // if(Valido)\r\n // {\r\n // let form = (<HTMLFormElement>document.getElementById(\"frmEmpleado\"));\r\n // if(form != null)\r\n // {\r\n // form.submit();\r\n // }\r\n // }\r\n // else\r\n // {\r\n // //COMENTADO POR LA PARTE 4 DEL TP\r\n // // let errorMessage = \"Los siguientes campos están vacíos o los valores ingresados no son válidos:\"\r\n // // errorArray.forEach(element => {\r\n // // errorMessage = errorMessage.concat('\\n', '- ', element);\r\n // // });\r\n // // alert(errorMessage);\r\n // }\r\n}", "function validacionDeCampos(idSolicitudVehiculo,callback){\n //var placa_vehiculo_asignado = $(\"#placa_vehiculo_asignado_\"+idSolicitudVehiculo+\"\").val();\n //var placa_verificado = $(\"#placa_verificado_\"+idSolicitudVehiculo+\"\").val();\n //var conductor_asignado = $(\"#conductor_asignado_\"+idSolicitudVehiculo+\"\").val();\n //var conductor_verificado = $(\"#conductor_verificado_\"+idSolicitudVehiculo+\"\").val();\n\n var campo_vehiculo_asignado, campo_conductor_asignado, campo_contrato_asignado;\n if($(\"#placa_vehiculo_asignado_\"+idSolicitudVehiculo+\"\").val() == \"\" || $(\"#placa_vehiculo_asignado_\"+idSolicitudVehiculo+\"\").val() == null){\n $(\"#placa_vehiculo_asignado_\"+idSolicitudVehiculo+\"\").css(\"background\", \"#D43949\");\n campo_vehiculo_asignado =0;\n $(\"#boton_asignar\"+id_campo).attr(\"disabled\",true);\n }else if($(\"#placa_verificado_\"+idSolicitudVehiculo+\"\").val() == \"\" || $(\"#placa_verificado_\"+idSolicitudVehiculo+\"\").val() == null){\n $(\"#placa_vehiculo_asignado_\"+idSolicitudVehiculo+\"\").css(\"background\", \"#1ab394\");\n campo_vehiculo_asignado =0;\n $(\"#boton_asignar\"+id_campo).attr(\"disabled\",true);\n }else if($(\"#placa_verificado_\"+idSolicitudVehiculo+\"\").val() != $(\"#placa_vehiculo_asignado_\"+idSolicitudVehiculo+\"\").val()){\n $(\"#placa_vehiculo_asignado_\"+idSolicitudVehiculo+\"\").css(\"background\", \"peru\");\n campo_vehiculo_asignado =0;\n $(\"#boton_asignar\"+id_campo).attr(\"disabled\",true);\n }else{\n campo_vehiculo_asignado =1;\n }\n //validacion conductor\n if($(\"#conductor_asignado_\"+idSolicitudVehiculo+\"\").val() == \"\" || $(\"#conductor_asignado_\"+idSolicitudVehiculo+\"\").val() == null){\n $(\"#conductor_asignado_\"+idSolicitudVehiculo+\"\").css(\"background\", \"#D43949\");\n campo_conductor_asignado =0;\n $(\"#boton_asignar\"+id_campo).attr(\"disabled\",true);\n }else if($(\"#conductor_verificado_\"+idSolicitudVehiculo+\"\").val() == \"\" || $(\"#conductor_verificado_\"+idSolicitudVehiculo+\"\").val() == null){\n $(\"#conductor_asignado_\"+idSolicitudVehiculo+\"\").css(\"background\", \"#1ab394\");\n campo_conductor_asignado =0;\n $(\"#boton_asignar\"+id_campo).attr(\"disabled\",true);\n }else if($(\"#conductor_verificado_\"+idSolicitudVehiculo+\"\").val() != $(\"#conductor_asignado_\"+idSolicitudVehiculo+\"\").val()){\n $(\"#conductor_asignado_\"+idSolicitudVehiculo+\"\").css(\"background\", \"peru\");\n campo_conductor_asignado =0;\n $(\"#boton_asignar\"+id_campo).attr(\"disabled\",true);\n }else{\n campo_conductor_asignado =1;\n }\n var validacion = campo_vehiculo_asignado + campo_conductor_asignado ;\n callback(validacion);\n}", "function getInitialValues()\n\t{\n\t settings.robotDirection = gameMap.getDirection()\n\t settings.columns = gameMap.getWidth();\n\t settings.rows = gameMap.getHeight();\n\n\t for (var x = 0; x < settings.columns; x++) {\n\t for (var y = 0; y < settings.rows; y++) {\n\n\t var row = y;\n\t var col = x;\n\t \n\t var tile = gameMap.getTile([row, col]);\n\n\t if(tile.containsPlayer()){\n\t settings.robotStart = [row,col];\n\t }\n\t \n\t if (tile.containsBattery()) {\n\t settings.batteryStart = [row, col];\n\t }\n\t }\n\t }\n\t}", "function realizarCambioHora() {\n var startTime = horaInicioTP.value();\n var endTime = horaFinTP.value();\n if (startTime && endTime) {\n startTime = new Date(startTime);\n endTime = new Date(endTime);\n topInicial = parseInt($(fragmentoActual).css(\"top\"));\n var alto = parseInt($(fragmentoActual).css(\"height\"));\n topInicial = ObtenerValor(startTime.getMinutes() + startTime.getHours() * 60, $(fragmentoActual).parent().height());\n alto = ObtenerValor(endTime.getMinutes() + endTime.getHours() * 60, $(fragmentoActual).parent().height()) - topInicial;\n var minutosInicio = ObtenerMinutos(topInicial, $(fragmentoActual).parent().height());\n var minutosFin = ObtenerMinutos(topInicial + alto, $(fragmentoActual).parent().height());\n var diaCalendario = $(fragmentoActual).parent();\n var id = $(fragmentoActual).attr('id');\n if (id == null) {\n id = '';\n }\n $(fragmentoActual).remove();\n dibujarFragmento(diaCalendario, minutosInicio, minutosFin, topInicial, alto, id);\n horaInicioTP.max(endTime);\n horaFinTP.min(startTime);\n }\n}", "function limpiarCapturaNuevaRuta(){\n contadorPuntos = 0;\n contadorHoras = 1;\n storePuntosRuta.removeAll();\n puntosLineaRuta.splice(0,puntosLineaRuta.length);\n}", "function activarRangoFechas() {\r\n\tvar horaCierreRestaurante = localStorage.getItem(\"hcierreRestLST\");//obtengo el horario de cierre\r\n\tvar fechaLimiteMax = localStorage.getItem(\"fechaLimiteRSVLST\");//obtengo el horario de cierre\r\n\r\n\tvar horaActual = obtenerHoraActual();\r\n\tvar fechaHoy = obtenerFechaHoy();\r\n\tvar fechaManana = obtenerFechaManana();\r\n\r\n\tif (horaCierreRestaurante == \"SIN HORARIO\") {\t\r\n\t\tvar fechaMinimoCal = horaCierreRestaurante == \"SIN HORARIO\" ? fechaHoy : fechaManana;\r\n\t\tvar fechaMaximoCal = fechaLimiteMax == \"SIN FECHA LIMITE\" ? \"\" : fechaLimiteMax;\r\n\t\t$(\"#nuevaFecha\").attr({ \"min\": fechaMinimoCal, \"max\": fechaMaximoCal });\r\n\r\n\t\t$.notify({\r\n\t\t\tmessage: '<i class=\"fas fa-sun\"></i> <strong>Nota:</strong> Este restaurante no tiene definido un horario de cierre, puede hacer reservas para hoy ' + fechaHoy +' sin restricciones ' \r\n\t\t}, {\r\n\t\t\t\ttype: 'info',\r\n\t\t\t\tz_index: 2000,\r\n\t\t\t\tdelay: 5000\r\n\t\t\t});\t\t\r\n\t} else {\r\n\t\t\tif (horaCierreRestaurante >= horaActual) {\r\n\t\t\t\tvar fechaMinimoCal = horaCierreRestaurante >= horaActual ? fechaManana : fechaHoy;\r\n\t\t\t\tvar fechaMaximoCal = fechaLimiteMax == \"SIN FECHA LIMITE\" ? \"\" : fechaLimiteMax;\r\n\t\t\t\t$(\"#nuevaFecha\").attr({ \"min\": fechaMinimoCal, \"max\": fechaMaximoCal });\r\n\t\t\t\tvar fechaMostrar = fechaHoy;\r\n\t\t\t} else {\r\n\t\t\t\tvar fechaMostrar = fechaManana;\r\n\t\t\t\tvar fechaMinimoCal = horaCierreRestaurante == \"SIN HORARIO\" ? fechaHoy : fechaManana;\r\n\t\t\t\tvar fechaMaximoCal = fechaLimiteMax == \"SIN FECHA LIMITE\" ? \"\" : fechaLimiteMax;\r\n\t\t\t\t$(\"#nuevaFecha\").attr({ \"min\": fechaMinimoCal, \"max\": fechaMaximoCal });\r\n\t\t\t}\t\t\r\n\t\t$.notify({\r\n\t\t\tmessage: '<i class=\"fas fa-clock\"></i> <strong>Nota:</strong> Este restaurante tiene horario definido de cierre, las reservas para hoy lo tiene que hacer antes de las ' + horaCierreRestaurante \r\n\t\t}, {\r\n\t\t\t\ttype: 'warning',\r\n\t\t\t\tz_index: 2000,\r\n\t\t\t\tdelay: 5000\r\n\t\t\t});\r\n\t\t}\r\n\t}", "function actualizarDatos(){\r\n centro1X = centroX-dist/2;\r\n centro2X = centroX +dist/2;\r\n console.log(centro1X-rad1);\r\n arrayMedidores[0].x = centro1X-rad1;\r\n arrayMedidores[1].x = centro1X-(-rad1);\r\n arrayMedidores[2].x = centro2X-rad2;\r\n arrayMedidores[3].x = centro2X-(-rad2);\r\n d=dist/PixelMet;\r\n\r\n arrayCargas=[];\r\n arrayCargas2=[];\r\n for(var i = 0;i < maxCargas ; i++){\r\n var posicion = calPosUno(i);\r\n var q = calCargaUno(i);\r\n arrayCargas.push(new CargaP(centro1X+posicion*PixelMet,centroY,10,q))\r\n }\r\n for(var i = 1;i < maxCargas ; i++){\r\n var posicion = calPosDos(i);\r\n var q = calCargaDos(i);\r\n arrayCargas2.push(new CargaP(centro2X-posicion*PixelMet,centroY,10,q))\r\n }\r\n\r\n\r\n\r\n var conta = sliderPas.value;\r\n for(var i = 0 ;i<arrayCargas.length;i++){\r\n if(i<conta){\r\n arrayCargas[i].Boolshow = 1;\r\n }\r\n else {\r\n arrayCargas[i].Boolshow = 0;\r\n }\r\n }\r\n\r\n for(var i = 0 ;i<arrayCargas2.length;i++){\r\n if(i<conta){\r\n \tarrayCargas2[i].Boolshow = 1;\t}\r\n else {\r\n \tarrayCargas2[i].Boolshow = 0; }\r\n }\r\n}", "resumen_estado_nave(){\n this.ajuste_potencia();\n if (typeof this._potencia_disponible !== \"undefined\"){\n if (this._potencia_disponible){\n let estado_plasma = \"\";\n for (let i = 0; i < this._injectores.length; i++) {\n estado_plasma += \"Plasma \"+i.toString()+\": \";\n let total = this._injectores[i].get_plasma+this._injectores[i].get_extra_plasma;\n estado_plasma += total+\"mg/s \";\n }\n console.log(estado_plasma);\n\n for (let i = 0; i < this._injectores.length; i++) {\n if (this._injectores[i].get_danio_por<100){\n if (this._injectores[i].get_extra_plasma>0){\n console.log(\"Tiempo de vida: \"+this._injectores[i].tiempo_vuelo().toString()+\" minutos.\");\n } else {\n console.log(\"Tiempo de vida infinito!\");\n break;\n }\n }\n }\n } else {\n console.log(\"Unable to comply.\")\n console.log(\"Tiempo de vida 0 minutos.\")\n }\n } else {\n throw \"_potencia_disponible: NO DEFINIDA\";\n }\n }", "function logicaNegocio(){\r\n\t\t\t//\tAgregado por Jorge Colmenarez 2016-03-25 10:06 \r\n\t\t\t//\tLlamado de metodo que captura los datos del visitante\r\n\t\t\tGetIP();\r\n\t\t\t//\tFin Jorge Colmenarez \r\n\t\t\t//Ver si Se puede Usar localStorage\r\n\t\t\tif(window['localStorage']){\r\n\t\t\t\t//console.log(\"validacion localStorage\");\r\n\t\t\t\tif(localStorage.getItem(\"ip\")){\r\n\t\t\t\t\t//console.log(\"la variable ip trae algo\");\r\n\t\t\t\t\tif(localStorage.getItem(\"ip\") == ip){\r\n\t\t\t\t\t\t//console.log(\"las ip son iguales\");\r\n\t\t\t\t\t\tif(localStorage.getItem(\"mes\") == mes){\r\n\t\t\t\t\t\t\t//console.log(\"el mes es igual\");\r\n\t\t\t\t\t\t\tif(localStorage.getItem(\"dia\") == dia){\r\n\t\t\t\t\t\t\t\t//console.log(\"el dia es igual\");\r\n\t\t\t\t\t\t\t\tvalido = false;\r\n\t\t\t\t\t\t\t\tmovepoint(valido);\r\n\t\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t\t//localStorage.removeItem(\"dia\");\r\n\t\t\t\t\t\t\t\t//localStorage.setItem(\"dia\",dia);\r\n\t\t\t\t\t\t\t\tvalido = true;\r\n\t\t\t\t\t\t\t\tmovepoint(valido);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//localStorage.removeItem(\"mes\");\r\n\t\t\t\t\t\t\t//localStorage.removeItem(\"dia\");\r\n\t\t\t\t\t\t\t//localStorage.setItem(\"mes\",mes);\r\n\t\t\t\t\t\t\t//localStorage.setItem(\"dia\",dia);\r\n\t\t\t\t\t\t\tvalido = true;\r\n\t\t\t\t\t\t\tmovepoint(valido);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t//localStorage.clear();\r\n\t\t\t\t\t\t//localStorage.setItem(\"ip\",ip);\r\n\t\t\t\t\t\t//localStorage.setItem(\"dia\",dia);\r\n\t\t\t\t\t\t//localStorage.setItem(\"mes\",mes);\r\n\t\t\t\t\t\t//localStorage.setItem(\"ano\",ano);\r\n\t\t\t\t\t\tvalido = true;\r\n\t\t\t\t\t\tmovepoint(valido);\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//localStorage.clear();\r\n\t\t\t\t\t//localStorage.setItem(\"ip\",ip);\r\n\t\t\t\t\t//localStorage.setItem(\"dia\",dia);\r\n\t\t\t\t\t//localStorage.setItem(\"mes\",mes);\r\n\t\t\t\t\t//localStorage.setItem(\"ano\",ano);\r\n\t\t\t\t\tvalido = true;\r\n\t\t\t\t\tmovepoint(valido);\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//console.log(\"No Soporta LocalSorage\");\r\n\t\t\t\tvalido = true;\r\n\t\t\t\tmovepoint(v)\r\n\t\t\t}\r\n\t\t\t//Funcion que Hace que el Anuncio Persiga al Puntero\r\n\t\t\tfunction movepoint(v){\r\n\t\t\t\tif(v){\r\n\t\t\t\t\t$(\"div#content-ads\").mouseenter(function(){\r\n\t\t\t\t\t \tmypublic = $(this);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t//\tFunción que oculta la publicidad\r\n\t\t\t\t \tfunction hide_publicidad(i){\r\n\t\t\t\t \tvalor = setInterval(function(){\r\n\t\t\t\t\t if(i>1){\r\n\t\t\t\t\t\t\t\tmypublic.css(\"display\",\"none\");\r\n\t\t\t\t\t\t\t\tclearInterval(valor);\r\n\t\t\t\t\t }\r\n\t\t\t\t\t i++;\r\n\t\t\t\t \t},500);\r\n\t\t\t\t \t}\r\n\t\t\t\t \t//\tFin ocultar publicidad\r\n\t\t\t\t \t//\tFunción que verifica si se dió clic en el iframe\r\n\t\t\t\t\tfunction clickActivo(){\r\n\t\t\t\t\t\treturn $(document.activeElement).is('IFRAME') || $(document.activeElement).is('iframe');\r\n\t\t\t\t \t}\r\n\t\t\t\t \t//\tFin verificación clic\r\n\t\t\t\t\tvar ant = setInterval(function(){\r\n\t\t\t\t\t\tif(clickActivo()){\r\n\t\t\t\t\t\t\t//\tAgregado por Jorge Colmenarez 2016-03-25 09:54\r\n\t\t\t\t\t\t\t//\tEstablecer datos de la ip solo cuando se ha ejecutado el clic sobre el anuncio\r\n\t\t\t\t\t\t\t//console.log(ip+\" \"+dia+\"/\"+mes+\"/\"+ano);\r\n\t\t\t\t\t\t\tlocalStorage.setItem(\"ip\",ip);\r\n\t\t\t\t\t\t\tlocalStorage.setItem(\"dia\",dia);\r\n\t\t\t\t\t\t\tlocalStorage.setItem(\"mes\",mes);\r\n\t\t\t\t\t\t\tlocalStorage.setItem(\"ano\",ano);\r\n\t\t\t\t\t\t\t//console.log(localStorage);\r\n\t\t\t\t\t\t\t//\tRemovemos el anuncio para que no sea necesario recargar la página\r\n\t\t\t\t\t\t\thide_publicidad(1);\r\n\t\t\t\t\t\t\tclearInterval(ant);\r\n\t\t\t\t\t\t\t//\tFin Jorge Colmenarez\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t},100);\r\n\t\t\t\t\t$(document).mousemove(function(e){\r\n\t\t\t\t\t\t$(\"div#content-ads\").css( {\"top\":(e.clientY-140), \"left\":(e.clientX-168) });\r\n\t\t\t\t\t});\r\n\t\t\t\t}else{\r\n\t\t\t\t\tvar padre = document.getElementById(\"content-ads\").parentNode;\r\n\t\t\t\t\tvar hijo = document.getElementById(\"content-ads\");\r\n\t\t\t\t\tpadre.removeChild(hijo);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}", "function failedPosition() {\n userPosition = [48.8566, 2.3522]; // failed position Paris, Fr\n addToMap();\n webSecurity();\n}", "function InicializarControlador()\n{\n idPalabraActual = 0; // Id de la palabra que tiene que escribir el jugador.\n idCharActual = 0; // Id a nivel de texto del primer caracter de la palabra que tiene que escribir el jugador.\n tIni = new Date(); // Momento de inicio del juego.\n errores = 0; // Número de errores que ha tenido el jugador hasta ahora.\n subIptAnterior = \"\"; // Lo que el usuario tenía escrito antes del último refresco del input.\n\n palabras = libreria[IndexarTextoAleatorio()].match(/\\S+/gi); // Elijo un texto al azar de la librería y lo divido en un array buscando cualquier bloque de texto que no sea un \" \".\n largoTexto = CalcularLargoDelTexto(); // Número de caracteres del texto, incluyendo espacios.\n texto = ConstruirTextoRevisado(palabras);\n}", "function cnsFrn_fecha(preencheLinha){\n if(!empty($CNSFORNECdimmer)){\n \n //A CONSULTA NAO ESTA INCLUIDA EM UMA OUTRA TELA\n if(empty(objFornecedor.divDaConsulta)){\n //VOLTA O SCROLL PRA CIMA\n $(CNSFORNEC_DIV_TABELA).animate({ scrollTop: \"=0\" }, \"fast\");\n $(\"#cnsFornec_pesquisa\").select();\n return;\n }\n\n // VOU FECHAR A CONSULTA SEM TER QUE PREENCHER AS LINHAS\n if(!preencheLinha){\n $CNSFORNECdimmer.dimmer(\"consulta hide\");\n\n //RETORNA O FOCO\n if(!empty(objFornecedor.returnFocus)) objFornecedor.returnFocus.select();\n // if(!empty(objCliente.returnFocus)) objCliente.returnFocus.select();\n\n return;\n }\n\n var posicao = $('#cnsFornec_position').val();\n var divDaConsulta = objFornecedor.divDaConsulta; //conteudo do objeto\n\n objFornecedor.fornecNum = objTabelaFornec.registros[posicao].fo_number;\n objFornecedor.fornecAbrev = objTabelaFornec.registros[posicao].fo_abrev;\n objFornecedor.razao = objTabelaFornec.registros[posicao].fo_razao;\n objFornecedor.cnpj = objTabelaFornec.registros[posicao].fo_cgc;\n objFornecedor.telefone = objTabelaFornec.registros[posicao].fo_fone;\n objFornecedor.cep = objTabelaFornec.registros[posicao].fo_cep;\n objFornecedor.endereco = objTabelaFornec.registros[posicao].fo_ender;\n objFornecedor.enderNum = objTabelaFornec.registros[posicao].fo_endnum;\n objFornecedor.bairro = objTabelaFornec.registros[posicao].fo_bairro;\n objFornecedor.cidade = objTabelaFornec.registros[posicao].fo_cidade;\n objFornecedor.uf = objTabelaFornec.registros[posicao].fo_uf;\n objFornecedor.calculoSt = objTabelaFornec.registros[posicao].fo_calc_st;\n objFornecedor.lucro = objTabelaFornec.registros[posicao].fo_lucro;\n objFornecedor.conta = objTabelaFornec.registros[posicao].fo_grdesp;\n objFornecedor.divDaConsulta = divDaConsulta; //recupera divDaConsulta\n\n for(var i in objTabelaFornec.registros[posicao]){\n objFornecedor[i] = objTabelaFornec.registros[posicao][i];\n }\n \n if($('#'+objFornecedor.divDaConsulta).hasClass('active')){\n $CNSFORNECdimmer.dimmer(\"consulta hide\");\n }\n cnsFrn_retorno();\n }\n}", "function actualizarHorasExtrasResta(horasARestar){\n\t\t//obtenemos el acumulado actual de las horas extras\n\t\tvar horasExtrasActuales = localStorage.getItem('HorasExtras');\n\t\tvar nuevaHorasExtras = restaHoras(horasExtrasActuales, horasARestar);\n\t\tvar vminutos = nuevaHorasExtras.split(\":\"); \n\t\tvar retNuevaHora = vminutos[0] + \":\" + ( (parseInt(vminutos[1],10) < 10) ? (\"0\" + vminutos[1]) : vminutos[1] );\n\t\tlocalStorage.setItem('HorasExtras', retNuevaHora );\n}", "function adjustCountry(){\r\n\r\n\t//haal de code op van het land\r\n\tvar landcode = $(\"#input-landcode-lang\").val();\r\n\tconsole.log(landcode);\r\n\t\r\n\t//ook de hidden-field met landcode \r\n\t//(als mensen ineens een andere landcode invullen die anders is dan het opgehaalde land)\r\n\t\r\n\tvar hiddenLandcode = $(\"#hidden-code\").val();\r\n\tconsole.log(hiddenLandcode);\r\n\t\r\n\t\r\n\tif(landcode != hiddenLandcode){\r\n\t\tmessageWindow(\"Error: Je landcode klopt niet meer. Verander terug of laad de data opnieuw in\" , \"yellow\");\r\n\t}\r\n\telse{// ga het land aanpassen in de database\r\n\t\t\r\n\t\t//validatie van alle data, lengte/converteren --> net als bij het toevoegen van een land\r\n\t\ttry{\r\n\t\t\tconsole.log(\"check-1\");\r\n\t\t\t//alle data ophalen uit de elementen\t\r\n\t\t\tvar kort = $('#input-landcode-kort').val();\r\n\t\t\tvar lang = $('#input-landcode-lang').val();\r\n\t\t\tvar naam = $('#input-land_naam').val();\r\n\t\t\tvar city = $('#input-hoofdstad').val();\r\n\t\t\tvar continent = $('#input-continent').val();\r\n\t\t\tvar regio = $('#input-regio').val();\r\n\t\t\tvar oppervlakte = $('#input-oppervlakte').val();\r\n\t\t\tvar populatie = $('#input-populatie').val();\r\n\t\t\tvar regering = $('#input-regering').val();\r\n\t\t\tvar lat = $('#input-latitude').val();\r\n\t\t\tvar lon = $('#input-longtitude').val();\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvar continentList = [ 'Europe' , 'Asia' , 'South America' , 'Antarctica' , 'North America' , 'Oceania' , 'Africa' ];\r\n\r\n\t\t\tconsole.log(\"1\");\r\n\t\t\t//checks op alle data \r\n\t\t\t\r\n\t\t\tif((kort.length <=2) == false ){ \r\n\t\t\t\tmessageWindow(\"landcode (kort) is MAX 2 tekens\", \"red\");\r\n\t\t\t}\r\n\t\t\telse if((lang.length > 0) == false || (lang.length <=3) == false){// de request gaat per code, minimaal 1 code is dus verplicht\r\n\t\t\t\tmessageWindow(\"landcode (lang) is MAX 3 tekens\", \"red\");\r\n\t\t\t}\r\n\t\t\telse if((naam.length > 0) == false || (naam.length <= 52) == false){\r\n\t\t\t\tmessageWindow(\"landnaam Moet ingevuld zijn en bestaat uit MAX 52 tekens\", \"red\");\t\t\t\r\n\t\t\t}\r\n\t\t\telse if((city.length > 0) == false){\r\n\t\t\t\tmessageWindow(\"Je moet een hoofdstad invullen\", \"red\");\r\n\t\t\t}\r\n\t\t\telse if((continentList.indexOf(continent) > -1) == false){\r\n\t\t\t\tmessageWindow(\"Geldige continenten zijn : Europe , Asia , South America , North America , Oceania , Africa , Antarctica \", \"red\");\r\n\t\t\t}\r\n\t\t\telse if((regio.length <= 26) == false){\r\n\t\t\t\tmessageWindow(\"Regio is MAX 26 tekens\", \"red\");\r\n\t\t\t}\r\n\t\t\telse if(isNumber(oppervlakte) == false){ \t\t\t\t// het moet een nummer zijn\r\n\t\t\t\tmessageWindow(\"Oppervlakte MOET een getal zijn\", \"red\");\r\n\t\t\t}\r\n\t\t\telse if(isNumber(populatie) == false){ \t\t\t\t\t// het moet een getal zijn\r\n\t\t\t\tmessageWindow(\"Populatie MOET een getal zijn\", \"red\");\r\n\t\t\t}\r\n\t\t\telse if((regering.length <= 45) == false){\r\n\t\t\t\tmessageWindow(\"Regering is MAX 45 tekens\",\"red\");\r\n\t\t\t}\r\n\t\t\telse if(isNumber(lat) == false){\t\t\t\t\t\t// het moet een getal zijn\r\n\t\t\t\tmessageWindow(\"Latitude MOET een getal zijn\", \"red\");\r\n\t\t\t}\r\n\t\t\telse if(isNumber(lon) == false){\t\t\t\t\t\t// het moet een getal zijn\r\n\t\t\t\tmessageWindow(\"Longitude MOET een getal zijn\", \"red\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tconsole.log(\"2\");\r\n\t\t\t\t// nu nog converteren waar nodig\r\n\t\t\t\ttry{\r\n\t\t\t\t\t\r\n\t\t\t\t\toppervlakte = Number(oppervlakte);\r\n\t\t\t\t\toppervlakte.toFixed(2);\r\n\t\t\t\t\t\r\n\t\t\t\t\tpopulatie = Number(populatie);\r\n\t\t\t\t\tpopulatie.toFixed(0);\t\t\t\t//halve mensen bestaan niet\r\n\r\n\t\t\t\t\tlat = Number(lat);\r\n\t\t\t\t\tlat.toFixed(2);\r\n\t\t\t\t\t\r\n\t\t\t\t\tlon = Number(lon);\r\n\t\t\t\t\tlon.toFixed(2);\r\n\t\t\t\t\t\r\n\t\t\t\t\tconsole.log(\"3\");\r\n\t\t\t\t\t\r\n\t\t\t\t}catch(err){\r\n\t\t\t\t\tmessageWindow(\"Error met converteren:\" + err, \"red\");\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\t/*============================================\t\t========================================\t\r\n\t\t\t\t Alle checks/converts nu (eindelijk) gehad ==> \tDan kan het de database in\t\r\n\t\t\t\t ============================================\t\t========================================*/\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tconsole.log(\"4\");\r\n\t\t\t\t\t\r\n\t\t\t\t//eerst een data-object maken van alle ingevoerde gegevens voordat we deze naar de servervice sturen\r\n\t\t\t\tvar data = { \"kort\": kort, \"lang\": lang, \"land\": naam, \"capital\": city, \"continent\": continent, \"regio\": regio,\t\"oppervlakte\": oppervlakte, \"populatie\": populatie, \"regering\": regering, \"latitude\": lat, \"longitude\": lon};\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t//omzetten naar een voor de servervice te begrijpen formaat\r\n\t\t\t\tvar JSONdata = JSON.stringify(data);\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\t\t$.ajax(\"/restservices/countries/\"+lang,{\r\n\t\t\t\t\ttype: \"put\",\r\n\t\t\t\t\tdata: JSONdata,\r\n\t\t\t\t beforeSend: function (xhr) { // je moet ingelogged zijn om het te mogen uitvoeren (token ophalen)\r\n\t\t\t\t var token = window.sessionStorage.getItem(\"sessionToken\");\r\n\t\t\t\t xhr.setRequestHeader( 'Authorization', 'Bearer ' + token);\r\n\t\t\t\t },\r\n\r\n\t\t\t\t\tsuccess: function(response){\r\n\t\t\t\t\t\trandomSearch();\r\n\t\t\t\t\t\t$('#land-pagina').hide();\r\n\t\t\t\t\t\t$('#search').fadeIn(1000);\r\n\t\t\t\t\t\tmessageWindow(\"Response:\" + response.response, \"green\");\r\n\r\n\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror: function(response){\r\n\t\t\t\t\t\tmessageWindow(\"Response AJAX POST: \" + response.response, \"red\");\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\t\t\t}\t\t\t\r\n\t\t}catch(err){\r\n\t\t\tmessageWindow(\"Error:\" + err, \"red\");\r\n\t\t}\t\t\r\n\t}\r\n}", "verificaDados(){\n this.verificaEndereco();\n if(!this.verificaVazio()) this.criaMensagem('Campo vazio detectado', true);\n if(!this.verificaIdade()) this.criaMensagem('Proibido cadastro de menores de idade', true);\n if(!this.verificaCpf()) this.criaMensagem('Cpf deve ser válido', true);\n if(!this.verificaUsuario()) this.criaMensagem('Nome de usuario deve respeitar regras acima', true);\n if(!this.verificaSenhas()) this.criaMensagem('Senha deve ter os critérios acima', true)\n else{\n this.criaMensagem();\n // this.formulario.submit();\n }\n }", "function template_actualizar_colonia(nomElemento) {\n\tvar indexMunicipio = -1;\n\tvar arrayCiudades = Array(\"template_venta_municipio\", \"template_renta_municipio\", \"template_rentaVac_municipio\");\n\tvar arrayColonias = Array(\"template_venta_colonia\", \"template_renta_colonia\", \"template_rentaVac_colonia\");\n\t\n\tindexMunicipio = arrayCiudades.indexOf(nomElemento);\n\t\n\tif (indexMunicipio > -1) {\n\t\tobjMunicipio = $(\"#\"+arrayCiudades[indexMunicipio]);\n\t\tobjColonia = $(\"#\"+arrayColonias[indexMunicipio]);\n\t\t\n\t\tobjColonia.find(\"li.lista ul\").html(\"\");\n\t\tobjColonia.find(\"p\").attr(\"data-value\", -1);\n\t\tobjColonia.find(\"p\").text(\"\");\n\t\t\n\t\t\n\t\t$.ajax({\n\t\t\turl: \"admin/lib_php/consDireccion.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tconsColonia: 1,\n\t\t\t\tciudad: objMunicipio.find(\"p\").attr(\"data-value\")\n\t\t\t}\n\t\t}).always(function(respuesta_json){\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tfor (var x = 0; x < respuesta_json.datos.length; x++) {\n\t\t\t\t\tobjColonia.find(\"li.lista ul\").append(\"<li data-value='\"+respuesta_json.datos[x].id+\"'>\"+respuesta_json.datos[x].nombre+\"</li>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tobjColonia.find(\"li.lista li\").on({\n\t\t\t\t\tclick: function() {\n\t\t\t\t\t\tobjColonia.find(\"p\").attr(\"data-value\", $(this).attr(\"data-value\"));\n\t\t\t\t\t\tobjColonia.find(\"p\").text($(this).text());\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}\n}", "function perder(error) {\n\n $(\"#\" + error.i + \"_\" + error.j).hide(100).css({ //Muestra la primera bomba\n background: \"url(img/mina.png)\",\n \"background-size\": \"cover\",\n border: \"1px solid red\"\n }).show('pulsate', 1000);\n\n $(\".casillaMarcada\").css({\n background: \"url(img/banderaIncorrecta.png)\",\n \"background-size\": \"cover\"\n });\n $.each(arrayMina, function (index, value) { //Muestra las demas bombas\n if (!value.hasClass(\"casillaMarcada\")) {\n setTimeout(() => {\n value.hide(100);\n value.css({\n background: \"url(img/mina.png)\",\n \"background-size\": \"cover\",\n border: \"1px solid red\"\n })\n value.show('pulsate', 1000);\n }, index * 10 + 100)\n } else {\n value.css({\n background: \"url(img/banderaCorrecta.png)\",\n \"background-size\": \"cover\",\n border: \"1px solid red\"\n })\n }\n })\n $(\".casillaDescubierta\").css({ //Pone el fondo de rojo.\n \"background-color\": \"rgba(185,53,53,0.64)\"\n });\n\n detenerReloj();\n alternaReinicia(\"inline\");\n }", "function calculaParcelaFinanciamento (valor,meses){\n var parcela={parcela:0, seguro:0, txadm:0}; \n //caso o prazo seja menor que 12 meses, não há incidência de juros\n if (meses<=12){\n parcela[\"parcela\"]=valor/meses;\n \n return parcela;\n }else{\n //caso contrário, procede ao cálculo financeiro \n var i=0.009488793;\n var numerador= i*Math.pow(1+i,meses);\n var denominador= Math.pow(1+i,meses)-1; \n var valorparcela=valor*(numerador/denominador);\n \n parcela[\"parcela\"]=valorparcela;\n parcela[\"seguro\"]=0.00019*valor;\n parcela[\"txadm\"]=25.00;\n \n return parcela;\n \n }//fim do else\n}//fim da função calculaParcelaFinanciamento ", "function loadMarkersPorTurno(lat, lon) {\n banderaMarcador = false;\n\n var myLatLng = new google.maps.LatLng(lat, lon);\n var map = new google.maps.Map(document.getElementById(\"map3\"), opcionesMap(myLatLng));\n $scope.map = map;\n markerUsuario = dibujarMarcadorMiPos(myLatLng, map);\n var farmaciaHorario = \"<div>\";\n var turnoFarmacia = new Array();\n for (var i = 0; i < datosTemporalesTurno.result.length - 1; i++) {\n record = datosTemporales.result[i];\n recordAux = datosTemporales.result[i + 1];\n console.log(record.nombreSucursal + \" \" + i);\n if ((fechaCel >= record.fechaInicio) && (fechaCel <= record.fechaFin)) {\n turnoFarmacia.push(datosTemporalesTurno.result[i]);\n if (record.nombreSucursal === recordAux.nombreSucursal) {\n farmaciaHorario += formatoInformacionHorario(record);\n } else {\n metodoCargarMarcodores(record, farmaciaHorario);\n farmaciaHorario = \"\";\n }\n if (datosTemporalesTurno.result.length - 1 === (i + 1)) {\n turnoFarmacia.push(datosTemporalesTurno.result[i + 1]);\n metodoCargarMarcodores(recordAux, farmaciaHorario);\n }\n }\n }\n\n\n if (turnoFarmacia.length <= 0) {\n mensaje = \"No hay farmacias de Turno a \" + radODis + \" KM de su ubicación\";\n alerta(mensaje, \"Aceptar\", \"Mensaje\")\n $ionicLoading.hide();\n }\n banderaBuscar = 1;\n datosTemporales = turnoFarmacia;\n\n }", "function guardarRecesoFecha(){\n\t\n\tif( $(\"#selectUsuario_horario\").val() == null ){\n\t\treturn false;\n\t}\n\t\n\tvar idUsuario = $(\"#selectUsuario_horario\").val();\n\tvar sw = 0;\n\n\n\t\t//fecha\n\t\tif( $(\"#fecha_recesoFecha\").val().trim().length == 0 ){\n\t\t\t\n\t\t\t$(\"#label_fecha_recesoFecha\").addClass( \"active\" );\n\t\t\t$(\"#fecha_recesoFecha\").addClass( \"invalid\" );\n\t\t\t\n\t\t\tsw = 1;\n\t\t}\n\t\n\t\t//hora inicio\n\t\tif( $(\"#fecha_recesoInicioFecha\").val().trim().length == 0 ){\n\t\t\t\n\t\t\t$(\"#label_fecha_recesoInicioFecha\").addClass( \"active\" );\n\t\t\t$(\"#fecha_recesoInicioFecha\").addClass( \"invalid\" );\n\t\t\t\n\t\t\tsw = 1;\n\t\t}\n\t\t\n\t\t//hora fin\n\t\tif( $(\"#fecha_recesoFinFecha\").val().trim().length == 0 ){\n\t\t\t\n\t\t\t$(\"#label_fecha_recesoFinFecha\").addClass( \"active\" );\n\t\t\t$(\"#fecha_recesoFinFecha\").addClass( \"invalid\" );\n\t\t \n\t\t sw = 1;\n\t\t}\t\n\t\t\n\t\tif (sw == 0) {\n\t\t\t\n\t\t\t$.ajax({\n\t \t\turl: \"http://www.nanuvet.com/Controllers/agenda/guardarRecesoFecha.php\",\n\t dataType: \"html\",\n\t type : 'POST',\n\t data: {\n\t \t idUsuario : idUsuario,\n\t \t fecha\t\t: $(\"#fecha_recesoFecha\").val(),\n\t \t horaInicio : $(\"#fecha_recesoInicioFecha\").val(),\n\t \t horaFin\t\t: $(\"#fecha_recesoFinFecha\").val()\n\t \t},success: function() {\n\t\t\t \t\n\t\t\t \tMaterialize.toast($(\"#mensajeGuardadoFechaReceso\").html(), 4000);\t\n\t\t\t \t\n\t\t\t \tconsultarRecesoFechas(idUsuario);\n\t\t\t \t\n\t\t\t \t//se limpian los campos\n\t\t\t \t$(\"#fecha_recesoFecha\").val(\"\");\n\t\t\t \t$(\"#fecha_recesoInicioFecha\").val(\"\");\n\t\t\t \t$(\"#fecha_recesoFinFecha\").val(\"\");\n\t\t\t \t\n\t\t\t \t$(\"#fecha_recesoFecha\").removeClass( \"invalid\" );\n\t\t\t \t$(\"#fecha_recesoInicioFecha\").removeClass( \"invalid\" );\n\t\t\t \t$(\"#fecha_recesoFinFecha\").removeClass( \"invalid\" );\n\t\t\t \t\n\t\t\t \t$(\"#fecha_recesoFecha\").removeClass( \"valid\" );\n\t\t\t \t$(\"#fecha_recesoInicioFecha\").removeClass( \"valid\" );\n\t\t\t \t$(\"#fecha_recesoFinFecha\").removeClass( \"valid\" );\n\t\t\t \t\n\t\t\t \t$(\"#label_fecha_recesoFecha\").removeClass( \"active\" );\n\t\t\t \t$(\"#label_fecha_recesoInicioFecha\").removeClass( \"active\" );\n\t\t\t \t$(\"#label_fecha_recesoFinFecha\").removeClass( \"active\" );\t\t\t \t\n\t\t\t \t\t \n\t\t\t }//fin succes\n\t \t});\t\t\n\t\t\t\n\t\t}else{\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t\n}", "function ActualizaPosicionTaxi()\n {\n //console.log(\"ActualizaPosicionTaxi\");\n var mts=getDistance(posicionActual, ultimaPosicionUsuario);\n //var mts=110;\n console.log(\"posicionActual:\" + posicionActual + \"ultimaPosicionUsuario: \" + ultimaPosicionUsuario);\n if (mts>DistanciaMinima) { //Actualiza posicion si se movió más de 100 mts\n console.log(\"Distancia > 100 mts, actualizando posicion\");\n //NotificaToast(\"Distancia=\" + mts);\n placa=window.localStorage.getItem(\"Placa\");\n $.post(urllocal + 'tools/Tx_ActualizaPosicion.php', \n {placa: placa,\n lattaxi: latitud_taxi,\n longtaxi: longitud_taxi}, null, null\n );\n ultimaPosicionUsuario=posicionActual;\n //navigator.notification.beep(1);\n }else{\n console.log(\"Distancia= \" + mts + \" < 100 mts, no se actualiza\");\n //NotificaToast(\"Distancia < 100 mts, no se actualiza\");\n };\n }", "function boucleJeu() {\n\n var nouvelInterval = Date.now();\n\n\n\n //SI au premier instant du jeu on initialise le debut de l'interval a quelque chose\n if (!debutInterval) {\n debutInterval = Date.now();\n }\n\n gestionnaireObjets.repositionnerObjets(Bouteille, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Obstacle, nouvelInterval);\n gestionnaireObjets.repositionnerObjets(Voiture, nouvelInterval);\n\n\n //Si le nouveau temps est plus grand que l'accelaration souhaiter par rapport au début de l'interval\n if (nouvelInterval - debutInterval >= 20) {\n vitesseRoute += 0.005;\n\n debutInterval = nouvelInterval;\n }\n\n //Appliquer les déplacements\n gestionnaireObjets.deplacerLesObjets(vitesseRoute);\n }", "function Inicializar() {\n $(\"input.fecha\").datepicker($.datepicker.regional[\"es\"]);\n Argumentos = searchToJSON();\n $(\"#idOperador\").val(Argumentos.idOperador);\n $(\"input.fecha\").val(AFechaMuyCorta(new Date()));\n if (Argumentos.Supervisados == 0) {\n $(\"#filaOperador\").hide();\n $(\"#Supervisado\").val(0);\n } else {\n //OperadoresSupervisados_lst(_OperadoresSupervisados_lst, Argumentos.idOperador);RA\n LlamarServicio(_OperadoresSupervisados_lst, \"OperadoresSupervisados_lst\", { idOperador: Argumentos.idOperador });\n $(\"#Supervisado\").val(1);\n }\n\n}", "function pedidos_realizados(){\r\n var base_url = document.getElementById('base_url').value;\r\n var desde = document.getElementById('fecha_desde').value;\r\n var hasta = document.getElementById('fecha_hasta').value;\r\n var usuario_id = document.getElementById('usuario_prevendedor').value;\r\n var controlador = base_url+'pedido/pedidos_pendientes/';\r\n \r\n document.getElementById('loader').style.display = 'block'; //muestra el bloque del loader\r\n \r\n $.ajax({url: controlador,\r\n type:\"POST\",\r\n data:{usuario_id:usuario_id, desde:desde, hasta:hasta},\r\n success:function(respuesta){\r\n $(\"#num_pedidos\").html(\"0\");\r\n var registros = JSON.parse(respuesta);\r\n if (registros != null){\r\n var n = registros.length; //tamaño del arreglo de la consulta\r\n $(\"#num_pedidos\").html(n);\r\n html = \"\";\r\n /* ************ Inicio para el mapa ************ */\r\n var coordenadas= new google.maps.LatLng(-17.4038, -66.1635); \r\n //var infowindow = true; \r\n //puntos a ser marcados en el mapa \r\n var puntos = []; \r\n //var link1 = '<?php //echo base_url().'venta/ventas_cliente/'; ?>';\r\n //var link2 = \"'\"+base_url+\"pedido/pedidoabierto/\"+\"'\";\r\n var punto; \r\n //var contenido ='';\r\n \r\n for (var i = 0; i < n ; i++){\r\n punto = [registros[i][\"cliente_nombre\"]+\"(\"+registros[i][\"cliente_codigo\"]+\")\", registros[i][\"cliente_latitud\"], registros[i][\"cliente_longitud\"], '\"'+registros[i][\"cliente_direccion\"]+'\"', registros[i][\"cliente_id\"], registros[i][\"cliente_visitado\"],registros[i][\"pedido_id\"]];\r\n puntos[i] = punto; \r\n }\r\n //alert(puntos);\r\n initialize(puntos); //inicializar el mapa \r\n document.getElementById('loader').style.display = 'none';\r\n }\r\n document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader\r\n },\r\n error:function(respuesta){\r\n // alert(\"Algo salio mal...!!!\");\r\n html = \"\";\r\n $(\"#tablaresultados\").html(html);\r\n },\r\n complete: function (jqXHR, textStatus) {\r\n document.getElementById('loader').style.display = 'none'; //ocultar el bloque del loader \r\n //tabla_inventario();\r\n }\r\n \r\n }); \r\n\r\n}", "function operadorAceptoSolicitud(req,res){\n let id_operador= req.params.id, id_solicitante = req.params.id_solicitante;\n let solicitud = buscarSolicitud(id_solicitante);\n let flag=buscarOperador(id_operador);\n\n\n solicitudes[solicitud].estatus='aceptada';\n solicitudes[solicitud].operador= id_operador;\n solicitudes[solicitud].latOperador = operadores[flag.i-1].lat;\n solicitudes[solicitud].lngOperador = operadores[flag.i-1].lng;\n\n console.log('SOLICITUD AGENDADA:',solicitudes[solicitud]);\n\n //AQUI VA LA FECHA POR EJEMPLO\n var date = new Date();\n var fechaActual = moment(date).format('YYYY-MM-DD');\n console.log(` fechas ${ fechaActual } == ${solicitudes[solicitud].fecha}`);\n if(fechaActual < solicitudes[solicitud].fecha ){\n //aqui se guardara\n console.log(`se guardardo en base de datos solicitud agendada`);\n let sql = `INSERT INTO solicitud \n (id_solicitud, id_solicitante, id_operador, id_servicio, fecha, hora, lat_inicio, lng_inicio, lat_fin, lng_fin, costo, estatus) \n VALUES \n ('NULL', \n '${solicitudes[solicitud].id_solicitante}',\n '${id_operador}',\n '${solicitudes[solicitud].id_servicio}', \n '${solicitudes[solicitud].fecha}', \n '${solicitudes[solicitud].hora}', \n '${operadores[flag.i-1].lat}', \n '${operadores[flag.i-1].lng}', \n '${solicitudes[solicitud].lat}', \n '${solicitudes[solicitud].lng}', \n '100', \n 'AGENDADA'\n )`;\n consultaBd.insertar(sql,(result)=>{\n if(result){\n console.log('se guardo en la base de datos solicitud agendada');\n res.status(200).send({message:[{'flag':'guardado','cuerpo':[]}]});\n solicitudes.splice(solicitud,1);\n }\n })\n }else{\n //buscamos al solicitante en la base de datos\n \n console.log(`solicitud de : ${ solicitudes[solicitud].id_solicitante } fue ${ solicitudes[solicitud].estatus }\n por el operador: ${ id_operador }`);\n //buscamos la lat y lng del operador para agregarlos al row de la solicitud en el arreglo\n let flag=buscarOperador(id_operador);\n solicitudes[solicitud].latOperador = operadores[flag.i-1].lat;\n solicitudes[solicitud].lngOperador = operadores[flag.i-1].lng;\n if(flag.flag){//verificamos que el operador este en el arreglo\n operadores.splice(flag.i-1,1);\n let rechazada = verificarRechazo(id_operador);\n if(rechazada.flag){//verificamos si alguien rechazo la solicitud\n arregloSolicitudRechazada.splice(rechazada.pos,1); //la eliminamos del arreglo de rechazadas\n }\n res.status(200).send({message:['Estado: Desconectado']})\n }else{\n res.status(404).send({message:['Error: No se encontro el operador']})\n }\n }\n}", "function buscaOrdenesDeCompraPendientesDeAprobacion(tipo_busqueda){\n\tvar error = 0;\n\tvar idSucursal = $(\"#select-sucursal\").find(\"option:selected\").val();\n\tvar idUsuarioSolicitante = $(\"#select-usuario-solicitante\").find(\"option:selected\").val();\n\tvar fecha_inicio = $(\"#fechadel\").val();\n\tvar fecha_fin = $(\"#fechaal\").val();\n\tvar idOrdenCompra = $(\"#idordencompra\").val();\n\t//var FechaInicioConv = convierteFechaJava(fecha_inicio);\n\t//var FechaFinConv = convierteFechaJava(fecha_fin);\n\t\n\t\n\tif(tipo_busqueda==1){\n\t\tif((idSucursal == '-1')&&(idUsuarioSolicitante == '-1')&&(fecha_inicio == '')&&(fecha_fin=='')){\n\t\t\talert('Debe elgir un crierio');\n\t\t\terror = 1;\n\t\t}\n\t\tif(fecha_inicio > fecha_fin){\n\t\t\talert(\"La fecha incial no puede ser mayor a la fecha final\");\n\t\t\terror = 1;\n\t\t}\n\t}else if(tipo_busqueda==2){\n\t\tif(idOrdenCompra==''){\n\t\t\talert('Debe introducir una orden de compra');\n\t\t\terror = 1;\n\t\t}\n\t}\n\tif(error == 0){\n\t\tvar FechaInicioConv = cambiarFormatoFecha(fecha_inicio,'ymd','-');\n\t\tvar FechaFinConv = cambiarFormatoFecha(fecha_fin,'ymd','-');\n\n\t\t$(\".detalle tbody tr\").remove();\n\t\tvar ruta = \"llenaTablaDetalle.php\";\n\t\tvar envio = \"idSucursal=\" + idSucursal + \"&idUsuarioSolicitante=\" + idUsuarioSolicitante + \"&fecini=\" + FechaInicioConv + \"&fecfin=\" + FechaFinConv + \"&idOrdenCompra=\"+idOrdenCompra+\"&proceso=ordenes_compra_pendientes_de_aprobacion\";\n\t\tvar respuesta = ajaxN(ruta, envio);\n\t\t$(\".detalle tbody\").append(respuesta);\n\t}\n}", "function effemeridi_pianeti(np,TEMPO_RIF,LAT,LON,ALT,ITERAZIONI,STEP,LAN){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2011\n // funzione per il calcolo delle effemeridi del Sole.\n // Parametri utilizzati\n // np= numero identificativo del pianeta 0=Mercurio,1=Venere.....7=Nettuno\n // il valore np=2 (Terra) non deve essere utilizzato come parametro.\n // TEMPO_RIF= \"TL\" o \"TU\" tempo locale o tempo universale.\n // LAT= latitudine in gradi sessadecimali.\n // LON= longtudine in gradi sessadecimali.\n // ALT= altitudine in metri.\n // ITERAZIONE =numero di ripetizioni del calcolo.\n // STEP=salto \n // LAN=\"EN\" versione in inglese.\n \n \n var njd=calcola_jdUT0(); // numero del giorno giuliano all'ora 0 di oggi T.U.\n\n njd=njd+0.00078; // correzione per il Terrestrial Time.\n\n //njd=njd+t_luce(njd,np); // correzione tempo luce.\n \nvar data_ins=0; // data\nvar data_inser=0; // data\nvar numero_iterazioni=ITERAZIONI;\n\nvar fusoloc=-fuso_loc(); // recupera il fuso orario della località (compresa l'ora legale) e riporta l'ora del pc. come T.U.\n\nvar sorge=0;\nvar trans=0;\nvar tramn=0;\nvar azimuts=0;\nvar azimutt=0;\n\nvar effe_pianeta=0;\nvar ar_pianeta=0;\nvar de_pianeta=0;\nvar classetab=\"colore_tabellaef1\";\nvar istanti=0;\nvar magnitudine=0;\nvar fase=0;\nvar diametro=0;\nvar distanza=0;\nvar elongazione=0;\nvar costl=\"*\"; // nome della costellazione.\nvar parallasse=0;\nvar p_ap=0; // coordinate apparenti del pianeta.\n\nif (STEP==0) {STEP=1;}\n \n document.write(\"<table width=100% class='.table_effemeridi'>\");\n document.write(\" <tr>\");\n\n // versione in italiano.\n\n if (LAN!=\"EN\") // diverso da EN\n {\n document.write(\" <td class='colore_tabella'>Data:</td>\");\n document.write(\" <td class='colore_tabella'>Sorge:</td>\");\n document.write(\" <td class='colore_tabella'>Culmina:</td>\");\n document.write(\" <td class='colore_tabella'>Tramonta:</td>\");\n document.write(\" <td class='colore_tabella'>A. So.:</td>\");\n document.write(\" <td class='colore_tabella'>A. Tr.:</td>\");\n document.write(\" <td class='colore_tabella'>A. Retta:</td>\");\n document.write(\" <td class='colore_tabella'>Dec.:</td>\");\n document.write(\" <td class='colore_tabella'>Fase.</td>\");\n document.write(\" <td class='colore_tabella'>Dist.</td>\");\n document.write(\" <td class='colore_tabella'>Dia.</td>\");\n document.write(\" <td class='colore_tabella'>El.</td>\");\n document.write(\" <td class='colore_tabella'>Ma.</td>\");\n document.write(\" <td class='colore_tabella'>Cost.</td>\");\n }\n\n // versione in inglese.\n\nif (LAN==\"EN\")\n {\n\n document.write(\" <td class='colore_tabella'>Date:</td>\");\n document.write(\" <td class='colore_tabella'>Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Transit:</td>\");\n document.write(\" <td class='colore_tabella'>Set:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Rise:</td>\");\n document.write(\" <td class='colore_tabella'>Az. Set:</td>\");\n document.write(\" <td class='colore_tabella'>R.A.:</td>\");\n document.write(\" <td class='colore_tabella'>Dec.:</td>\");\n document.write(\" <td class='colore_tabella'>Ph.</td>\");\n document.write(\" <td class='colore_tabella'>Dist.</td>\");\n document.write(\" <td class='colore_tabella'>Dia.</td>\");\n document.write(\" <td class='colore_tabella'>El.</td>\");\n document.write(\" <td class='colore_tabella'>Ma.</td>\");\n document.write(\" <td class='colore_tabella'>Const.</td>\");\n\n }\n\n\n document.write(\" </tr>\");\n\n // ST_ASTRO_DATA Array(azimut_sorgere,azimut_tramonto,tempo_sorgere,tempo_transito,tempo_tramonto)\n // 0 1 2 3 4\n\n njd=njd-STEP;\n\n for (b=0; b<numero_iterazioni; b=b+STEP){\n njd=njd+STEP;\n effe_pianeta=pos_pianeti(njd,np); \n\n // calcola le coordinate apparenti nutazione e aberrazione.\n\n p_ap=pos_app(njd,effe_pianeta[0],effe_pianeta[1]);\n ar_pianeta= sc_ore(p_ap[0]); // ascensione retta in hh:mm:ss.\n de_pianeta=sc_angolo(p_ap[1],0); // declinazione. \n \n fase=effe_pianeta[2];\n magnitudine=effe_pianeta[3];\n distanza=effe_pianeta[4].toFixed(3);\n diametro=effe_pianeta[5].toFixed(1);\n elongazione=effe_pianeta[6].toFixed(1);\n costl=costell(effe_pianeta[0]); // costellazione.\n\n istanti=ST_ASTRO_DATA(njd,effe_pianeta[0],effe_pianeta[1],LON,LAT,ALT,0);\n\nif (TEMPO_RIF==\"TL\"){\n sorge=ore_24(istanti[2]+fusoloc);\n trans=ore_24(istanti[3]+fusoloc);\n tramn=ore_24(istanti[4]+fusoloc); }\n\nelse {\n sorge=ore_24(istanti[2]);\n trans=ore_24(istanti[3]);\n tramn=ore_24(istanti[4]); } \n\n sorge=sc_ore_hm(sorge); // istanti in hh:mm\n trans=sc_ore_hm(trans);\n tramn=sc_ore_hm(tramn);\n\n // formatta la data da inserire.\n\n data_ins=jd_data(njd);\n\n if (LAN!=\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\":\"+Lnum(parseInt(data_ins[1]),2)+\" |\"+data_ins[3];} // versione in italiano.\n if (LAN==\"EN\") {data_inser=Lnum(parseInt(data_ins[0]),2)+\":\"+Lnum(parseInt(data_ins[1]),2)+\" |\"+data_ins[4];} // versione in inglese.\n\n azimuts=istanti[0].toFixed(1);\n azimutt=istanti[1].toFixed(1);\n\n if (b%2==0){classetab=\"colore_tabellaef2\"; }\n\n else {classetab=\"colore_tabellaef1\";}\n\n\n document.write(\" <tr>\");\n document.write(\" <td class='\"+classetab+\"'>\"+data_inser+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+sorge+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+trans+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+tramn+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+azimuts+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+azimutt+\"&deg;</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+ar_pianeta+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+de_pianeta+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+fase+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+distanza+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+diametro+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+elongazione+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+magnitudine+\"</td>\");\n document.write(\" <td class='\"+classetab+\"'>\"+costl+\"</td>\");\n\n document.write(\" </tr>\");\n\n }\n document.write(\" </table>\");\n\n\n}", "function inicializaCronometro() {\n\t\n\tcampo.one(\"focus\", function () { // a função one descarta eventos iguais seguintes\n//campo.on(\"focus\", function () { // a função on capta o 1º e todos os eventos posteriores\n\t\tvar tempoRestanteSPAN = $(\"#tempo-digitacao\");\n\t\tvar tempoRestante = tempoRestanteSPAN.text();\n\n\t\tdesabilitaIcon(\"#botao-reiniciar\");\n\t\t\t/*$(\"#botao-reiniciar\").attr(\"disabled\",true);\n\t\t\t$(\"#botao-reiniciar\").addClass(\"disabled\");*/\n\t\tvar cronometroID = setInterval(function () {\n\t\t\ttempoRestanteSPAN.text(--tempoRestante);\n\t\t\t// .attr(\"atributo da tag\", ?) devolve e define, como a .text(?).\n\t\t\tif( tempoRestante < 1 ) {\n\t\t\t\tclearInterval(cronometroID);\n\t\t\t\tfinalizaJogo();\n\t\t\t}\n\n\t\t}, 1000);\n\t});\n}", "function template_actualizar_colonia(nomElemento, idColonia) {\n\tvar indexMunicipio = -1;\n\tvar arrayCiudades = Array(\"template_venta_municipio\", \"template_renta_municipio\", \"template_rentaVac_municipio\", \"template_busqueda_municipio\");\n\tvar arrayColonias = Array(\"template_venta_colonia\", \"template_renta_colonia\", \"template_rentaVac_colonia\", \"template_busqueda_colonia\");\n\t\n\tindexMunicipio = arrayCiudades.indexOf(nomElemento);\n\t\n\tif (indexMunicipio > -1) {\n\t\tobjMunicipio = $(\"#\"+arrayCiudades[indexMunicipio]);\n\t\tobjColonia = $(\"#\"+arrayColonias[indexMunicipio]);\n\t\t\n\t\tobjColonia.find(\"li.lista ul\").html(\"\");\n\t\tobjColonia.find(\"p\").attr(\"data-value\", -1);\n\t\tobjColonia.find(\"p\").text(\"\");\n\t\t\n\t\t\n\t\t$.ajax({\n\t\t\turl: \"admin/lib_php/consDireccion.php\",\n\t\t\ttype: \"POST\",\n\t\t\tdataType: \"json\",\n\t\t\tdata: {\n\t\t\t\tconsColonia: 1,\n\t\t\t\tconResultados: 1,\n\t\t\t\tciudad: objMunicipio.find(\"p\").attr(\"data-value\")\n\t\t\t}\n\t\t}).always(function(respuesta_json){\n\t\t\tif (respuesta_json.isExito == 1) {\n\t\t\t\tfor (var x = 0; x < respuesta_json.datos.length; x++) {\n\t\t\t\t\tobjColonia.find(\"li.lista ul\").append(\"<li data-value='\"+respuesta_json.datos[x].id+\"'>\"+respuesta_json.datos[x].nombre+\"</li>\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tobjColonia.find(\"li.lista li\").on({\n\t\t\t\t\tclick: function() {\n\t\t\t\t\t\tobjColonia.find(\"p\").attr(\"data-value\", $(this).attr(\"data-value\"));\n\t\t\t\t\t\tobjColonia.find(\"p\").text($(this).text());\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tif ((idColonia != null) && (idColonia != -1)) {\n\t\t\t\t\tobjColonia.find(\"li.lista li[data-value='\"+idColonia+\"']\").click();\n\t\t\t\t\tobjColonia.find(\"li.lista\").hide();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}\n}", "function FinalizaFactura(){\n\tvar error = {\n\t\tstatus:false,\n\t\ttitle:\"Datos faltantes\",\n\t\tmsg:\"Debe completar todos las lineas vacias\"\n\t}\n\t//se actualizan los totales antes de ejecutar cualquier paso de la funcion\n\tActualizaPrecios();\n\t\n\t//se establecen las variables\n\tvar fecha = $(\"#data_fecha\").val();\n\tvar contribuyente = $(\"#data_contribuyente\").val();\n\tvar cliente = $(\"#data_cliente\").val();\n\tvar consecutivo = $(\"#data_consecutivo\").val();\n\tvar tipo_doc = $(\"data_tipo-doc\").val();\n\tvar servicio = \"\";\n\tvar cant = 0;\n\tvar monto = 0;\n\t\n\t//se establece el array asocioativo\n\tvar lineas = [];\n\n\t$(\".linea_factura\").each(function() {\n\t servicio = $(this).children(\"td\").children('.linea_servicio').first().val();\n\t cant = $(this).children(\"td\").children('.linea_cantidad').first().val();\n\t monto = $(this).children(\"td\").children('.linea_precio').first().val();\n\n\t if (cant == \"\") {\n\t \tcant = 1;\n\t }\n\n\t if (servicio == \"\") {\n\t \terror.status = true;\n\t \t$(this).children(\"td\").children('.linea_cantidad').first().addClass(\"has-error\");\n\t }\n\n\t if (monto == \"\") {\n\t \terror.status = true;\n\t \t$(this).children(\"td\").children('.linea_precio').first().addClass(\"has-error\");\n\t }else{\n\t \tlineas.push([cant, servicio, monto]);\n\t }\n\n\t});\n\n\t//resultado del array = \n\t// [ [cantidad, nombre, precio], [cantidad, nombre, precio], [cantidad, nombre, precio] ]\n\n\t// for (var i = 0; i < lineas.length; i++) {\n\t// \tfor (var j = 0; j < lineas[i].length; j++) {\n\t// \t\tconsole.log(lineas[i][j]);\n\t// \t}\n\t// }\n\n\tvar subtotal = $(\"\").val();\n\tvar impuesto = $(\"\").val();\n\tvar total = $(\"\").val();\n\t\n\tif (!error.status) {\n\t\t//Función AJAX para crear el XML\n\t\t$.ajax({\n\t\t\turl : \"controller/async/async.xmlCreator.php\",\n\t\t\tmethod : \"post\",\n\t\t\tdataType : \"json\",\n\t\t\tdata: {\n\t\t\t\tfecha : fecha,\n\t\t\t\tcedula : cliente,\n\t\t\t\tdetalle : lineas // Por estandar , las variables que contienen elementos del DOM obtenidos con JQuery se representan con un \"$\" al inicio.\n\n\t\t\t},\n\t\t\tsuccess: function(response){\n\t\t\t\tconsole.log(response.clave);\n\t\t\t\tconsole.log(response.fecha);\n\t\t\t\tconsole.log(response.emisor);\n\t\t\t\tconsole.log(response.receptor);\n\t\t\t\tconsole.log(response.comprobanteXml);\n\t\t\t},\n\t\t\terror: function(xhr, status, errormsg){\n\t\t\t\tconsole.log(xhr.responseText);\n\t\t\t\tconsole.log(status);\n\t\t\t\tconsole.log(errormsg);\n\t\t\t}\n\n\t\t});\n\t}else{\n\t\t$(\"#response_title\").text(error.title);\n\t\t$(\"#response_msg\").text(error.msg);\n\t\t$(\"#myModal\").modal(\"show\");\n\t}\n\n\n}", "validateData(){\n this.hasSavedValues = false\n\n this.publicoAlvoSim > 0 ? this.hasSavedValues = true : null\n this.publicoAlvoALVA > 0 ? this.hasSavedValues = true : null\n this.publicoAlvoALVA > 0 ? this.hasSavedValues = true : null\n\n this.XER > 0 ? this.hasSavedValues = true : null\n this.COP > 0 ? this.hasSavedValues = true : null\n\n this.listaPrefixos.length > 0 ? this.hasSavedValues = true : null\n\n this.operacaoNaoVinculada > 0 ? this.hasSavedValues = true : null\n this.operacaoVinculada > 0 ? this.hasSavedValues = true : null\n this.operacaoVinculadaEmOutroNPJ > 0 ? this.hasSavedValues = true : null\n\n this.acordoRegPortalSim > 0 ? this.hasSavedValues = true : null\n this.acordoRegPortalNao > 0 ? this.hasSavedValues = true : null\n //this.acordoRegPortalDuplicados > 0 ? this.hasSavedValues = true : null\n\n this.estoqueNumber > 0 ? this.hasSavedValues = true : null\n this.fluxoNumber > 0 ? this.hasSavedValues = true : null\n \n this.duplicadoSimNao > 0 ? this.hasSavedValues = true : null\n this.analisadoSimNao > 0 ? this.hasSavedValues = true : null\n }", "function initWaitZone() {\n\t\n\t// ajustement de la zone globale.\n\tvar $waitingZone = $('.wdg_section_wait');\n\tvar heightParent = $waitingZone.parent().height() + $('.wdg_produit_all').height() + 10; // 10 supplement marge.\n\t$waitingZone.css({\n\t\t'height' : heightParent\n\t});\n\t\n\t// positionnement de la zone message\n\tvar $waitZoneData = $('.wdg_section_wait_data');\n\tvar marginTop = ($waitZoneData.parent().height() - 50) / 2; \n\t// var width = $waitZoneData.find(\"img\")[0].width + $waitZoneData.find(\"span\").width(); \n\tvar marginLeft = ($waitZoneData.parent().width() - $waitZoneData.width()) / 2; \n\t$waitZoneData.css({\n\t\t'marginTop' : marginTop,\n\t\t'marginLeft' : marginLeft\n\t});\n\t\n}", "setAnteriorSala(){\n switch (this.entradaAnteriorSala) {\n case posicionSala.derecha:\n this.izquierda = this.anteriorSala;\n break;\n case posicionSala.izquierda:\n this.derecha = this.anteriorSala;\n break;\n case posicionSala.abajo:\n this.arriba = this.anteriorSala;\n break;\n case posicionSala.arriba:\n this.abajo = this.anteriorSala;\n break;\n\n\n }\n }", "function restaHoras(v1, v2){\n\t\tvar minutos1= PasarHoraAMinutos(v1);\n\t\tvar minutos2= PasarHoraAMinutos(v2);\n\t\tvar minutos = minutos1 - minutos2;\n\t\tretHoras = PasarMinutosAHora(minutos);\t\t\n\t\treturn retHoras;\n}", "function actualizaCompra(urlBase){\n //Se obtienen los valores digitados en el formulario.\n var id_compra = document.getElementById('id-compra').value;\n var proveedor = document.getElementById('compra-proveedor-id').value;\n var proveedor_idx = document.getElementById('compra-proveedor-id').selectedIndex;\n var fecha = document.getElementById('compra-fecha').value;\n var costo = document.getElementById('compra-costo').value;\n var estado = document.getElementById('compra-estado-id').value;\n var estado_idx = document.getElementById('compra-estado-id').selectedIndex;\n var descripcion = document.getElementById('compra-descripcion').value;\n \n //Se eliminan espacios en blanco al inicio y al final de los valores ingresados.\n id_compra = $.trim(id_compra);\n proveedor = $.trim(proveedor);\n fecha = $.trim(fecha);\n costo = $.trim(costo);\n estado = $.trim(estado);\n descripcion = $.trim(descripcion);\n \n //Se realizan las validaciones sobre los campos ingresados.\n try{\n if(id_compra === null || id_compra.length === 0 || /^\\s+$/.test(id_compra) ) {\n throw \"El campo Código de la Compra es obligatorio.\";\n }\n if(proveedor_idx === null){\n throw \"Debe seleccionar un Proveedor de la lista.\";\n }\n if(fecha === null || fecha.length === 0){\n throw \"El campo Fecha es obligatorio.\";\n }\n if(estado_idx === null){\n throw \"Debe seleccionar un Estado de la lista.\";\n }\n \n if(descripcion === null || descripcion.length === 0 || /^\\s+$/.test(descripcion) ) {\n throw \"El campo Descripción de la Compra es obligatorio.\";\n }\n //Se valida si la compra a registrar ya existe,\n //de lo contrario se realiza el registro\n $.ajax({\n url:urlBase+'compras/actualizarCompra',\n async:false,\n data:{\n idComp:id_compra,\n proveedorComp:proveedor,\n fechaComp:fecha,\n costoComp:costo,\n estadoComp:estado,\n descriComp:descripcion\n },\n type:'POST',\n success:function(update){\n try{\n if(update !== \"true\"){\n throw \"Falló la actualización de la Compra\";\n }\n if(update === \"true\"){\n alert(\"Compra actualizada exitosamente.\");\n }\n }\n catch(err){\n alert(err);\n }\n }\n });\n }\n catch(err){\n alert(err);\n }\n}", "function ControladorDeEscenas(){\n //contiene el controlador de elementos visuales\n var controladorHospitales;\n\n this.iniciaControl = function(_controladorHospitales){\n controladorHospitales = _controladorHospitales;\n }\n\n\n this.setEscena1 = function(){\n \n //pon los hospitales en grid\n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaGrid(0,0,generalWidth, generalHeight,80,150, hospitalesids));\n \n //define el diametro de los hexagonos\n //y el radio de los circulos\n controladorHospitales.controladorDeHexCharts.setDiameter(80);\n controladorHospitales.controladorDeHexCharts.setRadius(2);\n //pon las lineas Contadoras de un lado \n controladorHospitales.controladorDeLineasContadoras.movePosicionLineasContadoras(75,90);\n controladorHospitales.controladorDeLineasContadoras.setLargoLinea(50);\n }\n\n //en la escena dos ser ordenan los hospitales por delegacion o por tipo de hospital\n this.setEscena2 = function(){\n controladorHospitales.setPosicionDeDOMSHospitales(definidorDePosiciones.generaClustersDePosicionesPorTipo(100,100,600,600,80,150,mapHospitalesPorTipo,50));\n }\n\n //en la escena tres se muestran los datos acumulando por mes.\n this.setEscena3 = function(){\n var circulos = d3.selectAll(\"#vivo\");\n\n circulos.transition().duration(1000).attr(\"transform\", function(d) { \n return \"translate(\" + 0 + \",\" + 0 + \")\"; });\n }\n\n}", "async geraUsuariosNovos(){\n\t\tawait this.geraUsuarios(1);\n\t\t\n\t\t//Botei esse tempo porque acredito que mesmo esperando geraUsuarios, os setState dentro podem não ter terminado, pode ser por estar mal configurado também.\n\t\tawait new Promise(resolve => { setTimeout(resolve, 1000); });\n\t\tthis.setState({carregando: false});\n\t}", "function createCountry(){\r\n\t\r\n\t//validatie van alle data, lengte/converteren\r\n\ttry{\r\n\t\tconsole.log(\"check-1\");\r\n\t\t//alle data ophalen uit de elementen\t\r\n\t\tvar kort = $('#landcode-kort').val();\r\n\t\tvar lang = $('#landcode-lang').val();\r\n\t\tvar naam = $('#land_naam').val();\r\n\t\tvar city = $('#hoofdstad').val();\r\n\t\tvar continent = $('#continent').val();\r\n\t\tvar regio = $('#regio').val();\r\n\t\tvar oppervlakte = $('#oppervlakte').val();\r\n\t\tvar populatie = $('#populatie').val();\r\n\t\tvar regering = $('#regering').val();\r\n\t\tvar lat = $('#latitude').val();\r\n\t\tvar lon = $('#longtitude').val();\r\n\t\t\r\n\t\t\r\n\t\tvar continentList = [ 'Europe' , 'Asia' , 'South America' , 'Antarctica' , 'North America' , 'Oceania' , 'Africa' ];\r\n\r\n\t\tconsole.log(\"1\");\r\n\t\t//checks op alle data \r\n\t\t\r\n\t\tif((kort.length > 0) == false || (kort.length <=2) == false ){ // de request gaat per code, minimaal 1 code is dus verplicht\r\n\t\t\tmessageWindow(\"landcode (kort) is MAX 2 tekens\", \"red\");\r\n\t\t}\r\n\t\telse if((lang.length <= 3) == false){\r\n\t\t\tmessageWindow(\"landcode (lang) is MAX 3 tekens\", \"red\");\r\n\t\t}\r\n\t\telse if((naam.length > 0) == false || (naam.length <= 52) == false){\r\n\t\t\tmessageWindow(\"landnaam Moet ingevuld zijn en bestaat uit MAX 52 tekens\", \"red\");\t\t\t\r\n\t\t}\r\n\t\telse if((city.length > 0) == false){\r\n\t\t\tmessageWindow(\"Je moet een hoofdstad invullen\", \"red\");\r\n\t\t}\r\n\t\telse if((continentList.indexOf(continent) > -1) == false){\r\n\t\t\tmessageWindow(\"Geldige continenten zijn : Europe , Asia , South America , North America , Oceania , Africa , Antarctica \", \"red\");\r\n\t\t}\r\n\t\telse if((regio.length <= 26) == false){\r\n\t\t\tmessageWindow(\"Regio is MAX 26 tekens\", \"red\");\r\n\t\t}\r\n\t\telse if(isNumber(oppervlakte) == false){ \t\t\t\t// het moet een nummer zijn\r\n\t\t\tmessageWindow(\"Oppervlakte MOET een getal zijn\", \"red\");\r\n\t\t}\r\n\t\telse if(isNumber(populatie) == false){ \t\t\t\t\t// het moet een getal zijn\r\n\t\t\tmessageWindow(\"Populatie MOET een getal zijn\", \"red\");\r\n\t\t}\r\n\t\telse if((regering.length <= 45) == false){\r\n\t\t\tmessageWindow(\"Regering is MAX 45 tekens\",\"red\");\r\n\t\t}\r\n\t\telse if(isNumber(lat) == false){\t\t\t\t\t\t// het moet een getal zijn\r\n\t\t\tmessageWindow(\"Latitude MOET een getal zijn\", \"red\");\r\n\t\t}\r\n\t\telse if(isNumber(lon) == false){\t\t\t\t\t\t// het moet een getal zijn\r\n\t\t\tmessageWindow(\"Longitude MOET een getal zijn\", \"red\");\r\n\t\t}\r\n\t\telse{\r\n\t\t\tconsole.log(\"2\");\r\n\t\t\t// nu nog converteren waar nodig\r\n\t\t\ttry{\r\n\t\t\t\t\r\n\t\t\t\toppervlakte = Number(oppervlakte);\r\n\t\t\t\toppervlakte.toFixed(2);\r\n\t\t\t\t\r\n\t\t\t\tpopulatie = Number(populatie);\r\n\t\t\t\tpopulatie.toFixed(0);\t\t\t\t//halve mensen bestaan niet\r\n\r\n\t\t\t\tlat = Number(lat);\r\n\t\t\t\tlat.toFixed(2);\r\n\t\t\t\t\r\n\t\t\t\tlon = Number(lon);\r\n\t\t\t\tlon.toFixed(2);\r\n\t\t\t\t\r\n\t\t\t\tconsole.log(\"3\");\r\n\t\t\t\t\r\n\t\t\t}catch(err){\r\n\t\t\t\tmessageWindow(\"Error met converteren:\" + err, \"red\");\r\n\t\t\t}\r\n\t\t\r\n\t\t\r\n\t\t\t/*============================================\t\t========================================\t\r\n\t\t\t Alle checks/converts nu (eindelijk) gehad ==> \tDan kan het de database in\t\r\n\t\t\t ============================================\t\t========================================*/\r\n\t\t\tconsole.log(\"4\");\r\n\t\t\t\t\r\n\t\t\t//eerst een data-object maken van alle ingevoerde gegevens voordat we deze naar de servervice sturen\r\n\t\t\tvar data = { \"kort\": kort, \"lang\": lang, \"land\": naam, \"capital\": city, \"continent\": continent, \"regio\": regio,\t\"oppervlakte\": oppervlakte, \"populatie\": populatie, \"regering\": regering, \"latitude\": lat, \"longitude\": lon};\r\n/*\t\t\tdata.kort = kort;\r\n\t\t\tdata.lang = lang;\r\n\t\t\tdata.naam = naam;\r\n\t\t\tdata.capital = city;\r\n\t\t\tdata.continent = continent;\r\n\t\t\tdata.regio = regio;\r\n\t\t\tdata.oppervlakte = oppervlakte;\r\n\t\t\tdata.populatie = populatie;\r\n\t\t\tdata.regering = regering;\r\n\t\t\tdata.latitude = latitude;\r\n\t\t\tdata.longitude = longitude;*/\r\n\t\t\t\t\r\n\t\t\t//omzetten naar een voor de servervice te begrijpen formaat\r\n\t\t\tvar JSONdata = JSON.stringify(data);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t$.ajax(\"/restservices/countries/\"+kort,{\r\n\t\t\t\ttype: \"post\",\r\n\t\t\t\tdata: JSONdata,\r\n\t\t\t beforeSend: function (xhr) { // je moet ingelogged zijn om het te mogen uitvoeren (token ophalen)\r\n\t\t\t var token = window.sessionStorage.getItem(\"sessionToken\");\r\n\t\t\t xhr.setRequestHeader( 'Authorization', 'Bearer ' + token);\r\n\t\t\t },\r\n\r\n\t\t\t\tsuccess: function(response){\r\n\t\t\t\t\t$('#land-pagina').hide();\r\n\t\t\t\t\t$('#search').fadeIn(1000);\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar landElement = \"<div id='response-country-name'>\"+response.naam+\"</div>\";\r\n\t\t\t\t\t$('#toegevoegde-landen-content').append(landElement);\r\n\t\t\t\t\t\r\n\t\t\t\t\tmessageWindow(\"Response:\" + response.response, \"green\");\r\n\r\n\r\n\t\t\t\t},\r\n\t\t\t\terror: function(response){\r\n\t\t\t\t\tmessageWindow(\"Error response AJAX POST: \" + response.response, \"red\");\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\t\t\r\n\t}\r\n\tcatch(err){\r\n\t\tmessageWindow(\"Error:\" + err, \"red\");\r\n\t}\r\n}", "pacManBewegen() {\n let knoten = this.knoten;\n let geist = this.geist;\n let pacman = this.pacMan;\n let pillen = this.pillen;\n if (!this.beendet) { //darf sich nur bewegen wenn das spiel noch nicht zuende ist\n let PacManAltX = pacman.posX;\n let PacManAltY = pacman.posY;\n if (zustand.aengstlich) { //jagdmodus pacman sucht hier den kürzesten weg zum geist um ihn zu jagen und beschreitet diesen\n let zielRoute = astar.search(knoten, pacman.posX, pacman.posY, geist.posX, geist.posY);\n pacman.posX = zielRoute[0].posX;\n pacman.posY = zielRoute[0].posY;\n\n\n } else if ((pacman.darfwegglaufen && pacman.getAbstand(geist.posX, geist.posY) < 6) || !geist.isMoving) { //pacman weglaufen lassen wenn der geist steht oder die Manhattandistanz kleiner als 6 ist\n let aktKnoten = knoten[pacman.posY][pacman.posX];\n let auswege = aktKnoten.nachbarn;\n let bestnachbar = auswege[0];\n let bestabstand = geist.getAbstand(bestnachbar.posX, bestnachbar.posY);\n for (let i = 1; i < auswege.length; i++) {\n let neuabstand = geist.getAbstand(auswege[i].posX, auswege[i].posY);\n if (neuabstand > bestabstand) {\n bestabstand = neuabstand;\n bestnachbar = auswege[i];\n }\n }\n pacman.posX = bestnachbar.posX;\n pacman.posY = bestnachbar.posY;\n\n if (!this.toogleTimerAn) {\n //noinspection JSCheckFunctionSignatures\n clearTimeout(Spielvariablen.intervalle.flucht);\n //noinspection JSCheckFunctionSignatures\n clearTimeout(Spielvariablen.intervalle.nonflucht);\n //noinspection JSCheckFunctionSignatures\n Spielvariablen.intervalle.flucht=setTimeout(Spielvariablen.funtionen.flucht, 5000);\n //noinspection JSCheckFunctionSignatures\n Spielvariablen.intervalle.nonflucht=setTimeout(Spielvariablen.funtionen.nonflucht, 7000);\n this.toogleTimerAn = true;\n }\n\n }\n //keine jagt und kein weglaufen also nächste pille suchen und essen ;-)\n else {\n //--nächste pille rausfinden mittels manhattan distanz rausfinden;\n Spielvariablen.funtionen.shuffle(pillen);\n let nahestPille = 0;\n let nahestPilleManhattan = 1000;\n if (pillen.length == 0) {\n zustand.status = 3;\n Spielvariablen.Spielstart = false;\n return;\n }\n for (let i = 0; i < pillen.length; i++) {\n let manhattan = astar.manhattan(pacman.posX, pacman.posY, pillen[i].posX, pillen[i].posY);\n if (manhattan < nahestPilleManhattan) {\n nahestPilleManhattan = manhattan;\n nahestPille = i;\n }\n }\n\n let zielPille = pillen[nahestPille];\n let zielRoute = astar.search(knoten, pacman.posX, pacman.posY, zielPille.posX, zielPille.posY);\n pacman.posX = zielRoute[0].posX;\n pacman.posY = zielRoute[0].posY;\n }\n if (knoten[pacman.posY][pacman.posX].pille != null) {\n let pille = knoten[pacman.posY][pacman.posX].pille;\n knoten[pacman.posY][pacman.posX].pille = null;\n pillen.splice(pillen.indexOf(pille), 1);\n if (pille.isGross) {\n zustand.aengstlich = true;\n //noinspection JSCheckFunctionSignatures\n clearTimeout(Spielvariablen.intervalle.verwirrt);\n //noinspection JSCheckFunctionSignatures\n Spielvariablen.intervalle.verwirrt=setTimeout(Spielvariablen.funtionen.verwirrt, 10000);\n }\n }\n\n if (PacManAltY < pacman.posY) {\n pacman.offsetY = -this.factor;\n pacman.richtung = Spielvariablen.Richtungen.links;\n }\n if (PacManAltY > pacman.posY) {\n pacman.offsetY = this.factor;\n pacman.richtung = Spielvariablen.Richtungen.rechts;\n }\n if (PacManAltX < pacman.posX) {\n pacman.offsetX = -this.factor;\n pacman.richtung = Spielvariablen.Richtungen.hoch;\n }\n if (PacManAltX > pacman.posX) {\n pacman.offsetX = this.factor;\n pacman.richtung = Spielvariablen.Richtungen.runter;\n }\n\n\n if (pacman.posX == geist.posX && pacman.posY == geist.posY) {\n this.beendet = true;\n }\n //PacMan Bewegen Ende\n\n //gewinnüberprüfung\n if (this.beendet) {\n zustand.status = 3;\n Spielvariablen.Spielstart = false;\n }\n\n\n }\n\n }", "function calcPorcentajeMoras(){\r\n\r\n\tif (pm_called == 0){\r\n\t\tgetFiscalMoraInfo();\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tvar norectificativa = 1;\r\n\tif (document.getElementById('declarationType').value=='| 2 | RECTIFICATIVA'){\r\n\t\tnorectificativa = 0;\r\n\t}\r\n\tif(CONTRAVENSION_CMOV && CONTRAVENSION_CMOV != null){//Si es rectificativa no hay contravenci?n\r\n\t\tdocument.getElementById('c103').value = CONTRAVENSION_CMOV * norectificativa;\t\t\r\n\t\tif(document.getElementById('c103').value != null)\r\n \t\t colocarpuntos(document.getElementById('c103'));\r\n\t}\r\n\t\r\n\tvar tmp1 = removeCommas(document.getElementById('c107').value);\r\n\tvar tmp2 = removeCommas(document.getElementById('c103').value);\r\n\tvar op = tmp1 - tmp2;\r\n\tif(op < 0){\r\n\t\top = 0;\r\n\t}\r\n\r\n\tif (PORC_MORA && PORC_MORA != null){\r\n\t\tdocument.getElementById('c108').value = (PORC_MORA * op).toFixed(0);\r\n\t\tif(document.getElementById('c108').value < 0){\r\n\t\t\tdocument.getElementById('c18').value = 0;\r\n\t\t}\r\n\t\tif(document.getElementById('c108').value != null)\r\n \t\t colocarpuntos(document.getElementById('c108'));\r\n\t}\t\t\r\n\tif (PORC_INTERES && PORC_INTERES != null){\r\n\t\tdocument.getElementById('c109').value = (PORC_INTERES * op).toFixed(0);\r\n\t\tif(document.getElementById('c109').value < 0){\r\n\t\t\tdocument.getElementById('c109').value = 0;\r\n\t\t}\r\n\t\tif(document.getElementById('c109').value != null)\r\n \t\t colocarpuntos(document.getElementById('c109'));\r\n\t}\r\n\t\r\n\trefreshVars();\r\n\tTRGc105();\r\n\tTRGc106();\r\n\tTRGc106_0();\r\n\tTRGc107();\r\n\tTRGc107_0();\r\n\tTRGc110();\r\n\t\r\n\tvar tmp = (0).toFixed(0);\r\n\r\n}", "function guardarDatosClima(e){\n\te.preventDefault();\n\n// Selectores------------------------------------\n\n\tlet ciudadUsuario = document.getElementById(\"filtroSelect\").value;\n\tlet split = ciudadUsuario.split(\",\");\n\tlet city = split[0];\n\tlet longitud = split[1];\n\tlet latitud = split[2];\n\n\t// console.log(split);\n\n\t// let ciudadUsuario = document.getElementById(\"filtroSelect\").value;\n\t// const ClimaUsuario = new Clima(city, 18, \"Parcialmente Nublado\", fechaTexto(fecha));\n\t// Url de conexion api concatenando el valor de la ciudad\n\tconst url = 'https://api.openweathermap.org/data/2.5/weather?q='+city+'&units=metric&lang=sp&appid=509a71114c79dce7fe4e067058ed0286';\n\t// console.log(url);\n\n// Selectores------------------------------------\n\n\t// ClimaDefinido.push(ClimaUsuario);\n\n\t// Imprime en mi id=ciudad lo que traiga mi Valor de ciudadUsuario\n\tciudad.textContent = city;\n\n\t// API CLIMA Openweathermap ---------------------\n\t\n\t// Conexion por fetch y agregar variables que se van a utilizar\n\n\tfetch(url).then(response => response.json())\n\t.then(data => {\n\n\t\t// console.log(url);\n\t\tlet nombreCiudadData = data['name'];\n\t\tlet idClima = data['id'];\n\n\t\tlet temperatura = data['main']['temp'];\n\t\tlet sensacionTermica = data['main']['feels_like'];\n\t\tlet humedadClima = data['main']['humidity'];\n\t\tlet temperaturaMinima = data['main']['temp_min'];\n\t\tlet temperaturaMaxima = data['main']['temp_max'];\n\n\t\tlet statusClima = data['weather'];\n\t\tlet statusClimaDescripcion = data['weather'][0]['description'];\n\t\tlet iconClimaDescripcion = data['weather'][0]['icon'];\n\n\t\tlet vientoClima = data['wind']['speed'];\n\t\t\n\n\t\t// Imprimir los datos del clima - dependiendo de la respuesta del usuario\n\t\tgradosClima.textContent = Math.round(temperatura);\n\t\tfactorClima.textContent = statusClimaDescripcion;\n\t\tclimaMax.textContent = `${Math.round(temperaturaMaxima)} °C /`;\n\t\tclimaMin.textContent = `${Math.round(temperaturaMinima)} °C`;\n\t\tviento.textContent = `${vientoClima} km/h`;\n\t\tsensacionTer.textContent = `${Math.round(sensacionTermica)} °C`;\n\t\thumedad.textContent = `${humedadClima} %`;\n\n\t\t// jQuery Animación de Imagen del Clima\n\n\t\t$(function mostrarImagen() { \n\t\t\t// console.log(iconClimaDescripcion);\n\t\t\t$(\"#imagenClima\").attr(\"src\",`http://openweathermap.org/img/wn/${iconClimaDescripcion}@2x.png`);\n\t\t});\n\t})\n\t.catch(error => alert(\"Nombre de la ciudad Invalido\"));\n\n\t// API CLIMA Openweathermap ---------------------\n\n\t// Resetear pagina despues de 2 minutos ---------\n\n\tsetTimeout(function(){\n\t\twindow.location.reload(1);\n\t}, 60000);\n\n\t// Resetear pagina despues de 2 minutos ---------\n\n\t// Funcion Clima 7 Days -------------------------\n\n\tfunction clima7Dias(){\n\n\t\tconst url7Days = 'https://api.openweathermap.org/data/2.5/onecall?lat='+latitud+'&lon='+longitud+'&units=metric&lang=sp&exclude=current,minutely,hourly,alerts&appid=509a71114c79dce7fe4e067058ed0286';\n\n\t\tfetch(url7Days).then(response => response.json())\n\t\t.then(data => {\n\n\t\t\tconsole.log(url7Days);\n\n\t\t\tlet daily = data['daily'];\n\t\t\tlet tomorrow = data['daily'][0];\n\t\t\tlet tomorrowTemp = data['daily'][0]['temp'];\n\t\t\t// console.log(tomorrowTemp);\n\t\t\tlet tomorrowTempMin = data['daily'][0]['temp']['min'];\n\t\t\t// console.log(tomorrowTempMin);\n\t\t\tlet tomorrowTempMax = data['daily'][0]['temp']['max'];\n\t\t\t// console.log(tomorrowTempMax);\n\n\t\t\tlet iconClimaTomorrowDescripcion = data['daily'][0]['weather'][0]['icon'];\n\t\t\t// console.log(iconClimaTomorrowDescripcion);\n\n\t\t\tlet postTomorrowTempMin = data['daily'][1]['temp']['min'];\n\t\t\t// console.log(postTomorrowTempMin);\n\t\t\tlet postTomorrowTempMax = data['daily'][1]['temp']['max'];\n\t\t\t// console.log(postTomorrowTempMax);\n\n\t\t\tlet iconClimaPostTomorrowDescripcion = data['daily'][1]['weather'][0]['icon'];\n\t\t\t// console.log(iconClimaPostTomorrowDescripcion);\n\n\t\t\t// Imprimir los datos del clima - dependiendo de la respuesta del usuario\n\n\t\t\ttempMaxTomorrow.textContent = `${Math.round(tomorrowTempMax)} °C /`;\n\t\t\ttempMinTomorrow.textContent = `${Math.round(tomorrowTempMin)} °C`;\n\n\t\t\ttempMaxPostTomorrow.textContent = `${Math.round(postTomorrowTempMax)} °C /`;\n\t\t\ttempMinPostTomorrow.textContent = `${Math.round(postTomorrowTempMin)} °C`;\n\t\t\t// Imprimir los datos del clima - dependiendo de la respuesta del usuario\n\n\t\t\t$(function mostrarImagenSiguientesDias() { \n\t\t\t\t// console.log(iconClimaDescripcion);\n\t\t\t\t$(\"#imagenClimaMañana\").attr(\"src\",`http://openweathermap.org/img/wn/${iconClimaTomorrowDescripcion}@2x.png`);\n\t\n\t\t\t\t$(\"#imagenClimaPostMañana\").attr(\"src\",`http://openweathermap.org/img/wn/${iconClimaPostTomorrowDescripcion}@2x.png`);\n\t\t\t});\n\t\t\t\n\t\t})\n\t\t.catch(error => alert(\"Nombre de la ciudad Invalido\"));\n\n\t\t// API CLIMA Openweathermap ---------------------\n\n\t}\n\n\tclima7Dias();\n\n\t// Funcion Clima 7 Days -------------------------\n}", "function mezclarPiezas(veces){\n if(veces <= 0){return;}\n var direcciones = [40, 38, 39, 37];\n var direccion = direcciones[Math.floor(Math.random()*direcciones.length)];\n moverEnDireccion(direccion);\n\n setTimeout(function(){\n mezclarPiezas(veces-1);\n },100);\n}", "function AsignarRecursos() {\n\n $('.lblTitulo').text(\"*\" + $('#lb_Titulo').text() + \":\");\n $('.lblDescripcionObli').text(\"*\" + $('#lb_Descripcion').text() + \":\");\n $('.inDescripcionObli').attr(\"placeholder\", $('#lb_Descripcion').text());\n $('.inDescripcionObli').attr(\"validationMessage\", $('#lb_DescripcioRequired').text());\n $('.inTitulo').attr(\"placeholder\", $('#lb_Titulo').text());\n $('.inTitulo').attr(\"validationMessage\", $('#lb_TituloRequired').text());\n $('.inOpcionRespuesta').attr(\"placeholder\", $('#lb_OpcionRespuesta').text());\n $('.inOpcionRespuesta').attr(\"validationMessage\", $('#lb_OpcionRespuestaRequired').text());\n if ($('.lblFechaActualizacion').text() != undefined) {\n var lblFechaActualizacionText = $('.lblFechaActualizacion').text();\n lblFechaActualizacionText = lblFechaActualizacionText.replace(\"FechaUpd\", $('#lb_FechaActualizacion').text());\n $('.lblFechaActualizacion').text(lblFechaActualizacionText);\n }\n}", "function validarEquipasEpisodios() {\n var listaToAdd = [];\n var erros = [];\n \n episodios.forEach(function(episodio, it) {\n if($(\"#pendente_secretariado_\"+it).is(':checked')){\n if(parseInt(episodio['cir_segura']) == 0){\n var erro = {\n episodio: episodio,\n tipo: 'warning',\n erro: 'não está marcado como cirurgia segura'\n };\n erros.push(erro);\n } \n var hasElementEC = false;\n var hasElementEA = false;\n var somaDasPercentagens = 0;\n episodio.intervenientes.forEach(function(interveniente) {\n var funcao = interveniente.funcao;\n if(funcao.equipa == 'EC'){\n hasElementEC = true;\n }\n if(funcao.equipa == 'EA'){\n hasElementEA = true;\n }\n somaDasPercentagens += Number(funcao.perc);\n });\n if(!hasElementEC){\n var erro = {\n episodio: episodio,\n tipo: 'error',\n erro: 'não tem elementos na equipa cirurgica'\n };\n erros.push(erro);\n }\n if(!hasElementEA){\n var erro = {\n episodio: episodio,\n tipo: 'error',\n erro: 'não tem elementos na equipa de apoio'\n };\n erros.push(erro);\n }\n if(somaDasPercentagens != 100){\n var erro = {\n episodio: episodio,\n tipo: 'error',\n erro: 'a soma das percentagens dos intervenientes dá '+somaDasPercentagens+'%' \n };\n erros.push(erro);\n }\n var servico;\n for (let i = 0; i < servicos.length; i++) {\n const servicoI = servicos[i];\n if(episodio.servico == servicoI.id){\n servico = servicoI;\n break;\n }\n } \n var horaInicioServico = moment(servico.horario_ini, 'HH:mm:ss');\n var horaEntradaBloco = moment(episodio.horas_oper_ini, 'HH:mm:ss');\n var isHoraEntradaBlocoEarlier = horaInicioServico.isBefore(horaEntradaBloco) \n if(!isHoraEntradaBlocoEarlier){\n var erro = {\n episodio: episodio,\n tipo: 'warning',\n erro: 'a hora registada como entrada no bloco operatório ('+horaEntradaBloco.format('HH:mm:ss')+') é anterior ao horário de funcionamento do serviço \"'+servico['servico']+'\" ('+horaInicioServico.format('HH:mm:ss')+')', \n };\n erros.push(erro);\n }\n listaToAdd.push(episodio);\n }\n });\n\n if(listaToAdd.length == 0 && erros.length == 0){\n toastr(\"Selecione pelo menos um episódio para validar\", \"error\");\n return;\n }\n var errosValidacaoSecretariadoModal=\"<div class='overlay'>\"+\n \"<div id='erros_validacao_pendente_secretariado' class='modal bigModal'>\"+\n \"<h4 class='modal_title font-black'>Erro(s) ao validar episódio(s) <i onclick='closeModal();' class='fas fa-times-circle close_modal'></i></h4>\"+\n \"<p id='episodios_com_erros_pendente_secretariado_label'>Os seguintes episódios <span style='color:red'>não serão válidados</span> devido à existência de erros:</p>\"+\n \"<div id='episodios_com_erros_pendente_secretariado' class='errors_modal_container'>\"+\n \"</div>\"+\n \"<p id='episodios_com_inconformidades_pendente_secretariado_label' style='border-top: 1px solid lightgray; padding-top: 15px; margin-top: 15px;'>Os seguintes episódios <span style='color:orange'>poderão ser válidados</span> mas apresentam inconformidades:</p>\"+\n \"<div id='episodios_com_inconformidades_pendente_secretariado' class='errors_modal_container'>\"+\n \"<label class='container costumHeight' style='width:1.75vw; float: left; margin-right: 1vw;'>\"+\n \"<input type='checkbox' id='episodio_desconforme_all' onclick='selecAlltDesconformes()'>\"+\n \"<span class='checkmark costumCheck_inner'></span>\"+\n \"</label>\"+ \n \"<b>Selecionar todos os desconformes</b>\"+\n \"</div>\"+\n \"<p id='episodios_sem_erros_pendente_secretariado_label' style='border-top: 1px solid lightgray; padding-top: 15px; margin-top: 15px;'>Assim sendo, apenas os seguintes episódios serão validados:</p>\"+\n \"<div id='episodios_sem_erros_pendente_secretariado' class='errors_modal_container'>\"+\n \"</div>\"+\n \"<div style='margin-top:1vw'>\"+\n \"<button id='validarEpisodiosComErros_pendente_secretariado' class='confirm-btn'>Validar Conformes e Desconformes Selecionados (<span id='nrOfSelected'>0</span>)</button>\"+\n \"<button id='validarEpisodiosSemErros_pendente_secretariado' class='confirm-btn'>Validar Apenas Conformes</button>\"+\n \"<button onclick='closeModal();' class='confirm-btn'>Cancelar</button>\"+\n \"</div>\"+\n \"</div>\"+ \n \"</div>\";\n if(erros.length > 0){\n var contaImpeditivos = 0;\n var contaInconformes = 0;\n var contaConformes = 0;\n $(\"body\").append(errosValidacaoSecretariadoModal);\n for (let index = 0; index < listaToAdd.length; index++) {\n const episodio = listaToAdd[index];\n var errosEpisodio = [];\n erros.forEach(function (error) {\n if(error.episodio == episodio){\n errosEpisodio.push(error);\n }\n });\n if(errosEpisodio.length == 0){\n contaConformes++;\n listaToAdd[index]['errosImpeditivos'] = [];\n listaToAdd[index]['errosNaoImpeditivos'] = [];\n $(\"#episodios_sem_erros_pendente_secretariado\").append(\"<p><b>\"+episodio['num_processo']+\"</b> - \"+episodio['nome']+\" <i style='color:green; margin-left:5px;' class='fas fa-check-circle'></i></p>\");\n } else {\n var errosImpeditivos = [];\n var errosNaoImpeditivos = [];\n errosEpisodio.forEach(function (error) {\n if(error.tipo == 'error'){\n errosImpeditivos.push(error);\n }else {\n errosNaoImpeditivos.push(error);\n }\n });\n listaToAdd[index]['errosImpeditivos'] = errosImpeditivos;\n listaToAdd[index]['errosNaoImpeditivos'] = errosNaoImpeditivos;\n if(errosImpeditivos.length > 0){\n var string = \"<p>O episódio <b>\"+episodio['num_processo']+\"</b> - \"+episodio['nome'];\n errosImpeditivos.forEach( function (erro) {\n contaImpeditivos++;\n string += \" \" + erro.erro + \",\";\n });\n string = string.substring(0, string.length-1);\n string+=\" <i style='color:red; margin-left:5px;' class='fas fa-times-circle'></i></p>\";\n $(\"#episodios_com_erros_pendente_secretariado\").append(string);\n } else {\n if(errosNaoImpeditivos.length > 0){\n var string = \"\";\n string += \"<p>\"+\n \"<label class='container costumHeight' style='width:1.75vw; float: left; margin-right: 1vw;'>\"+\n \"<input type='checkbox' id='episodio_desconforme_\"+episodio['id']+\"' class='episodio_desconforme'>\"+\n \"<span class='checkmark costumCheck_inner' onclick='selectDesconforme(\"+episodio['id']+\")'></span>\"+\n \"</label>\"+ \n \"O episódio <b>\"+episodio['num_processo']+\"</b> - \"+episodio['nome'];\n errosNaoImpeditivos.forEach( function (erro) {\n contaInconformes++;\n string += \" \" + erro.erro + \",\";\n });\n string = string.substring(0, string.length-1);\n string+=\" <i style='color:orange; margin-left:5px;' class='fas fa-exclamation-triangle'></i></p>\";\n $(\"#episodios_com_inconformidades_pendente_secretariado\").append(string);\n }\n }\n }\n }\n if(contaConformes == 0){\n $(\"#episodios_sem_erros_pendente_secretariado_label\").remove();\n $(\"#episodios_sem_erros_pendente_secretariado\").remove();\n }\n if(contaImpeditivos == 0){\n $(\"#episodios_com_erros_pendente_secretariado_label\").remove();\n $(\"#episodios_com_erros_pendente_secretariado\").remove();\n }\n if(contaInconformes == 0){\n $(\"#episodios_com_inconformidades_pendente_secretariado_label\").remove();\n $(\"#episodios_com_inconformidades_pendente_secretariado\").remove();\n $(\"#validarEpisodiosComErros_pendente_secretariado\").remove();\n }\n document.getElementById('validarEpisodiosSemErros_pendente_secretariado').addEventListener('click', function(){\n var listaToAddIds = [];\n listaToAdd.forEach(function(episodioValidado) {\n if(episodioValidado.errosImpeditivos.length == 0 && episodioValidado.errosNaoImpeditivos.length == 0){\n listaToAddIds.push(episodioValidado['id']);\n }\n });\n if(listaToAddIds == 0){ \n toastr(\"Nenhum episódio está completamente válido\", \"error\");\n } else{\n realValidarPendenteSecretariado(listaToAddIds); \n closeModal();\n }\n return;\n });\n if(document.getElementById('validarEpisodiosComErros_pendente_secretariado') != null){\n document.getElementById('validarEpisodiosComErros_pendente_secretariado').addEventListener('click', function () {\n var listaToAddIds = [];\n listaToAdd.forEach(function(episodioValidado) {\n if(episodioValidado.errosImpeditivos.length == 0 && episodioValidado.errosNaoImpeditivos.length != 0){\n if($(\"#episodio_desconforme_\"+episodioValidado['id']).is(':checked')){\n listaToAddIds.push(episodioValidado['id']);\n }\n } else if(episodioValidado.errosImpeditivos.length == 0 && episodioValidado.errosNaoImpeditivos.length == 0){\n listaToAddIds.push(episodioValidado['id']);\n }\n });\n if(listaToAddIds == 0){ \n toastr(\"Nenhum episódio está completamente válido\", \"error\");\n } else{\n realValidarPendenteSecretariado(listaToAddIds); \n closeModal();\n }\n return;\n });\n }\n return;\n }\n var listaToAddIds = [];\n listaToAdd.forEach(function(episodioValidado) {\n listaToAddIds.push(episodioValidado['id']);\n });\n realValidarPendenteSecretariado(listaToAddIds); \n}", "function LeerDatos(){\n var celdasvacias=false;\n renglonconceldasvacias=[];\n \n var data=Array();\n data.push({\"prestamoaccionistas\":LeerExcel(\"excelsituacion\",8,3)}); //nombre de la tabla, renglon(r) y columna(c) \n data.push({\"prestamolargoplazo\":LeerExcel(\"excelsituacion\",9,3)}); \n data.push({\"inversionaccionistas\":LeerExcel(\"excelsituacion\",12,3)});\n data.push({\"utilidadreservas\":LeerExcel(\"excelsituacion\",13,3)});\n \n data.push({\"porcgastos2\":$(\"#anio1gastos\").val().replace(/[\\$,]/g, \"\")});\n data.push({\"porcgastos3\":$(\"#anio2gastos\").val().replace(/[\\$,]/g, \"\")});\n \n data.push({\"oficinas\":LeerExcel(\"excelgastos\",1,1)});\n data.push({\"servpublicos\":LeerExcel(\"excelgastos\",3,1)});\n data.push({\"telefonos\":LeerExcel(\"excelgastos\",4,1)});\n data.push({\"seguros\":LeerExcel(\"excelgastos\",5,1)});\n data.push({\"papeleria\":LeerExcel(\"excelgastos\",6,1)});\n data.push({\"rentaequipo\":LeerExcel(\"excelgastos\",7,1)});\n data.push({\"costoweb\":LeerExcel(\"excelgastos\",8,1)});\n data.push({\"costoconta\":LeerExcel(\"excelgastos\",9,1)});\n \n data.push({\"honorariolegal\":LeerExcel(\"excelgastos\",1,3)});\n data.push({\"viajesysubsistencia\":LeerExcel(\"excelgastos\",2,1)});\n data.push({\"gastosautos\":LeerExcel(\"excelgastos\",3,1)});\n data.push({\"gastosgenerales\":LeerExcel(\"excelgastos\",4,1)});\n data.push({\"cargosbancarios\":LeerExcel(\"excelgastos\",5,1)});\n data.push({\"otrosservicios\":LeerExcel(\"excelgastos\",6,1)});\n data.push({\"gastosinvestigacion\":LeerExcel(\"excelgastos\",8,1)});\n data.push({\"gastosdiversos\":LeerExcel(\"excelgastos\",9,1)});\n \n data.push({\"totalgastos\":$(\"#totalgastos\").val().replace(/[\\$,]/g, \"\")});\n \n data.push({\"tasalider\":$(\"#tasalider\").val().replace(/[\\$,]/g, \"\")});\n data.push({\"primariesgo\":$(\"#primariesgo\").val().replace(/[\\$,]/g, \"\")});\n data.push({\"riesgopais\":$(\"#riesgopais\").val().replace(/[\\$,]/g, \"\")});\n \n data.push({\"tasalargoplazo\":$(\"#tasalargoplazo\").val().replace(/[\\$,]/g, \"\")});\n data.push({\"tasacortoplazo\":$(\"#tasacortoplazo\").val().replace(/[\\$,]/g, \"\")});\n data.push({\"interesexcedente\":$(\"#interesexcedente\").val().replace(/[\\$,]/g, \"\")});\n \n return data;\n}", "function pensiones_sobreviviente(accion) {\r\n\t$(\".div-progressbar\").css(\"display\", \"block\");\r\n\t\r\n\t//\tvalores\r\n\tvar NomDependencia = changeUrl($(\"#CodDependencia option:selected\").text());\r\n\tvar DescripCargo = changeUrl($(\"#CodCargo option:selected\").text());\r\n\tvar AniosServicio = $(\"#AniosServicio\").val();\r\n\tvar SueldoBase = parseFloat(setNumero($(\"#SueldoBase\").val()));\r\n\tvar MontoJubilacion = parseFloat(setNumero($(\"#MontoJubilacion\").val()));\r\n\tvar Coeficiente = parseFloat(setNumero($(\"#Coeficiente\").val()));\r\n\tvar TotalSueldo = parseFloat(setNumero($(\"#TotalSueldo\").val()));\r\n\tvar TotalPrimas = parseFloat(setNumero($(\"#TotalPrimas\").val()));\r\n\t\t\r\n\t//\tvalido\r\n\tvar error = \"\";\r\n\tif ($(\"#CodPersona\").val() == \"\") error = \"Debe seleccionar el Empleado a Procesar\";\r\n\telse if ($(\"#FlagCumple\").val() != \"S\") error = \"El Empleado NO cumple con los requisitos para optar a la Jubilaci&oacute;n\";\r\n\telse if (Coeficiente <= 0 || isNaN(Coeficiente)) error = \"Coeficiente Incorrecto\";\r\n\telse if (TotalSueldo <= 0 || isNaN(TotalSueldo)) error = \"Total de Sueldos Incorrecto\";\r\n\telse if (TotalPrimas <= 0 || isNaN(TotalPrimas)) error = \"Total de Primas de Antiguedad Incorrecto\";\r\n\telse if (MontoJubilacion <= 0 || isNaN(MontoJubilacion)) error = \"Monto de Jubilaci&oacute;n Incorrecto\";\r\n\tif (accion == \"nuevo\" || accion == \"modificar\") {\r\n\t\tif ($(\"#CodTipoNom\").val() == \"\") error = \"Debe seleccionar el Tipo de N&oacute;mina\";\r\n\t\telse if ($(\"#CodTipoTrabajador\").val() == \"\") error = \"Debe seleccionar el Tipo de Trabajador\";\r\n\t\telse if ($(\"#Fegreso\").val() == \"\") error = \"Debe ingresar la Fecha de Egreso\";\r\n\t\telse if (!valFecha($(\"#Fegreso\").val())) error = \"Formato de Fecha de Egreso Incorrecta\";\r\n\t\telse if ($(\"#CodMotivoCes\").val() == \"\") error = \"Debe seleccionar el Motivo del Cese\";\r\n\t}\r\n\t\r\n\t//\tdetalles\r\n\tif (error == \"\") {\r\n\t\t//\tantecedentes\r\n\t\tvar detalles_antecedentes = \"\";\r\n\t\tvar frm = document.getElementById(\"frm_antecedentes\");\r\n\t\tfor(var i=0; n=frm.elements[i]; i++) {\r\n\t\t\tif (n.name == \"Organismo\") detalles_antecedentes += changeUrl(n.value) + \";char:td;\";\r\n\t\t\telse if (n.name == \"FIngreso\") detalles_antecedentes += formatFechaAMD(n.value) + \";char:td;\";\r\n\t\t\telse if (n.name == \"FEgreso\") detalles_antecedentes += formatFechaAMD(n.value) + \";char:td;\";\r\n\t\t\telse if (n.name == \"Anios\") detalles_antecedentes += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"Meses\") detalles_antecedentes += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"Dias\") detalles_antecedentes += n.value + \";char:tr;\";\r\n\t\t}\r\n\t\tvar len = detalles_antecedentes.length; len-=9;\r\n\t\tdetalles_antecedentes = detalles_antecedentes.substr(0, len);\r\n\t\t\r\n\t\t//\tsueldos\r\n\t\tvar detalles_sueldos = \"\";\r\n\t\tvar frm = document.getElementById(\"frm_sueldos\");\r\n\t\tfor(var i=0; n=frm.elements[i]; i++) {\r\n\t\t\tif (n.name == \"Secuencia\") detalles_sueldos += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"Periodo\") detalles_sueldos += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"CodConcepto\") detalles_sueldos += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"Monto\") detalles_sueldos += setNumero(n.value) + \";char:tr;\";\r\n\t\t}\r\n\t\tvar len = detalles_sueldos.length; len-=9;\r\n\t\tdetalles_sueldos = detalles_sueldos.substr(0, len);\r\n\t\tif (detalles_sueldos == \"\") error = \"El Empleado debe tener por lo menos 24 cotizaciones en la Ficha de Relaci&oacute;n de Sueldos\";\r\n\t\t\r\n\t\t//\tbeneficiarios\r\n\t\tvar detalles_beneficiarios = \"\";\r\n\t\tvar frm = document.getElementById(\"frm_beneficiarios\");\r\n\t\tfor(var i=0; n=frm.elements[i]; i++) {\r\n\t\t\tif (n.name == \"NroDocumento\") detalles_beneficiarios += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"NombreCompleto\") detalles_beneficiarios += changeUrl(n.value) + \";char:td;\";\r\n\t\t\telse if (n.name == \"FlagPrincipal\") {\r\n\t\t\t\tif (n.checked) detalles_beneficiarios += \"S;char:td;\";\r\n\t\t\t\telse detalles_beneficiarios += \"N;char:td;\";\r\n\t\t\t}\r\n\t\t\telse if (n.name == \"Parentesco\") detalles_beneficiarios += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"FechaNacimiento\") detalles_beneficiarios += formatFechaAMD(n.value) + \";char:td;\";\r\n\t\t\telse if (n.name == \"Sexo\") detalles_beneficiarios += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"FlagIncapacitados\") detalles_beneficiarios += n.value + \";char:td;\";\r\n\t\t\telse if (n.name == \"FlagEstudia\") detalles_beneficiarios += n.value + \";char:tr;\";\r\n\t\t}\r\n\t\tvar len = detalles_beneficiarios.length; len-=9;\r\n\t\tdetalles_beneficiarios = detalles_beneficiarios.substr(0, len);\r\n\t}\r\n\t\r\n\t//\tvalido errores\r\n\tif (error != \"\") {\r\n\t\tcajaModal(error, \"error\", 400);\r\n\t} else {\r\n\t\t//\tgeneral\r\n\t\tvar post_general = getForm(document.getElementById('frmgeneral'));\r\n\t\t\r\n\t\t//\tjubilacion\r\n\t\tvar post_jubilacion = getForm(document.getElementById('frmjubilacion'));\r\n\t\t\r\n\t\t//\tajax\r\n\t\t$.ajax({\r\n\t\t\ttype: \"POST\",\r\n\t\t\turl: \"lib/form_ajax.php\",\r\n\t\t\tdata: \"modulo=pensiones_sobreviviente&accion=\"+accion+\"&NomDependencia=\"+NomDependencia+\"&DescripCargo=\"+DescripCargo+\"&AniosServicio=\"+AniosServicio+\"&detalles_antecedentes=\"+detalles_antecedentes+\"&detalles_sueldos=\"+detalles_sueldos+\"&detalles_beneficiarios=\"+detalles_beneficiarios+\"&Coeficiente=\"+Coeficiente+\"&TotalSueldo=\"+TotalSueldo+\"&TotalPrimas=\"+TotalPrimas+\"&MontoJubilacion=\"+MontoJubilacion+\"&SueldoBase=\"+SueldoBase+\"&\"+post_general+\"&\"+post_jubilacion,\r\n\t\t\tasync: false,\r\n\t\t\tsuccess: function(resp) {\r\n\t\t\t\tvar datos = resp.split(\"|\");\r\n\t\t\t\tif (datos[0].trim() != \"\") cajaModal(datos[0], \"error\", 400);\r\n\t\t\t\telse {\r\n\t\t\t\t\tif (accion == \"nuevo\") {\r\n\t\t\t\t\t\tvar funct = \"document.getElementById('frmgeneral').submit();\";\r\n\t\t\t\t\t\tcajaModal(\"Proceso de Jubilaci&oacute;n <strong>Nro. \"+datos[1]+\"</strong> generado exitosamente\", \"exito\", 400, funct);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse document.getElementById('frmgeneral').submit();;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}\r\n\treturn false;\r\n}", "function enviarVehiculoAgsinado(idSolicitudVehiculo){\n var idSolicitudVehiculo = idSolicitudVehiculo\n $(\".animacion_boton_\"+idSolicitudVehiculo+\"\").html('<div class=\"load-3\"><div class=\"line\"></div><div class=\"line\"></div><div class=\"line\"></div></div>');\n validacionDeCampos(idSolicitudVehiculo, function(validacion){\n if(validacion == 2){\n var placa_vehiculo_asignado = $(\"#placa_vehiculo_asignado_\"+idSolicitudVehiculo+\"\").val();\n var placa_verificado = $(\"#placa_verificado_\"+idSolicitudVehiculo+\"\").val();\n var placa_trayler_vehiculo_asignado = $(\"#placa_trayler_vehiculo_asignado_\"+idSolicitudVehiculo+\"\").val();\n var placa_trayler_verificado = $(\"#placa_trayler_verificado_\"+idSolicitudVehiculo+\"\").val();\n var conductor_asignado = $(\"#conductor_asignado_\"+idSolicitudVehiculo+\"\").val();\n var conductor_verificado = $(\"#conductor_verificado_\"+idSolicitudVehiculo+\"\").val();\n var idDestinatarioViaje = $(\"#destinatario_verificado_\"+idSolicitudVehiculo).val();\n\n placa_vehiculo_asignado = placa_vehiculo_asignado.split(\"-\");\n placa_vehiculo_asignado = placa_vehiculo_asignado[0].trim();\n\n placa_trayler_vehiculo_asignado = placa_trayler_vehiculo_asignado.split(\"-\");\n placa_trayler_vehiculo_asignado = placa_trayler_vehiculo_asignado[0].trim();\n\n conductor_asignado = conductor_asignado.split(\"-\");\n numero_documento_conductor_asignado = conductor_asignado[0].trim();\n conductor_asignado = conductor_asignado[1].trim();\n \n\n var cedi = $(\".cedi\"+idSolicitudVehiculo+\"\").val();\n var estado = \"Cargar\";\n \n var nuevo_dato = {\n placa_vehiculo_asignado:placa_vehiculo_asignado, \n placa_trayler_vehiculo_asignado:placa_trayler_vehiculo_asignado, \n numero_documento_conductor_asignado:numero_documento_conductor_asignado, \n conductor_asignado:conductor_asignado,\n estado:estado, \n idSolicitudVehiculo:idSolicitudVehiculo,\n idDestinatarioViaje:idDestinatarioViaje,\n \"vehiculoSolicitudVehiculos\":\n {id: idSolicitudVehiculo}\n };\n jQuery.post('querys/crear/query_vehiculo_agsinado_Json.php', {\n nuevo_dato: nuevo_dato\n }, function(response){\n $(\".animacion_boton_\"+idSolicitudVehiculo+\"\").html('<i class=\"fa fa-check\" style=\"font-size: 13px\"></i>');\n cedi_clicked(cedi);\n var windowOrdenDeCarga = window.open(`pdf?id=${idSolicitudVehiculo}&estado=Asignar`);\n windowOrdenDeCarga.print()\n })\n }else{\n $(\".animacion_boton_\"+idSolicitudVehiculo+\"\").html('<i class=\"fa fa-times\" style=\"font-size: 13px\"></i>');\n setTimeout(function(){\n $(\".animacion_boton_\"+idSolicitudVehiculo+\"\").html('<i class=\"fa fa-truck\" style=\"font-size: 13px\"></i>');\n }, 2000)\n }\n });//end validacionDeCampos\n}", "function initInterfaz() {\n let status = this.g.options.status;\n\n function reflejarOpciones(opts) {\n for(const ajuste of this.ajustes.$children) {\n const input = ajuste.$el.querySelector(\"input\");\n if(opts[input.name]) {\n input.checked = true;\n input.dispatchEvent(new Event(\"change\"));\n }\n }\n }\n\n // Nos aseguramos de que al (des)aplicarse\n // un filtro o corrección se refleja en la interfaz.\n this.g.Centro.on(\"filter:* unfilter:*\", reflejarFiltro.bind(this));\n this.g.Centro.on(\"correct:* uncorrect:*\", reflejarCorreccion.bind(this));\n\n let opciones = {};\n if(status) {\n this.g.setStatus(); // Aplicamos el estado del mapa.\n // Lo único que queda por reflejar son las opciones\n // exclusivas de la interfaz virtual.\n for(const o in defaults_v) {\n const name = o.substring(0, 3);\n if(status.visual.hasOwnProperty(name)) {\n opciones[o] = status.visual[name];\n }\n }\n if(status.esp) this.selector.cambiarSidebar(status.esp);\n }\n else opciones = this.options;\n\n reflejarOpciones.call(this, opciones);\n\n // Si no se incluyen vacantes telefónicas, entonces\n // debe deshabilitarse la corrección por adjudicaciones no telefónicas.\n if(!this.options[\"correct:vt+\"]) {\n for(const f of this.filtrador.$children) {\n if(f.c.tipo === \"correct\" && f.c.nombre === \"vt\") {\n f.$children[0].disabled = true;\n break;\n }\n }\n }\n\n // Una vez aplicados todos los cambios iniciales, definimos\n // el disparador para que vaya apuntando en local los cambios de estado.\n // TODO: Esto quizás se pueda pasar a un sitio más adecuando, haciendo uso de statusset\n this.g.on(\"statuschange\", e => {\n if(localStorage && this.options.recordar) localStorage.setItem(\"status\", this.status);\n });\n\n this.g.fire(\"statusset\", {status: !!status});\n // Guardamos el estado final de la inicialización.\n this.g.fire(\"statuschange\");\n }", "function funAtualizarConta(parametros,callbackf) {\n var query = \"\";\n var queryItens = \"\";\n var parcela = 0;\n\tvar totalParcelas = 0;\n var resposta = null;\n\tvar conexao = null;\n\tvar dataEmissao = null;\n\tvar dataVencimento = null;\n\n resposta = {\n status: 1,\n mensagem: [],\n titulo: null\n }\n\n try{\n if(parametros.idEntidade == \"\" || parametros.idEntidade == \"undefined\"){\n resposta.status = 0;\n resposta.mensagem.push(\"O cliente não foi informado.\");\n }\n\n if(parametros.nrTitulo == \"\" || parametros.nrTitulo == \"undefined\"){\n resposta.status = 0;\n resposta.mensagem.push(\"O documento não foi informado.\");\n }\n\n if(!parametros.idParcelamento){\n resposta.status = 0;\n resposta.mensagem.push(\"A forma de parcelamento não foi informada.\");\n }\n\n if(parametros.emissao == \"\" || parametros.emissao.indexOf(\"undefined\") >= 0){\n resposta.status = 0;\n resposta.mensagem.push(\"A data de emissão não foi informada.\");\n }\n\n if(parametros.valor == \"\" || parametros.valor == \"undefined\" || isNaN(parametros.valor)){\n resposta.status = 0;\n resposta.mensagem.push(\"Valor do documento é inválido ou não foi informado.\");\n }\n\n if(!(parametros.hasOwnProperty(\"parcelas\")) || parametros.parcelas.length == 0){\n resposta.status = 0;\n resposta.mensagem.push(\"As parcelas não foram informadas.\");\n }\n else{\n dataEmissao = new Date(parametros.emissao.substring(0,4),parseInt(parametros.emissao.substring(5,7)) - 1,parametros.emissao.substring(8,10));\n for(parcela = 0; parcela < parametros.parcelas.length; parcela++){\n if(parametros.parcelas[parcela].documento == \"\" || parametros.parcelas[parcela].documento == \"undefined\"){\n resposta.status = 0;\n resposta.mensagem.push(\"A parcela \" + (parcela + 1).toString().trim() + \" não possui o documento.\");\n }\n if(parametros.parcelas[parcela].parcela == \"\" || parametros.parcelas[parcela].parcela == \"undefined\"){\n resposta.status = 0;\n resposta.mensagem.push(\"A parcela \" + (parcela + 1).toString().trim() + \" não possui o número informado.\");\n }\n if(parametros.parcelas[parcela].vencimento == \"\" || parametros.parcelas[parcela].vencimento == \"undefined\"){\n resposta.status = 0;\n resposta.mensagem.push(\"A parcela \" + (parcela + 1).toString().trim() + \" não possui a data de vencimento.\");\n }\n\t\t\t\telse{\n\t\t\t\t\tdataVencimento = new Date(parametros.parcelas[parcela].vencimento.substring(0,4),parseInt(parametros.parcelas[parcela].vencimento.substring(5,7)) - 1,parametros.parcelas[parcela].vencimento.substring(8,10));\n\t\t\t\t\tif(dataVencimento.getTime() < dataEmissao.getTime()){\n\t\t\t\t\t\tresposta.status = 0;\n\t\t\t\t\t\tresposta.mensagem.push(\"A data de vencimento da parcela \" + (parcela + 1).toString().trim() + \" é anterior à data de emissão do documento.\");\n\t\t\t\t\t}\n\t\t\t\t}\n if(parametros.parcelas[parcela].valor == \"\" || parametros.parcelas[parcela].valor == \"undefined\" || isNaN(parametros.parcelas[parcela].valor)){\n resposta.status = 0;\n resposta.mensagem.push(\"A parcela \" + (parcela + 1).toString().trim() + \" não possui valor.\");\n }\n\t\t\t\telse{\n\t\t\t\t\ttotalParcelas += parseFloat(parametros.parcelas[parcela].valor);\n\t\t\t\t}\n }\n\t\t\tif(resposta.status == 1){\n\t\t\t\tconsole.log(parametros);\n\t\t\t\tif(parseFloat(parametros.valor) != totalParcelas){\n\t\t\t\t\tresposta.status = 0;\n\t\t\t\t\tresposta.mensagem.push(\"A soma dos valores das parcelas difere do total do documento.\")\n\t\t\t\t}\n\t\t\t}\n }\n\n if(resposta.status == 1){\n if(parametros.idTitulo == \"\"){\n parametros.idTitulo = general.guid();\n query = \"insert into contas_receber (id,id_empresa,id_entidade,id_venda,id_notafiscal,id_parcelamento,id_plano_contas_financeiro,id_origem,nm_documento,dt_emissao,nm_competencia,vl_valor,sn_dre,nm_observacao) values(\"\n query += \"'\" + parametros.idTitulo + \"',\";\n query += \"'\" + EnterpriseID + \"',\";\n query += \"'\" + parametros.idEntidade + \"',\";\n query += (!parametros.idPedido ? \"null\" : \"'\" + parametros.idPedido + \"'\") + \",\";\n query += (!parametros.idNotaFiscal ? \"null\" : \"'\" + parametros.idNotaFiscal + \"'\") + \",\";\n query += \"'\" + parametros.idParcelamento + \"',\";\n query += (!parametros.idContaFinanceira ? \"null\" : \"'\" + parametros.idContaFinanceira + \"'\") + \",\";\n query += (!parametros.idOrigem ? \"null\" : \"'\" + parametros.idOrigem + \"'\") + \",\";\n query += \"'\" + parametros.nrTitulo + \"',\";\n query += \"'\" + parametros.emissao + \"',\";\n query += \"'\" + parametros.competencia + \"',\";\n query += parametros.valor.toString().trim() + \",\";\n query += parametros.dre.toString().trim() + \",\";\n query += \"'\" + parametros.observacao + \"'\";\n query += \"); \";\n\n query += \"insert into contas_receber_parcelas (id,id_empresa,id_contas_receber,id_Banco,id_forma_pagamento,id_configuracao_cnab,id_plano_contas_financeiro,nr_parcela,nm_documento,sn_fluxocaixa,dt_data_vencimento,vl_valor)\";\n query += \" values \";\n\t\t\t\t\n for(parcela = 0; parcela < parametros.parcelas.length; parcela++){\n parametros.parcelas[parcela].idParcela = general.guid();\n\t\t\t\t\tif(parcela > 0)\n\t\t\t\t\t\tquery += \",\";\n query += \"(\";\n query += \"'\" + parametros.parcelas[parcela].idParcela + \"',\";\n query += \"'\" + EnterpriseID + \"',\";\n query += \"'\" + parametros.idTitulo + \"',\";\n query += (!parametros.parcelas[parcela].idBanco ? \"null\" : \"'\" + parametros.parcelas[parcela].idBanco + \"'\") + \",\"; \n query += (!parametros.parcelas[parcela].idFormaPagamento ? \"null\" : \"'\" + parametros.parcelas[parcela].idFormaPagamento + \"'\") + \",\";\n query += (!parametros.parcelas[parcela].idConfCNAB ? \"null\" : \"'\" + parametros.parcelas[parcela].idConfCNAB + \"'\") + \",\";\n query += (!parametros.parcelas[parcela].idContaFinanceira ? \"null\" : \"'\" + parametros.parcelas[parcela].idContaFinanceira + \"'\") + \",\";\n query += \"'\" + parametros.parcelas[parcela].parcela + \"',\";\n query += \"'\" + parametros.parcelas[parcela].documento + \"',\";\n query += parametros.parcelas[parcela].fluxoCaixa + \",\";\n query += \"'\" + parametros.parcelas[parcela].vencimento + \"',\";\n query += parametros.parcelas[parcela].valor.toString().trim()\n query += \")\";\n }\n\t\t\t\t\n\t\t\t\tconexao = new sql.ConnectionPool(config,function (err) {\n\t\t\t\t\tif (err){\n\t\t\t\t\t\tresposta.status = -2;\n\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\trespsota.titulo = null;\n\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tvar transacao = conexao.transaction();\n\t\t\t\t\t\t\ttransacao.begin(err =>{\n\t\t\t\t\t\t\t\tvar request = transacao.request();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\trequest.query(query, function (err, recordset) {\n\t\t\t\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\t\t\t\tresposta.status = -3;\n\t\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\t\t\t\ttransacao.rollback();\n\t\t\t\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\tresposta.status = 1;\n\t\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"ok\"];\n\t\t\t\t\t\t\t\t\t\tresposta.titulo = parametros;\n\t\t\t\t\t\t\t\t\t\ttransacao.commit();\n\t\t\t\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(err){\n\t\t\t\t\t\t\tresposta.status = -4;\n\t\t\t\t\t\t\trespsosta.mensagem = [\"ok\"];\n\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n }\n else{\n\t\t\t\tquery = \"select sum(vl_valor) totalbaixas from contas_receber_baixas where id_empresa = '\" + EnterpriseID + \"' and id_contas_receber_parcela in (select id from contas_receber_parcelas where id_contas_receber = \";\n\t\t\t\tquery += \"(select id from contas_receber where id_empresa = '\" + EnterpriseID + \"' and id = '\" + parametros.idTitulo + \"'))\";\n\t\t\t\t\n conexao = new sql.ConnectionPool(config,function (err) {\n\t\t\t\t\tif (err){\n\t\t\t\t\t\tresposta.status = -5;\n\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\tvar request = conexao.request();\n\t\t\t\t\t\t\trequest.query(query, function (err, recordset) {\n\t\t\t\t\t\t\t\ttry{\n\t\t\t\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\t\t\t\tresposta.status = -6;\n\t\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\tif(recordset.recordsets[0][0].totalbaixas == null){\n\t\t\t\t\t\t\t\t\t\t\tqueryItens = \"delete contas_receber_parcelas where id_empresa = '\" + EnterpriseID + \"' and id_contas_receber = '\" + parametros.idTitulo + \"'; \"\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"update contas_receber set \"\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_parcelamento = '\" + parametros.idParcelamento + \"',\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_plano_contas_financeiro = \" + (!parametros.idContaFinanceira ? \"null\" : \"'\" + parametros.idContaFinanceira + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"nm_competencia = '\" + parametros.competencia + \"',\"\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"nm_observacao = '\" + parametros.observacao + \"'\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" where id = '\" + parametros.idTitulo + \"'\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" and id_empresa = '\" + EnterpriseID + \"'; \";\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"insert into contas_receber_parcelas (id,id_empresa,id_contas_receber,id_Banco,id_forma_pagamento,id_plano_contas_financeiro,nr_parcela,nm_documento,sn_fluxocaixa,dt_data_vencimento,vl_valor)\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" values \";\n\t\t\t\t\t\t\t\t\t\t\tfor(parcela = 0; parcela < parametros.parcelas.length; parcela++){\n\t\t\t\t\t\t\t\t\t\t\t\tif(parcela > 0)\n\t\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \",\";\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\tparametros.parcelas[parcela].idParcela = general.guid();\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"(\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + parametros.parcelas[parcela].idParcela + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + EnterpriseID + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + parametros.idTitulo + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += (!parametros.parcelas[parcela].idBanco ? \"null\" : \"'\" + parametros.parcelas[parcela].idBanco + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += (!parametros.parcelas[parcela].idFormaPagamento ? \"null\" : \"'\" + parametros.parcelas[parcela].idFormaPagamento + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += (!parametros.parcelas[parcela].idContaFinanceira ? \"null\" : \"'\" + parametros.parcelas[parcela].idContaFinanceira + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + parametros.parcelas[parcela].parcela + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + parametros.parcelas[parcela].documento + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += parametros.parcelas[parcela].fluxoCaixa + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"'\" + parametros.parcelas[parcela].vencimento + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += parametros.parcelas[parcela].valor.toString().trim();\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \")\";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\tqueryItens = \"update contas_receber set \"\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_plano_contas_financeiro = \" + (!parametros.idContaFinanceira ? \"null\" : \"'\" + parametros.idContaFinanceira + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"nm_competencia = '\" + parametros.competencia + \"',\"\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"nm_observacao = '\" + parametros.observacao + \"'\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" where id = '\" + parametros.idTitulo + \"'\";\n\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" and id_empresa = '\" + EnterpriseID + \"'\";\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tfor(parcela = 0; parcela < parametros.parcelas.length; parcela++){\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"; \";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"update contas_receber_parcelas set \";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_banco = \" + (!parametros.parcelas[parcela].idBanco ? \"null\" : \"'\" + parametros.parcelas[parcela].idBanco + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_forma_pagamento = \" + (!parametros.parcelas[parcela].idFormaPagamento ? \"null\" : \"'\" + parametros.parcelas[parcela].idFormaPagamento + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"id_plano_contas_financeiro = \" + (!parametros.parcelas[parcela].idContaFinanceira ? \"null\" : \"'\" + parametros.parcelas[parcela].idContaFinanceira + \"'\") + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"nm_documento = '\" + parametros.parcelas[parcela].documento + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"sn_fluxocaixa = \" + parametros.parcelas[parcela].fluxoCaixa + \",\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"dt_data_vencimento = '\" + parametros.parcelas[parcela].vencimento + \"',\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \"vl_valor = \" + parametros.parcelas[parcela].valor.toString().trim();\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" where id_empresa = '\" + EnterpriseID + \"'\";\n\t\t\t\t\t\t\t\t\t\t\t\tqueryItens += \" and id = '\" + parametros.parcelas[parcela].idParcela + \"'\";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tvar transacao = conexao.transaction();\n\t\t\t\t\t\t\t\t\t\ttransacao.begin(err =>{\n\t\t\t\t\t\t\t\t\t\t\tvar request = transacao.request();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\trequest.query(queryItens, function (err, recordset) {\n\t\t\t\t\t\t\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.status = -7;\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\t\t\t\t\t\t\ttransacao.rollback();\n\t\t\t\t\t\t\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.status = 1;\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"ok\"];\n\t\t\t\t\t\t\t\t\t\t\t\t\tresposta.titulo = parametros;\n\t\t\t\t\t\t\t\t\t\t\t\t\ttransacao.commit();\n\t\t\t\t\t\t\t\t\t\t\t\t\tconexao.close();\n\t\t\t\t\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tcatch(err){\n\t\t\t\t\t\t\t\t\tresposta.status = -8;\n\t\t\t\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch(err){\n\t\t\t\t\t\t\tresposta.status = -9;\n\t\t\t\t\t\t\tresposta.mensagem = [\"\" + err];\n\t\t\t\t\t\t\tresposta.titulo = null;\n\t\t\t\t\t\t\tcallbackf(resposta);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n }\n else{\n resposta.titulo == null;\n callbackf(resposta);\n }\n }\n catch(erro){\n resposta.status = -1;\n resposta.mensagem = [];\n resposta.mensagem.push(\"f: \" + erro);\n resposta.titulo = null;\n callbackf(resposta);\n }\n}", "function checaHora(diaEscolhido) {\n var mesId = \"d\";\n var mesAt = mes + 1;\n mesId = mesId.replace(\"d\", mesAt);\n \n\n var checaDia = \"d\";\n var checaDia = checaDia.replace(\"d\", diaEscolhido);\n\n tirarHoraGasta(horaIntervalo.inicio, horaIntervalo.fim);\n\n if (agMes[mesId] != null) {\n for (var i = 0; i < agMes[mesId].length; i++) {\n\n if (agMes[mesId][i].dia == checaDia) {\n\n var minutoM = 0; //minuto marcado\n var horaM = 0; //hora marcada\n\n //se for igual a 3 para saber se a hora é\n //menor que 10\n if (agMes[mesId][i].hora.length == 3) {\n horaM = parseInt(agMes[mesId][i].hora[0]);\n minutoM = agMes[mesId][i].hora[1] + agMes[mesId][i].hora[2];\n minutoM = parseInt(minutoM);\n }\n else {\n horaM = agMes[mesId][i].hora[0] + agMes[mesId][i].hora[1];\n minutoM = agMes[mesId][i].hora[2] + agMes[mesId][i].hora[3];\n horaM = parseInt(horaM);\n minutoM = parseInt(minutoM);\n }\n var horaG = agMes[mesId][i].horaGasta; //hora gasta\n var minutoG = agMes[mesId][i].minutoGasto; // minuto gasto\n horaG = parseInt(horaG);\n minutoG = parseInt(minutoG);\n\n var horaS = horaM + horaG; //hora somada\n var minutoS = minutoM + minutoG; //minuto somado\n \n if (minutoS > 30) {\n minutoS = 0;\n ++horaS;\n }\n\n var tMinuto = \"d\"; //texto Minuto\n var tHora = \"d\"; //texto hora\n if (minutoS == 0) {\n tMinuto = tMinuto.replace(\"d\", \"00\");\n }\n else {\n tMinuto = tMinuto.replace(\"d\", minutoS);\n }\n\n tHora = tHora.replace(\"d\", horaS);\n\n var fim = tHora + tMinuto;\n fim = parseInt(fim);\n var inicio = agMes[mesId][i].hora;\n tirarHoraGasta(inicio, fim);\n }\n }\n }\n}", "_validateInitialPropertyValues() {\n const that = this;\n\n that._validateFooterTemplate();\n\n that.minuteInterval = Math.max(1, Math.min(that.minuteInterval, 60));\n\n that._validateValue();\n }", "function ControlloOraInserita(oradafiltrare,campo,colore,sfondo) {\r\n var hh=new String();\r\n var mm=new String();\r\n\r\n var pattern1=/^([0-9]{4,4})+$/\r\n var pattern2=/^([0-9]{2,2})+\\:+([0-9]{2,2})+$/;\r\n \r\n switch (oradafiltrare.length) {\r\n case 0:\r\n document.getElementById(campo).style.color=colore;\r\n document.getElementById(campo).style.background=sfondo;\r\n return;\r\n break;\r\n \r\n case 2:\r\n oradafiltrare+=\":00\";\r\n break;\r\n } \r\n \r\n //controlla che siano stati inseriti solo numeri\r\n if (!pattern1.test(oradafiltrare)) { \r\n if (!pattern2.test(oradafiltrare)) {\r\n alert (\"Attenzione! L'ora che hai inserito e' errata!\")\r\n return;\r\n }\r\n }\r\n \r\n //controllo dell'ora\r\n hh=oradafiltrare.substr(0,2);\r\n if (Number(hh)>23) {\r\n alert (\"Attenzione! L'ora che hai inserito e' errata!\")\r\n return;\r\n }\r\n \r\n //controllo dei minuti\r\n if (oradafiltrare.length==4) {\r\n mm=oradafiltrare.substr(2,2);\r\n } else {\r\n mm=oradafiltrare.substr(3,2);\r\n }\r\n \r\n if (Number(mm)>59) {\r\n alert (\"Attenzione! L'ora che hai inserito e' errata!\")\r\n return;\r\n }\r\n \r\n \r\n // ricostruzione della stringa e uscita\r\n document.getElementById(campo).value=hh+\":\"+mm;\r\n document.getElementById(campo).style.color=colore;\r\n document.getElementById(campo).style.background=sfondo;\r\n return;\r\n}", "siguientePaso(valores, evento) {\n\n if (evento) {\n evento.preventDefault();\n }\n\n let pasoActual = this.state.pasoActual;\n let infoPasos = this.state.pasos;\n infoPasos[pasoActual - 1] = { ...infoPasos[pasoActual - 1], ...valores };\n\n // Solo si el paso actual es menor que el último, que aumente el paso actual. (Empezamos de 1). Además, que guarde los valores\n if (pasoActual < this.state.pasos.length) {\n this.setState({\n pasos: infoPasos,\n pasoActual: pasoActual + 1\n })\n\n }\n // Cuando alcance el paso final, que guarda los valores y cuando termine, haga el fetch\n else if (pasoActual == this.state.pasos.length) {\n this.setState({\n pasos: infoPasos,\n modalAbierto: true\n\n }, () => {\n this.props.registrarUsuario(this.state);\n })\n }\n\n }", "function soltaObj(ele){ \n\t//console.log(\"soltou!!\");\n\t\n\tif(!elementoCarregado)return; \t\n\t\t\n\t$(\"#\"+elementoCarregado.id).css(\"pointer-events\", \"all\");\n\t$(\"#\"+elementoCarregado.id).css(\"z-index\", \"7\");\n\n\tvar pontoX = $(elementoCarregado).position().left/prop+($(elementoCarregado).width())/2;\n\tvar pontoY = $(elementoCarregado).position().top/prop+($(elementoCarregado).height())/2;\n\t\n\t\tif (pontoX > $(\"#areaDrop\").position().left/prop && pontoY > $(\"#areaDrop\").position().top/prop && pontoY < ($(\"#areaDrop\").position().top/prop+$(\"#areaDrop\").height()) && pontoX < ($(\"#areaDrop\").position().left/prop+$(\"#areaDrop\").width())) {\n\t\t\n\t\t\t\t$(elementoCarregado).fadeOut(200, function(){\n\t\t\t\t\t$(elementoCarregado).css({ top:posOriginTop, left:posORiginLeft});\n\t\t\t\t\t$(elementoCarregado).fadeIn(200);\n\t\t\t\t\telementoCarregado = null;\n\t\t\t\t\tobjEmMovimento = false;\n\n\t\t\t\t\tdinArrastado = Number(dinArrastado);\n\n\t\t\t\t\tfaltandoP -= parseFloat(dinArrastado.toFixed(2));\n\t\t\t\t\tmeuDinheiro -= parseFloat(dinArrastado.toFixed(2));\n\n\t\t\t\t\t$(\"#dinPago\").html(\"R$ \"+mascaraValor(faltandoP.toFixed(2)));\n\t\t\t\t\t$(\".boxMeuDinheiro span+span\").html(mascaraValor(meuDinheiro.toFixed(2)));\n\n\t\t\t\t\tverificaCarteira();\n\n\t\t\t\t\tif (parseFloat(faltandoP.toFixed(2)) <= 0.00) {//Math.floor(faltandoP)\n\t\t\t\t\t\t$(\"#dinPago\").html(\"R$ 0,00\");\n\t\t\t\t\t\tmeuTroco = Number(faltandoP.toFixed(2))*-1\n\t\t\t\t\t\t//$(\".boxMeuDinheiro span+span\").html(mascaraValor(meuDinheiro.toFixed(2)));\n\n\t\t\t\t\t\tconsole.log(\"TudoPago\");\n\t\t\t\t\t\tChamaModalFinal();\n\t\t\t\t\t}\n\n\t\t\t\t});\n\t\t\n\t\t\t\treturn;\n\t\t}else{\n\t\t\t\n\t\t}\t\n\t\n\t$(elementoCarregado).animate({left:posORiginLeft, top:posOriginTop},function(){\n\t\tobjEmMovimento = false;\n\t});\t\n\telementoCarregado = null;/**/\n\t\n}", "function validarItinerario(id,no_de_itinerario,noItinerarioSet){\n\t//alert(\"Valor de itinerario de ventana\"+no_de_itinerario);\n\t//alert(\"valor del itinerario seleccionado\"+noItinerarioSet);\n\t\n\t//Funciones que permitiran recorrer los indices de las cotizaciones de hotel realizadas\n\t $(\"#rowCount_hotel\"+no_de_itinerario).bind(\"restar\",function(e,data,data1){\n\t \te.stopImmediatePropagation();\n\t\t\t\t$(\"#rowCount_hotel\"+no_de_itinerario).val(parseInt($(\"#hotel_table\"+no_de_itinerario+\">tbody >tr\").length));\n\t });\n\t $(\"#rowDel_hotel\"+no_de_itinerario).bind(\"cambiar\",function(e,inicio,tope){\n\t e.stopImmediatePropagation();\n\t\t\tvar nextno = \"\";\n\t\t\tvar no = \"\";\n\t\t\tvar jqueryno = \"\";\n\t\t\tvar nextrow = \"\";\n\t\t\tvar row = \"\";\n\t\t\tvar jqueryrow = \"\";\n\t\t\tvar nextciudad = \"\";\n\t\t\tvar ciudad = \"\";\n\t\t\tvar jqueryciudad =\"\";\n\t\t\tvar nexthotel = \"\";\n\t\t\tvar hotel = \"\";\n\t\t\tvar jqueryhotel =\"\";\n\t\t\tvar nextcomentario = \"\";\n\t\t\tvar comentario = \"\";\n\t\t\tvar jquerycomentario =\"\";\n\t\t\tvar nextnoches = \"\";\n\t\t\tvar noches = \"\";\n\t\t\tvar jquerynoches =\"\";\n\t\t\tvar nextllegada = \"\";\n\t\t\tvar llegada = \"\";\n\t\t\tvar jqueryllegada =\"\";\n\t\t\tvar nextsalida = \"\";\n\t\t\tvar salida = \"\";\n\t\t\tvar jquerysalida =\"\";\n\t\t\tvar nextnoreservacion = \"\";\n\t\t\tvar noreservacion = \"\";\n\t\t\tvar jquerynoreservacion =\"\";\n\t\t\tvar nextcostoNoche = \"\";\n\t\t\tvar costoNoche = \"\";\n\t\t\tvar jquerycostoNoche =\"\";\n\t\t\tvar nextiva = \"\";\n\t\t\tvar iva = \"\";\n\t\t\tvar jqueryiva =\"\";\n\t\t\tvar nexttotal = \"\";\n\t\t\tvar total = \"\";\n\t\t\tvar jquerytotal =\"\";\n\t\t\tvar nextselecttipodivisa = \"\";\n\t\t\tvar selecttipodivisa = \"\";\n\t\t\tvar jqueryselecttipodivisa =\"\";\n\t\t\tvar nextmontoP = \"\";\n\t\t\tvar montoP = \"\";\n\t\t\tvar jquerymontoP =\"\";\n\t\t\tvar nextdel = \"\";\n\t\t\tvar del = \"\";\n\t\t\tvar jquerydel =\"\";\n\t\t\tvar nextsubtotal = \"\";\n\t\t\tvar subtotal = \"\";\n\t\t\tvar jquerysubtotal =\"\";\n\t\t\tvar nextdeldiv = \"\";\n\t\t\tvar deldiv = \"\";\n\t\t\tvar jquerydeldiv =\"\";\n\t\t\t\n\t/*\t\t*/\n\t\t\t\n\t\t\tfor (var i=parseFloat(inicio);i<=parseFloat(tope);i++){\n\t\t\t\tnextno=\"#no_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tno=\"no_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryno=\"#no_\"+no_de_itinerario+\"_\"+parseInt(i);\n\n\t\t\t\tnextrow=\"#row_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\trow=\"row_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryrow=\"#row_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\t\n\t\t\t\tnextciudad=\"#ciudad_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tciudad=\"ciudad_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryciudad=\"#ciudad_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnexthotel=\"#hotel_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\thotel=\"hotel_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryhotel=\"#hotel_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextcomentario=\"#comentario_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tcomentario=\"comentario_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerycomentario=\"#comentario_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextnoches=\"#noches_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tnoches=\"noches_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerynoches=\"#noches_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextllegada=\"#llegada_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tllegada=\"llegada_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryllegada=\"#llegada_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextsalida=\"#salida_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tsalida=\"salida_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerysalida=\"#salida_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextnoreservacion=\"#noreservacion_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tnoreservacion=\"noreservacion_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerynoreservacion=\"#noreservacion_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextcostoNoche=\"#costoNoche_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tcostoNoche=\"costoNoche_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerycostoNoche=\"#costoNoche_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextiva=\"#iva_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tiva=\"iva_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryiva=\"#iva_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnexttotal=\"#total_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\ttotal=\"total_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerytotal=\"#total_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextselecttipodivisa=\"#selecttipodivisa_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tselecttipodivisa=\"selecttipodivisa_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjqueryselecttipodivisa=\"#selecttipodivisa_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextmontoP=\"#montoP_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tmontoP=\"montoP_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerymontoP=\"#montoP_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\tnextsubtotal=\"#subtotal_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tsubtotal=\"subtotal_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerysubtotal=\"#subtotal_\"+no_de_itinerario+\"_\"+parseInt(i);\n\t\t\t\t\n\t\t\t\tnextdeldiv=\"#delDiv_\"+no_de_itinerario+\"_\"+((parseInt(i)+(1)));\n\t\t\t\tdeldiv=\"delDiv_\"+no_de_itinerario+\"_\" + parseInt(i);\n\t\t\t\tjquerydeldiv=\"#delDiv_\"+no_de_itinerario+\"_\"+parseInt(i);\n\n\t\t\t\tdel=parseInt(i)+\"delHotel\";\n\t\t\t\tjquerydel=\"#\"+parseInt(i)+\"delHotel\";\n\t\t\t\tnextdel=\"#\"+((parseInt(i)+(1)))+\"delHotel\";\n\n\t\t\t\t$(nextno).attr(\"id\",no);\n\t\t\t\t$(jqueryno).attr(\"name\",no);\n\t\t\t\t$(jqueryno).html(parseInt(i));\n\t\t\t\t\n\t\t\t\t$(nextrow).attr(\"id\",row);\n\t\t\t\t$(jqueryrow).attr(\"name\",row);\n\t\t\t\t\n\t\t\t\t$(nextciudad).attr(\"id\",ciudad);\n\t\t\t\t$(jqueryciudad).attr(\"name\",ciudad);\n\t\t\t\t$(nexthotel).attr(\"id\",hotel);\n\t\t\t\t$(jqueryhotel).attr(\"name\",hotel);\n\t\t\t\t$(nextcomentario).attr(\"id\",comentario);\n\t\t\t\t$(jquerycomentario).attr(\"name\",comentario);\n\t\t\t\t$(nextnoches).attr(\"id\",noches);\n\t\t\t\t$(jquerynoches).attr(\"name\",noches);\n\t\t\t\t$(nextllegada).attr(\"id\",llegada);\n\t\t\t\t$(jqueryllegada).attr(\"name\",llegada);\n\t\t\t\t$(nextsalida).attr(\"id\",salida);\n\t\t\t\t$(jquerysalida).attr(\"name\",salida);\n\t\t\t\t$(nextnoreservacion).attr(\"id\",noreservacion);\n\t\t\t\t$(jquerynoreservacion).attr(\"name\",noreservacion);\n\t\t\t\t$(nextcostoNoche).attr(\"id\",costoNoche);\n\t\t\t\t$(jquerycostoNoche).attr(\"name\",costoNoche);\n\t\t\t\t$(nextiva).attr(\"id\",iva);\n\t\t\t\t$(jqueryiva).attr(\"name\",iva);\n\t\t\t\t$(nexttotal).attr(\"id\",total);\n\t\t\t\t$(jquerytotal).attr(\"name\",total);\n\t\t\t\t$(nextselecttipodivisa).attr(\"id\",selecttipodivisa);\n\t\t\t\t$(jqueryselecttipodivisa).attr(\"name\",selecttipodivisa);\n\t\t\t\t$(nextmontoP).attr(\"id\",montoP);\n\t\t\t\t$(jquerymontoP).attr(\"name\",montoP);\n\t\t\t\t$(nextsubtotal).attr(\"id\",subtotal);\n\t\t\t\t$(jquerysubtotal).attr(\"name\",subtotal);\n\t\t\t\t$(nextdel).attr(\"id\",del);\n\t\t\t\t$(jquerydel).attr(\"name\",del);\n\t\t\t\t$(nextdeldiv).attr(\"id\",deldiv);\n\t\t\t\t$(jquerydeldiv).attr(\"name\",deldiv);\n\t\t\t}\n\t });\n\t //END de funciones.\t \t\n\t\t\t//alert(\"elimna click\");\n\t\t\t//$(this).parent().parent().parent().fadeOut(\"normal\", function () {\n\t\t\t//$(this).fadeOut(\"normal\", function () {\n\t\t\t$(\"#hotel_table\"+no_de_itinerario+\">tbody\").find(\"tr\").eq((parseFloat(id))-1).fadeOut(\"normal\", function () {\t\t\t\t\t\n\t\t\t\tvar i=0;\t\t\t\n\t\t\t\t$(this).remove();\t\n\t\t\t\t$(\"#rowCount_hotel\"+no_de_itinerario).trigger(\"restar\");\n\t\t\t\t$(\"#rowCount_hotel\"+no_de_itinerario).unbind(\"restar\");\n\t\t\t\t\t var tope=$(\"#rowCount_hotel\"+no_de_itinerario).val();\n\t\t\t\t\t i=parseFloat(id);\n\t\t\t\t$(\"#rowDel_hotel\"+no_de_itinerario).trigger(\"cambiar\",[i,tope]);\n\t\t\t\t$(\"#rowDel_hotel\"+no_de_itinerario).unbind(\"cambiar\");\n\t\t\t\tcalculaTotalHospedaje();\n\t\t\t\tdeshabilita_aceptar();\t\t\t\t\n\t });\n}" ]
[ "0.58225214", "0.55095285", "0.54532754", "0.54475945", "0.5429833", "0.53908575", "0.5372989", "0.5352312", "0.5348509", "0.5329354", "0.5328913", "0.529499", "0.52425516", "0.5231468", "0.52233416", "0.5192849", "0.5179097", "0.51694113", "0.51685107", "0.51322806", "0.51305044", "0.5119586", "0.5119577", "0.5119549", "0.5119549", "0.5112111", "0.5109901", "0.50999427", "0.5086774", "0.508665", "0.50774807", "0.5065142", "0.50607604", "0.50564146", "0.5046446", "0.504639", "0.50400305", "0.50339425", "0.5005548", "0.49936372", "0.49773806", "0.49773067", "0.49731717", "0.4972147", "0.49677318", "0.49571902", "0.49544868", "0.49525326", "0.4951516", "0.49488196", "0.49267605", "0.49250746", "0.49233153", "0.4923125", "0.4922474", "0.4911439", "0.49088725", "0.49024698", "0.49022743", "0.4895748", "0.48826534", "0.4881774", "0.4879492", "0.48688868", "0.48685527", "0.48667938", "0.48579416", "0.48552603", "0.48529032", "0.4852605", "0.48491687", "0.48294985", "0.48288757", "0.48236933", "0.48229873", "0.48200762", "0.48163185", "0.4815227", "0.48148578", "0.48134324", "0.48117724", "0.48044991", "0.48000625", "0.4799414", "0.47956058", "0.4780199", "0.47787356", "0.4777319", "0.47765875", "0.47757345", "0.47684935", "0.4768269", "0.47675878", "0.4764784", "0.47628915", "0.47625896", "0.47615743", "0.475829", "0.47580856", "0.47558042" ]
0.6449129
0
Created on : Oct 28, 2015, 4:22:48 PM Author : Sreenath Koyyam Eros:category get
function alertit() { alert(123); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCategory()\n{\n\tvar category = new Array([111,'server'], [222,'switcher'], [333,'storage'], [444,'workstation']);\n\treturn category;\n}", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "getcategory(state){\n return state.category\n }", "function getCatCategory() {\n\tvar categories = \"\";\n\tvar listValues = getCategoryValues([\"catVinRouge\", \"catVinBlanc\", \"catVinGrappa\", \"catVinMousseuxRose\", \"catVinPineau\", \"catVinAromatise\"]);\n\tif (listValues != \"\")\n\t\tcategories = \"(@tpcategorie==(\" + listValues + \"))\";\n\t\n\treturn categories;\n}", "get type() {\n\t\treturn \"category\";\n\t}", "function getCategories() {\n\trimer.category.find(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}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category() {\n\t\treturn this.__category;\n\t}", "getCategories() {\n return ['Snacks', 'MainDishes', 'Desserts', 'SideDishes', 'Smoothies', 'Pickles', 'Dhal', 'General']\n }", "card_getCategory(card){\n return card.category;\n }", "category () {\n if (this.categoryId) {\n return BacklogItemCategories.findOne(this.categoryId)\n }\n }", "categ(state,data)\n {\n return state.category=data\n }", "function getCategory() {\n let href = window.location.href;\n let index = href.indexOf(\"#\");\n let cat = href.substr(index + 1);\n if(index == -1) {\n cat = '';\n }\n return cat;\n }", "function _dex_getCategories(){ // Step 1 of 2 – Gets top-level categories\n var t=new Date().getTime(),out={},ar=LibraryjsUtil.getHtmlData(\"http://www.dexknows.com/browse-directory\",/\\\"http:\\/\\/www\\.dexknows\\.com\\/local\\/(\\w+\\/\\\">.+)<\\/a>/gm)//return ar;\n ,i=ar.length;while(i--){ar[i]=ar[i].split('/\">');ar[i][1]=ar[i][1].replace(/&amp;/g,\"&\");out[ar[i][0]]={\"displayName\":ar[i][1]}}\n LibraryjsUtil.write2fb(\"torrid-heat-2303\",\"dex/categories/\",\"put\",out)}//function test(){/*print2doc*/Logger.log(_dex_getCategories())}", "function findCategory(){\n return _.find(categories, function(c){\n return c.name == categoryName;\n });\n }", "function whatCategory(num, cat) {\n for(var i = 0; i < cat.categories.length; i++) {\n if(cat.categories[i].id === num) {\n return cat.categories[i].name\n }\n }\n}", "function getCategories() {\n\tvar categories = getCatDisponibility() + \" \" + getCatCategory() + \" \" + getCatCountries();\n\t\n\treturn categories;\n}", "get category() {\n const value = Number(this.getAttribute('category'))\n if (!Number.isNaN(value)) {\n return value\n } else {\n return ''\n }\n }", "getAllDisplayName(category) {\n return category === 'All' ? 'Todos los lugares' : category;\n }", "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "getCategories() {\n return this.$node.attr('data-category').split(/\\s*,\\s*/g);\n }", "function findCategory(category) {\n return originals[category]\n}", "function GetCategory(categoryId) {\n const [category, setCategory] = useState('');\n const url = \"/api/categories/\"+categoryId;\n useEffect(() => {\n const requestCategory = async () => {\n const response = await fetch(url);\n const { data } = await response.json();\n const att = await data.attributes;\n const cat = await att.category;\n setCategory(cat);\n };\n requestCategory();\n }, []);\n\n return category;\n}", "function getCategory(){\n var deferred = $q.defer();\n\n $http({\n url: API_ENDPOINT + APIPATH.category,\n method: 'GET'\n })\n .then(function (data) {\n deferred.resolve(data);\n },function(data){\n deferred.resolve(data);\n $mdToast.show(\n $mdToast.simple()\n .textContent('Sorry! Unable to show categories')\n .position('top')\n .hideDelay(5000)\n );\n })\n\n return deferred.promise;\n }", "async function getCategory() {\r\n let request = {\r\n method: 'GET',\r\n redirect: 'follow'\r\n }\r\n\r\n if (token === \"\" || typeof token === 'undefined') {\r\n addAgentMessage(\"Sorry I cannot perform that. Please login first!\")\r\n return;\r\n }\r\n\r\n const serverReturn = await fetch(ENDPOINT_URL + '/categories', request);\r\n\r\n if (!serverReturn.ok) {\r\n addAgentMessage(\"There was a problem accessing the list of categories. Please try again!\");\r\n return;\r\n }\r\n\r\n const serverResponse = await serverReturn.json()\r\n\r\n let categories = serverResponse.categories;\r\n\r\n // comma separated; using 'and' to give the assistant a more of human personality \r\n let message = \"We offer products for \" + categories.length + \" total categories: \\n\"\r\n message += categories.splice(0, categories.length - 1).join(', ') + \", and \" + categories[0] + \".\"\r\n addAgentMessage(message);\r\n\r\n\r\n }", "function getNameByCatID(which) {\n\n for (var c = 0; c < activityCats.length; c++) {\n if (activityCats[c].CategoryID == which) {\n return activityCats[c].CategoryName;\n }\n }\n\n}", "function getCatIconURL(categoryId) {\n for (var j = 0; j < kiezatlas.workspaceCriterias.result[kiezatlas.selectedCriteria].categories.length; j++) {\n if (kiezatlas.workspaceCriterias.result[kiezatlas.selectedCriteria].categories[j].catId == categoryId) {\n // log(\"<b>catIcon is: </b>\" + workspaceCriterias.result[crtCritIndex].categories[j].catIcon);\n return kiezatlas.workspaceCriterias.result[kiezatlas.selectedCriteria].categories[j].catIcon;\n }\n // var catToShow = mapTopics.result.topics[i].criterias[j].categories\n }\n return null;\n }", "function _get_category(resource_text) {\n\n\t\t\tfor (var key_cat in browser_conf_json.categories) {\n\t\t\t\tif (browser_conf_json.categories.hasOwnProperty(key_cat)) {\n\t\t\t\t\tvar re = new RegExp(browser_conf_json.categories[key_cat][\"rule\"]);\n\t\t\t\t\tif (resource_text.match(re)) {return key_cat;}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}", "function getCategory(catId) {\n\n /* Locate a record within the global categoryList array based on the */\n /* category name */\n let result = categoryList.find(\n (category) => category.category.toLowerCase() === catId.toLowerCase());\n\n // If no result is found, result is false\n if (!result) {\n result = false;\n }\n\n return result; // return the result\n}", "function get_categories(){\r\n\tvar cats = [];\r\n\tif (this.categories != null) {\r\n\t\tfor (var i = 0; i < this.categories.length; i++) {\r\n\t\t\tcats.push(this.categories[i].getTarget());\r\n\t\t}\r\n\t}\r\n\treturn cats;\r\n}", "function getCategoryFromPage() {\n var pathComponents = window.location.pathname.split('/');\n return pathComponents[1];\n}", "function chooseCategory(input) {\n\t var category = data[input];\n\t return category;\n\t }", "getCategoryDrinks(category) {\n return apiClient.get(`/drinks/${category.name}`);\n }", "function getCategory(content) {\n var category = '';\n // var url = /(\\w+):\\/\\/([\\w.]+)(\\.craigslist\\.org)\\/(\\w+)(\\/index\\.rss)/;\n var url = /(\\w+):\\/\\/([\\w.]+)(\\.craigslist\\.org)\\/search\\/(\\w+)(\\?&srchType=A)/;\n var result = content.match(url);\n if(result != null) {\n category = result[4];\n }\n return category;\n}", "function hotcat_find_category (wikitext, category)\n{\n var cat_name = category.replace(/([\\\\\\^\\$\\.\\?\\*\\+\\(\\)])/g, \"\\\\$1\");\n var initial = cat_name.substr (0, 1);\n var cat_regex = new RegExp (\"\\\\[\\\\[\\\\s*[Kk]ategoria\\\\s*:\\\\s*\"\n + (initial == \"\\\\\"\n ? initial\n : \"[\" + initial.toUpperCase() + initial.toLowerCase() + \"]\")\n + cat_name.substring (1).replace (/[ _]/g, \"[ _]\")\n + \"\\\\s*(\\\\|.*?)?\\\\]\\\\]\", \"g\"\n );\n var result = new Array ();\n var curr_match = null;\n while ((curr_match = cat_regex.exec (wikitext)) != null) {\n result [result.length] = {match : curr_match};\n }\n return result; // An array containing all matches, with positions, in result[i].match\n}", "function getCategoryById(id) {\n return categoryHandler.GetCategoryById(id);\n }", "function getReportSetCategory(category) {\r\n\t\t\tvar categoryStr = angular.isDefined(category)\r\n\t\t\t? (category.toLowerCase() === 'uncategorized' ? '' : category)\r\n\t\t\t: '';\r\n\t\t\treturn $izendaRsQuery.query('reportlistdatalite', [categoryStr], {\r\n\t\t\t\tdataType: 'json'\r\n\t\t\t},\r\n\t\t\t// custom error handler:\r\n\t\t\t{\r\n\t\t\t\thandler: function (name) {\r\n\t\t\t\t\treturn 'Failed to get reports for category \"' + name + '\"';\r\n\t\t\t\t},\r\n\t\t\t\tparams: [category]\r\n\t\t\t});\r\n\t\t}", "function get_categories_view() {\r\n\tvar cats = this.get_categories().map(function(obj) {\r\n\t\tvar str = '<a href=\"' + obj.getURI() + '\">' + obj.title + '</a>';\r\n\t\treturn str.replace(/&(?!\\w+;)/g, '&amp;')\r\n\t}).join(', ');\r\n\r\n\treturn this.categories != null ? new XMLList(cats) : '';\r\n}", "function Category() {\n}", "function getCategoryIcon(value) {\n if (value.category === \"chores\") {\n return (\n <LocalLaundryServiceIcon style={{ color: CategoryColors[\"chores\"] }} />\n );\n } else if (value.category === \"school\") {\n return <SchoolIcon style={{ color: CategoryColors[\"school\"] }} />;\n } else if (value.category === \"self-care\") {\n return <FavoriteIcon style={{ color: CategoryColors[\"self-care\"] }} />;\n } else if (value.category === \"social\") {\n return <GroupIcon style={{ color: CategoryColors[\"social\"] }} />;\n } else if (value.category === \"work\") {\n return <WorkIcon style={{ color: CategoryColors[\"work\"] }} />;\n } else {\n // other\n return <HelpIcon style={{ color: CategoryColors[\"other\"] }} />;\n }\n}", "getCategories(category) {\n return this._categories;\n }", "async readCategories() {\n let response = await fetch(url + 'get/categories');\n let data = await response.json();\n return data\n }", "function categorify(cat) {\n var ret;\n if(typeof cat == \"string\")\n ret = cat\n ;\n else ret = d3.entries(cat) // Overview pseudo-phase\n .filter(function(e) { return e.value === \"Yes\"; })\n .map(function(k) { return k.key.trim(); })\n [0]\n ;\n return ret || \"Not Applicable\";\n } // categorify()", "function getCategoryObject(str) {\n\n var ans = GAME.categories.filter(function(elem,index){\n return GAME.categories[index].idName == str;});\n return ans[0];\n}", "getData(category){\n let data = [];\n let subcategories = [];\n let count = this.getCount(category);\n let types = this.getAllPossible(category);\n \n types.forEach((type) => {\n subcategories.push(type.value);\n });\n\n data.push(subcategories);\n data.push(count);\n\n return data;\n }", "function getCategoryInfo() {\n\t\tAdminService.categories().get({ categoryId: vm.categoryId }, function (response) {\n\t\t\tif (response.data.length > 0) {\n\t\t\t\tvm.category = response.data[0];\n\t\t\t\tif(vm.category.type == 'article') {\n\t\t\t\t\tvm.category.listType = \"all\";\n\t\t\t\t}\t\t\t\t\n\t\t\t\tif (response.data[0].parentId !== '0') {\n\t\t\t\t\tvar parentId = response.data[0].parentId\n\t\t\t\t\tvm.models.push(parentId); // Model value for selected sub categories\t\t\t\t\t\n\t\t\t\t\t/* Get parent Info */\n\t\t\t\t\tAdminService.categories().get({ categoryId: parentId }, function (parentInfo) {\n\t\t\t\t\t\tif (parentInfo.data[0].parentId === 0) {\n\t\t\t\t\t\t\tvm.parentId = parentId;\n\t\t\t\t\t\t\tvm.hideMainCategory = false;\n\t\t\t\t\t\t\tgetMainCategories(false);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvm.hideMainCategory = true\n\t\t\t\t\t\t\tAdminService.subCategories().get({ parentCatId: parentInfo.data[0].parentId }, function (subCatResOnj) {\n\t\t\t\t\t\t\t\tif (subCatResOnj.code == 200 && subCatResOnj.data.list.length > 0) {\n\t\t\t\t\t\t\t\t\tvm.subCategoryList.push({ label: 'Sub Category', list: subCatResOnj.data.list, model: \"subCat\" + 1 })\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t\tvm.noDataText = false;\n\t\t\t} else {\n\t\t\t\tvm.noDataText = response.message;\n\t\t\t}\n\t\t});\n\t}", "getCategories() {\n return this.categories;\n }", "function categType (category){\n if(category == 1){\n category = \"Limpeza\";\n } else if(category == 2) {\n category = \"Alimentação\";\n } else if(category == 3){\n category = \"Vestuário\";\n } else {\n throw new Error(`\n O código digitado não corresponde à nenhuma categoria de produto! \n Digite 1 - Limpeza, 2 - Alimentação, 3 - Vestuário.\n `);\n }\n return category;\n}", "function getCategoryById(id) {\n return categoryHandler.GetCategoryById(id);\n }", "function ListCategories () \n{\n\tMakeXMLHTTPCallListCategories(\"GET\", \"http://uvm061.dei.isep.ipp.pt/ARQSI/Widget/WidgetAPI/EditorAPI.php?type=GetAllCategories\");\n}", "function getCategoryIconClass(category) {\n // Call getCategory() to return the icon class string\n return getCategory(category.toLowerCase()).category_icon;\n}", "async categories() {\n return await this.fetch(\"/categories/list\");\n }", "function get_cat(e){\"forum\"==e||\"fjb\"==e?($(\".select-category\").addClass(\"show\"),$.ajax({url:\"/misc/get_categories_search/\"+e,success:function(e){var t=location.href.match(/forumchoice(\\[\\])*=([^&]+)/),s=\"\";t&&(s=t[2]);var a=\"\";for(var o in e)s==e[o].forum_id?(a=\"selected\",$(\"#search_category\").parent().find(\".customSelectInner\").text(e[o].name)):a=\"\",$(\"#search_category\").append('<option data-child-list=\"'+e[o].child_list+'\" value=\"'+e[o].forum_id+'\" '+a+\">\"+e[o].name+\"</option>\")}})):$(\".select-category\").removeClass(\"show\")}", "getAllCategories() {\n return this.http.get(this.allCategoryUrl);\n }", "get categories() {\n return this.data.categories ? getCategories(this.data.categories) : [];\n }", "function getCategories() {\n \n // API call to get categories\n fetch(\"https://my-store2.p.rapidapi.com/catalog/categories\", {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"ef872c9123msh3fdcc085935d35dp17730cjsncc96703109e1\",\n \"x-rapidapi-host\": \"my-store2.p.rapidapi.com\"\n }\n })\n .then(response => {\n return response.json();\n })\n .then(response => {\n\n // call display catgories to display it on screen\n displayCategories(response);\n })\n .catch(err => {\n console.error(err);\n });\n }", "function checkCategory(){\n let urlParams = new URLSearchParams(window.location.search);\n let category = urlParams.get(\"category\");\n if (category != null){\n return category\n }\n else{\n return \"\"\n }\n}", "function getCategories(word){\n\twhile(word.length > 0){\n\t\tif (RID[word]){\n\t\t\treturn RID[word];\n\t\t}\n\t\tif (RID[word+\"%\"]){\n\t\t\treturn RID[word+\"%\"];\n\t\t}\n\t\tword = word.substr(0,word.length-1);\n\t}\n\treturn null;\n}", "function fetch_categories(wiki){\n var cats=[]\n var reg=new RegExp(\"\\\\[\\\\[:?(\"+category_words.join(\"|\")+\"):(.{2,60}?)\\]\\](\\w{0,10})\", \"ig\")\n var tmp=wiki.match(reg)//regular links\n if(tmp){\n var reg2=new RegExp(\"^\\\\[\\\\[:?(\"+category_words.join(\"|\")+\"):\", \"ig\")\n tmp.forEach(function(c){\n c=c.replace(reg2, '')\n c=c.replace(/\\|?[ \\*]?\\]\\]$/i,'')\n if(c && !c.match(/[\\[\\]]/)){\n cats.push(c)\n }\n })\n }\n return cats\n }", "function getCategoryTwo(content) {\n var category = '';\n var url = /(\\w+):\\/\\/([\\w.]+)(\\.craigslist\\.org)\\/(\\w+)(\\/(\\S*))/;\n var result = content.match(url);\n if(result != null) {\n category = result[4];\n }\n return category;\n}", "categoryListByType(type) {\n return axios\n .get(this.url+`${type}`)\n .then((response) => (response && response.data) || null);\n }", "function categories() {\n // assign categories object to a variable\n var categories = memory.categories;\n // loop through categories\n for (category in categories) {\n // call categories render method\n memory.categories[category].render();\n //console.log(memory);\n }\n }", "function get_sell_category(category) {\n\tvar div = document.getElementById(\"sell_users_properties\");\n\thr.open(\"POST\", \"/sell/get_sell_category\", true);\n\thr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\thr.onreadystatechange = function() {\n\t\tif(hr.readyState == 4) {\n\t\t\tif(hr.status == 200) {\n\t\t\t\tdiv.innerHTML = hr.responseText;\n\t\t\t\t}\n\t\t\t}\n\t}\n\tvar t = \"category=\"+category+\"&val=1\";\n\thr.send(t);\n}", "function note_category(a) {\n var category = a.meta[\"coco:category\"] || 'other';\n if (a.getAnnotationType().title == 'Quiz') {\n category = \"quiz\";\n };\n return capitalize(category);\n }", "function getCategoryFilterItems(){\n var tempFilterArray = [];\n for(i=0; i<blog.rawData.length; i++){\n tempFilterArray.push(blog.rawData[i].category);\n }\n // console.log(tempFilterArray);\n return tempFilterArray;\n }", "retrieveCategories() {\n return call(`${this.__url__}/categories`, {\n headers: {\n 'Content-Type': 'application/json'\n },\n timeout: this.__timeout__\n })\n }", "getCategoriesPathFromRootArray(category){\n return category.path_from_root.map(( category ) => category.name);\n }", "function getPostsByCategory() {\n\tvar snippet = {\n\t\tquery: {category: \"testodd\"}\n\t}\n\trimer.post.findByCategory(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}", "hasCategory(category) {\n if(this.Categories.length == 0) {\n this.addCategory(Category.Default, this.Type);\n }\n returnVal = _.find(this.Categories, function (catId) {\n return category._id == catId;\n });\n if (returnVal) {\n return returnVal;\n } else {\n return false;\n }\n }", "getCategory() {\n return AWSS3Provider.CATEGORY;\n }", "async getAllCategories() {\n const data = await this.get('jokes/categories');\n return data;\n }", "function getCategory(id){\n return _categoryProducts.filter(category=>category.id===id*1)[0];\n}", "function getCategoryId (id) {\n window.categoriaid = id //Guardo el id de la categoria en global\n }", "function getCategorySelect() {\n\tajax('GET', 'categories', null, createCategorySelect);\n}", "static async getAllCategoriesAndQuestions() {\n categories = [];\n let categoryIds = await Category.getCategoryIds();\n for ( let categoryId of categoryIds ) {\n let fullCategory = await Category.getCategory(categoryId);\n categories.push(fullCategory);\n }\n return categories;\n }", "handleCategory(event) {\n let category = event.target.innerHTML\n dispatch(fetchCategory(category))\n }", "function getCategoryEnum(str) {\n\n if (str == 'Style') {\n return Enum.Categories.Style;\n } else if (str == 'Data') {\n return Enum.Categories.Data;\n }\n else if (str == 'Control') {\n return Enum.Categories.Control;\n }\n else if (str == 'Settings') {\n return Enum.Categories.Settings;\n }\n else if (str == 'Editor') {\n return Enum.Categories.Editor;\n } else {\n return Enum.Categories.Style;\n }\n }", "getAllcategory() {\n this.albumcategoryServices.getAll('', '1', '100').subscribe(res => {\n this.categoryList = res.result;\n });\n }", "getAllcategory() {\n this.albumcategoryServices.getAll('', '1', '100').subscribe(res => {\n this.categoryList = res.result;\n });\n }", "async function getCategory(catId) {\n let categoryObjResponse= await axios.get(`http://jservice.io/api/category`, {params: {id: catId}})\n categoryObj = {\n title: categoryObjResponse.data.title,\n clues: categoryObjResponse.data.clues,\n showing: null\n };\n return categoryObj;\n}", "function getCategory(categoryId, cb){\n\tconsole.log('getCategory()');\n\tdb.connect(function(conn){\n\t\tconn.query('select * from categories where id = $1', [categoryId], function(err, result){\n\t\t\tif (err) throw err;\n\t\t\tcb(result.rows);\n\t\t})\n\t});\n}", "retriveSubCategory(context, cat) {\n\t\t\taxios.get(\"/show/product/subcategory/\" + cat\n\t\t\t).then((res) => {\n\t\t\t\tcontext.commit('PRODUCT_SUB_CATEGORY', res.data.data);\n\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t}", "async getCategorybyId (id) {\n const response = await fetch(`http://jservice.io/api/category?id=${id}`)\n const json = await response.json()\n return json\n }", "function getCategory(obj) {\n var id = obj.id;\n for (i in cats) {\n for (j = 0; j < cats[i].length; j++) {\n if (id == cats[i][j]) {\n return i;\n }\n }\n }\n}", "function setCategory(cat) {\n\tcategory = cat;\n\tdisplayPic(1);\n}", "async getCategories() {\n // Consultar las categorias a la REST API de event brite\n const responseCategories = await fetch\n (`https://www.eventbriteapi.com/v3/categories/?token=${this.token_auth}`);\n\n // Esperar la respuesta de las categorias y devolver un JSON\n const categories = await responseCategories.json();\n // Devolvemos el resultado\n return {\n categories\n }\n }", "function getCategoryList() {\n var categoryList = [];\n categoryList.push({\n \"key\": -1,\n \"value\": \"请选择\"\n });\n categoryList.push({\n \"key\": 2,\n \"value\": \"完成稿\"\n });\n categoryList.push({\n \"key\": 3,\n \"value\": \"修改\"\n });\n categoryList.push({\n \"key\": 4,\n \"value\": \"修改完成稿\"\n });\n categoryList.push({\n \"key\": 5,\n \"value\": \"疑问\"\n });\n categoryList.push({\n \"key\": 6,\n \"value\": \"疑问回复\"\n });\n return categoryList;\n}", "function getCategories(){\n return _categoryProducts;\n}", "function getCategories() {\n const apicall = 'http://localhost:3010/api/events/categories';\n fetch(apicall, {\n method: 'GET',\n }).then((response) => {\n if (!response.ok) {\n if (response.status === 401) {\n throw response;\n }\n }\n return response.json();\n }).then((json) => {\n setCategoryList(json);\n json.map((category1) =>\n // attach to category state\n setCategories({...categories, [category1.category]: false}),\n );\n })\n .catch((error) => {\n console.log(error);\n });\n }", "get subCategory () {\n\t\treturn this._subCategory;\n\t}", "function getCategory(id) {\n $.get(\"/api/categories/\" + id, function (data) {\n if (data) {\n name.text(data.name);\n desc.text(data.description);\n }\n });\n }", "function categorizeMenu(arr, cat){\r\n var categorized = [];\r\n for(var x=0; x<arr.length; x++){\r\n arr[x]['category'] == cat ? categorized.push(arr[x]) : true;\r\n }\r\n if(categorized.length == 0){\r\n $('.warning-text').show();\r\n return categorized;\r\n }\r\n $('.warning-text').hide();\r\n return categorized;\r\n }", "function setCategory(category) {\r\n\t\t\tvar textElem = $('<span>' + category + '</span>');\r\n\t\t\t$(textElem).appendTo(self.bbgCss.jq.category);\r\n\t\t}", "getCategory(_parameters) {\n\t\treturn new Category(_parameters);\n\t}", "getSelectedCategory(category) {\n axios\n .get(`${apiBaseUrl}/entries?category=${encodeURIComponent(category)}`)\n .then(res => {\n\n this.selectedCategory = res.data.entries;\n this.show = true;\n })\n .catch(error =>\n console.error(\"Can't get the Categories\", error)\n );\n }", "getCategories() {\n if (this._categories && this._categories.length > 0) return this._categories;\n return [this.getId().series];\n }", "get categoryMapping() {\n let categoryMapping = {};\n this.domain.forEach(d => {\n this.currentCategories.forEach(f => {\n if (f.categories.includes(d.toString())) {\n categoryMapping[d] = f.name;\n }\n });\n });\n return categoryMapping;\n }", "function addCategory(category) {\n// var db = ScriptDb.getMyDb(); \n var db = ParseDb.getMyDb(applicationId, restApiKey, \"list\");\n \n if (category == null) {\n return 0; \n }\n \n // if (db.query({type: \"list#categories\"}).getSize() == 0) {\n \n if (PropertiesService.getScriptProperties().getProperty(\"categories\") == null) {\n var id = db.save({type: \"categories\", list: [category]}).getId(); \n PropertiesService.getScriptProperties().setProperty(\"categories\", id);\n return 1;\n }\n var categories = db.load(PropertiesService.getScriptProperties().getProperty(\"categories\"));\n for (var i = 0 ; i<categories.list.length ; i++) {\n if (categories.list[i] == category) {\n return 0;\n }\n }\n categories.list.push(category);\n categories.list = categories.list.sort();\n db.save(categories);\n return 1;\n}" ]
[ "0.7986381", "0.756013", "0.73747176", "0.7294691", "0.724049", "0.72260135", "0.71835387", "0.71835387", "0.71835387", "0.71835387", "0.7133661", "0.70948476", "0.69894356", "0.69886595", "0.6977929", "0.6946505", "0.6924409", "0.6919577", "0.6910602", "0.6892076", "0.68629307", "0.68523693", "0.6838965", "0.68123174", "0.67762953", "0.67518544", "0.67487985", "0.67261153", "0.6681238", "0.66440994", "0.66358066", "0.66338444", "0.66223466", "0.66051", "0.6540972", "0.65182024", "0.65161806", "0.65086055", "0.6480099", "0.6475026", "0.64695746", "0.6443946", "0.641331", "0.6411419", "0.6401631", "0.63956004", "0.6390142", "0.63742185", "0.6373056", "0.63689864", "0.63639", "0.63628304", "0.6339137", "0.63214755", "0.6320713", "0.6316869", "0.6313687", "0.63134605", "0.63038486", "0.62978315", "0.6286957", "0.6278418", "0.6276717", "0.62708414", "0.6259766", "0.62560916", "0.6255309", "0.6251578", "0.62503964", "0.6244368", "0.624115", "0.6226984", "0.622539", "0.6223963", "0.62142664", "0.62117994", "0.6209451", "0.6206096", "0.6202581", "0.61930925", "0.61877656", "0.61877656", "0.61834764", "0.6159694", "0.6151264", "0.6141521", "0.6140725", "0.61387974", "0.613844", "0.6134266", "0.61228245", "0.61210024", "0.6119045", "0.6112047", "0.61072737", "0.61057734", "0.6096292", "0.6084572", "0.6077607", "0.6074195", "0.6071515" ]
0.0
-1
Returns a configuration used to subscribe to an SNS topic.
bind(_topic) { return { subscriberId: this.phoneNumber, endpoint: this.phoneNumber, protocol: sns.SubscriptionProtocol.SMS, filterPolicy: this.props.filterPolicy, }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getConfig() {\n if (arguments.length <= 1 && typeof (arguments.length <= 0 ? undefined : arguments[0]) !== 'function') {\n var option = arguments.length <= 0 ? undefined : arguments[0];\n return option ? utils.deepAccess(_getConfig(), option) : _getConfig();\n }\n\n return subscribe.apply(void 0, arguments);\n }", "function SnsConnector(settings) {\n\n assert(typeof settings === 'object', 'cannot initialize SnsConnector without a settings object');\n var connector = this;\n\n var accessKeyId = this.accessKeyId = settings.accessKeyId;\n var secretAccessKey = this.secretAccessKey = settings.secretAccessKey;\n var region = this.region = settings.region;\n var platformApplicationArn = this.platformApplicationArn = settings.platformApplicationArn\n \n AWS.config.update({\n 'accessKeyId': accessKeyId,\n 'secretAccessKey': secretAccessKey,\n 'region': region\n })\n Sns.prototype = sns = connector.sns = new AWS.SNS()\n}", "function cfnTopicSubscriptionPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnTopic_SubscriptionPropertyValidator(properties).assertSuccess();\n return {\n Endpoint: cdk.stringToCloudFormation(properties.endpoint),\n Protocol: cdk.stringToCloudFormation(properties.protocol),\n };\n}", "function cfnConfigurationSetEventDestinationSnsDestinationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnConfigurationSetEventDestination_SnsDestinationPropertyValidator(properties).assertSuccess();\n return {\n TopicARN: cdk.stringToCloudFormation(properties.topicArn),\n };\n}", "constructor(topicArn) {\n\t\tAWS.config.update({\n accessKeyId: process.env.AWS_ACCESS_KEY_ID,\n secretKeyId: process.env.AWS_SECRET_ACCESS_KEY,\n region: process.env.AWS_REGION,\n });\n\t\tthis.sns = new AWS.SNS();\n\t\tthis.topicArn = topicArn;\n\t}", "get snsTopicArnInput() {\n return this._snsTopicArn;\n }", "async subscribe (topic) {\n const isProtocolNew = this._config.mqttSettings && this._config.mqttSettings.protocolVersion === 5\n if (!Array.isArray(topic)) {\n topic = [topic]\n }\n return topic.reduce(async (result, topic) => {\n const id = Number(uniqueId())\n if (isProtocolNew && topic.options && topic.options.filterByTimestamp) {\n topic.handler = this._generateTimestampFilteringWrapper(topic.name, topic.handler)\n }\n if (isProtocolNew) {\n if (!topic.options) { topic.options = {} }\n topic.options = merge(topic.options, { properties: { subscriptionIdentifier: id } })\n }\n this._topics[id] = topic\n /* if has client and he is connected */\n if (this._client) {\n try {\n const granted = await this._client.subscribe(topic.name, topic.options)\n result[id] = granted\n } catch (e) {\n result[id] = e\n }\n } else {\n result[id] = new Error('Client don`t created')\n }\n return result\n }, {})\n }", "bindAsNotificationRuleTarget(_scope) {\n // SNS topic need to grant codestar-notifications service to publish\n // @see https://docs.aws.amazon.com/dtconsole/latest/userguide/set-up-sns.html\n this.grantPublish(new iam.ServicePrincipal('codestar-notifications.amazonaws.com'));\n return {\n targetType: 'SNS',\n targetAddress: this.topicArn,\n };\n }", "function topicResourceSubscriptionPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n TopicResource_SubscriptionPropertyValidator(properties).assertSuccess();\n return {\n Endpoint: cdk.stringToCloudFormation(properties.endpoint),\n Protocol: cdk.stringToCloudFormation(properties.protocol),\n };\n }", "function subscribe(topic, queue) {\n if (topic === undefined) throw \"A topic must be given\"\n\n params = {\n Protocol: 'sqs',\n TopicArn: \"arn:aws:sns:us-west-2:123456789012:\" + topic,\n Endpoint: 'arn:aws:sqs:elasticmq:000000000000:' + queue,\n };\n\n sns.subscribe(params, return_function)\n}", "registerDeviceEndpoint() {\n this.SNS = new AWS.SNS();\n return this.SNS.createPlatformEndpoint({\n Token: this.deviceId,\n PlatformApplicationArn: this.applicationArn\n }, (err, data) => {\n if (err) {\n console.log('error registering device', err);\n return;\n }\n\n const params = {\n Protocol: 'application',\n TopicArn: this.topicArn,\n Endpoint: data.EndpointArn\n };\n\n this.subscribeToTopic(params);\n });\n }", "function subscribeKPNS(regId, ostype) {\n var sub = {\n \"sid\": regId,\n \"appId\": appID,\n \"osType\": ostype,\n \"deviceId\": deviceID\n };\n var inp = {\n \"subscriptionService\": {\n \"subscribe\": sub\n }\n };\n var myhttpheaders = {\n \"Content-Type\": \"application/json\"\n };\n var paramTab = {\n postdata: JSON.stringify(inp),\n httpheaders: myhttpheaders\n };\n var url = kpnsURL + \"/subscription\";\n kony.net.invokeServiceAsync(url, paramTab, KPNSregCallback);\n}", "function buildSubscriptionUrl() {\n if(subscriptionId.includes(\"projects/\") || subscriptionId.includes(\"subscriptions/\")) {\n let startSubscriptionId = subscriptionId.lastIndexOf('/');\n subscriptionId = subscriptionId.substring(startSubscriptionId + 1);\n updateSubscriptionId(subscriptionId);\n }\n\n const parsedKey = JSON.parse(serviceAccountKey);\n const projectPath = \"projects/\" + parsedKey.project_id;\n const subscriptionPath = \"subscriptions/\" + subscriptionId;\n return PUBSUB_ENDPOINT + \"/\" + projectPath + \"/\" + subscriptionPath;\n}", "function subscribe(topic, callback) {\n /* initialise a topic if it doesn't exist already */\n if (!topicChannel[topic]) {\n topicChannel[topic] = {\n totalSubscriptions: 0,\n subscriptions: [],\n };\n }\n\n /* create a subscription */\n const subscription = {\n subscriptionID: String(++subscriberID),\n callback,\n };\n\n /* store the subscription for the topic */\n topicChannel[topic].subscriptions.push(subscription);\n topicChannel[topic].totalSubscriptions++;\n\n /* return the subscriptionIdentifier for unsubscribing later on */\n return {\n subscriptionTopic: topic,\n subscriptionID: subscription.subscriptionID,\n };\n }", "function mqtt_subscribe(topic, options, callback) {\n try {\n client.subscribe(topic, {qos: (options.qos) ? options.qos : 0});\n } catch (exec) {\n callback({err: 1, message: exec.message})\n }\n callback(null, {err: 0, message: 'Subscribed.'})\n}", "async function createNotificationSubscription() {\n //wait for service worker installation to be ready\n const serviceWorker = await navigator.serviceWorker.ready;\n // subscribe and return the subscription\n return await serviceWorker.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: pushServerPublicKey\n });\n}", "function mailConfig() {\n\tconst grid = get('SENDGRID_API_KEY');\n\tlet transportConfig;\n\tif (grid) {\n\t\ttransportConfig = nodemailerSendgrid({ apiKey: grid });\n\t} else {\n\t\ttransportConfig = {\n\t\t\tservice: 'gmail',\n\t\t\tauth: {\n\t\t\t\tuser: get('SMTP_USER'),\n\t\t\t\tpass: get('SMTP_PASSWORD'),\n\t\t\t},\n\t\t};\n\t}\n\treturn transportConfig;\n}", "addSubscription(topicSubscription) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_sns_ITopicSubscription(topicSubscription);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.addSubscription);\n }\n throw error;\n }\n const subscriptionConfig = topicSubscription.bind(this);\n const scope = subscriptionConfig.subscriberScope || this;\n let id = subscriptionConfig.subscriberId;\n if (core_1.Token.isUnresolved(subscriptionConfig.subscriberId)) {\n id = this.nextTokenId(scope);\n }\n // We use the subscriber's id as the construct id. There's no meaning\n // to subscribing the same subscriber twice on the same topic.\n if (scope.node.tryFindChild(id)) {\n throw new Error(`A subscription with id \"${id}\" already exists under the scope ${scope.node.path}`);\n }\n const subscription = new subscription_1.Subscription(scope, id, {\n topic: this,\n ...subscriptionConfig,\n });\n // Add dependency for the subscription, for example for SQS subscription\n // the queue policy has to deploy before the subscription is created\n if (subscriptionConfig.subscriptionDependency) {\n subscription.node.addDependency(subscriptionConfig.subscriptionDependency);\n }\n return subscription;\n }", "function getNatsConnection() {\n const { clientId, clusterId, uri } = config.eventbus\n \n return new Promise((resolve, reject) => {\n if (natsConnection) return resolve(natsConnection)\n \n const stan = nats.connect(clusterId, clientId, { url: uri })\n natsConnection = stan\n\n stan.on('connect', () => resolve(natsConnection))\n stan.on('error', reject)\n })\n\n}", "function getNatsConnection() {\n const { clientId, clusterId, uri } = config.eventbus\n \n return new Promise((resolve, reject) => {\n if (natsConnection) return resolve(natsConnection)\n \n const stan = nats.connect(clusterId, clientId, { url: uri })\n natsConnection = stan\n\n stan.on('connect', () => resolve(natsConnection))\n stan.on('error', reject)\n })\n\n}", "function createSubscribe(topic, qos) {\n var byte1 = 8 /* Subscribe */ << 4 | 2;\n var pid = strChr.apply(void 0, getBytes(1 /* FixedPackedId */));\n return createPacket(byte1, pid, pack(topic) +\n strChr(qos));\n }", "async subscribe() {\n var subscription = await this.getSubscription();\n if (!subscription) {\n subscription = await this.registration.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: urlBase64ToUint8Array(this.params.PUBLIC_KEY),\n }).then(subscription => {\n console.log('Subscribed to', subscription.endpoint);\n return subscription;\n });\n return await fetch(this.params.REGISTRATION_URL, {\n method: 'post',\n headers: {'Content-type': 'application/json', Accept: 'application/json'},\n body: JSON.stringify({subscription,}),\n }).then(response => response.json()).then(response => {\n console.log('Subscribed with Notifications server', response);\n return response;\n });\n }\n }", "function _promisifySNS(functionName) {\n return function (...args) {\n return new Promise(function (resolve, reject) {\n if (!accessKeyId || !secretAccessKey) {\n reject(new Error('Missing SNS config'))\n }\n sns[functionName](...args, function (err, data) {\n if (err) {\n logger.debug(`Error sending to SNS: ${err}`)\n reject(err)\n } else resolve(data)\n })\n })\n }\n}", "async getSubscription() {\n return await this.registration.pushManager.getSubscription();\n }", "function getSPPConfig () {\n return SPP_CONFIG\n}", "function createSensorSubscriptionObject(topicname, messagetype, subtopicnames)\n{\n return {\n TopicName: topicname,\n MessageType: messagetype,\n SubTopicNames: subtopicnames\n };\n}", "function subscribe(topic, listener) {\n var callback = listener;\n\n if (typeof topic !== 'string') {\n // first param should be callback function in this case,\n // meaning it gets called for any config change\n callback = topic;\n topic = ALL_TOPICS;\n }\n\n if (typeof callback !== 'function') {\n utils.logError('listener must be a function');\n return;\n }\n\n var nl = {\n topic: topic,\n callback: callback\n };\n listeners.push(nl); // save and call this function to remove the listener\n\n return function unsubscribe() {\n listeners.splice(listeners.indexOf(nl), 1);\n };\n }", "bind(topic) {\n try {\n jsiiDeprecationWarnings.aws_cdk_lib_aws_sns_ITopic(topic);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.bind);\n }\n throw error;\n }\n // Create subscription under *consuming* construct to make sure it ends up\n // in the correct stack in cases of cross-stack subscriptions.\n if (!(this.queue instanceof constructs_1.Construct)) {\n throw new Error('The supplied Queue object must be an instance of Construct');\n }\n const snsServicePrincipal = new iam.ServicePrincipal('sns.amazonaws.com');\n // add a statement to the queue resource policy which allows this topic\n // to send messages to the queue.\n const queuePolicyDependable = this.queue.addToResourcePolicy(new iam.PolicyStatement({\n resources: [this.queue.queueArn],\n actions: ['sqs:SendMessage'],\n principals: [snsServicePrincipal],\n conditions: {\n ArnEquals: { 'aws:SourceArn': topic.topicArn },\n },\n })).policyDependable;\n // if the queue is encrypted, add a statement to the key resource policy\n // which allows this topic to decrypt KMS keys\n if (this.queue.encryptionMasterKey) {\n this.queue.encryptionMasterKey.addToResourcePolicy(new iam.PolicyStatement({\n resources: ['*'],\n actions: ['kms:Decrypt', 'kms:GenerateDataKey'],\n principals: [snsServicePrincipal],\n conditions: core_1.FeatureFlags.of(topic).isEnabled(cxapi.SNS_SUBSCRIPTIONS_SQS_DECRYPTION_POLICY)\n ? { ArnEquals: { 'aws:SourceArn': topic.topicArn } }\n : undefined,\n }));\n }\n // if the topic and queue are created in different stacks\n // then we need to make sure the topic is created first\n if (topic instanceof sns.Topic && topic.stack !== this.queue.stack) {\n this.queue.stack.addDependency(topic.stack);\n }\n return {\n subscriberScope: this.queue,\n subscriberId: core_1.Names.nodeUniqueId(topic.node),\n endpoint: this.queue.queueArn,\n protocol: sns.SubscriptionProtocol.SQS,\n rawMessageDelivery: this.props.rawMessageDelivery,\n filterPolicy: this.props.filterPolicy,\n filterPolicyWithMessageBody: this.props.filterPolicyWithMessageBody,\n region: this.regionFromArn(topic),\n deadLetterQueue: this.props.deadLetterQueue,\n subscriptionDependency: queuePolicyDependable,\n };\n }", "function subscribe() {\n if( !supportsDesktopNotifications() ) { return; }\n navigator.serviceWorker.register('/serviceWorker.js').then(function() {\n return navigator.serviceWorker.ready;\n }).then(function(reg) {\n reg.pushManager.subscribe({\n userVisibleOnly: true\n }).then(function(sub) {\n if( !sub.endpoint ) { return console.error(\"Endpoint not provided\", sub); }\n var subscriptionId = sub.endpoint.split('/').slice(-1)[0];\n return fetch('/subscriptions', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify({fcm_id: subscriptionId})\n }).then(function(res) {\n if( res.status > 299 ) { return console.error(\"Received unexpected status\", res.status); }\n console.log(\"Subscribed\", subscriptionId);\n window.localStorage && window.localStorage.setItem('subscribed', 1);\n $(document).find('.js-notifications').html(\"Thanks!\");\n }).catch(function(err) {\n console.error(\"Error adding subscription\", err);\n })\n }).catch(function(err) {\n console.error(\"Push subscription error :(\", err);\n });\n }).catch(function(err) {\n console.error(\"Service worker error :(\", err)\n })\n }", "function cfnSubscriptionPropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnSubscriptionPropsValidator(properties).assertSuccess();\n return {\n DeliveryPolicy: cdk.objectToCloudFormation(properties.deliveryPolicy),\n Endpoint: cdk.stringToCloudFormation(properties.endpoint),\n FilterPolicy: cdk.objectToCloudFormation(properties.filterPolicy),\n Protocol: cdk.stringToCloudFormation(properties.protocol),\n RawMessageDelivery: cdk.booleanToCloudFormation(properties.rawMessageDelivery),\n Region: cdk.stringToCloudFormation(properties.region),\n TopicArn: cdk.stringToCloudFormation(properties.topicArn),\n };\n}", "function configurePushSub() {\n console.log('Push subscription setup');\n //always check for feature availability\n if (!('serviceWorker' in navigator)) {\n return; //exit, cant listen to push notifications\n }\n\n var reg;\n //get sw registration and all subscriptions\n navigator.serviceWorker.ready\n .then(function(swreg) {\n reg = swreg;\n return swreg.pushManager.getSubscription();\n })\n .then(function(sub) {\n if (sub === null) {\n //create new subscription\n //with web-push package:\n var vapidPublicKey = 'BEwDbohq-fnCLZxm386PV5a1mL1T6071a0Bt7IJdytHo-CUbk7tw0Fo-3OzV5cMjRmAlTwCt_FlyZc-m0DRH7bs';\n var convertedVapidPublicKey = urlBase64ToUint8Array(vapidPublicKey);\n\n //identification for creating push messages\n return reg.pushManager.subscribe({\n userVisibleOnly: true,\n applicationServerKey: convertedVapidPublicKey\n });\n } else {\n //we already have subscription\n }\n })\n .then(function(newSub) {\n //push new subscription to server\n fetch('https://pwagram-5acb8.firebaseio.com/subscriptions.json', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify(newSub)\n })\n .then(function(res) {\n if (res.ok) {\n displayConfirmNotification();\n }\n })\n .catch(function(err) {\n console.log('Error creating subscription...', err);\n });\n });\n}", "function subscriptionResourcePropsToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n SubscriptionResourcePropsValidator(properties).assertSuccess();\n return {\n DeliveryPolicy: cdk.objectToCloudFormation(properties.deliveryPolicy),\n Endpoint: cdk.stringToCloudFormation(properties.endpoint),\n FilterPolicy: cdk.objectToCloudFormation(properties.filterPolicy),\n Protocol: cdk.stringToCloudFormation(properties.protocol),\n RawMessageDelivery: cdk.booleanToCloudFormation(properties.rawMessageDelivery),\n Region: cdk.stringToCloudFormation(properties.region),\n TopicArn: cdk.stringToCloudFormation(properties.topicArn),\n };\n }", "function ifttt_sub() {\n pxymqtt_client.subscribe('/oneM2M/req/Mobius/ifttt-sub/xml');\n console.log('subscribe ifttt_topic as ' + '/oneM2M/req/Mobius/ifttt-sub/xml');\n}", "function onConnect() {\n\n topic = \"home/poliv/#\";\n\n // Print output for the user in the messages div\n // document.getElementById(\"messages\").innerHTML += '<span>Subscribing taaaa: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n}", "function updatePubSub(){\n\n\t\t// LOAD IN PUBLISH INFO\n\t\tvar publishers = [];\n\n\t\tfor (var i=0, len=publishes.length; i<len; i++){\n\t\t var m = publishes[i];\n\t\t var pub = {\n\t\t \t\"name\": m.name,\n\t\t \t\"type\": m.type,\n\t\t \t\"default\": m._default\n\t\t }\t \n\n\t\t publishers.push(pub); \n\t\t}\n\t\t \n\t\t// LOAD IN SUBSCRIBE INFO\n\t\tvar subscribers = [];\n\t\t \n\t\tfor (var i=0; i<subscribes.length; i++){\n\t\t var m = subscribes[i];\n\t\t var sub = {\n\t\t \t\"name\": m.name,\n\t\t \t\"type\": m.type\n\t\t }\n\t\t \n\t\t subscribers.push(subs); \n\t\t}\n\n\t\ttConfig.config = {\n\t\t\tname: this.name,\n\t\t\tdescription: this.description,\n\t\t\tsubscribe: {\n\t\t\t\tmessages: subscribers\n\t\t\t}, \n\t\t\tpublish: {\n\t\t\t\tmessages: publishers\n\t\t\t}\n\t\t};\n\n\t\tif ( connectionEstablished ){\n\t\t\twsClient.send( JSON.stringify( tConfig ) );\n\t\t}\n\t}", "function cfnReceiptRuleSNSActionPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnReceiptRule_SNSActionPropertyValidator(properties).assertSuccess();\n return {\n Encoding: cdk.stringToCloudFormation(properties.encoding),\n TopicArn: cdk.stringToCloudFormation(properties.topicArn),\n };\n}", "_requestConfig () {\n return this._api.requestConfig().then(config => {\n this._config = config\n this._rtc.updateIceServers(config.iceServers)\n this.emit(PeerSoxClient.EVENT_SERVER_READY)\n })\n }", "getById(subscriptionId) {\r\n const s = new Subscription(this);\r\n s.concat(`('${subscriptionId}')`);\r\n return s;\r\n }", "get notificationTopicArnInput() {\n return this._notificationTopicArn;\n }", "function onConnect() {\n // Fetch the MQTT topic from the form\n topic = document.getElementById(\"topic\").value;\n\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n}", "function onConnect() {\n // Fetch the MQTT topic from the form\n topic = document.getElementById(\"topic\").value;\n\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n}", "function configurePushSub() {\n // check if browser supports service workers:\n if (!(\"serviceWorker\" in navigator)) return;\n // save in outer scope to access lower in promise chain\n var reg;\n\n navigator.serviceWorker.ready\n .then(function (swregistration) {\n reg = swregistration;\n // access push manager and check for existing subscriptions\n return swregistration.pushManager.getSubscription(); //returns promise\n })\n .then(function (sub) {\n // subscription will be null if none exist\n // Note a subscription is per browser/device/service worker combo - if another browser on same device is opened, that would be a separate subscription, and if a service worker is unregistered - those subs are then invalid\n // check if this browser/device combo has a subscription:\n if (sub === null) {\n // use the npm package web-push installed in your backend to generate a public and private key used to secure push notifications are only sent from your server\n var vapidPublicKey =\n \"BBq2LFlh9tntYdZA-XtAt7CnOa7Zx4STdM8AV5y8p-vxOf0NfvntuTuM_E-NHRksH-915tFcVai407a-Gp-VVdY\";\n // you need to convert the key to a Uint8Array which the subscribe method is expecting - use a utility function\n var convertedVapidPublicKey = urlBase64ToUint8Array(vapidPublicKey);\n\n // create a new subscription - this creates a new one or overwrites the old existing one if it exists\n // If anyone finds out what your endpoint is, they can send messages that will look like they're coming from you.\n // you need to pass in configuration to secure your endpoint\n return reg.pushManager.subscribe({\n userVisibleOnly: true, // messages sent are only visible to this user\n applicationServerKey: convertedVapidPublicKey,\n });\n } else {\n // use existing subscription\n }\n })\n .then(function (newSub) {\n // returned a new subscription to store in your backend (database)\n // this creates a subscriptions node if it doesn't exist in firebase\n // NOTE: If you unregister you service worker, then you need to clear that subscription from the database\n return fetch(\n \"https://pwa-practice-app-289604.firebaseio.com/subscriptions.json\",\n {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n },\n body: JSON.stringify(newSub),\n }\n );\n })\n .then(function (response) {\n if (response.ok) displayConfirmNotification();\n })\n .catch(function (err) {\n console.error(err);\n });\n}", "function onSubscribe() {\n // Fetch the MQTT topic from the form\n topic = document.getElementById(\"topic\").value;\n to = document.getElementById(\"to\").value;\n\n if (topic.includes(\"/\")) {\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n } else {\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Unable to subscribe to topic without a key prefix: ' + topic + '</span><br/>';\n }\n\n if (to.includes(\"/\")) {\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + to + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n } else {\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Unable to subscribe to topic without a key prefix: ' + to + '</span><br/>';\n }\n}", "function cfnAutoScalingGroupNotificationConfigurationPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnAutoScalingGroup_NotificationConfigurationPropertyValidator(properties).assertSuccess();\n return {\n NotificationTypes: cdk.listMapper(cdk.stringToCloudFormation)(properties.notificationTypes),\n TopicARN: cdk.stringToCloudFormation(properties.topicArn),\n };\n}", "function MQTT_Subscribe(topic_filter, system) {\r\n\t//CF.log(\"Sending Subscribe Message to topic: \" + topic_filter + \" To system: \" + system);\r\n\t// Calculate message length: Packet identifier (2 bytes) + Topic filter Length(2 bytes) + Topic Filter + QoS(1 bytes)\r\n\tvar message_length = 2 + 2 + topic_filter.length + 1;\r\n\t//CF.log(\"Message length is : \"+ message_length);\r\n\tvar message = binaryString([0x82, message_length, 0x00, 0x01, 0x00, topic_filter.length, topic_filter, 0x00]);\r\n\tCF.send(system, message);\r\n\t//CF.log(\"Message sent \" + message);\t\r\n}", "function getConfig() {\n var session = store.get('session');\n return session.config\n}", "function setConfig(options) {\n if (!utils.isPlainObject(options)) {\n utils.logError('setConfig options must be an object');\n return;\n }\n\n var topics = Object.keys(options);\n var topicalConfig = {};\n topics.forEach(function (topic) {\n var prop = topic === 'fpd' ? 'ortb2' : topic;\n var option = topic === 'fpd' ? convertFpd(options[topic]) : options[topic];\n\n if (utils.isPlainObject(defaults[prop]) && utils.isPlainObject(option)) {\n option = _extends({}, defaults[prop], option);\n }\n\n topicalConfig[prop] = config[prop] = option;\n });\n callSubscribers(topicalConfig);\n }", "function onConnect() {\n // Fetch the MQTT topic from the form\n topic = \"/septiesp32\";\n\n // Print output for the user in the messages div\n //document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n}", "subscribe (topic, handler, content_type='default'){\n\t\treturn this.ready.then((socket)=>{\n\t\t\tif (!(topic in this.subscriptions)){\n\t\t\t\tthis.subscriptions[topic] = {\n\t\t\t\t\t// handlers: {},\n\t\t\t\t\tmessages: []\n\t\t\t\t}\n\n\t\t\t\tif (this.socket.readyState === WebSocket.OPEN){\n\t\t\t\t\tthis.socket.send(JSON.stringify({ \n action: 'subscribe', \n topic: topic\n // content_type: content_type\n }));\n\t\t\t\t\t// console.log(\"Subscribed to \"+topic+\" - handler \"+handler_id);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.log(\"WebSocket is closed, cannot subscribe to [\"+topic+\"]\");\n\t\t\t\t}\n\t\t\t}\n\n let ref = (data)=>handler(DESERIALIZERS[content_type](data));\n\t\t\t// this.on('msg:'+topic, handler);\n this.on('msg:'+topic, ref);\n return ref;\n\t\t});\n\t}", "function createSubscription(topic, kind) {\n return new Promise(function (fulfill, reject) {\n var subscriber_name = topicPrefix + '.' + kind;\n var subs_options = {\n autoAck: false,\n ackDeadlineSeconds: 20,\n interval: 30,\n maxInProgress: 1\n };\n\n pubsub.subscribe(topic, subscriber_name, subs_options,\n function (err, subscription) {\n if (err) {\n seneca.log.error('Failed to subscribe to \"' + topic.name + '\"');\n reject(err);\n }\n else {\n seneca.log.info('Created subscription to \"' + topic.name\n + '\", Subscription: ' + subscriber_name);\n fulfill(subscription);\n }\n }\n );\n });\n }", "function SubscriptionClient(serviceBus, configuration, transport){\n\t\t\n\t\tvar configuration = configuration;\n\t\tvar subscriptions = [];\n\t\tvar self = this;\n\t\t\n\t\tserviceBus.on(\"urn:message:MassTransit.Services.Subscriptions.Messages:SubscriptionRefresh\", consumeSubscriptionRefresh);\n\t\tserviceBus.on(\"urn:message:MassTransit.Services.Subscriptions.Messages:RemoveSubscription\", consumeSubscriptionRemove);\n\t\tserviceBus.on(\"urn:message:MassTransit.Services.Subscriptions.Messages:AddSubscription\", \t consumeSubscriptionAdd);\n\t\n\t\t/**\n\t\t *\tRegisters a new client in the pool\n\t\t */\n\t\tfunction addSubscriptionClient(){ \n\n\t\t\tLog.info(\"registering a new client in the pool\");\n\t\t\t\n\t\t\tconfiguration.clientId = Math.uuid().toLowerCase();\n\t\t\t\n\t\t\tvar message = {\n\t\t\t correlationId: configuration.clientId,\n\t\t\t\tcontrolUri\t : configuration.receiveFrom.toString(),\n\t\t\t\tdataUri\t\t : configuration.receiveFrom.toString()\n\t\t\t};\n\t\t\t\n\t\t\ttransport.send({messageType:\"urn:message:MassTransit.Services.Subscriptions.Messages:AddSubscriptionClient\", message:message });\n\t\t}\n\n\t\t/**\n\t\t *\tRegisters a new subscription\n\t\t */\n\t\tfunction addSubscription(messageName){ \n\n\t\t\tLog.info(\"adding a message consumer for: \" + messageName);\n\t\t\n\t\t\tvar message = {\n\t\t\t\tsubscription: {\n\t\t\t\t\tclientId: configuration.clientId,\n\t\t\t\t\tsequenceNumber: 1,\n\t\t\t\t\tmessageName: messageName,\n\t\t\t\t\tendpointUri: configuration.receiveFrom.toString(),\n\t\t\t\t\tsubscriptionId: Math.uuid() }};\n\n\t\t\ttransport.send({ messageType:\"urn:message:MassTransit.Services.Subscriptions.Messages:AddSubscription\", message:message });\n\t\t}\n\t\t\n\t\t/**\n\t\t *\tConsume incomming subscription refresh messages\n\t\t */\n\t\tfunction consumeSubscriptionRefresh(message){\n\t\t\n\t\t\tLog.info(\"subscription refresh handling\");\n\t\t\n\t\t\t_.each(message.subscriptions, function(val){\n\t\t\t\tLog.info(\"subscription add: \" + val.messageName + \" from \" + val.endpointUri);\n\t\t\t\t// check for duplicates\n\t\t\t\tif( _.filter(subscriptions, function(v){return v.subscriptionId == val.subscriptionId}).length == 0){\n\t\t\t\t\tsubscriptions.push(val);\n\t\t\t\t}\n\t\t\t});\n\t\t\n\t\t\tthis.emit('subscriptionClientReady');\n\t\t}\n\n\t\t/**\n\t\t *\tConsume incomming subscription remove messages\n\t\t */\n\t\tfunction consumeSubscriptionRemove(message){\n\t\t\tLog.info(\"subscription remove handling: \" + message.subscription.messageName + \" from \" + message.subscription.endpointUri);\n\t\t\tsubscriptions = _.filter(subscriptions, function(v){ return v.subscriptionId != message.subscription.subscriptionId})\n\t\t}\n\n\t\t/**\n\t\t *\tConsume incomming subscription add messages\n\t\t */\n\t\tfunction consumeSubscriptionAdd(message){\n\t\t\tLog.info(\"subscription add handling: \" + message.subscription.messageName + \" from \" + message.subscription.endpointUri);\n\t\t\tif( _.filter(subscriptions, function(v){ return v.subscriptionId == message.subscription.subscriptionId}).length == 0)\n\t\t\t\tsubscriptions.push(message.subscription);\n\t\t}\n\t\t\n\t\t/**\n\t\t *\tGets the list of subscriptions\n\t\t */\n\t\tfunction getSubscriptions(){\n\t\t\treturn subscriptions;\n\t\t}\n\t\t\n\t\tthis.addSubscription = addSubscription;\n\t\tthis.addSubscriptionClient = addSubscriptionClient;\n\t\tthis.getSubscriptions = getSubscriptions;\n\t}", "function sendNotification() {\n http.get(`/subscription/${subscritionId}`);\n}", "function cfnStreamingDistributionStreamingDistributionConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnStreamingDistribution_StreamingDistributionConfigPropertyValidator(properties).assertSuccess();\n return {\n Aliases: cdk.listMapper(cdk.stringToCloudFormation)(properties.aliases),\n Comment: cdk.stringToCloudFormation(properties.comment),\n Enabled: cdk.booleanToCloudFormation(properties.enabled),\n Logging: cfnStreamingDistributionLoggingPropertyToCloudFormation(properties.logging),\n PriceClass: cdk.stringToCloudFormation(properties.priceClass),\n S3Origin: cfnStreamingDistributionS3OriginPropertyToCloudFormation(properties.s3Origin),\n TrustedSigners: cfnStreamingDistributionTrustedSignersPropertyToCloudFormation(properties.trustedSigners),\n };\n}", "function cfnFunctionSNSEventPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnFunction_SNSEventPropertyValidator(properties).assertSuccess();\n return {\n Topic: cdk.stringToCloudFormation(properties.topic),\n };\n}", "function cfnFunctionSNSEventPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnFunction_SNSEventPropertyValidator(properties).assertSuccess();\n return {\n Topic: cdk.stringToCloudFormation(properties.topic),\n };\n}", "function onConnect() {\n // Fetch the MQTT topic from the form\n topic = document.getElementById(\"topic\").value;\n to = document.getElementById(\"to\").value;\n msg = document.getElementById(\"msg\").value;\n\n if (topic.includes(\"/\")) {\n // Print output for the user in the messages div\n document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n\n // Subscribe to the requested topic\n client.subscribe(topic);\n }\n}", "function onConnect() {\r\n // Fetch the MQTT topic from the form\r\n topic_readings = \"IC.embedded/jhat/sensors/readings\";\r\n topic_connection = \"IC.embedded/jhat/sensors/connect_ack\";\r\n\r\n // Print output for the user in the messages div\r\n // document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + topic_readings + '</span><br/>';\r\n \r\n\r\n // Subscribe to the requested topic\r\n client.subscribe(topic_readings);\r\n client.subscribe(topic_connection);\r\n\r\n client.send(\"IC.embedded/jhat/sensors/connect_req\", \"Connected\", 1, true)\r\n \r\n}", "createFromConnectionConfig(config) {\n ConnectionConfig.validate(config, { isEntityPathRequired: true });\n config.getManagementAudience = () => {\n return `${config.endpoint}${config.entityPath}/$management`;\n };\n config.getManagementAddress = () => {\n return `${config.entityPath}/$management`;\n };\n config.getSenderAudience = (partitionId) => {\n if (partitionId != undefined) {\n return `${config.endpoint}${config.entityPath}/Partitions/${partitionId}`;\n }\n else {\n return `${config.endpoint}${config.entityPath}`;\n }\n };\n config.getSenderAddress = (partitionId) => {\n if (partitionId != undefined) {\n return `${config.entityPath}/Partitions/${partitionId}`;\n }\n else {\n return `${config.entityPath}`;\n }\n };\n config.getReceiverAudience = (partitionId, consumergroup) => {\n if (!consumergroup)\n consumergroup = \"$default\";\n return (`${config.endpoint}${config.entityPath}/ConsumerGroups/${consumergroup}/` +\n `Partitions/${partitionId}`);\n };\n config.getReceiverAddress = (partitionId, consumergroup) => {\n if (!consumergroup)\n consumergroup = \"$default\";\n return `${config.entityPath}/ConsumerGroups/${consumergroup}/Partitions/${partitionId}`;\n };\n return config;\n }", "function TopicPublisher() {\n\t\tthis.subscribers = {\n\t\t}\n\t}", "function getPushSubscription() {\n if (!navigator.serviceWorker) return;\n\n return navigator.serviceWorker.ready.then(reg => {\n return reg.pushManager.getSubscription();\n });\n}", "handlePublishMessage(topic, message) {\n let subscriptions = this.subscription.getSubscriptions(\n (subs) => subs.topic === topic)\n // now let send to all subscribers in the topic with exactly message from publisher\n subscriptions.forEach((subscription) => {\n const clientId = subscription.clientId\n this.send(clientId, {\n action: 'publish',\n payload: {\n topic: topic,\n message: message,\n },\n })\n })\n }", "bind(_scope, lifecycleHook) {\n this.topic.grantPublish(lifecycleHook.role);\n return { notificationTargetArn: this.topic.topicArn };\n }", "function cfnQuickConnectQueueQuickConnectConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnQuickConnect_QueueQuickConnectConfigPropertyValidator(properties).assertSuccess();\n return {\n ContactFlowArn: cdk.stringToCloudFormation(properties.contactFlowArn),\n QueueArn: cdk.stringToCloudFormation(properties.queueArn),\n };\n}", "function _mapSpidrConfigToAPI(spidrConfig) {\n\n // In newer version (2.2.1+) we don't do any parsing of the parameters and pass them through directly if the server\n // configuration also supports it.\n if (spidrConfig.fcsApi) {\n return spidrConfig.fcsApi;\n }\n\n return {\n notificationType: fcs.notification.NotificationTypes.WEBSOCKET,\n restUrl: spidrConfig.REST_server_address,\n restPort: spidrConfig.REST_server_port,\n websocketIP: spidrConfig.webSocket_server_address,\n websocketPort: spidrConfig.webSocket_server_port,\n websocketProtocol: (spidrConfig.webSocket_secure !== false ? 'wss' : 'ws'),\n protocol: spidrConfig.REST_protocol,\n serverProvidedTurnCredentials: spidrConfig.serverProvidedTurnCredentials\n };\n }", "function getConfig() {\n return config;\n }", "async initSubscriptions() {\n\n }", "requestSubscription(options) {\n if (!this.sw.isEnabled || this.pushManager === null) {\n return Promise.reject(new Error(ERR_SW_NOT_SUPPORTED));\n }\n const pushOptions = { userVisibleOnly: true };\n let key = this.decodeBase64(options.serverPublicKey.replace(/_/g, '/').replace(/-/g, '+'));\n let applicationServerKey = new Uint8Array(new ArrayBuffer(key.length));\n for (let i = 0; i < key.length; i++) {\n applicationServerKey[i] = key.charCodeAt(i);\n }\n pushOptions.applicationServerKey = applicationServerKey;\n return this.pushManager.pipe(switchMap(pm => pm.subscribe(pushOptions)), take(1))\n .toPromise()\n .then(sub => {\n this.subscriptionChanges.next(sub);\n return sub;\n });\n }", "subscribe(topic, callback) {\n if (!Array.isArray(this.subscribersByTopic[topic])) {\n this.subscribersByTopic[topic] = [];\n }\n\n this.subscribersByTopic[topic].push(callback);\n\n return () => {\n this.unsubscribe(topic, callback);\n };\n }", "function _getConfig() {\n if (currBidder && bidderConfig && utils.isPlainObject(bidderConfig[currBidder])) {\n var currBidderConfig = bidderConfig[currBidder];\n var configTopicSet = new __WEBPACK_IMPORTED_MODULE_3_core_js_pure_features_set___default.a(Object.keys(config).concat(Object.keys(currBidderConfig)));\n return from(configTopicSet).reduce(function (memo, topic) {\n if (typeof currBidderConfig[topic] === 'undefined') {\n memo[topic] = config[topic];\n } else if (typeof config[topic] === 'undefined') {\n memo[topic] = currBidderConfig[topic];\n } else {\n if (utils.isPlainObject(currBidderConfig[topic])) {\n memo[topic] = Object(__WEBPACK_IMPORTED_MODULE_4__utils_js__[\"mergeDeep\"])({}, config[topic], currBidderConfig[topic]);\n } else {\n memo[topic] = currBidderConfig[topic];\n }\n }\n\n return memo;\n }, {});\n }\n\n return _extends({}, config);\n }", "function Subscription() {\n\n var logger = new Logger('Subscription');\n\n /**\n * Storage keywords for storing subscription settings\n * @type {Object}\n */\n var config = {\n storageKeywords: {\n\n VOIPTN: \"VoipTn\",\n VOIPCREF: \"VoipTnCipherRef\",\n MYPUBLICUSER: \"MyPublicUser\",\n services: 'services',\n serviceName: 'serviceName',\n serviceCatalog: {\n publicId: 'publicId',\n domain: 'domain',\n id: 'id',\n webSocketEndpoints: 'webSocketEndpoints',\n voipTnCipherRef: 'voipTnCipherRef'\n },\n RTCService: {\n Enabled : \"RTCServiceEnabled\",\n Exists : \"RTCServiceExists\",\n ProvisioningState : \"RTCServiceProvisioningState\",\n Uris : \"RTCUris\"\n }\n }\n };\n\n /**\n * Retrieve list of subscribed services\n * @return {Ctl.Promise} CTL promise object\n */\n function getSubscriptionServices() {\n var slRequest = new SubscriptionServiceIdentitiesRequest();\n return Ajax.request(\n slRequest.type,\n slRequest.getRequestUrl(),\n null,\n slRequest.getRequestHeaders()\n );\n }\n\n /**\n * Retrieve details of particular service\n * @param {String} serviceName Name of the service to get details about\n * @param {String} publicId Moniker (public ID) tied to the service\n * @return {Ctl.Promise} CTL promise object\n */\n function getSubscriptionServiceDetails(serviceName, publicId) {\n var seCatalogRequest = new SubscriptionServiceCatalogRequest(serviceName, publicId);\n return Ajax.request(\n seCatalogRequest.type,\n seCatalogRequest.getRequestUrl(),\n null,\n seCatalogRequest.getRequestHeaders()\n );\n }\n\n /**\n * Set services into storage\n * @param {Object} services Object with services\n * @protected\n */\n function setServices(services) {\n Utils.set(config.storageKeywords.services, JSON.stringify(services));\n }\n\n /**\n * Get services from the storage\n * @return {Object} Object with services\n * @protected\n */\n function getServices() {\n return Utils.get(config.storageKeywords.services);\n }\n\n /**\n * Set service catalog details into storage\n * @param {Object} serviceCatalog Object with service details\n */\n function setServiceCatalog(serviceCatalog) {\n Utils.setObject(config.storageKeywords.serviceName, serviceCatalog.productName);\n Utils.setObject(config.storageKeywords.services + '_' + serviceCatalog.productName, serviceCatalog);\n }\n\n /**\n * Get service details\n * @return {Object} Object with service details\n */\n function getServiceCatalog() {\n var serviceName = Utils.getObject(config.storageKeywords.serviceName);\n return Utils.getObject(config.storageKeywords.services + '_' + serviceName);\n }\n\n /**\n * Set moniker (public ID) in storage\n * @param {String} publicId user's public ID (moniker)\n */\n function setPublicId(publicId) {\n Utils.set(config.storageKeywords.serviceCatalog.publicId, publicId);\n }\n\n /**\n * Get moniker (public ID) from storage\n */\n function getPublicId() {\n return Utils.get(config.storageKeywords.serviceCatalog.publicId);\n }\n\n function parseWebRTCServers(uris) {\n\n var parsedServers = [];\n\n if (typeof uris === 'string') {\n uris = uris.replace(/ /g,'');\n try {\n uris = JSON.parse(uris);\n } catch (e) {\n if(uris.indexOf('$') >= 0) {\n uris = uris.split('$');\n }\n }\n }\n\n var addToServerList = function(server) {\n if(parsedServers.indexOf(server) === -1) {\n parsedServers.push(server);\n }\n };\n\n if (uris) {\n for (var key in uris) {\n if (uris.hasOwnProperty(key)) {\n if (uris[key] instanceof Array) {\n for (var i=0; i<uris[key].length; i++) {\n addToServerList(uris[key][i]);\n }\n } else {\n if (typeof uris[key] === 'string') {\n\n try {\n var parsedUris = JSON.parse(uris[key]);\n if (parsedUris instanceof Array) {\n for (var j=0; j<parsedUris.length; j++) {\n var parsedServerList = this.parseWebRTCServers(parsedUris[j]);\n for(var k = 0; k < parsedServerList.length; k++) {\n addToServerList(parsedServerList[k]);\n }\n }\n }\n }\n catch(e) {\n addToServerList(uris[key]);\n }\n } else {\n for (var p in uris[key]) {\n if (uris[key].hasOwnProperty(p)) {\n if (uris[key][p] instanceof Array) {\n for(var m = 0; m < uris[key][p].length; m++) {\n addToServerList(uris[key][p][m]);\n }\n }\n else {\n addToServerList(uris[key][p]);\n }\n }\n }\n }\n }\n }\n }\n }\n\n localStorage.setItem(config.storageKeywords.RTCService.Uris, JSON.stringify(parsedServers));\n }\n\n function setOAuthCredentials(data) {\n\n var dynamicStorage = Utils.getDynamicStorage();\n\n var publicUser = '';\n\n dynamicStorage.setItem(config.storageKeywords.VOIPCREF, data.networkIdentity.authenticationandCipheringReference);\n dynamicStorage.setItem(config.storageKeywords.VOIPTN, data.networkIdentity.moniker);\n\n if(data.rtc) {\n publicUser = data.networkIdentity.moniker + data.rtc.domain;\n parseWebRTCServers(data.rtc.routing);\n }\n else {\n publicUser = data.networkIdentity.moniker;\n }\n\n localStorage.setItem(config.storageKeywords.MYPUBLICUSER, publicUser);\n }\n\n function setCtlIdCredentials(preRegData) {\n\n var dynamicStorage = Utils.getDynamicStorage();\n\n dynamicStorage.setItem(config.storageKeywords.VOIPTN, preRegData.HomePreRegisterResponse.VoipTn);\n dynamicStorage.setItem(config.storageKeywords.VOIPCREF, preRegData.HomePreRegisterResponse.VoipTnCipherRef);\n\n localStorage.setItem(config.storageKeywords.MYPUBLICUSER, preRegData.HomePreRegisterResponse.MyPublicUser);\n localStorage.setItem(config.storageKeywords.RTCService.Exists, preRegData.HomePreRegisterResponse.RTCServiceExists);\n\n parseWebRTCServers(preRegData.HomePreRegisterResponse.VoIPDomainURIs);\n }\n\n this.getSubscriptionServices = getSubscriptionServices;\n this.getSubscriptionServiceDetails = getSubscriptionServiceDetails;\n this.getServiceCatalog = getServiceCatalog;\n this.setServiceCatalog = setServiceCatalog;\n this.setPublicId = setPublicId;\n this.getPublicId = getPublicId;\n this.setCtlIdCredentials = setCtlIdCredentials;\n this.setOAuthCredentials = setOAuthCredentials;\n\n }", "function cfnFunctionTopicSAMPTPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnFunction_TopicSAMPTPropertyValidator(properties).assertSuccess();\n return {\n TopicName: cdk.stringToCloudFormation(properties.topicName),\n };\n}", "function cfnFunctionTopicSAMPTPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnFunction_TopicSAMPTPropertyValidator(properties).assertSuccess();\n return {\n TopicName: cdk.stringToCloudFormation(properties.topicName),\n };\n}", "function cfnQuickConnectQuickConnectConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnQuickConnect_QuickConnectConfigPropertyValidator(properties).assertSuccess();\n return {\n PhoneConfig: cfnQuickConnectPhoneNumberQuickConnectConfigPropertyToCloudFormation(properties.phoneConfig),\n QueueConfig: cfnQuickConnectQueueQuickConnectConfigPropertyToCloudFormation(properties.queueConfig),\n QuickConnectType: cdk.stringToCloudFormation(properties.quickConnectType),\n UserConfig: cfnQuickConnectUserQuickConnectConfigPropertyToCloudFormation(properties.userConfig),\n };\n}", "async _connectToQueues() {\n if (this.options.inputFile) {\n this.inputFileReader = new lineByLine(this.options.inputFile);\n } else {\n this.options.sourceQueueUrl = await this._connectToQueue(this.options.queue);\n }\n if (this.options.redrive) {\n this.options.moveTo = await this._findDlqSourceQueue(this.options.sourceQueueUrl);\n }\n if (this.options.moveTo) {\n this.options.moveToQueueUrl = await this._connectToQueue(this.options.moveTo);\n }\n if (this.options.copyTo) {\n this.options.copyToQueueUrl = await this._connectToQueue(this.options.copyTo);\n }\n if (this.options.publishTo) {\n this.log(chalk`Connecting to target SNS topic '{green ${this.options.publishTo}}' in the '{green ${this.options.region}}' region...`);\n await this.sns.getTopicAttributes({\n TopicArn: this.options.publishTo,\n });\n }\n }", "subscribe(topic) {\n this.topicQueues[topic] = []\n }", "function MqttWsBridge(mqtt_url, wss_config, options){\n\tif (!(this instanceof MqttWsBridge)) return new MqttWsBridge(mqtt_url, wss_config);\n\tEventEmitter.call(this);\n\tvar self = this;\n\tthis.mqtt_config = { url: mqtt_url || MQTT_DEFAULT.url };\n\tthis.wss_config = Object.assign({}, wss_config || WSS_DEFAULT);\n\tthis.options = Object.assign({\n\t\trestricted_topics: []\n\t}, options);\n\n\tthis.mqtt = undefined;\n\tthis.wss = undefined;\n\t\n\tthis.clients = {};\n\tthis.subscribers = {};\n\n\tthis.init();\n}", "function onConnect() {\n // Once a connection has been made, make a subscription and send a message.\n console.log(\"onConnect\");\n client.subscribe(topic);\n }", "function onConnect() {\n console.log(\"Connected to broker, subscribing for subtopic: \" + localStorage.subtopic);\n client.subscribe(localStorage.subtopic);\n chrome.browserAction.setIcon({path: \"icon_blue128.png\"});\n popupNotification(\"MQTT Broker connected\", \"\", \"icon.png\");\n\n /*\n //uncomment the below if you want to publish to a topic on connect\n message = new Messaging.Message(\"Hello\");\n message.destinationName = \"/World\";\n client.send(message);\n */\n}", "function fct_getTopicTemplate(configContent, stationNumber) {\n var errorCode = 0;\n var errorMessage = \"\";\n var topicTemplate = \"\";\n\n var configuration = configContent.plcSettings.topicTemplates;\n if (configuration == \"undefined\") {\n errorCode = -1;\n errorMessage = \".plcSettings.topicTemplates is not defined in configuration!\";\n return {\n errorCode: errorCode,\n errorMessage: errorMessage,\n topicTemplate: topicTemplate\n }\n }\n\n for (var i = 0; i < configuration.length; i++) {\n if (configuration[i].stationNumber == stationNumber) {\n topicTemplate = configuration[i].topicTemplate;\n }\n }\n\n return {\n errorCode: errorCode,\n errorMessage: errorMessage,\n topicTemplate: topicTemplate\n }\n}", "supportsSubscriptions() {\n\t\treturn true;\n\t}", "function snsPublish(req, res) {\n snsUtil.createOrGetTopic(BROWN_TOPIC)\n .then( (topicARN) => {\n snsUtil.publish(topicARN, 'Brown IOC has been created or updated', 'Brown IOC has been created or modified. Please investigate');\n res.send('done');\n })\n}", "function onConnect() {\n // Fetch the MQTT topic from the form\n SubSuhu = \"[email protected]/suhu\";\n SubRh = \"[email protected]/rh\";\n\n SubSuhu2 = \"[email protected]/suhu2\";\n SubRh2 = \"[email protected]/rh2\";\n\n lampu = \"[email protected]/lamp\";\n fan = \"[email protected]/fan\";\n\n // Print output for the user in the messages div\n // document.getElementById(\"messages\").innerHTML += '<span>Subscribing to: ' + topic + '</span><br/>';\n // document.getElementById(\"pesan\").innerHTML = '0';\n\n // Subscribe to the requested topic\n client.subscribe(SubSuhu);\n client.subscribe(SubRh);\n\n client.subscribe(SubSuhu2);\n client.subscribe(SubRh2);\n\n client.subscribe(lampu);\n client.subscribe(fan);\n}", "function onConnect()\n{\n console.log(\"Connected to broker, subscribing for subtopic: \" + localStorage.subtopic);\n client.subscribe(localStorage.subtopic);\n chrome.browserAction.setIcon({path:\"icon.png\"});\n popupNotification(\"MQTT Broker connected\",\"\",\"icon.png\");\n\n /*\n //uncomment the below if you want to publish to a topic on connect\n message = new Messaging.Message(\"Hello\");\n message.destinationName = \"/World\";\n client.send(message);\n */\n}", "function onConnect()\n{\n console.log(\"Connected to broker, subscribing for subtopic: \" + localStorage.subtopic);\n client.subscribe(localStorage.subtopic);\n chrome.browserAction.setIcon({path:\"icon.png\"});\n popupNotification(\"MQTT Broker connected\",\"\",\"icon.png\");\n\n /*\n //uncomment the below if you want to publish to a topic on connect\n message = new Messaging.Message(\"Hello\");\n message.destinationName = \"/World\";\n client.send(message);\n */\n}", "function cfnMaintenanceWindowTaskNotificationConfigPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnMaintenanceWindowTask_NotificationConfigPropertyValidator(properties).assertSuccess();\n return {\n NotificationArn: cdk.stringToCloudFormation(properties.notificationArn),\n NotificationEvents: cdk.listMapper(cdk.stringToCloudFormation)(properties.notificationEvents),\n NotificationType: cdk.stringToCloudFormation(properties.notificationType),\n };\n}", "function getPayload() {\n let iat = Math.round((new Date()).getTime() / 1000);\n let exp = iat + (60 * 60);\n\n return {\n \"iss\": parsedKey.client_email,\n \"scope\": \"https://www.googleapis.com/auth/cloud-platform \"\n + \"https://www.googleapis.com/auth/pubsub\",\n \"aud\": AUTH_ENDPOINT,\n \"iat\": iat,\n \"exp\": exp\n };\n }", "function cfnContactListTopicPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnContactList_TopicPropertyValidator(properties).assertSuccess();\n return {\n DefaultSubscriptionStatus: cdk.stringToCloudFormation(properties.defaultSubscriptionStatus),\n Description: cdk.stringToCloudFormation(properties.description),\n DisplayName: cdk.stringToCloudFormation(properties.displayName),\n TopicName: cdk.stringToCloudFormation(properties.topicName),\n };\n}", "function config(name) {\n\t\treturn getProperty(CONFIG, name);\n\t}", "function addSubscriptionClient(){ \n\n\t\t\tLog.info(\"registering a new client in the pool\");\n\t\t\t\n\t\t\tconfiguration.clientId = Math.uuid().toLowerCase();\n\t\t\t\n\t\t\tvar message = {\n\t\t\t correlationId: configuration.clientId,\n\t\t\t\tcontrolUri\t : configuration.receiveFrom.toString(),\n\t\t\t\tdataUri\t\t : configuration.receiveFrom.toString()\n\t\t\t};\n\t\t\t\n\t\t\ttransport.send({messageType:\"urn:message:MassTransit.Services.Subscriptions.Messages:AddSubscriptionClient\", message:message });\n\t\t}", "supportsSubscriptions() {\n return false;\n }", "function setupIotTopic(topicName) {\n const {PubSub} = require('@google-cloud/pubsub');\n\n const pubsub = new PubSub();\n const topic = pubsub.topic(topicName);\n const serviceAccount = `serviceAccount:[email protected]`;\n\n topic.iam\n .getPolicy()\n .then(results => {\n const policy = results[0] || {};\n policy.bindings || (policy.bindings = []);\n console.log(JSON.stringify(policy, null, 2));\n\n let hasRole = false;\n let binding = {\n role: 'roles/pubsub.publisher',\n members: [serviceAccount],\n };\n\n policy.bindings.forEach(_binding => {\n if (_binding.role === binding.role) {\n binding = _binding;\n hasRole = true;\n return false;\n }\n });\n\n if (hasRole) {\n binding.members || (binding.members = []);\n if (binding.members.indexOf(serviceAccount) === -1) {\n binding.members.push(serviceAccount);\n }\n } else {\n policy.bindings.push(binding);\n }\n\n // Updates the IAM policy for the topic\n return topic.iam.setPolicy(policy);\n })\n .then(results => {\n const updatedPolicy = results[0];\n\n console.log(JSON.stringify(updatedPolicy, null, 2));\n })\n .catch(err => {\n console.error('ERROR:', err);\n });\n}", "function load_config(){\n S.config = K.config.fetch();\n return S.config;\n }", "_subscribe(subscription) {\n return new Promise((resolve, reject) => {\n let watcherInfo = this._getWatcherInfo(subscription);\n\n // create the 'bare' options w/o 'since' or relative_root.\n // Store in watcherInfo for later use if we need to reset\n // things after an 'end' caught here.\n let options = watcherInfo.watchmanWatcher.createOptions();\n watcherInfo.options = options;\n\n // Dup the options object so we can add 'relative_root' and 'since'\n // and leave the original options object alone. We'll do this again\n // later if we need to resubscribe after 'end' and reconnect.\n options = Object.assign({}, options);\n\n if (this._relative_root) {\n options.relative_root = watcherInfo.relativePath;\n }\n\n options.since = watcherInfo.since;\n\n this._client.command(\n ['subscribe', watcherInfo.root, subscription, options],\n (error, resp) => {\n if (error) {\n reject(error);\n } else {\n resolve(resp);\n }\n }\n );\n });\n }", "static getConfig() {\n return {\n apiKey: Firebase.apiKey,\n appId: Firebase.appId,\n authDomain: Firebase.authDomain,\n databaseURL: Firebase.databaseURL,\n projectId: Firebase.projectId,\n messagingSenderId: Firebase.messagingSenderId,\n };\n }", "function onConnect(){\n console.log(\"Connected!\");\n client.subscribe(topic);\n }", "get configurationEndpointAddress() {\n return this.getStringAttribute('configuration_endpoint_address');\n }", "async function getConfig(){\n const config = await getAuthConfig()\n const returnConfig = {\n apiKey: config.AUTH_KEY,\n authDomain: config.AUTH_DOMAIN \n }\n return returnConfig\n }", "constructor(schema, subscriptionRequest, config, googlePublisher = new pubsub_1.PubSub(config.Gcp.Auth)) {\n var _a;\n this.schema = schema;\n this.config = config;\n this.googlePublisher = googlePublisher;\n this.googlePublisher.projectId = this.googlePublisher.projectId.replace('-private', '-public');\n // This object is a very longlived 'active' object, so we dont want to have\n // any unexpected side-effects of holding relay objects in memory and the\n // potential for large networks of objects and services never being garbage collected\n //\n //\n let id;\n ({\n gql_query_string: this.gql_query_string,\n query_attributes: this.query_attributes,\n operation_name: this.operation_name,\n publish_to_topic_name: this.publish_to_topic_name,\n subscription_name: this.subscription_name,\n marshalled_acl: this.marshalled_acl,\n onResponseHook: this.onResponseHook,\n create_unique_subscription: this.create_unique_subscription,\n active: this.active,\n cache_consistency_id: this.cache_consistency_id,\n serviced_by: this.serviced_by,\n id\n } = subscriptionRequest);\n this.owner_id = (_a = subscriptionRequest.owner_id) !== null && _a !== void 0 ? _a : '';\n if (!id) {\n throw new Error('Must have an id!');\n }\n this.id = id.toString();\n this.executionContext = QueuedSubscription.validateSubscriptionRequest(this.schema, this);\n }", "function unsubscribeKPNS() {\n var sub = {\n \"appId\": appID,\n \"ksid\": ksid,\n \"deviceId\": deviceID\n };\n var inp = {\n \"subscriptionService\": {\n \"unsubscribe\": sub\n }\n };\n var myhttpheaders = {\n \"Content-Type\": \"application/json\"\n };\n var paramTab = {\n postdata: JSON.stringify(inp),\n httpheaders: myhttpheaders\n };\n var url = kpnsURL + \"/subscription\";\n kony.net.invokeServiceAsync(url, paramTab, KPNSunregCallback);\n}", "async getConfig() {\n return await axios.get(`${globals.apiUrl}/calendar/google-config`);\n }" ]
[ "0.56542504", "0.5565252", "0.55441356", "0.5511009", "0.5509086", "0.54455256", "0.5404455", "0.5395602", "0.534267", "0.5295037", "0.52103776", "0.5074877", "0.49914277", "0.49867672", "0.49727187", "0.49520382", "0.490879", "0.49014488", "0.4886454", "0.4886454", "0.48811322", "0.48636493", "0.48422843", "0.48369685", "0.48367888", "0.48270178", "0.48202786", "0.47883558", "0.47845832", "0.47742817", "0.47553414", "0.4725913", "0.47215727", "0.4716929", "0.47150669", "0.471412", "0.47046566", "0.47026125", "0.4700697", "0.4698477", "0.4698477", "0.4689153", "0.46694666", "0.46665356", "0.46631098", "0.46574214", "0.46546966", "0.4650702", "0.46435508", "0.46154466", "0.46146217", "0.4600266", "0.45886993", "0.45747802", "0.45747802", "0.45634833", "0.4563308", "0.45631182", "0.45621425", "0.45540535", "0.45492718", "0.4536279", "0.4531716", "0.45295876", "0.45270196", "0.45262358", "0.45146102", "0.45143852", "0.4511677", "0.4505984", "0.45028383", "0.45028383", "0.4499315", "0.4496727", "0.44867393", "0.4484116", "0.44822332", "0.44660294", "0.4458019", "0.44533163", "0.44493926", "0.4439772", "0.44146034", "0.44146034", "0.44106218", "0.44002914", "0.43966603", "0.43921715", "0.4391782", "0.43884802", "0.43864363", "0.4384112", "0.43822286", "0.43814948", "0.437952", "0.4378723", "0.43659762", "0.43586487", "0.43552732", "0.43549448" ]
0.550591
5
trick: account for multiple letters and remember that arrays are defined by reference
function main() { const a = readLine(); const b = readLine(); // log deletions from strings A to B and from B to A console.log((countDeletions(a, b) + countDeletions(b, a))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_addToWordLetterArray(thisKey){\n let startIndex = 0;\n let i;\n while((i = this._word.indexOf(thisKey,startIndex))> -1 ){\n this._wordLetter[i] = thisKey;\n startIndex = i+1;\n }\n }", "function sameStart(arr, letter) {\n\n}", "function mutation(arr) {\n // Mutating both to be lowercase \n arr[0] = arr[0].toLowerCase();\n arr[1] = arr[1].toLowerCase();\n // Setting return boolean value to true\n var allLettersPresent = true;\n // Iterating through second string in arr \n for (var i = 0; i < arr[1].length; i++){\n // Searching first string for indexOf current letter of second string \n indexOf = arr[0].indexOf(arr[1][i]);\n // If indexOf returned -1 -> letter was not found\n if (indexOf == -1){\n // first string does not contain all the letters in second string\n allLettersPresent = false;\n }\n }\n // If allLetterPresent wasn't changed to false - returns true \n return allLettersPresent;\n }", "function letterCombinations(arr) {\n // ...\n}", "function letter(arr2, char){\n let arr = []\n for(let i = 0; i < arr2.length; i++){\n if (arr2[i].includes(char)) {\n arr.push(arr2[i])\n }\n }\n return arr\n}", "manipulateString() {\n let myArray = Array.from(gatherInput().toLowerCase(), x => {\n switch (x) {\n case 'a':\n return 1\n break;\n case 'b':\n return 2\n break;\n case 'c':\n return 3\n break;\n case 'd':\n return 4\n break;\n case 'e':\n return 5\n break;\n case 'f':\n return 6\n break;\n case 'g':\n return 7\n break;\n case 'h':\n return 8\n break;\n case 'i':\n return 9\n break;\n case 'j':\n return 10\n break;\n case 'k':\n return 11\n break;\n case 'l':\n return 12\n break;\n case 'm':\n return 13\n break;\n case 'n':\n return 14\n break;\n case 'o':\n return 15\n break;\n case 'p':\n return 16\n break;\n case 'q':\n return 17\n break;\n case 'r':\n return 18\n break;\n case 's':\n return 19\n break;\n case 't':\n return 20\n break;\n case 'u':\n return 21\n break;\n case 'v':\n return 22\n break;\n case 'w':\n return 23\n break;\n case 'x':\n return 24\n break;\n case 'y':\n return 25\n break;\n case 'z':\n return 26\n break;\n case ',':\n return ','\n break;\n case '!':\n return '!'\n break;\n case '?':\n return '?'\n break;\n case '.':\n return '.'\n break;\n case ' ':\n return ' '\n break;\n case 'á':\n return '1(á)'\n break;\n case 'ã':\n return '1(ã)'\n break;\n case 'ó':\n return '15(ó)'\n break;\n case 'õ':\n return '15(õ)'\n break;\n case 'ô':\n return '15ô'\n break;\n case 'é':\n return '5(é)'\n break;\n case 'ê':\n return '5(ê)'\n break;\n case 'ç':\n return '3(ç)'\n break;\n case ',':\n return ','\n break;\n case '0':\n return 'Num(0)'\n break;\n case '1':\n return 'Num(1)'\n break;\n case '2':\n return 'Num(2)'\n break;\n case '3':\n return 'Num(3)'\n break;\n case '4':\n return 'Num(4)'\n break;\n case '5':\n return 'Num(5)'\n break;\n case '6':\n return 'Num(6)'\n break;\n case '7':\n return 'Num(7)'\n break;\n case '8':\n return 'Num(8)'\n break;\n case '9':\n return 'Num(9)'\n break;\n default:\n return 404;\n }\n })\n\n return myArray\n }", "function multiplesArray(letter) {\n var arrLetter = letter.split(\"\");\n var newLetter = \"\";\n\n for (var i = 0; i < arrLetter.length; i++) {\n if (arrLetter[i] !== arrLetter[0]) {\n newLetter += \"-\";\n }\n for (\n var j = 0; j < arrLetter[i].length + arrLetter.indexOf(arrLetter[i]); j++\n ) {\n newLetter += `${arrLetter[i]}`;\n }\n }\n return newLetter \n}", "function mutationArr(arr) {\n\t//let firstArr = arr[0].toLowerCase().split();//cant call split on arr el\n\tlet firstArr = arr[0].toLowerCase();\n\tlet secondArr = arr[1].toLowerCase();\n\tfor(let letter = 0;letter<secondArr.length;letter++) {\n\t\tif(firstArr.indexOf(secondArr[letter]) === -1) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function letterChanges(str) {}", "function letterChanges(str) {}", "function letterChanges(str) {}", "function substitution(input, alphabet, encode = true) {\n//if there is no alphabet passed in, return false\n if (!alphabet) return false;\n //if the length of the alphabet passed in is greater than or less than 26, return false \n if(alphabet.length !== 26) return false; \n\n//create empty array to hold letters in alphabet \n const duplicate = [] \n //using for in to loop through each character in the alphabet string \n for(let character in alphabet) {\n//looking at duplicate array. If the character is not present in the array, this will return an index of -1. If so, then push this letter into array.\n if(duplicate.indexOf(alphabet[character]) < 0) { \n duplicate.push(alphabet[character])\n }\n //if the indexOf returns a value that is > -1 (meaning that the letter is already present and thus a duplicate), return false.\n else { \n return false\n }\n }\n\n\n let abc = \"abcdefghijklmnopqrstuvwxyz \".split('') //capturing abc's in a variable as an array of individual characters using the split method. Includes intentional space.//Splitting our abc to loop over it. Creates an array of individual characters. \n let altAbc = [...alphabet, \" \"]; //includes space to alternative abc.\n let lowerCaseInput = input.toLowerCase().split('') //taking input passed into function and making it all lowercase so that we don't have to worry about capital letters.//Splitting our lowerCaseInput to loop over it. Creates an array of individual characters. \n \n \n \n if (encode === true) { //if we are encoding\n return lowerCaseInput.map((letter) => { //We map over array of letters to create new array with results of the callback fn\n return altAbc[abc.indexOf(letter)] //Accessing altAbc array(ie: if altAbc = xoyqmcgrukswaflnthdjpzibev, then altAbc[0] is \"x\". Returning the element in altAbc array at the position of the index of the letter in the abc array.\n }).join('') //bringing individual characters back together\n }\n else { //If we are decoding\n return lowerCaseInput.map((letter) => { //We map over array of letters to create new array with results of the callback fn\n return abc[altAbc.indexOf(letter)] //Accessing altAbc array(ie: if abc = \"abcdefghijklmnopqrstuvwxyz \", then abc[0] is \"a\". Returning the element in abc array at the position of the index of the letter in the altAbc array.\n }).join('') //bringing individual characters back together\n }\n }", "function letterCheck(arr) {\n return [...arr[1].toLowerCase()].every(el => arr[0].toLowerCase().includes(el));\n\n}", "fillAlpha(arr) {\n\t\tconst alpha = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(''),\n\t\tstart = alpha.indexOf(arr[0]),\n\t\tend = alpha.indexOf(arr[arr.length-1]),\n\t\tfullAlpha = alpha.slice(start, end + 1);\t\t\n\n\t\treturn fullAlpha;\n\t}", "function mutation(arr) {\n return arr[1].toLowerCase() //second string is lower cased\n .split('') // the string is converted to array of string characters\n .every(function(letter) { // array. every method passes each string character of the array to the function\n return arr[0].toLowerCase() // the first string is lowercased\n .indexOf(letter) != -1; // and string.indexOf method is used to check is there is no match. if this check return false, then fucntion returns false\n });\n}", "function LetterChanges(str) { \n\t\tstr = str.split('');\n\t\n\t\tvar offArr = [];\n\t\tfor(var i = 0; i < str.length; i++){\n\t\t\tif(str[i] !== \"z\"){\n\t\t\toffArr.push(str[i + 1]);\n\t\t\t}else{\n\t\t\t\toffArr.push(\"a\")\n\t\t\t}\n \t\tswitch(offArr[i]) {\n case 'a': case 'e': case 'i': case 'o': case 'u':\n offArr[i] = offArr[i].toUpperCase();\n }\n }\n offArr = offArr.join('')\n return offArr; \n}", "function mutation(arr) {\n const word = arr[0].toLowerCase();\n const letters = arr[1].toLowerCase().split(\"\");\n return letters.every((l) => word.includes(l));\n}", "function mutation(arr) {\r\n \r\n str = arr[0].toLowerCase();\r\n pattern = arr[1].toLowerCase();\r\n \r\n// \tfor (i=0; i < pattern.length; i++) {\r\n// if (str.indexOf(pattern[i]) === -1) {arr = false; break;} else {arr = true;}\r\n// } \r\n\r\n for (var character of pattern) {\r\n if (str.indexOf(character) === -1) {arr = false; break;} else {arr = true;}\r\n//\t\t\tif (str.search(character) === -1) {arr = false; break;} else {arr = true;}\r\n//\t\t\tif (str.includes(character) === false) {arr = false; break;} else {arr = true;}\r\n \t} \r\n \r\n return arr;\r\n}", "function mutation(arr) {\n return arr[1].toLowerCase()\n .split('')\n .every(function(letter) {\n return arr[0].toLowerCase()\n .indexOf(letter) != -1;\n });\n}", "function consec(strArr, k ) {\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 pickLetter(arrLong) {\n var arrTwo = '';\n var tmp;\n for (var i = 0; i < arrLong.length; i++) {\n if (arrLong[i].length >= 2 && typeof (arrLong[i]) === \"string\") {\n tmp = arrLong[i];\n arrTwo = arrTwo + tmp[0] + tmp[1];\n }\n else {\n continue;\n }\n } return arrTwo;\n}", "function mutation(arr) {\n\n var str2 = arr.splice(1).toString().toLowerCase();\n var str1 = arr.toString().toLowerCase();\n for(var i = 0; i < str2.length; i++) {\n if (str1.indexOf(str2.charAt(i)) == -1) {\n return false;\n }\n }\n return true;\n}", "function react(letters) {\n const stack = [];\n for (let char of letters.split(\"\")) {\n const top = stack[stack.length - 1];\n if (top && top.toLowerCase() === char.toLowerCase() && top !== char) {\n stack.pop();\n } else {\n stack.push(char);\n }\n }\n return stack.length;\n}", "updateWordMap(word, wordMap, letter) {\n for (let i = 0; i < word.length; i++) {\n if (word[i] === letter) {\n wordMap[i] = letter;\n }\n }\n return wordMap;\n }", "function wrongChar (input) {\n wrongArr.unshift(`${input}`)\n console.log(`The letter ${input} has been added to wrongArr`) \n}", "function mutation(arr) {\n var str1 = arr[0].toLowerCase(); // to lowercase\n var str2 = arr[1].toLowerCase();\n\n\n // loop at each char in str2\n for (var i = 0; i < str2.length; i++) {\n // condition: check if the char on str2[i] exist on str1 using indexOf\n if (str1.indexOf(str2[i]) === -1)\n return false;\n }\n return true;\n}", "handleChange(i, event) {\n let values = [...this.state.values];\n values[i] = event.target.value.toUpperCase();\n\n this.setState({\n values: values\n });\n\n // converting arrays\n const fullChars = this.state.words.join(\"\").split(\"\");\n const usedChars = values.join(\"\").split(\"\");\n\n const copy = [...usedChars];\n\n let allowedChars = [];\n\n for (let i = 0; i < fullChars.length; i++) {\n let index = copy.indexOf(fullChars[i]);\n if (index === -1) {\n allowedChars.push(fullChars[i]);\n } else copy.splice(index, 1);\n }\n\n this.setState({\n allowedChars: allowedChars\n });\n\n // helper function to get nth index of a character that exists multiple times\n Array.prototype.nthIndexOf = function(e, n) {\n var index = -1;\n for (var i = 0, len = this.length; i < len; i++) {\n if (i in this && e === this[i] && !--n) {\n index = i;\n break;\n }\n }\n return index;\n };\n\n // helper function to count number of characters in specific array\n function countInArray(array, what) {\n return array.filter(item => item === what).length;\n }\n\n const charGreyedCopy = [...this.state.charGreyedFull];\n const mappedChars = [];\n\n // iterating over used characters and updating greyed out character array\n usedChars.forEach(char => {\n let charIndex;\n let count = countInArray(mappedChars, char);\n\n if (!mappedChars.includes(char)) {\n charIndex = fullChars.indexOf(char);\n } else {\n charIndex = fullChars.nthIndexOf(char, count + 1);\n }\n\n mappedChars.push(char);\n\n charGreyedCopy[charIndex] = true;\n });\n\n this.setState({ charGreyed: charGreyedCopy });\n }", "function a(e){var t,i=e?e.indexOf(\"!\"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}", "function mutation(arr) {\n var str = arr[0].toLowerCase();\n var charChk = arr[1].toLowerCase();\n for (var pos = 0; pos <= charChk.length;) {\n if (str.indexOf(charChk) !== -1) { // Checks whether the entirety of charChk exist as is in str\n return true\n }\n else if (str.indexOf(charChk[pos]) !== -1) { //Checks for occurances for each index individually, only incrementing to the next position if an occurance is found\n pos++ // Only incrememnts if an occurance is found\n }\n else if (pos == charChk.length) {\n return true //If the position reaches the full length arr[1] then an occurance of all items were found and a true statement is returned\n }\n else {\n return false\n }\n }\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}", "function replaceLetter(letter){\n var str = currentWordChosen;\n var indices = [];\n for(var i=0; i<str.length;i++) {\n if (str[i] === letter) indices.push(i);\n }\n //console.log(indices);\n if(indices.length == 0){\n return -1;\n }\n for(var key in indices){\n var index = indices[key];\n guessedWordSoFar[index] = letter;\n }\n\n //console.log(guessedWordSoFar);\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 mutation(arr) {\n\tvar first = arr[0].toLowerCase(); \n\tvar second = arr[1].toLowerCase(); \n\tvar fLength = first.length-1; \n\tvar sLength = second.length-1\n\tvar swtch = false;\n\n\tfor (var i = 0; i <= fLength; i++){ \n\t\tfor (var c = 0; c <= sLength; c++){ \n\t\t\tif (first.indexOf(second[c]) !== -1){\n\t\t\t\tswtch = true;\n\t\t\t}\n\t\t\telse{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\nreturn swtch;\n}", "function checkLetters(letter) {\n\n\tvar lettersInWord = false;\n\tvar letter = event.key;\n\n\t// Check if a letter exists insidethe array at all\n\tfor (var i = 0; i < underscores; i++) {\n\t\t\n\t\tif (word[i] === letter) {\n\t\t\tconsole.log('word[i] ' + word[i])\n\t\t\tlettersInWord = true;\n\t\t}\n\t}\n// If the letter exists in the word, find which index\n\tif (lettersInWord) {\n\t\t\n\t\tfor (var j = 0; j < underscores; j++) {\n\t\t//Populate the blanksAndSuccesses with every correct letter.\n\t\t\tif (word[j] === letter) {\n\t\t\t// This is where the specfic space in blanks is set and letter is equal to the letter when there is a match.\n\t\t\tblanksAndSuccesses[j] = letter;\n\t\t\t}\n\t\t}\t\n\t}\n\t\n\telse {\n\t\twrongLetter.push(letter);\n\t\tguesses--;\n\t}\n}", "function lettersWithStrings(arr, str) {\n var words = []\n for(var i = 0; i < arr.length; i++){\n if(arr[i].indexOf(\"!\") !== -1) {\n \n words.push(arr[i])\n }\n }\n return words\n}", "function mutation(arr) {\n var arg1 = arr[0].toLowerCase(),\n arg2 = arr[1].toLowerCase();\n\n for (var i = 0; i < arg2.length; i++) {\n \n var letter = arg2.charAt(i);\n\n if (arg1.indexOf(letter) === -1) {\n return console.log(false);\n }\n\n }\n return console.log(true);\n}", "function answerArray(word) {\n var ansArray = [];\n for (var i = 0; i < word.length; i++) {\n ansArray.push(\"_\");\n }\n return ansArray;\n}", "function mutation(arr) {\n\n // extract first str item, lowercase\n let strFirst = arr[0].toLowerCase();\n console.log(strFirst);\n\n // extract second str item, lowercase\n let strSecond = arr[1].toLowerCase();\n console.log(strSecond);\n\n // convert second str item into array of letters\n let arrSecond = strSecond.split('');\n console.log(arrSecond);\n\n // loop through array of letters from second str\n for (let i=0; i<arrSecond.length; i++) {\n let boolFoundLetter = strFirst.includes(arrSecond[i]);\n console.log(boolFoundLetter);\n\n // if letter from second str missing from first str,\n // return false\n if (boolFoundLetter==false) {\n return false;\n }\n\n }\n\n // else return true\n return true\n}", "function generateArray(realString) {\n\n\t// This array acts as the keyframe array and will be returned at the end of the function.\n\tvar strArray = Array();\n\n\t// Position will keep track of the number of \"correctly\" typed letters\n\tvar position = 0;\n\n\twhile (position != realString.length) {\n\n\t\t// 1 in 7 probability of making a typo\n\t\tif (Math.floor(Math.random() * 7) == 1) {\n\n\t\t\t// If it decides to make a typo, it will next\n\t\t\t// decide the number of typos it will make in a row.\n\t\t\t// The maximum number of typos has been set to 2.\n\t\t\tvar typoCount = Math.floor(Math.random() * 2) + 1;\n\n\t\t\tfor (let i = 0; i < typoCount; i++) {\n\n\t\t\t\tvar randomAlpha = alphabet[Math.floor(Math.random() * alphabet.length)];\n\n\t\t\t\t// If the random alphabet corresponds to the actual correct letter, we will\n\t\t\t\t// choose until it doesn't.\n\t\t\t\twhile (randomAlpha == realString[position]) {\n\t\t\t\t\trandomAlpha = alphabet[Math.floor(Math.random() * alphabet.length)];\n\t\t\t\t}\n\n\t\t\t\t// Push the alphabet onto the keyframe array\n\t\t\t\tstrArray.push(randomAlpha);\n\t\t\t}\n\n\t\t\t// Determine the number of backspaces needed to remove the typos\n\t\t\tvar tmpStr = \"\";\n\t\t\tfor (let i = 0; i < typoCount; i++) {\n\t\t\t\ttmpStr += \"<\";\n\t\t\t}\n\n\t\t\t// Push the backspaces onto the keyframe array\n\t\t\tstrArray.push(tmpStr);\n\n\t\t\t// NOTE the backspaces are not pushed individually as characters, but as a string. This\n\t\t\t// is to allow for more realistic timing of removing characters\n\t\t} else {\n\n\t\t\t// If it is decided that a real character will be typed, push the real character\n\t\t\tstrArray.push(realString[position]);\n\n\t\t\tposition++;\n\t\t}\n\t}\n\n\treturn strArray;\n}", "function LetterChanges(str) {\n\n // First we do a little meta-problem solving by setting up our alpha and newAlpha strings:\n // Each character in alpha has the same index as the character coderbyte wants us to convert it to in newAlpha\n // For instance, since we want all d's in our input string to be converted to e's, and then we want all vowels to be capitalized,\n // we can \"cheat\" a by making alpha[3] equal to \"d\" and newAlpha[3] equal to \"E\".\n var alpha = \"abcdefghijklmnopqrstuvwxyz\";\n var newAlpha = \"bcdEfghIjklmnOpqrstUvwxyzA\";\n\n // Next, we declare a variable to hold our answer\n var answer = \"\";\n\n // After that, we loop through each character in our input string\n for (i = 0; i < str.length; i++) {\n\n // First, we use the indexOf method to check if the current character in our string is contained in alpha.\n // Note that if the string you pass into indexOf isn't found, it will return -1. Otherwise, it will return the index of the first matching character found.\n // For instance, alpha.indexOf(\"c\") returns 2, while alpha.indexOf(\"C\") returns -1.\n if (alpha.indexOf(str[i]) !== -1) {\n\n // If we find the character in the alpha string, we declare a variable to hold the index of the character.\n // Note that this is an unnessary step that I do for the purposes of clarity. See the 2nd function for a faster implementation.\n var index = alpha.indexOf(str[i]);\n\n // Since we set up the characters in alpha to have the same index as the one we want to convert it to in newAlpha,\n // all we have to do is use the charAt method to add the converted character to our answer variable.\n answer += newAlpha.charAt(index);\n\n // If str[i] doesn't appear in alpha...\n } else {\n\n // ...we add it to our answer string, leaving any characters we don't want to change untouched and in the same index in our answer variable as they were in our input string.\n answer += str[i];\n }\n }\n // Finally, we return the variable where we stored our answer.\n return answer;\n\n}", "function allSameVowels (arr)\n{\n\n\n}", "function mutation(arr) {\n //setting the first and seBasic Algorithm Scripting: Mutations\n\nReturn true if the string in the first element of the array contains all of the letters of the string in the second element of the array.\n\nFor example, [\"hello\", \"Hello\"], should return true because all of the letters in the second string are present in the first, ignoring case.\n\nThe arguments [\"hello\", \"hey\"] should return false because the string \"hello\" does not contain a \"y\".\n\nLastly, [\"Alien\", \"line\"], should return true because all of the letters in \"line\" are present in \"Alien\".\n\nRemember to use Read-Search-Ask if you get stuck. Write your own code.cond elements of the arry as first and second respectively\n let first = arr[0];\n let second = arr[1]\n //Making variables lowercase for comparison\n first = first.toLowerCase();\n second = second.toLowerCase();\n//looping through the letters of the second word\n for (let i = 0, n = second.length; i < n; i++) {\n //setting the regex of the ith letter of the second word as patt\n var patt = new RegExp(second[i]);\n //testing the first word for patt\n var res = patt.test(first); \n \n if (res == false) {\n return false;\n }\n \n\n } return true;\n \n}", "function setupAnswerArray(word) {\n \"use strict\";\n var answerArray = [];\n for (var i = 0; i < word.length; i++) {\n answerArray[i] = '_';\n }\n return answerArray;\n}", "function checkLetters(letter) {\n\n\n var letterInWord = false;\n\n for (var i = 0; i < blanks; i++) {\n if (word[i] === letter) {\n letterInWord = true;\n\n }\n }\n\n if (letterInWord) {\n for (var i = 0; i < blanks; i++) {\n if (word[i] === letter) {\n correctLetters[i] = letter;\n }\n\n }\n } else {\n guessesLeft--;\n wrongLetters.push(letter)\n }\n\n\n}", "function mutation(arr) {\n var word1 = arr[0].toLowerCase();\n var word2 = arr[1].toLowerCase();\n //Lowercase both inputs for comparison purposes\n \n for(var i = 0; i < word2.length; i++) {\n /*\n Length of 2nd word is important because\n we are iterating through it's letters to see if they are in word1\n */\n var value = word1.indexOf(word2[i]);\n //Value holder for character\n if(value === -1) {\n //-1 means it's not contained in word1\n return false;\n } \n }\n return true;\n}", "function mutate(arr){\n\tfor(var i in arr){\n\t\tarr[i] = arr[i].toLowerCase();\n\t}\n\n\tfor(var j = 0; j < arr[1].length; j++){\n\t\tif(arr[0].indexOf(arr[1][j]) < 0){\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function dualLetterReduce(t, i, index, arr) {\n const innerT = t;\n if (arr[index] && arr[index + 1]) {\n if (innerT.every((z) => z.word !== `${arr[index]}${arr[index + 1]}`)) {\n innerT.push({ word: `${arr[index]}${arr[index + 1]}`, times: 1 });\n } else {\n const indy = t.findIndex(\n (x) => x.word === `${arr[index]}${arr[index + 1]}`\n );\n innerT[indy].times += 1;\n }\n }\n return innerT;\n }", "function mutation(arr) {\n var set = arr[0].toLowerCase(); //returns hello\n var toCheck = arr[1].toLowerCase(); //returns hey\n\t var splitWord = toCheck.split(\"\"); //returns [\"h\", \"e\", \"y\"]\n for (var i = 0; i < splitWord.length; i++) {\n var check = set.indexOf(splitWord[i]);\n if (check === -1) {\n return false;\n } \n }\n return true;\n}", "function findLetterIndexes(letter) {\n var letterIndexes = [];\n for (var i = 0; i < randomWordArray.length; i++) {\n if (randomWordArray[i] === letter) {\n letterIndexes.push(i);\n }\n }\n replaceDashes(letterIndexes); // returns an array of number indexes like [1, 2, 3]\n }", "function mutation(arr) {\n let arr0 = [];\n let arr1 = [];\n for (let i=0; i<arr[0].length; i++) {\n arr0.push(arr[0][i].toLowerCase());\n }\n for (let i=0; i<arr[1].length; i++) {\n arr1.push(arr[1][i].toLowerCase());\n }\n // console.log(arr0 + arr1);\n for(let i=0; i<arr1.length; i++) {\n if(!arr0.includes(arr1[i])) {\n return false;\n }\n }\n return true;\n // for (let i=0; i<arr[1].length; i++) {\n // if (arr[0].includes(arr[1].substring(i,i+1).ignoreCase)) {\n // return false;\n // }\n // }\n // return true;\n}", "function initAlphaArray() {\n this.length = 26;\n this[0] = \"A\";\n this[1] = \"B\";\n this[2] = \"C\";\n this[3] = \"D\";\n this[4] = \"E\";\n this[5] = \"F\";\n this[6] = \"G\";\n this[7] = \"H\";\n this[8] = \"I\";\n this[9] = \"J\";\n this[10] = \"K\";\n this[11] = \"L\";\n this[12] = \"M\";\n this[13] = \"N\";\n this[14] = \"O\";\n this[15] = \"P\";\n this[16] = \"Q\";\n this[17] = \"R\";\n this[18] = \"S\";\n this[19] = \"T\";\n this[20] = \"U\";\n this[21] = \"V\";\n this[22] = \"W\";\n this[23] = \"X\";\n this[24] = \"Y\";\n this[25] = \"Z\";\n}", "function guessVal(letter, arr){\n if((arr.indexOf(letter) == -1) && letter != undefined){\n arr.push(letter);\n }else{\n console.log('you have already guessed this letter');\n }\n}", "function compareArrays(word, guess, guessarray) {\n for (let i = 0; i < word.length; i++) {\n guessarray.splice(i, i, '_');\n if (guess == word[i]) {\n index = i;\n guessarray.splice(index, index, guess);\n }\n }\n }", "function fillEmptyLetter(){\n\n var underline= [];\n var checkWin = word.length;\n var firstLetterValue;\n for(var i= 0; i <= word.length; i++){\n //get the letter from indice\n firstLetterValue = word.charAt(i);\n //verify the word if contains \n if(firstLetterValue == letter()){\n underline[i]= firstLetterValue;\n //count until the lenght of the word to win\n win = win +1;\n //set goodwords with the good letter\n underline.forEach((value,x ) =>{\n if(value == firstLetterValue){\n goodwords[i]= firstLetterValue;\n }\n \n //if is the same lenght the game is finished\n if(win == checkWin){\n alert('you won the game congratulations!!!, the word was ' + word);\n document.getElementById('restart').click();\n }\n })\n \n }\n }\n}", "function findWord( letters ) {\n // Clone the array for manipulation\n var curLetters = letters.slice( 0 ), word = \"\";\n \n // Make sure the word is at least 3 letters long\n while ( curLetters.length > 2 ) {\n // Get a word out of the existing letters\n word = curLetters.join(\"\");\n \n // And see if it's in the dictionary\n if ( options.dict[ word ] ) {\n // If it is, return that word\n return word;\n }\n \n // Otherwise remove another letter from the end\n curLetters.pop();\n }\n }", "function rotWord(word) {\n var characters = word.split(\"\");\n var newWord = [];\n for (var i = 0; i < characters.length; i++) {\n\n //console.log(letterIndex(characters[i])); // WORKSS!!!!!!!!\n //return letterIndex(characters[i]); why does this not work?\n //console.log(letterIndex(characters[i]) + 13); // adds 13\n //console.log(reverseLetterIndex(letterIndex(characters[i]) + 13)); // works\n newWord.push(reverseLetterIndex(letterIndex(characters[i]) + 13));\n }\n newWord = newWord.join(\"\");\n return newWord;\n}", "function gameToArray() {\n currentLocation = 0;\n gameArray = gameCopy.textContent.split('');\n currentLetter = gameArray[currentLocation];\n}", "missingLetters(arr) {\n\t\tlet missing = [], \n\t\tunicode = arr.map((letter) => {\n\t\t\treturn letter.charCodeAt();\n\t\t});\n\n\t\tfor(let i = 0; i < unicode.length; i++){\n\t\t\tif(unicode[i + 1] - unicode[i] > 1){\n\t\t\t\tmissing.push(String.fromCharCode(unicode[i] + 1));\n\t\t\t}\n\t\t}\n\n\t\treturn missing\n\t}", "function mutation(arr) {\n var arrOneStr = arr[0].toLowerCase(); // Transform everything to lower case\n var arrTwoStr = arr[1].toLowerCase(); // Transform everything to lower case\n \n arrOneStr = arrOneStr.split(''); // Split string into an array of every character\n arrTwoStr = arrTwoStr.split(''); // Split string into an array of every character\n \n return arrTwoStr.every(((x) => arrOneStr.indexOf(x) > -1)); // If a character isnt found, return false\n}", "function sol(chars) {\n let indexRes = 0;\n let index = 0;\n while (index < chars.length) {\n const cur = chars[index];\n let count = 1;\n while (index + 1 < chars.length && chars[index + 1] === cur) {\n index++;\n count++;\n }\n chars[indexRes] = cur;\n indexRes++;\n index++;\n if (count === 1) continue;\n for (let c of String(count).split(\"\")) {\n chars[indexRes] = c;\n indexRes++;\n }\n }\n return indexRes;\n}", "function substitution(input, alphabet, encode = true) {\n // your solution code here\n const reference = \"abcdefghijklmnopqrstuvwxyz\";\n let result = false;\n if(!alphabet || alphabet.length < 26 || alphabet.length > 26) {\n return result;\n }\n \n for(let i = 0; i < alphabet.length ; i++) {\n const char = alphabet[i];\n if(alphabet.indexOf(char) !== alphabet.lastIndexOf(char)) return result;\n }\n \n if(encode){\n result = \"\";\n for(let i = 0; i < input.length; i++){\n const character = input[i].toLowerCase();\n if(character === \" \") result += character;\n else {\n const index = reference.indexOf(character);\n result += alphabet.charAt(index)\n }\n }\n }\n else {\n result = \"\";\n for(let i =0; i < input.length; i++){\n const character = input[i];\n if(character === \" \") result += character;\n else {\n const index = alphabet.indexOf(character);\n result += reference.charAt(index);\n }\n }\n }\n return result; \n }", "function mutation(arr) {\r\n var test = arr[1].toLowerCase();\r\n var target = arr[0].toLowerCase();\r\n for (let index = 0; index < test.length; index++) {\r\n if (target.indexOf(test[index]) == -1)\r\n return false;\r\n }\r\n return true;\r\n}", "function underscore(){\n\tarrayU=[null];\n\tfor (var i=0; i<ChosenWord.length; i++)\n\t{\n\t\tarrayU[i] = \"_\";\n\t}\n}", "function ChangeWrong(){\r\n Wrong = \"\";\r\n for (x=0; x<WrongLetters.length;x++){\r\n Wrong = Wrong + WrongLetters[x] + \" \";\r\n }\r\n}", "function duplicatonsFree(t) {\n\n\tvar duplicationFreeArr = [];\n\ttext = t.toLowerCase();\n\n\tif(text && text.length) duplicationFreeArr = text.match(/[A-Za-z]+/g);\n\tlet x = (names) => names.filter((v,i) => names.indexOf(v) === i);\n\n\tduplicationFreeArr = x(duplicationFreeArr);\nconsole.log(duplicationFreeArr.length);//remove it\n\treturn duplicationFreeArr;\n\n}", "function mutation(arr) {\n\n let str0 = arr[0].toLowerCase();\n let str1 = arr[1].toLowerCase();\n for(var i=0; i<str1.length; i++){\n if(str0.indexOf(str1[i])===-1){\n return false;\n }\n }\n return true;\n\n // function cleanStr(str){\n // let pureStr = \"\";\n // for(var i=0; i<str.length; i++){\n // if(pureStr.indexOf(str[i]) === -1){\n // pureStr+=str[i];\n // }\n // }\n // return pureStr;\n // }\n\n // let str0 = cleanStr(arr[0]).toLowerCase();\n // let str1 = cleanStr(arr[1]).toLowerCase();\n // console.log('this is str0: ', str0);\n // console.log('this is str1: ', str1);\n \n // method I\n // for(var i=0; i<str0.length; i++){\n // if(str1.indexOf(str0[i]) === -1 || str0.indexOf(str1[i]) === -1){\n // return false;\n // }\n // return true;\n // }\n\n // method II\n\n // for(var i=0; i<str0.length; i++){\n // for(var j=0; j<str1.length; j++){\n // if(str0.indexOf(str1[j]) === -1 || str1.indexOf(str0[i]) === -1){\n // return false;\n // }\n // }\n // return true;\n // }\n}", "function substitution(input, alphabet, encode = true) {\n // your solution code here\n\n let normAlphabet = \"abcdefghijklmnopqrstuvwxyz\";\n\n //if no alphabet parameter is given, or its over or under 26\n if (!alphabet || alphabet.length != 26) return false;\n\n //check to see if the alphabet contains only unique letters\n //loops through twice, the first loop char will check to see if it\n //equals the second loop char, if it does then false is returned\n for (let i = 0; i < alphabet.length; i++) {\n for (let j = i + 1; j < alphabet.length; j++) {\n if (alphabet[i] === alphabet[j]) {\n return false;\n }\n }\n }\n\n //makes sure that the input is all lowercase, ignoring capitalization\n let lowCaseInput = input.toLowerCase();\n //create array from string\n let inputArr = Array.from(lowCaseInput);\n let codeAlphabet = Array.from(alphabet);\n let encodingArr = [];\n\n if (encode) {\n //go trough input and for each letter find equivalent in the normal alphabet, and then based on number from indexOf find its equivalent in the coded alphabet\n let newArr = [];\n for (let i = 0; i < lowCaseInput.length; i++) {\n if (inputArr[i].match(/[a-z]/)) {\n let normalAlphabetIndex = normAlphabet.indexOf(lowCaseInput[i]);\n newArr.push(alphabet[normalAlphabetIndex]);\n } else {\n newArr.push(lowCaseInput[i]);\n }\n }\n return newArr.join(\"\");\n } else if (!encode) {\n let newArr = [];\n for (let i = 0; i < lowCaseInput.length; i++) {\n if (inputArr[i] == \" \") {\n newArr.push(lowCaseInput[i]);\n } else {\n let codeAlphabetIndex = alphabet.indexOf(lowCaseInput[i]);\n newArr.push(normAlphabet[codeAlphabetIndex]);\n }\n }\n return newArr.join(\"\");\n }\n }", "function processWord(word) {\n var cipheredWord = []; // must be initialized as an array or it won't work\n var letters = word.split(\"\");\n\n for(var i = 0; i < letters.length; i++) {\n cipheredWord.push(reverseLetterIndex(letterIndex(letters[i]) + 13));\n }\n cipheredWord = cipheredWord.join(\"\");\n\n\n return cipheredWord;\n}", "function squashLettersTogether(acc, currentString, array){\n if (array.length === 0) {\n acc.push(currentString)\n return acc\n }\n else {\n var element = array.shift();\n if (element === currentString[0]) {\n var newString = currentString.concat(element);\n return squashLettersTogether(acc, newString, array)\n }\n else {\n acc.push(currentString)\n return squashLettersTogether(acc, element, array)\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 arrayWord(word) {\n var arrayWord = [];\n for (i = 0; i < word.length; i++) {\n arrayWord.push(word[i]);\n }\n return arrayWord;\n }", "function input(word){\n // Call matchChar on each letter\n word.forEach(letter => matchChar(letter));\n}", "function replaceDashes(letterIndexes) {\n //we have two arrays - [ - - - - - - ] and [1, 2, 3]\n //we want to get the number out of the letterIndexes array and use it as the index in the word array\n //we only want to check if there are numbers in our indexes array\n if (letterIndexes.length !== 0) {\n //get the first value in the letterIndexes\n for (var i = 0; i < letterIndexes.length; i++) {\n var letterToReplace = letterIndexes[i];\n //use that index to replace the letter in the dashes array\n dashes[letterToReplace] = letter;\n }\n } else {\n wrongGuesses++;\n wrongGuessArray.push(letter);\n $(\"#wrongGuesses\").text(wrongGuessArray.join(\" \"));\n $(\"#guesses\").show();\n }\n //print out the secret word with any guessed letters replaced\n $(\"#secretWord\").text(dashes.join(\" \"));\n //check to see if the game is over\n isGameOver();\n }", "function letterCheck(letter) {\n if (lettersArray.indexOf(letter.key) > -1) {\n correctLetterCheck(letter);\n }\n}", "function manipulateName(name) {\n\tvar joinName = name.join('').toUpperCase();\n\tconsole.log(joinName);\n\n\tvar joinName = name.join('').toUpperCase();\n\tvar letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\n\tvar acc = 0;\n\tvar emptyArr = [];\n\n\tfor (var i = 0; i < letters.length; i++) {\n\t\tvar match = joinName.indexOf(letters[i]);\n\t\t//console.log(letters[i] + ' ' + match);\n\t\tif (match > -1) {\n\t\t\t//console.log('La letra ' + letters[i] + ' se repite ' + acc + ' veces');\n\t\t\temptyArr.push(letters[i])\n\t\t}\n\t}\n\tconsole.log(emptyArr);\n\n\tfor (var i = 0; i < emptyArr.length; i++) {\n\t\tvar repeat = 0;\n\t\tfor (var j = 0; j < joinName.length; j++) {\n\t\t\tif (emptyArr[i] === joinName[j]) {\n\t\t\t\trepeat++;\n\t\t\t}\n\t\t}\n\t\tconsole.log('la letra ' + emptyArr[i] + ' se repite ' + repeat);\n\t}\n}", "function LetterChanges(str) {\n\tvar ltrs = \"abcdefghijklmnopqrstuvwxyz\";\n\tvar ltrArr = ltrs.split('');\n\tvar vowels = 'aeiou';\n\tvar vowelArr = vowels.split('');\n\tvar strArr = str.toLowerCase().split('');\n\tvar newStr = [];\n\n\tfor (var i = 0; i < strArr.length; i++) {\n\t\tfor (var j = 0; j < ltrArr.length-1; j++) {\n\t\t\tif (strArr[i] == ltrArr[j]) {\n\t\t\t\tfor (var n = 0; n < vowelArr.length; n++) {\n\t\t\t\t if (ltrArr[j+1] == vowelArr[n]) {\n\t\t\t\t newStr.push(vowels.toUpperCase().split('')[n]);\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tif (newStr.length != (i+1)) { \n\t\t\t newStr.push(ltrArr[j+1]);\n\t\t\t\t}\n\t\t\t\t \n\t\t \t\n\t\t\t}\n\t\t\telse if (strArr[i] == ltrArr[ltrArr.length-1]) {\n\t\t\t newStr.push(vowels.toUpperCase().split('')[0]);\n\t\t\t break;\n\t\t\t}\n\t\t}\t\n\t\tif (newStr.length != (i + 1)) {\n\t\t newStr.push(strArr[i]);\n\t }\n\t}\n\n\tstr = newStr.join('');\n\treturn str;\n}", "function mutation(arr) {\n let x = arr[1].split('');\n let count =0;\n arr[0] = arr[0].toLowerCase();\n for (let i of x){\n if(arr[0].includes(i.toLowerCase())){\n count++;\n }\n }\n if (count == arr[1].length){\n return true\n }\n return false;\n}", "function LetterChanges(str) {\r\n let strArr = str.toLowerCase().split(\"\");\r\n strArr = strArr.map(x => {\r\n // if((x >= 'a' && x <= 'z') || (x >= 'A' && x <= 'Z')){\r\n if (\r\n (x.charCodeAt() >= 65 && x.charCodeAt() <= 90) ||\r\n (x.charCodeAt() >= 97 && x.charCodeAt() <= 122)\r\n ) {\r\n if (x === \"z\") {\r\n return \"a\";\r\n }\r\n return String.fromCharCode(x.charCodeAt() + 1);\r\n }\r\n return x;\r\n });\r\n\r\n let vowel = \"aeiou\";\r\n\r\n let result = strArr\r\n .map(x => (vowel.includes(x) ? x.toUpperCase() : x))\r\n .join(\"\");\r\n\r\n // code goes here\r\n return result;\r\n}", "function LetterChanges(str) { \n\n // code goes here \n \n let expectedRes = str.split('')\n let res = [];\n let regExp = ''; \n let vowels = 'aeiou'\n \n expectedRes.forEach(function(item, index){\n if (item.match('^[a-zA-Z]')){\n res[index] = String.fromCharCode(item.charCodeAt()+1)\n regExp += vowels.includes(res[index].toLowerCase()) ? res[index].toUpperCase(): res[index]\n }else{\n res[index] = item\n regExp += item\n }\n \n })\n \n return regExp; \n \n }", "function solve2(arr) {\n let arr2 = arr.map(ele => ele.toLowerCase());\n let alphabet = 'abcdefghijklmnopqrstuvwxyz';\n let returnArry = [];\n for (let idx = 0; idx < arr2.length; idx++) {\n let count = 0;\n for (let idx2 = 0; idx2 < arr2[idx].length; idx2++) {\n if (idx2 === alphabet.indexOf(arr2[idx][idx2])) {\n count++; \n }\n }\n returnArry.push(count);\n }\n return returnArry;\n}", "function checkLetters(letter) {\n var lettersInChosenWord = false;\n\n // checks if the selected letter exists within the array\n for (var i = 0; i < numBlanks; i++) {\n if (selectedWord[i] === letter) {\n lettersInChosenWord = true;\n };\n }\n // IF LETTER EXIST, POPULATE THE BLANKSANDSUCCESS ARRAY\n if (lettersInChosenWord) {\n for (var j = 0; j < numBlanks; j++) {\n if (selectedWord[j] === letter) {\n blanksAndSuccess[j] = letter;\n }\n }\n // LETTER WASNT FOUND\n } else {\n wrongLetters.push(letter);\n guessesLeft--;\n }\n // TEST/ DEBUGGING\n // console.log(letter)\n // console.log(blanksAndSuccess);\n}", "function mutation2(arr) {\n var haystack = arr[0].toLowerCase();\n var needle = arr[1].toLowerCase();\n \n for (let i = 0, needleLen = needle.length; i < needleLen; i++) {\n if (haystack.indexOf(needle[i]) < 0) {return false;}\n }\n return true;\n}", "function genCharArray() {\n //Clear the array of prior use.\n passwordArray = [];\n\n if (document.getElementById(\"charType0\").checked) {\n passwordArray = passwordArray.concat(lowerCaseArray);\n }\n if (document.getElementById(\"charType1\").checked) {\n passwordArray = passwordArray.concat(upperCaseArray);\n }\n if (document.getElementById(\"charType2\").checked) {\n passwordArray = passwordArray.concat(numericArray);\n }\n if (document.getElementById(\"charType3\").checked) {\n passwordArray = passwordArray.concat(specialCharArray);\n }\n displayPasswordResults();\n}", "function fearNotLetter(str) {//0 al 25 //chartCodeAt?\r\nlet abc='abcdefghijklmnopqrstuvwxyz'\r\nlet start=abc.indexOf(str[0])\r\nlet miss=abc.slice(start)\r\n//console.log(abc[start])\r\n//al final del array sera el inicio mas el final\r\nfor(let i= start; i< start+str.length; i++){\r\n //console.log(abc[i])\r\n //recorremos el string y cuando encuentra una diferencia, entre nuestra variable abc y el indice del str - el comienzo (18 para la s), nos retorna el elemento que falta\r\n if(abc[i] !=str[i - start]){\r\n return abc[i]\r\n };\r\n}\r\n}", "function mutation(arr) {\n let tracker;\n\n arr = arr.map((item) => {\n return item.toLowerCase();\n });\n\n const newArr = arr[1].split('');\n\n for (let i = 0; i < newArr.length; i++) {\n if (arr[0].indexOf(newArr[i]) >= 0) {\n tracker = true;\n }else {\n tracker = false;\n }\n }\n console.log('tracker', tracker);\n return tracker;\n}", "determineAvailableLetters(){\n let alphabet_string = 'abcdefghijklmnopqrstuvwxyz'\n let alphabet_array = alphabet_string.toUpperCase().split('')\n let available_letters = []\n\n if(this.props.chosen_letters.length > 0){\n for(let i = 0; i < alphabet_array.length; i++){\n if(!this.props.chosen_letters.includes(alphabet_array[i])){\n available_letters.push(alphabet_array[i])\n }\n }\n this.setState({\n available_letters: available_letters\n })\n } else {\n this.setState({\n available_letters: alphabet_array\n })\n }\n }", "function mutation(arr) {\r\n\tvar left = arr[0].toLowerCase();\r\n\tvar right = arr[1].toLowerCase();\r\n\tfor (var i = 0; i < right.length; i++) {\r\n\t\tvar re = RegExp(right[i]);\r\n\t\tif (left.match(re) === null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function findMissingLetter(tempArr)\r\n {\r\n let arr2 = tempArr.join('');\r\n for(let i = 0; i < arr2.length ; i++){\r\n if(arr2.charCodeAt(i+1) - arr2.charCodeAt(i) !== 1 ){\r\n return String.fromCharCode(arr2.charCodeAt(i) + 1);\r\n }}\r\n return arr2;\r\n }", "function repeatedLetter() {\n\n}", "function mutation(arr) {\n let arr1 = arr[0];\n let arr2 = arr[1];\n\n arr1.forEach((e, i) => {\n arr2.includes(e.toLowerCase())\n });\n\n return arr;\n}", "function longWord(array) {\n return array;\n}", "function check(letter) {\n \n if (guessedLetters.indexOf(letter) === -1) {\n guessedLetters.push(letter);\n \n if (ansWord.indexOf(letter) === -1) {\n numGuessesRemaining--;\n \n if (numGuessesRemaining <=3) {\n document.getElementById(\"numGuesses\").style.color = \"#fff\";\n }\n \n } else { \n for (var i = 0; i < ansWord.length; i++) {\n if (letter === ansWord[i]) {\n ansWordArr[i] = letter;\n } \n } \n }\n }\n\n}", "function referenceArray(stringName) {\n switch(stringName) { \n case 'kicks':\n return kicks;\n case 'snares':\n return snares\n case 'hiHats':\n return hiHats;\n case 'rideCymbals':\n return rideCymbals;\n default:\n return null; \n }\n}", "function flatArr() {\n var toArr = [];\n for (var i = 0; i < chosenWord.length; i++) {\n if(/[a-zA-Z0-9]/.test(chosenWord[i])) {\n toArr.push(chosenWord[i]);\n }\n }\n turnCount = toArr.length;\n}", "function checkLetters(input) {\n var isLetterInWord = false;\n for (var i = 0; i < numEmpty; i++) {\n if (lettersInMovie.indexOf(input) > -1) {\n isLetterInWord = true;\n }\n }\n if (isLetterInWord) {\n for (var i = 0; i < numEmpty; i++) {\n if (lettersInMovie[i] == input) {\n answer[i] = input;\n\n }\n }\n }\n else {\n guesses--;\n guessedLetters.push(input);\n document.getElementById(\"guesses\").innerHTML = guesses;\n document.getElementById(\"guessed-letters-list\").innerHTML = guessedLetters;\n }\n}", "function lettersWithStrings(data, str) {\r\n let array = []\r\n for (let i = 0; i < data.length; i++){\r\n if (data[i].includes(str)){\r\n array.push(data[i])\r\n }\r\n } \r\n return array\r\n }", "function letterInWord(letter) {\n // the array that will contain the char positions in the currentWord that has the\n var positions = new Array();\n for (i = 0 ; i < currentWord.length; i++) {\n if (currentWord[i] === letter)\n positions.push(i);\n }\n return positions;\n }", "function replaceLetter(letter)\n{\n\tvar j = targetWordArray.indexOf(letter);\n\tdisplayWord.splice(j, 1, letter);\n}", "function makeArray(word) {\n var word_array = [];\n for (var i = 0; i < word.length; i++) {\n word_array.push(word.charAt(i));\n }\n return word_array;\n }", "function sameChar(arr){\r\n let string = '';\r\n for(i = 0; i < arr.length; i++)\r\n string += arr[i].innerText;\r\n \tlet str = new RegExp(string[0], 'g');\r\n \tif(string.length === 3 && !string.replace(str,''))\r\n return true\r\n \treturn false\r\n }" ]
[ "0.6582856", "0.65238327", "0.6431768", "0.61395293", "0.613267", "0.6088074", "0.6081125", "0.6080631", "0.6046739", "0.6046739", "0.6046739", "0.6022575", "0.59699434", "0.5954992", "0.59540033", "0.5939402", "0.5933453", "0.59323674", "0.5899911", "0.58680457", "0.58635396", "0.58608496", "0.58492583", "0.5829816", "0.58222705", "0.58212084", "0.5799114", "0.5777922", "0.5759848", "0.5753068", "0.5739871", "0.57256645", "0.57214105", "0.5702987", "0.5670707", "0.56689125", "0.5665766", "0.56599915", "0.56588596", "0.5645409", "0.5640317", "0.5637942", "0.56356347", "0.5625274", "0.56212276", "0.5614357", "0.5613102", "0.56065166", "0.5600011", "0.55988127", "0.55945736", "0.55806834", "0.5573628", "0.55571574", "0.555663", "0.5542476", "0.553665", "0.55348796", "0.5533459", "0.55250686", "0.55197996", "0.55112034", "0.55110973", "0.55084115", "0.55063766", "0.5497069", "0.5496819", "0.5490958", "0.54901403", "0.54900444", "0.5485772", "0.54850125", "0.54848427", "0.5481641", "0.5467255", "0.5465489", "0.54648495", "0.54593676", "0.5457378", "0.54496354", "0.5448586", "0.5434102", "0.54226226", "0.5421274", "0.5421195", "0.5420722", "0.54201925", "0.54168254", "0.5416457", "0.53934443", "0.5391178", "0.5390719", "0.5384129", "0.53730947", "0.53707045", "0.5367915", "0.5365846", "0.5365678", "0.5363718", "0.536369", "0.5363239" ]
0.0
-1
strings are passed in so that actual values of array are not altered
function countDeletions(firstString, secondString) { var firstArray = firstString.split(''); var secondArray = secondString.split(''); // begin deletions counter var deletions = 0; // for every letter in first array for (let i = 0; i < firstArray.length; i++) { // is the letter in first array also in second array? Default: no var common = false; // for every letter in the second array for (let j = 0; j < secondArray.length; j++) { if (firstArray[i] === secondArray[j]) { common = true; // to account for multiple letters secondArray[j] = null; // if a common letter is found, effectively break this for loop j = secondArray.length } } // if letter is not in common, increase the deletions counter if (common === false) { deletions++ } } // return total number of deletions return deletions; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function SwapStringForArrayNegativeVals(arr){\n}", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n var newArr = [];\n for (var i = 0; i < strings.length; i++) {\n newArr.push(modify(strings[i]));\n} return newArr;\n\n\n \n // YOUR CODE ABOVE HERE //\n}", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n \n // inputs an array, containing string. a function that modifies strings, BUT NOT ARRAYS\n //outputs return an array, where all of its contents have been modified individually by the function\n \n //should increment over array strings, taking each value in it and applying the modify function to it, placing the results in a new array\n //should return the new array\n let newArray = [];\n for (let i = 0; i< strings.length; i++){\n newArray.push(modify(strings[i]));\n \n }\n return newArray;\n \n \n // YOUR CODE ABOVE HERE //\n}", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n// Strings is an array of strings\n//Modify is a function that takes a string and returns the string in upper case.\n\n// I need to run the modify function on each string in the array and return an array of modified strings.\n//First we need to create the array for modified strings\n\n \n// we need to loop through the original parameter of strings.\nfor(var i = 0; i <= strings.length -1; i++){\n \n // call modify for each string inside of strings array.\n strings[i] = modify(strings[i]);\n}\n \n \nreturn strings;\n}", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n // we have an array of strings that we need to loop through and apply the modifyStings function through it\n // pass these strings through the moddified function\n var arr = [];\n for(var i = 0; i < strings.length; i++){\n arr.push(modify(strings[i]));\n \n }\n return arr;\n \n \n \n \n // YOUR CODE ABOVE HERE //\n}", "function convertToString()\t{\r\n\tarrayString = prefer.toString();\r\n\t\r\n}", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n //create an empty array to for the modified strings\n var modifiedStrings = [];\n //Use a for loop to iterate through the array\n for (var i = 0; i <= strings.length - 1; i++) {\n // push the modified strings into the empty array \n modifiedStrings.push(modify(strings[i]));\n }\n return modifiedStrings;\n \n // YOUR CODE ABOVE HERE //\n}", "function modifyStrings(strings, modify) {\n // YOUR CODE BELOW HERE //\n //I-array of strings and function\n //O-array of strings, modified\n //C-\n //E-\n //I'll make a variable to hold the new array\n var newStrings = []\n var tempString\n //Ok, ok, so next a loop, I'll use a for loop\n for(let i=0;i<strings.length;i++) {\n //Now I'll modify the string and put it in the new array\n tempString = strings[i]\n tempString = modify(tempString)\n newStrings.push(tempString)\n }\n \n return newStrings\n \n \n // YOUR CODE ABOVE HERE //\n}", "static listArrayAsString(stringArray) {\n // Check if argument is an array\n if (Array.isArray(stringArray)) {\n let arrayItemText = '';\n // Loop through each value of array\n for (let index = 0, arrLength = stringArray.length; index < arrLength; index++) {\n arrayItemText += stringArray[index];\n // If array length is more than 1 and index is NOT the last element\n // If array length is 2, only add ' and '\n // Else: If index is second to last element, add ', and ' Else add ', '\n if (arrLength > 1 && index != arrLength - 1) {\n arrayItemText += (arrLength == 2) ? ' and '\n : (index == arrLength - 2) ? ', and ' : ', ';\n }\n }\n // Return created string\n return arrayItemText;\n } else if (typeof stringArray == 'string') // Else if argument is string, return the same string\n return stringArray;\n }", "function stringfyArray(sa,sb){\n\tvar s = '';\n\tif(sb === undefined){\n\t\tfor(var i = 0; i < sa.length; i++)\n\t\t\ti == 0 ? s = sa[i] : s = s + ',' + sa[i];\n\t}\n\telse if(sb === 'AND' || sb === 'and'){\n\t\tfor(var i = 0; i < sa.length; i++)\n\t\t\ti == 0 ? s = sa[i] : s = s + ' ' + sb + ' ' + sa[i];\n\t}\n\telse if (sa.length != sb.length){\n\t\treturn s\n\t}\n\telse {\n\t\tfor(var i = 0; i < sa.length; i++)\n\t\t\ti == 0 ? s = sa[i] + ' ' + sb[i] : s = s + ',' + sa[i] + ' ' + sb[i];\t\t\n\t}\n\treturn s;\n}", "function fromArrayToString(array, negArray){\n\tvar str = \"\";\n\tvar str2 = \"\";\n\tfor(var i=0; i<array.length; i++){\n\t\tif(array[i] == undefined){\n\t\t\tstr += '_';\n\t\t\tcontinue;\n\t\t}\n\t\tstr += array[i];\n\t}\n\tif(negArray !== undefined){\n\t\tfor(var i=negArray.length-1; i > -1; i--){\n\t\t\tif(negArray[i] == undefined){\n\t\t\tstr2 += '_';\n\t\t\tcontinue;\n\t\t}\n\t\tstr2 += negArray[i];\n\t\t}\n\t}\n\treturn (str2+str);\n}", "apply_array(array, OPEN='[', CLOSE=']', SEPARATOR=',') {\n var str = new ArrayStringifier(OPEN,CLOSE,SEPARATOR)\n return str.apply(array) \n }", "function getArrayValues( string, values ) {\n\n\t\t\tstring = string.split( \" \" ).join( \"\" );\n\n\t\t\tif ( arrayRegex.test( string ) ) {\n\t\t\t\treturn string.match( arrayRegex )[ 1 ].split( \",\" );\n\t\t\t} else {\n\t\t\t\treturn resolveName( string, values );\n\t\t\t}\n\n\t\t}", "_toStringArray(t) {\n if (!Array.isArray(t))\n throw TypeError();\n if (t.some(function(t) {\n return \"string\" != typeof t;\n }))\n throw TypeError();\n return t;\n }", "supportsStringArrayValues() {\n return true;\n }", "function test (input) {\n for (var i = 0; i < input.length; i++) {\n\n if (Array.isArray(input[i])) {\n\n stringifier (input[i]);\n\n }\n \n else {\n \n converter (input[i]);\n \n \n }\n\n }\n \n }", "function stringItUp(arr){\n var newArr = arr.map(function(item){\n return item.toString()\n })\n console.log(newArr)\n}", "function getStringArray(items) {\n // Return empty array if undefined or null\n if (!items) return [];\n // If string, split by commas\n if (typeof items === \"string\") items = items.split(\",\");\n // Trim and convert all to lowercase\n var length = items.length;\n for (var i = 0; i < length; i++) items[i] = $.trim(items[i].toString());\n return items;\n }", "function translateArgs(args, array = false) {\n return (array ? '[' : '(')\n +(args.length\n ? ' '+args.map(arg => translate(arg)).join(', ')+' '\n : ''\n )\n +(array ? ']' : ')');\n\n}", "formatArray() {\n let formattedArray = this.manipulateString().map(y => {\n switch (y) {\n case '':\n return ''\n break;\n case ' ':\n return ' '\n break;\n case ',':\n return ','\n break;\n case \"!\":\n return y\n break;\n default:\n return `[${y}]`\n break;\n }\n }).join(' - ')\n\n return formattedArray\n }", "function argToString(array, strtInd, argName) {\r\n\tvar jS = strtInd, aS = '', ar = array;\r\n\targName=(argName ? argName : 'ar');\r\n\t\r\n\tif (ar.length > jS) {\r\n\t\tfor (var k = jS; k < ar.length; k++) aS += argName+'['+k+'], ';\r\n\t\taS = aS.substring(0, aS.length-2);\r\n\t}\r\n\t\r\n\treturn aS;\r\n}", "function myTagFn(strings, ...values) {\n console.log(strings, strings.raw, values);\n // strings[0] = 'xyz'; // Error: strings is read-only\n}", "function drawStrings(array){\n if(isArgumentArray(array)){\n array.forEach(element => {\n if (element.constructor === Number) {\n console.log(starString(element));\n }\n else if (element.constructor === String) {\n var letter = element[0];\n var size = element.length;\n var answer = \"\"\n for(size; size > 0; size--){\n answer += letter; \n }\n console.log(answer);\n }\n else{\n console.log(\"??????????\");\n }\n });\n }\n}", "function meeting(s) {\n s = s.toUpperCase();\n let sArray = s.split(';')\n console.log(sArray);\n let sArray2 = sArray.join(',')\n// .replace(':', ',')\n// .map(item => `(${item})`)\n console.log(sArray2);\n// let sArray3 = Array.from(sArray2)\n// // let sArray2 = sArray.map(item => `(${item})` )\n// // let sArray3 = new Object(sArray)\n// console.log(sArray3);\nlet sArray3 = sArray2.replace(/:/g, ',')\nconsole.log(sArray3);\n}", "function caml_array_of_string (s) {\n if (s.t != 4 /* ARRAY */) caml_convert_string_to_array(s);\n return s.c;\n}", "function addToArray( val, stringArray, regexArray ){\n\t\t\tvar arr = stringArray;\n\t\t\t\n\t\t\t//if regex, set the value to be the source without capture groups:\n\t\t\tif( isRegExp( val ) ){\n\t\t\t\tarr = regexArray;\n\t\t\t\tval = removeCaptureGroups( val.source );\n\t\t\t}\n\t\t\t//if not string, then return:\n\t\t\telse if( !isString( val ) ) return\n\t\t\t\n\t\t\t//add the value to the array if not already there\n\t\t\tif( arr.indexOf( val ) === -1 ) arr.push( val );\n\t\t}", "function mutation(arr) {\n\n var str2 = arr.splice(1).toString().toLowerCase();\n var str1 = arr.toString().toLowerCase();\n for(var i = 0; i < str2.length; i++) {\n if (str1.indexOf(str2.charAt(i)) == -1) {\n return false;\n }\n }\n return true;\n}", "function changeWinners(winnersArray) {\n winnersArray[0] = 'xyz'\n winnersArray[1] = 'pqr'\n winnersArray[2] = 'jkl'\n}", "function stringItUp(arr){\n return arr.toString()\n}", "function sc_string() {\n for (var i = 0; i < arguments.length; i++)\n\targuments[i] = arguments[i].val;\n return \"\".concat.apply(\"\", arguments);\n}", "function test_arr(s1,s2){\n return [s1,s2];\n}", "function encodeStrings(a) {\n for (let i = 0; i < a.length; i++) {\n const val = a[i];\n if (Array.isArray(val)) {\n encodeStrings(val);\n }\n else {\n a[i] = encodeString(val);\n }\n }\n return a;\n}", "function updateNumberArr() {\n var tempStr = numberArr.join('');\n var tempArr = tempStr.split('~');\n return tempArr;\n}", "function encodeStrings(a) {\n for (let i = 0; i < a.length; i++) {\n const val = a[i];\n if (Array.isArray(val)) {\n encodeStrings(val);\n }\n else {\n a[i] = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"encodeString\"])(val);\n }\n }\n return a;\n}", "function makeStrings(arr){\r\n const result = arr.map(function(num){\r\n return canGoToTheMovies\r\n });\r\n return result;\r\n }", "function consec(strArr, k ) {\n\n}", "function fillArray(array, string) {\n\troleData.forEach(roleThing => {\n\t\tif (roleThing.category.includes(string)) {\n\t\t\tarray.push(roleThing);\n\t\t}});\n}", "function main()\r\n{\r\n integerList=getIntegerList(myArgs);\r\n stringArray=getStringArray(integerList);\r\n printStringArray(stringArray);\r\n}", "function SpecialArray(){\n //Create the array\n var values = new Array()\n values.push.apply(values, arguments);\n\n //assign the method\n values.toPipedString = function (){\n return this.join(\"|\")\n }\n return values;\n}", "function swapStringForArrNegs(arr) {\n for (var idx = 0; idx < arr.length; i++) {\n if (arr[idx] < 0) {\n arr[idx] = 'Dojo!';\n }\n }\n return arr;\n}", "function swapStrNegatives(strArr) {\r\n var length = strArr.length;\r\n for (var i = 0; i < length; i++) {\r\n if (strArr[i] < 0) {\r\n strArr[i] = \"Dojo\"\r\n }\r\n }\r\n console.log(\"\\n\\nSwap String for Negatives: [1, -5, 10, -2]\")\r\n console.log((strArr))\r\n}", "function encodeStrings(a) {\n for (var i = 0; i < a.length; i++) {\n var val = a[i];\n if (Array.isArray(val)) {\n encodeStrings(val);\n }\n else {\n a[i] = util_1.encodeString(val);\n }\n }\n return a;\n}", "function makeArray(values){\n\t\tif(typeof values !== 'undefined'){\n\t\t\tif (!(values instanceof Array)){\n\t\t\t\tif(typeof values === 'string'){\n\t\t\t\t\tif(values.indexOf(' ') >= 0){\n\t\t\t\t\t\tif(((typeof opts !== 'undefined') && (typeof opts.breakIntoLetters !== 'undefined') && opts.breakIntoLetters)){\n\t\t\t\t\t\t\tvalues = values.replace(/([\\s]+)/ig, \"\");\n\t\t\t\t\t\t\tvalues = values.split(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvalues = values.replace(/([!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]+)([^\\s]+)/ig, '$1 $2'); //add space after special characters if there is no space \n\t\t\t\t\t\t\tvalues = values.replace(/([^\\s]+)([!@#$%^&*()_+\\-=\\[\\]{};':\"\\\\|,.<>\\/?]+)/ig, '$1 $2'); //add space before special characters if there is no space\n\t\t\t\t\t\t\tvalues = values.split(\" \");\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\tvalues = values.split(\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(isNumber(values)){\n\t\t\t\t\tvalues = ''+values+'';\n\t\t\t\t\tvalues = values.split(\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tvalues = opts.values.slice(0);\n\t\t}\n\t\t\n\t\treturn values;\n\t}", "function ctResolveArray(str, values)\n{\n\tvar ret = '';\n\tvar type = ctParseType(str);\n\n\twhile (type['len'] !== undefined) {\n\t\tif (isNaN(parseInt(type['len'], 10))) {\n\t\t\tif (typeof (values[type['len']]) != 'number')\n\t\t\t\tthrow (new Error('cannot sawp in non-number ' +\n\t\t\t\t 'for array value'));\n\t\t\tret = '[' + values[type['len']] + ']' + ret;\n\t\t} else {\n\t\t\tret = '[' + type['len'] + ']' + ret;\n\t\t}\n\t\ttype = ctParseType(type['type']);\n\t}\n\n\tret = type['type'] + ret;\n\n\treturn (ret);\n}", "function SpecialArray() {\n var values = new Array();\n\n values.push.apply(values, arguments);\n \n values.toPipedString = function() {\n return this.join(\"|\");\n };\n \n return values;\n}", "function changeTheValue(arrInput, value) {\r\n var key = \"a\";\r\n var indexOfSubarray;\r\n console.log(this);\r\n for (let eachKey in this) {\r\n //when we pass a \"hello\" string into changeTheValue using .call()\r\n //it will be like calling new String(\"hello\"). when we save the returned value of new String(\"hello\"), it will return String(\"hello\");\r\n //each key will be str 0,1,2,3,4\r\n let eachStr = this[eachKey];\r\n console.log(eachStr);\r\n }\r\n arrInput.forEach(function findValue(subarray, index) {\r\n var eachKey = subarray[0];\r\n if (eachKey === key) {\r\n indexOfSubarray = index;\r\n }\r\n });\r\n var mutateSubarray = arrInput[indexOfSubarray];\r\n mutateSubarray[1] = value;\r\n // var [, ourValue] = arrInput[indexOfSubarray];\r\n // ourValue = value;\r\n console.log(arrInput);\r\n}", "function changeCompletely(element, index, array){\n array[index] = `How about ${index} in a string?`;\n}", "function foo(strings, ...values) {\n var str = \"\";\n for (var i=0; i<strings.length; i++) {\n str += strings[i];\n }\n return str;\n}", "function getStringLists(arr) {\n const stringArray = arr.filter(str =>typeof str === 'string');\n return stringArray;\n }", "function stringItUp(arr){\r\n return arr.map(num => num.toString())\r\n }", "populateString(stringNumber) {\n this.strings[stringNumber] = [[this.tuning[stringNumber].duplicate()]];\n if (this.tuning[stringNumber].getAccidental().isSharp()) {\n /* check for alias if note is sharp */\n this.strings[stringNumber].push(musix.NoteAlias.findFlatAlias(newNote))\n }\n\n if (this.tuning[stringNumber].getAccidental().isFlat()) {\n /* check for alias if note is sharp */\n this.strings[stringNumber].push(musix.NoteAlias.findSharpAlias(newNote))\n }\n for (var f = 1; f <= this.frets; f++) {\n let newNote = this.tuning[stringNumber].duplicate()\n newNote.sharpenTo(f)\n this.strings[stringNumber].push([newNote])\n if (newNote.getAccidental().isSharp()) {\n /* check for alias if note is sharp */\n this.strings[stringNumber][f].push(musix.NoteAlias.findFlatAlias(newNote))\n }\n }\n }", "function filterString(arr) {\n let newArray = arr.filter((args) => {\n return args.includes('js') + args.includes('JS');\n })\n return newArray;\n}", "function caml_string_of_array (a) { return new MlString(4,a,a.length); }", "function doCollectStringValues(data, _, val) {\n if (Array.isArray(val)) return;\n if ('string' === typeof val) {\n data.push(val);\n } else if ('object' === typeof val) {\n data.push(...collectStringValues(val));\n }\n}", "function stringifyArray(input){\n return input.join(',');\n}", "function fillInStory(str, arr){\n for(var i = 0; i < arr.length; i++){\n str = replaceWords(arr[i], str);\n }\n return str;\n}", "function setVars(array) {\n\ttotal = array.length;\n\tmstrArry = array; \n}", "function magicArray(wordArray) {\n let fullString = '';\n\n for (let i = 0; i < wordArray.length; i++) {\n fullString = fullString + wordArray[i]\n }\n\n return fullString;\n}", "function convertToString(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = \"Dojo\"\n }\n }\n return arr;\n}", "function myFunction(arr, str) {\n for (const val of arr) {\n val['continent'] = str;\n }\n return arr\n}", "function buildArray(int) {\nvar stringsArray = [];\nint * stringsArray.fill(\"Kiwi\") \n}", "stringThisArray(array){\n return array.join(\"\");\n }", "function madLibs(str, array) {\n let finalString = \"\";\n let counter = 0;\n \n for(let i = 0; i < str.length; i++) {\n let char = str[i];\n \n if(char === \"*\") {\n finalString += array[counter];\n counter++;\n if(counter === array.length) counter=0;\n }\n else {\n finalString += char;\n }\n }\n return finalString;\n }", "function getRandomPhraseAsArray(arr){\n //do stuff to any arr that is passed in\n let randomNumber = arr.length;\n let i = Math.floor(Math.random() * randomNumber);\n arr[i].split('');\n return arr[i];\n\n}", "function changeFilePaths(arr, str){\n\t\tvar _str = str;\n\t\tarr.forEach(function(path){\n\t\t\tvar replace = path.replace(base, '').split('/')[path.replace(base, '').split('/').length-1];\n\t\t\tvar search = path.replace(base, '').split('/').join('/').slice(1);\n\t\t\t_str = _str.replace(search, replace);\n\t\t})\n\t\treturn _str;\n\t}", "function stringifier (input) {\n \n var answer = [];\n\n // If not an array, it's a basic type. No need to call converter via test in that case\n // This if statement is a shortcut\n // CAN BE PLACED IN TEST BEFORE THE FOR LOOP\n\n if (Array.isArray(input) === false) {\n\n converter (input);\n }\n\n\n\n //CONVERTER\n // This function converts any type into a string and pushes it to an array\n function converter (part) {\n\n if (typeof(input) === 'undefined') {\n return undefined\n }\n \n if (typeof part == \"number\")\n {\n\n answer.push(part.toString());\n\n }\n\n \n if (typeof part == \"string\") {\n\n answer.push(\"\\\"\" + part.toString()+ \"\\\"\");\n }\n\n if (typeof part == \"function\") {\n\n return \"null\";\n }\n\n \n } \n\n \n \n //CALLER if array\n //Identifies the dimensions of the array and calls converter with each value of any array\n function test (input) {\n for (var i = 0; i < input.length; i++) {\n\n if (Array.isArray(input[i])) {\n\n stringifier (input[i]);\n\n }\n \n else {\n \n converter (input[i]);\n \n \n }\n\n }\n \n }\n\n\n var stringified = answer.join();\n return stringified;\n\n \n\n\n \n\n// -------- TESTS -------\n\n\n\n}", "function mutationArr(arr) {\n\t//let firstArr = arr[0].toLowerCase().split();//cant call split on arr el\n\tlet firstArr = arr[0].toLowerCase();\n\tlet secondArr = arr[1].toLowerCase();\n\tfor(let letter = 0;letter<secondArr.length;letter++) {\n\t\tif(firstArr.indexOf(secondArr[letter]) === -1) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "set ids(value) {\n this._namedArgs.ids = value.join(\",\");\n }", "manipulateString() {\n let myArray = Array.from(gatherInput().toLowerCase(), x => {\n switch (x) {\n case 'a':\n return 1\n break;\n case 'b':\n return 2\n break;\n case 'c':\n return 3\n break;\n case 'd':\n return 4\n break;\n case 'e':\n return 5\n break;\n case 'f':\n return 6\n break;\n case 'g':\n return 7\n break;\n case 'h':\n return 8\n break;\n case 'i':\n return 9\n break;\n case 'j':\n return 10\n break;\n case 'k':\n return 11\n break;\n case 'l':\n return 12\n break;\n case 'm':\n return 13\n break;\n case 'n':\n return 14\n break;\n case 'o':\n return 15\n break;\n case 'p':\n return 16\n break;\n case 'q':\n return 17\n break;\n case 'r':\n return 18\n break;\n case 's':\n return 19\n break;\n case 't':\n return 20\n break;\n case 'u':\n return 21\n break;\n case 'v':\n return 22\n break;\n case 'w':\n return 23\n break;\n case 'x':\n return 24\n break;\n case 'y':\n return 25\n break;\n case 'z':\n return 26\n break;\n case ',':\n return ','\n break;\n case '!':\n return '!'\n break;\n case '?':\n return '?'\n break;\n case '.':\n return '.'\n break;\n case ' ':\n return ' '\n break;\n case 'á':\n return '1(á)'\n break;\n case 'ã':\n return '1(ã)'\n break;\n case 'ó':\n return '15(ó)'\n break;\n case 'õ':\n return '15(õ)'\n break;\n case 'ô':\n return '15ô'\n break;\n case 'é':\n return '5(é)'\n break;\n case 'ê':\n return '5(ê)'\n break;\n case 'ç':\n return '3(ç)'\n break;\n case ',':\n return ','\n break;\n case '0':\n return 'Num(0)'\n break;\n case '1':\n return 'Num(1)'\n break;\n case '2':\n return 'Num(2)'\n break;\n case '3':\n return 'Num(3)'\n break;\n case '4':\n return 'Num(4)'\n break;\n case '5':\n return 'Num(5)'\n break;\n case '6':\n return 'Num(6)'\n break;\n case '7':\n return 'Num(7)'\n break;\n case '8':\n return 'Num(8)'\n break;\n case '9':\n return 'Num(9)'\n break;\n default:\n return 404;\n }\n })\n\n return myArray\n }", "function stringItUp(arr){\n stringArr = arr.map(function(num){\n return num.toString()\n })\n console.log(stringArr)\n}", "function numbstring(arr){\n\n for (i=0;i<arr.length;i++){\n if(arr[i]<0){\n arr[i]=\"Dojo\"\n }\n }\n\n return arr;\n\n}", "function j(a){return a.map(function(a){return\" \"+a})}", "setFilter(filterstring) {\n if (Array.isArray(filterstring)) {\n this.filter = filterstring\n }\n\n }", "function steamrollArray(arr) {\n return arr.toString().replace(',,', ',').split(',').map(change);\n}", "function printStringArray(outputString)\r\n{\r\n console.log(outputString); \r\n}", "function getStringLists(array){\n return [array].push(array)\n}", "function mutation(arr) {\r\n \r\n str = arr[0].toLowerCase();\r\n pattern = arr[1].toLowerCase();\r\n \r\n// \tfor (i=0; i < pattern.length; i++) {\r\n// if (str.indexOf(pattern[i]) === -1) {arr = false; break;} else {arr = true;}\r\n// } \r\n\r\n for (var character of pattern) {\r\n if (str.indexOf(character) === -1) {arr = false; break;} else {arr = true;}\r\n//\t\t\tif (str.search(character) === -1) {arr = false; break;} else {arr = true;}\r\n//\t\t\tif (str.includes(character) === false) {arr = false; break;} else {arr = true;}\r\n \t} \r\n \r\n return arr;\r\n}", "static arrayToText(array, fn) {\n if (fn) {\n array = array.map(fn);\n }\n\n return array.join(', ').replace(/,(?=[^,]*$)/, this.L('L{ and }'));\n }", "function changeArr(arr) {\n arr[3] = 'MUTATED';\n}", "function equalStringArray (a, b) {\n if (a.length === b.length) {\n var c = a.filter(function (aValue, aIndex) {\n return (aValue === '*' || b[aIndex] === '*') ?\n true :\n ((Number.isInteger(aValue) && b[aIndex] === '&') ?\n true : (aValue === b[aIndex]));\n });\n if (a.length === c.length) return true;\n else return false;\n }\n return false;\n}", "function complementGiver (array, string) {\n\tvar complementArr = [];\n\tfor ( var i = 0; i < array.length; i++) {\n\t\tcomplementArr.push(array[i] + string);\n\t}\n\treturn complementArr;\n}", "function stringClean(str) {\n // initialize the array that will be returned as the response\n\n // take the input string and loop through it\n\n // while looping push anything that is not a string numerical value to a new array\n\n // this array can then be joined and returned as the clean string\n}", "function arrOFNames(str) {\n // complete the function\n return str.split(\",\");\n \n}", "static arrayToText(array, fn) {\n if (fn) {\n array = array.map(fn);\n }\n\n return array.join(', ').replace(/,(?=[^,]*$)/, this.L('L{ and }'));\n }", "function update(array, args) {\n\t\t var arrayLength = array.length, length = args.length;\n\t\t while (length--) array[arrayLength + length] = args[length];\n\t\t return array;\n\t\t}", "function swapString(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 'Negative Value'\n }\n }\n return arr\n}", "function addQuestion(arr) {\n arr.map(function (item, index) {\n arr[index] = item + \"?\";\n });\n return arr;\n}", "function process(jsArr) {\n for (var i=0;i<jsArr.length;i++) {\n jsArr.splice(i, 1, evalStr(jsArr[i]));\n }\n return jsArr;\n}", "function transferToString(arr) {\r\n\tvar str = \"[\";\r\n\tfor (var i = 0; i < arr.length; i++){\r\n\t\tstr += JSON.stringify(arr[i]);\r\n\t\tif (i != arr.length-1)\r\n\t\t\tstr += \",\";\r\n//\t\tfor (var j = 0; j < q[i].length; j++){\r\n//\t\t\tstr += \"'\" + q[i][j] ;\r\n//\t\t\tif (j != (q[i].length-1) ){\r\n//\t\t\t\tstr += \"', \";\r\n//\t\t\t}\r\n//\t\t\telse{\r\n//\t\t\t\tstr += \"' \";\r\n//\t\t\t}\r\n//\t\t\t\t\r\n//\t\t}\r\n//\t\tif (i != (q.length-1) )\r\n//\t\t\tstr += \"], \";\r\n//\t\telse{\r\n//\t\t\tstr += \"] \";\r\n//\t\t}\r\n\t}\r\n\tstr += \"]\";\r\n\treturn str;\r\n}", "function numStr(arr) {\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < 0) {\n arr[i] = 'Dojo';\n }\n }\n return arr;\n}", "function syncGeneArrayToInputText() {\n const inputTextValues = inputText.trim().split(/[\\s,]+/)\n if (!inputTextValues.length || !inputTextValues[0].length) {\n return geneArray\n }\n const newGeneArray = geneArray.concat(getOptionsFromGenes(inputTextValues))\n setInputText(' ')\n setGeneArray(newGeneArray)\n return newGeneArray\n }", "function stringify(array){\n\tvar arrayB=[]\n\tfor(i in array)\n\t\tarrayB[i]=\"\"+array[i];\n\treturn arrayB;\n}", "function setArgs(args){\n\t\tvar removalItems = [];\n\t\tfor (var i = 1; i < args.length; i++) {\n\t\t\tremovalItems.push(args[i]);\n\t\t}\n\n\t\t//Return the array for future use\n\t\treturn removalItems;\n\t} //setArgs", "function awesomesauced(strings) {\n var index = 0;\n var lengthOfArray = strings.length;\n var awesomesaucedArray = [];\n\n while (index < lengthOfArray) {\n awesomesaucedArray.push(strings[index]);\n if (index !== lengthOfArray - 1) {\n awesomesaucedArray.push(\"awesomesauce\");\n }\n index++;\n }\n console.log(awesomesaucedArray);\n}", "function pushString(arr, value) {\n\tvar innerValue = value && value.valueOf()\n\tvar result = typeof innerValue == 'string'\n\tif (result) {\n\t\tarr.push(innerValue)\n\t}\n\treturn result\n}", "function transferToString(arr) {\n\tvar str = \"[\";\n\tfor (var i = 0; i < arr.length; i++){\n\t\tstr += JSON.stringify(arr[i]);\n\t\tif (i != arr.length-1)\n\t\t\tstr += \",\";\n//\t\tfor (var j = 0; j < q[i].length; j++){\n//\t\t\tstr += \"'\" + q[i][j] ;\n//\t\t\tif (j != (q[i].length-1) ){\n//\t\t\t\tstr += \"', \";\n//\t\t\t}\n//\t\t\telse{\n//\t\t\t\tstr += \"' \";\n//\t\t\t}\n//\t\t\t\t\n//\t\t}\n//\t\tif (i != (q.length-1) )\n//\t\t\tstr += \"], \";\n//\t\telse{\n//\t\t\tstr += \"] \";\n//\t\t}\n\t}\n\t\t\n\tstr += \"]\";\n\t\n\treturn str;\n}", "function format(s) {\n\t return formatArr(s, slice.call(arguments, 1))\n\t}", "function stringifyArr(arr){\n\tvar str = \"[\";\n\tarr.forEach(function(e){\n\t\tstr += \"'\"+e+\"', \";\n\t});\n\tstr += \"]\";\n\treturn str.replace(\"', ]\", \"']\");\t\n}", "function arrayOfStrings (a, checkLowerCase) {\n\t var v = low.isArray(a) && a.every(low.string);\n\t if (v && low.bool(checkLowerCase) && checkLowerCase) {\n\t return a.every(low.lowerCase)\n\t }\n\t return v\n\t}", "function modifyArray(arr) {\n if (arr.length >= 5) {\n arr[4] = arr[4].toLocaleUpperCase();\n }\n return arr;\n}", "function testStringToPoints()\n{\n var s = \"ABC abc\";\n var c = stringToPoints(s);\n var t = pointsToString(c);\n test.assertEqualArray(s, t);\n}" ]
[ "0.6432839", "0.6400642", "0.6294013", "0.6254479", "0.621948", "0.6153452", "0.6110674", "0.60218585", "0.5952823", "0.59509456", "0.5939075", "0.5938604", "0.5885659", "0.5879565", "0.58561414", "0.5838446", "0.5830814", "0.582712", "0.5809896", "0.5808138", "0.57652324", "0.5733426", "0.5713525", "0.57035077", "0.5691359", "0.56817704", "0.567337", "0.56668407", "0.566309", "0.56583315", "0.5655336", "0.565047", "0.5637124", "0.5637093", "0.56272507", "0.55984294", "0.5584165", "0.55819494", "0.5578496", "0.5574251", "0.55639625", "0.5542953", "0.5539743", "0.5532801", "0.5528581", "0.5518351", "0.55131584", "0.5511519", "0.5504129", "0.54910815", "0.5483109", "0.5480166", "0.5476683", "0.54711854", "0.5470965", "0.5461946", "0.5443524", "0.5438255", "0.5437426", "0.5432689", "0.54305446", "0.5430315", "0.5427156", "0.54163176", "0.5406811", "0.5404053", "0.5402396", "0.5397487", "0.5397259", "0.5392966", "0.5390098", "0.5387255", "0.538187", "0.53797054", "0.5378445", "0.5372769", "0.53703153", "0.53643197", "0.53585094", "0.53568184", "0.5356152", "0.53550375", "0.53531045", "0.53525585", "0.5352389", "0.53518844", "0.535061", "0.5349747", "0.53491175", "0.5343043", "0.5332014", "0.531062", "0.5310575", "0.5309647", "0.53070635", "0.5295378", "0.5294633", "0.5292887", "0.5287134", "0.52802485", "0.5274268" ]
0.0
-1
Calculate a for _myutma
function _myuFixA (c, s, t) { if (!c || c === '' || !s || s === '' || !t || t === '') return '-' let a = _myuGC(c, '__myutma=' + _myudh, s) let lt = 0 let i = 0 if ((i = a.lastIndexOf('.')) > 9) { _myuns = a.substring(i + 1, a.length) _myuns = (_myuns * 1) + 1 a = a.substring(0, i) if ((i = a.lastIndexOf('.')) > 7) { lt = a.substring(i + 1, a.length) a = a.substring(0, i) } if ((i = a.lastIndexOf('.')) > 5) { a = a.substring(0, i) } a += '.' + lt + '.' + t + '.' + _myuns } return a }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculTva(montantht,tva){\n var ht = montantht * tva;\n return ht;\n}", "function skaiciuotiVidurki(mas) {\n var suma = 0;\n for (var i = 0; i < mas.length; i++) {\n suma += mas[i];\n }\n // return Math.round(suma / mas.length);\n var ats = suma / mas.length;\n ats = Math.round(ats);\n return ats;\n}", "a(){\n return (this.Abc*this.Fy)/(0.85*this.Fc*this.beff())\n }", "function calculation () {\n omega = 2*Math.PI*ny; // Kreisfrequenz (1/s)\n if (dPhi == 0) i0 = u0/r; // Maximale Stromstärke (A, für Widerstand)\n else if (dPhi > 0) i0 = u0*omega*c; // Maximale Stromstärke (A, für Kondensator)\n else i0 = u0/(omega*l); // Maximale Stromstärke (A, für Spule)\n }", "function totalMU(values) {\n\t\t\tif(values === undefined || values.length == 0) return 0;\n\t\t\tvar total = 0;\n\t\t\tfor(var loop = 0; loop < values.length; loop++) total += values[loop].footprint;\n\t\t\treturn total;\n\t\t}", "static ToMetres(ac) {\n if (AltitudeCode.IsMetric(ac)) {\n throw \"Metric altitude decoding is not supported.\";\n } else {\n return AltitudeCode.ToFt(ac) * 12 * 2.54 / 100;\n }\n }", "calcula(i){\n let vP = this.arrCamisas[i].camisap*10;\n let vM = this.arrCamisas[i].camisam*12;\n let vG = this.arrCamisas[i].camisag*15;\n\n let valortotal = vP+vM+vG;\n\n return valortotal;\n }", "function calculate(){}", "function calculerTotal(){ \r\n var total = 0\r\n for (var i in achats) {\r\n total = total + achats[i].nbre*achats[i].prix;\r\n }\r\n setElem(\"tot\", total.toFixed(2));\r\n }", "function updateTotaal(){\n var totaal = 0\n for (var pizza in pizzas){\n totaal += pizzas[pizza].aantal * pizzas[pizza].price;\n }\t\n $(\"#winkelmandje #totaal\").html(totaal);\n }", "function calcPerim() {\n\tthis.perimetr=0;\n\tfor(key in this){\n\t\tif(checkisNum(this[key])&&key!=='perimetr'){\n\t\t\tthis.perimetr+=this[key];\n\t\t}\n\t}\n\treturn this.perimetr;\n}", "function calcularIva(){\n var tasaIva = 12;\n var monto = 300;\n var iva;\n\n //Calculo del Iva\n console.log(\"Calculo de iva: \")\n console.log(iva = (monto * tasaIva)/100);\n \n}", "suma(){\n return this.a + this.b;\n }", "function AgenMath(){\n let T_vec = new Array(5);\n let heatflux = g.lengthA*g.Q*1000;\n T_vec[0] = heatflux/g.h + g.Tinf;\n T_vec[1] = heatflux*g.lengthC/g.kC + T_vec[0];\n T_vec[2] = heatflux*g.Rtc + T_vec[1];\n T_vec[3] = heatflux*g.lengthB/g.kB + T_vec[2];\n T_vec[4] = heatflux*g.Rtc + T_vec[3];\n let C2 = T_vec[4] + g.Q*Math.pow(g.lengthA,2)*1000/(2*g.kA);\n T_vec.push(C2);\n return{T_vec};\n}", "function hitungLuasPersegi(sisi) {\n var luas = sisi * sisi;\n return luas;\n}", "function calculateTotal_usa_cm() {\n //Aqui obtenemos el precio total llamando a nuestra funcion\n\t//Each function returns a number so by calling them we add the values they return together\n\t'use strict';\n var cakePrice = traerDensidadSeleccionada() * traerDensidadSeleccionada2() / getIndiceDeLogro() / 1000000, densidadimplantada = traerDensidadSeleccionada() / getIndiceDeLogro(), densidadobjetivo = traerDensidadSeleccionada();\n \n //Aqui configuramos los decimales que queremos que aparezcan en el resultado\n\tvar resultadodosdecimales1 = cakePrice.toFixed(2), resultadodosdecimales2 = densidadimplantada.toFixed(2), resultadodosdecimales3 = densidadobjetivo.toFixed(2);\n\t\n\t//Aqui exponemos el calculo\n\tvar divobj = document.getElementById('totalPrice');\n\tdivobj.style.display = 'block';\n\tdivobj.innerHTML = 'You will need to plant ' + resultadodosdecimales2 + ' seeds per hectare wich represents ' + resultadodosdecimales1 + ' seeds in a lineal meter for achieving your population target of ' + resultadodosdecimales3;\n}", "function hitungLuasSegiEmpat(sisi){\n //tidak ada nilai balik\n var luas = sisi * sisi\n return luas\n}", "_a(){\n\t\t\treturn Math.max(Math.min(0.1*this.B,0.4*this.z),0.04*this.B,3)\n }", "function custoFinal(custoFabrica, percDistribuidor, percImpostos ){\n let custoFinal = custoFabrica + ((custoFabrica * percDistribuidor) / 100 ) + ((custoFabrica * percImpostos ) / 100)\n\n return custoFinal;\n}", "getYerushalmiMasechta() {\n return Daf.masechtosYerushlmi[this.masechtaNumber];\n }", "calcularIMC() {\n const peso = this.peso;\n const altura = this.altura;\n return (peso / altura * altura)\n }", "precioTotal() {\n return this.ctd * this.valor;\n }", "function calcAmort(K, T, Ti, y) {\n r = T/12\n n = y*12\n M = K*r/(1-1/Math.pow(1+r,n))\n // Insurance:\n M = M + K*Ti/12\n return M\n}", "suma(){\n let suma = 0;\n let i = 0;\n for(let x of this._data){\n i++;\n suma = suma + x;\n }\n return suma;\n }", "function hitungLuasSegiTiga(alas,tinggi){\n var luas = 0.5 * alas * tinggi\n return luas\n}", "function calculateM() {\n return d['T'] * (d['L'] / d['v'] + d['B']) / d['H']\n}", "asistenciasTotalesPorDia(equipo){\n let len = equipo.length;\n let asistencia_total = [];\n let total_lunes=0;\n let total_martes=0;\n let total_miercoles=0;\n let total_jueves=0;\n let total_viernes=0;\n let total_sabado=0;\n let total_domingo=0;\n \n for (var i = 0; i <len; ++i) {\n total_lunes = total_lunes + (equipo[i].asistencia.lunes * equipo[i].factor_dias_laborados);\n total_martes = total_martes+ (equipo[i].asistencia.martes * equipo[i].factor_dias_laborados);\n total_miercoles = total_miercoles + (equipo[i].asistencia.miercoles * equipo[i].factor_dias_laborados);\n total_jueves = total_jueves + (equipo[i].asistencia.jueves * equipo[i].factor_dias_laborados);\n total_viernes = total_viernes + (equipo[i].asistencia.viernes * equipo[i].factor_dias_laborados);\n total_sabado = total_sabado + (equipo[i].asistencia.sabado * equipo[i].factor_dias_laborados);\n // total_domingo = total_domingo + (equipo[i].asistencia.domingo * equipo[i].factor_dias_laborados);\n }\n\n asistencia_total.push(total_lunes);\n asistencia_total.push(total_martes);\n asistencia_total.push(total_miercoles);\n asistencia_total.push(total_jueves);\n asistencia_total.push(total_viernes);\n asistencia_total.push(total_sabado);\n // asistencia_total.push(total_domingo);\n\n \n return asistencia_total;\n }", "totalSpent(){\n return this.meals().reduce((a,b)=>(a += b.price), 0);\n }", "function add(tot,p,m){\n\t\t\tif(!m) m = {'cost':1,'mass':1,'power':1};\n\t\t\tfor(var i in tot){\n\t\t\t\tif(p[i] && p[i].typeof==\"convertable\"){\n\t\t\t\t\tvar c = p[i].copy();\n\t\t\t\t\tif(c.value != Infinity) c.value *= m[i];\n\t\t\t\t\telse c.value = (m[i]==0) ? 0 : Infinity;\n\t\t\t\t\ttot[i].add(c);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn tot;\n\t\t}", "function trasf_equa_azim(njd,Ar,De,Long,Lat){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) giugno 2013\n // njd= numero del giorno giuliano dell'istante da calcolare riferito al T.U.\n // Ar= ascensione retta in ore decimali.\n // De= declinazione in gradi sessadecimali\n // Long= Longitudine dell'osservatore =- per ovest rispetto a Greenwich\n // Lat= Latitudine dell'osservatore.\n\nvar ang_H=angolo_H(njd,Ar,Long); // calcolo dell'angolo orario H.\n\n // trasformare gli angoli sessadecimali in radianti.\n\n ang_H=Rad(ang_H*15); \n Ar= Rad(Ar*15); \n De= Rad(De); \n Long=Rad(Long); \n Lat= Rad(Lat); \n \n // angolo_a=altezza sull'orizzonte dell'astro. \n\nvar angolo_a=Math.sin(De)*Math.sin(Lat)+Math.cos(De)*Math.cos(Lat)*Math.cos(ang_H);\n angolo_a=Math.asin(angolo_a); // in radianti.\n angolo_a=Rda(angolo_a); // altezza dell'astro in gradi. \n \nvar azimut=(Math.sin(De)-Math.sin(Lat)*Math.sin(Rad(angolo_a)))/(Math.cos(Lat)*Math.cos(Rad(angolo_a)));\n azimut=Math.acos(azimut); \n azimut=Rda(azimut);\n\nazimut=(Math.sin(ang_H)<0) ? (azimut=azimut):(azimut=360-azimut); // operatore ternario.\n\nvar coord_azimut= new Array(angolo_a,azimut) ; // restituisce 2 valori: altezza e azimut.\n\nreturn coord_azimut;\n\n// NOTE SUL CALCOLO: \n// Se il seno di ang_H(angolo orario) è negativo (>180°) azimut=azimut, se positivo azimut=360-azimut\n\n}", "promedio(){\n let promedio = 0;\n let i =0;\n for(let x of this._data){\n i = i++;\n promedio = promedio + x;\n }\n return promedio/i;\n }", "function PerkalianV2 (a, b) {\n //local variabel\n let hasil = a * b\n\n //give return value, spy value dr hasil bisa dipake diluar\n return hasil\n}", "suma (vec){return new Vector(this.x+vec.x, this.y+vec.y, this.z+vec.z);}", "function exam(a)\r\n {\r\n let fexam = (60/100)*a //fexam = 0.6*a\r\n return fexam\r\n\r\n }", "calcolaArea() {\n\n return (this.base * this.altezza) / 2; \n }", "do_calculation( bunch_of_numerical_data)\n {\n var total = 0 ;\n bunch_of_numerical_data.forEach(element => {\n total += element\n });\n return total ;\n }", "function imc(peso,altura){\n var imc = peso/(altura*altura);\n return imc\n}", "function IMC(peso,altura) {\n\n indice = peso/(Math.pow(altura,2));\n imc = indice.toFixed(2);\n console.log(`El IMC es de: ${imc}.`);\n //return imc;\n}", "function c$a(t,n,r){const a=z$6(t,n)/z$6(t,t);return d$c(r,t,a)}", "function skaiciuotiAtlyginima() {\n let a = 110 * 21;\n console.log( a );\n}", "static genereazaVariabilaNormala01() {\n\t\t\t// Lista pentru numere aleatoare U1...U12\n\t\t\tlet U = [];\n\n\t\t\t// Se genereaza cu RNG 12 numere aleatoare U1...U12\n\t\t\t// uniforme si independente pe (0, 1)\n\t\t\tfor(let i = 0; i < 12; i++) {\n\t\t\t\t// Atasam numerele in lista\n\t\t\t\tU.push(Math.random());\n\t\t\t}\n\n\t\t\t// Iesire Z = U1+...+U12 - 6 \n\t\t\treturn (U.reduce((a, b) => a + b, 0) - 6);\n\t\t}", "function pazymiuVidurkis(q,w,e,r,t) {\n var atsakymas = (q+w+e+r+t)/5;\n console.log(atsakymas);\n}", "function getI(name,un_name) \n{\n\tvar x=getVar(name);\n\tvar unit=getVtext(un_name);\n\tif(\"mA\"==unit) return x/=1e3;\n\tif(\"A\"==unit) return x;\n\tif(\"uA\"==unit) return x/=1e6;\n\tif(\"pA\"==unit) return x/=1e9;\n\treturn x;\n}", "function calcularIVA(precioSinIVA){\n return precioSinIVA*1.21;\n}", "function duplicarTreinta(){\n return 30*2;\n}", "function getBaseCalculo() {\n var pfaEng = config_isEng && isEng ? Number($('#pct-pfa-eng').html()) : 0;\n var pfaDes = config_isDes && isDes ? Number($('#pct-pfa-des').html()) : 0;\n var pfaImp = config_isImp && isImp ? Number($('#pct-pfa-imp').html()) : 0;\n var pfaTes = config_isTes && isTes ? Number($('#pct-pfa-tes').html()) : 0;\n var pfaHom = config_isHom && isHom ? Number($('#pct-pfa-hom').html()) : 0;\n var pfaImpl = config_isImpl && isImpl ? Number($('#pct-pfa-impl').html()) : 0;\n var V = Number((pfaEng + pfaDes + pfaImp + pfaTes + pfaHom + pfaImpl) * config_aumentoEsforco).toFixed(4);\n return V;\n}", "function calc_aadt(unmapper,sum_variables,ts_column){\n\n return function(data){\n\n // data is all the data to sum up,by column. Theoretically a\n // subset of the big data, but really I don't care inside this\n // code\n\n // start is the starting point for the map summing function\n var start=new Array(sum_variables.length)\n // zero volume at start of summation\n for(var i=0,j=sum_variables.length; i<j; i++){\n start[i]=0\n }\n var days={}\n\n // make two passes max. first pass computes aadt. then check\n // that all intervals put out less than aadt. if not, drop\n // those periods, and recompute aadt in second pass\n function sum_aadt(memo,rec){\n // simple sums of volumes, ignore the rest\n _.each(sum_variables\n ,function(v,i){\n memo[i]+=rec[unmapper[v]]\n });\n var d = new Date(rec[unmapper[ts_column]])\n var day = day_formatter(d)\n if(days[day]===undefined){\n days[day]=1\n }\n return memo\n }\n var end = _.reduce(data,sum_aadt,start)\n // have the sum of volumes. Divide by days to get average annual daily\n var numdays=_.size(days)\n end = _.map(end\n ,function(value,veh_type){\n return value / numdays\n });\n var grouped = _.groupBy(data\n ,function(rec){\n return rec[unmapper[sum_variables[0]]]/end[0] > 1 ? 'outlier':'okay'\n })\n var final_result = {}\n if(grouped.outlier !== undefined && grouped.outlier.length > 0 ){\n console.log('redo aadt computation, '+(grouped.outlier.length) + ' out of '+data.length+' are putting out hourly volumes that are higher than computed AADT.')\n console.log('computed aadt')\n console.log(end)\n\n var iterate = 10\n var prior = grouped.outlier.length - 1\n while (iterate-- >0 && grouped.outlier !== undefined && grouped.outlier.length > 0 && grouped.outlier.length > prior){\n // if this is true, we have outliers, and must prune them.\n prior = grouped.outlier.length\n final_result.outliers=grouped.outlier\n\n // reset reduce\n // zero volume at start of summation\n for(var i=0,j=sum_variables.length; i<j; i++){\n start[i]=0\n }\n days={}\n // redo reduce\n end = _.reduce(grouped.okay,sum_aadt,start)\n numdays=_.size(days)\n end = _.map(end\n ,function(value,veh_type){\n return value / numdays\n });\n grouped = _.groupBy(data\n ,function(rec){\n return rec[unmapper[sum_variables[0]]]/end[0] > 1 ? 'outlier':'okay'\n })\n console.log('outlier removal iteration '+(10-iterate))\n }\n console.log('recomputed aadt')\n console.log(end)\n // okay, the worst outliers just got dropped. Not\n // perfect, but better\n }\n _.each(end\n ,function(value,veh_type){\n final_result[sum_variables[veh_type]] = value\n });\n return final_result\n }\n}", "function ubahJuta(angka) {\n\n let nominal = Math.round(angka * 1000000);\n let ubahFormatRupiah = rupiah(nominal);\n\n return ubahFormatRupiah;\n}", "function calcular() {\r\n console.log(\"SUMA: \" + (6 + 6));\r\n console.log(\"RESTA: \" + (6 - 6));\r\n console.log(\"MULTIPLICACIÓN: \" + (6 * 6));\r\n console.log(\"DIVISIÓN: \" + (6 / 6));\r\n}", "function sumaM(x_in) {\r\n var y = 0; \r\n var lt=x_in.length;\r\n var y = 0.0;\r\n for (igo = 0; igo < lt; igo++) {\r\n for (jgo = 0; jgo < lt; jgo ++) {\r\n y = y + Math.abs(x_in[igo][jgo])\r\n }\r\n }\r\n return y;\r\n}", "function sumuoti(sk1 = 0,sk2 = 0) {\n let masyvas;\n masyvas = [sk1, sk2];\n let suma;\n\n //suma = masyvas[0] + masyvas[1];\n suma = sk1 + sk2;\n\n return suma ; //grazinti bet koki kintamojo tipa\n}", "function hmdaStat(tractData) {\n var $selected = $('#action-taken-selector option:selected'),\n fieldName = $selected.val(),\n scale = $selected.data('scale'),\n area = scale * tractData['volume'];\n // As Pi is just a constant scalar, we can ignore it in this\n // calculation: a = pi*r*r or r = sqrt(a/pi)\n return Math.sqrt(area);\n }", "function sum_aadt(memo,rec){\n // simple sums of volumes, ignore the rest\n _.each(sum_variables\n ,function(v,i){\n memo[i]+=rec[unmapper[v]]\n });\n var d = new Date(rec[unmapper[ts_column]])\n var day = day_formatter(d)\n if(days[day]===undefined){\n days[day]=1\n }\n return memo\n }", "calculate(modify) {\n return this.total = [].slice.call(arguments, 1)\n .reduce((total, y) => modify(total, y), this.total);\n }", "function t1(){\n return (1/3)*(dataArray[1][1]-dataArray[0][1])+(dataArray[2][1]-dataArray[1][1])+(dataArray[3][1]-dataArray[2][1]);\n }", "sumOfMovables()\n {\n let sum = 0;\n for(let a of this.getValues())\n {\n sum+=a;\n }\n\n return sum;\n\n }", "function hitungLuasSegitiga(alas,tinggi) {\n var luas = 1/2 * alas * tinggi;\n\n return luas;\n\n}", "calculate() {\n let answer = 0;\n\n if(this.type === 0) {\n answer = this.permutation();\n } else if(this.type === 1){\n answer = this.combination();\n }\n\n return Math.ceil(answer);\n }", "function simplesMontante(capital, taxa, tempo){\n let juros = capital * taxa * tempo\n let montanteSimples = capital + juros\n console.log(`O montante é: ${montanteSimples.toFixed(2)}`)\n}", "function computeU1(x1, x2, x3) {\r\n var u1 = x2 / (1000 * x3);\r\n \r\n return u1;\r\n}", "function exam(a)\r\n{\r\n //solving fexam\r\nlet fexam = (60/100)*a\r\n//allowing access to fexam result\r\nreturn fexam\r\n\r\n}", "function appetize(total){\n\n}", "function Ut(a,b){this.sm=[];this.nV=a;this.qQ=b||null;this.Au=this.Rf=!1;this.Ie=void 0;this.IM=this.s0=this.yE=!1;this.yD=0;this.Fa=null;this.ty=0}", "function kelimasKvadratu(skaicius) {\n // atsakymas = skaicius * skaicius;\n atsakymas = Math.pow(skaicius, 2);\n console.log(atsakymas);\n}", "function getPazymiuVidurkis2(x1,x2,x3,x4,x5){\n var atsakymas=(x1 + x2 + x3 + x4 + x5)/5;\n return atsakymas;\n}", "getValorTotal(){\n return this._valorUnitario * this._quantidade;\n }", "function printMetinisPajamuDydis(){\n let metinis = atlyginimas*12;\n console.log(metinis);\n}", "function totaal (a , b , c){\n\nlet sum = a + b + c ;\nreturn sum\n\n\n}", "function pitagoroTeorema(x,y) {\n let pit = x*x + y*y;\n let ats = Math.sqrt(pit);\n console.log(\"Pitagoro teorema: \",ats);\n}", "function exam(a)\n{\nlet fexam = (60/100)*a\nreturn fexam\n\n}", "function aritMedia(myArray) {\n let arr = cleanArray(myArray);\n // En la variable \"sum\" almacenaremos la sumatoria del array\n let sum = 0;\n for (let i in arr) {\n // Recorremos el array y sumamos cada uno de los elementos \n sum += arr[i];\n }\n // La funcion devuelve la suma total dividido la longitud del array\n return sum / (arr.length);\n}", "function pitagoroTeorema (x,y) {\n\nvar atsakymas = Math.sqrt( (x*x) + (y*y) );\nconsole.log(atsakymas);\n\n}", "function imc(altura, peso) {\n return peso / (altura * altura);\n}", "function imc(altura, peso) {\n return peso / (altura * altura);\n}", "get imc() {\n const IMC = this.peso / (this.altura ** 2);\n return IMC.toFixed(2);\n }", "function medicareCalc() {\n // Calculations for standard medicare tax.\n result.projected.fica.medicare = result.householdGross * federal.fica.medicareTax;\n\n // Calculationsfor additional medicare tax.\n var threshold = getVar(federal.fica.additionalMedicareLiability);\n if (result.householdGross > threshold) {\n result.projected.fica.addlMedicare = ( (result.householdGross - threshold) * federal.fica.additionalMedicareTax );\n } else {\n result.projected.fica.addlMedicare = 0;\n }\n }", "function mont_add(t1, t2, t3, t4, ax, az, dx) {\n mul(ax, t2, t3);\n mul(az, t1, t4);\n add(t1, ax, az);\n sub(t2, ax, az);\n sqr(ax, t1);\n sqr(t1, t2);\n mul(az, t1, dx);\n }", "function mi(t,e){0}", "UmmAlQura() {\n return new CalculationParameters_CalculationParameters(\"UmmAlQura\", 18.5, 0, 90);\n }", "function calcularIVA3(precioSinIVA,IVA=21){\n return precioSinIVA*(1+(IVA/100));\n}", "total (itens) {\n prod1 = list[0].amount\n prod2 = list[1].amount\n prod3 = list[2].amount\n prod4 = list[3].amount\n\n itens = prod1 + prod2 + prod3 + prod4\n\n return itens\n }", "function impostaTotaliInDataTable(totaleStanziamentiEntrata, totaleStanziamentiCassaEntrata, totaleStanziamentiResiduiEntrata, totaleStanziamentiEntrata1, totaleStanziamentiEntrata2,\n \t\ttotaleStanziamentiSpesa, totaleStanziamentiCassaSpesa, totaleStanziamentiResiduiSpesa, totaleStanziamentiSpesa1, totaleStanziamentiSpesa2){\n\n \tvar totaleStanziamentiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata);\n var totaleStanziamentiCassaEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaEntrata);\n var totaleStanziamentiResiduiEntrataNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiEntrata);\n //anno = anno bilancio +1\n var totaleStanziamentiEntrata1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata1);\n //anno = anno bilancio +2\n var totaleStanziamentiEntrata2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiEntrata2);\n \n \n var totaleStanziamentiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa);\n var totaleStanziamentiCassaSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiCassaSpesa);\n var totaleStanziamentiResiduiSpesaNotUndefined = getStanziamentoNotUndefined(totaleStanziamentiResiduiSpesa);\n //anno = anno bilancio +1\n var totaleStanziamentiSpesa1NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa1);\n //anno = anno bilancio +2\n var totaleStanziamentiSpesa2NotUndefined = getStanziamentoNotUndefined(totaleStanziamentiSpesa2);\n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazione\", totaleStanziamentiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateResiduoVariazione\", totaleStanziamentiResiduiEntrataNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCassaVariazione\", totaleStanziamentiCassaEntrataNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiEntrata1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleEntrateCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiEntrata2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazione\", totaleStanziamentiSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCassaVariazione\", totaleStanziamentiCassaSpesaNotUndefined);\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseResiduoVariazione\", totaleStanziamentiResiduiSpesaNotUndefined);\n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuUno\", totaleStanziamentiSpesa1NotUndefined);\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#totaleSpeseCompetenzaVariazioneAnnoPiuDue\", totaleStanziamentiSpesa2NotUndefined);\n \n\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazione\", (totaleStanziamentiEntrataNotUndefined - totaleStanziamentiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaResiduoVariazione\", (totaleStanziamentiResiduiEntrataNotUndefined - totaleStanziamentiResiduiSpesaNotUndefined));\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCassaVariazione\", (totaleStanziamentiCassaEntrataNotUndefined - totaleStanziamentiCassaSpesaNotUndefined));\n \n //anno = anno bilancio +1\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuUno\", (totaleStanziamentiEntrata1NotUndefined - totaleStanziamentiSpesa1NotUndefined));\n //anno = anno bilancio +2\n capVarImp.impostaValutaEAllineaADestra(\"#differenzaCompetenzaVariazioneAnnoPiuDue\", (totaleStanziamentiEntrata2NotUndefined - totaleStanziamentiSpesa2NotUndefined));\n }", "function pitagoroTeorema (x,y) {\n var ats = Math.sqrt (x*x + y*y);\n console.log(ats);\n}", "getMasechta() {\n return Daf.masechtosBavli[this.masechtaNumber];\n }", "function astor(a) {\n return a * (Math.PI / (180.0 * 3600.0));\n}", "function montReduce(x) {\n while (x.t <= this.mt2) // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = (j * this.mpl + (((j * this.mph + (x[i] >> 15) * this.mpl) & this.um) << 15)) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) { x[j] -= x.DV;\n x[++j]++; }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n }", "getTotal(){\n this.totalPaid = this.periods * this.scPayment\n this.totalInterest = this.totalPaid - this.loanAmount\n }", "function exam(a)\n{\n\nlet fexam = (60/100)*a\n\n//Stores the value of \"fexam\"\nreturn fexam\n\n}", "function Uf(a){this.m=a}", "calculate() {\n\treturn this.exercise.calculate(this.weight, this.distance, this.time);\n }", "function eq_tempo(){\n\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) ottobre 2011.\n // funzione per il calcolo del valore dell'equazione del tempo per la data odierna.\n // algoritmo di P.D. SMITH.\n \nvar njd=calcola_jd(); // giorno giuliano in questo istante a Greenwich.\n njd=jdHO(njd)+0.5; // g. g. a mezzogiorno di Greenwich.\n\nvar ar_sole=pos_sole(njd); // calcolo dell'ascensione retta del sole.\nvar anno=jd_data(njd); // anno di riferimento.\n\nvar Tempo_medio_Greenw=tsg_tmg_data(ar_sole[0],anno[2],njd); // tempo medio di Greenwich.\nvar valore_et=12-Tempo_medio_Greenw; // valore dell'equazione del tempo.\n\n valore_et=valore_et*60; // valore in minuti.\n\n valore_et=valore_et.toFixed(6);\n\n\n\nreturn valore_et\n\n}", "entfernungVomUrsprung(){\n let a = this.x;\n let b = this.y;\n let c;\n let py = (a*a) + (b*b);\n c= Math.sqrt(py);\n return c;\n }", "function penjumlahanDuaBujurSangkar(a, b) {\n\n let total = a * a + b * b;\n\n return total;\n}", "function areaTringulo(base,altura){\n return (base*altura)/2;\n}", "function calculateUnitValue(i) {\n\tif (getUnit(i) === \"in\") return 1;\n\telse if (getUnit(i) === \"cm\") return .3937;\n\telse return 0;\n}", "function IndicadorTotal () {}", "totalTime() {\n let time = 0\n this.measures.forEach(m => time += m.totalTime())\n return time\n }", "function altcalc(a, k, i) {\n // a= sea level in atmospheres\n // k= temperature in kelvin\n // i= pressure in pascals\n if ((a / i) < (101325 / 22632.1)) {\n var d = -0.0065;\n var e = 0;\n var j = Math.pow((i / a), (R * d) / (g * M));\n return e + ((k * ((1 / j) - 1)) / d)\n } else {\n if ((a / i) < (101325 / 5474.89)) {\n var e = 11000;\n var b = k - 71.5;\n var f = (R * b * (Math.log(i / a))) / ((-g) * M);\n var l = 101325;\n var c = 22632.1;\n var h = ((R * b * (Math.log(l / c))) / ((-g) * M)) + e;\n return h + f\n }\n }\n return NaN\n}", "function calcularTasaMuerta(id) {\r\n //Obtener el valor de la Amortizacion\r\n var lista1 = document.getElementById(\"amortizacion1\");\r\n var amort_cf1 = lista1.options[lista1.selectedIndex].text;\r\n //Si el usuario ingresa el valor Efectivo anual\r\n if (id == \"EA1\") {\r\n \t\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n\t\t\r\n tasa_ip_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_EA_cf1\").value) / 100)), (30 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 30)) - 1) * 100;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n //alert(document.getElementById(\"tasa_EA_cf1\").value);\r\n \r\n\r\n } else {\r\n //Si es trimestral\r\n tasa_ip_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_EA_cf1\").value) / 100)), (90 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 90)) - 1) * 100;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n\r\n if (id == \"NA1\") {\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n tasa_ip_cf1 = (parseFloat(document.getElementById(\"tasa_NA_cf1\").value) / 12);\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 30)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n } else {\r\n //Si es trimestral\r\n tasa_ip_cf1 = (parseFloat(document.getElementById(\"tasa_NA_cf1\").value) / 4);\r\n tasa_ea_cf1 = (Math.pow((1 + (tasa_ip_cf1 / 100)), (360 / 90)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n\r\n if (id == \"Ip1\") {\r\n //Si es mensual\r\n if (amort_cf1 == \"Mensual\") {\r\n tasa_ea_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_Ip_cf1\").value) / 100)), (360 / 30)) - 1) * 100;\r\n tasa_ip_cf1 = (Math.pow((1 + (tasa_ea_cf1 / 100)), (30 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 12;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n } else {\r\n //Si es trimestral\r\n tasa_ea_cf1 = (Math.pow((1 + (parseFloat(document.getElementById(\"tasa_Ip_cf1\").value) / 100)), (360 / 90)) - 1) * 100;\r\n tasa_ip_cf1 = (Math.pow((1 + (tasa_ea_cf1 / 100)), (90 / 360)) - 1) * 100;\r\n tasa_na_cf1 = tasa_ip_cf1 * 4;\r\n document.getElementById(\"tasa_Ip_cf1\").value = tasa_ip_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_NA_cf1\").value = tasa_na_cf1.toFixed(2) + \" %\";\r\n document.getElementById(\"tasa_EA_cf1\").value = tasa_ea_cf1.toFixed(2) + \" %\";\r\n }\r\n }\r\n}", "function astor(a)\n{\n return a * (Math.PI / (180.0 * 3600.0));\n}", "get median(): number {\n return this.xm * Math.pow(2, 1 / this.alpha);\n }" ]
[ "0.61534286", "0.6019287", "0.5916586", "0.58771396", "0.58476245", "0.58014196", "0.57877976", "0.5761055", "0.57284516", "0.56890976", "0.5659006", "0.56566423", "0.56298584", "0.55815643", "0.5559714", "0.5543781", "0.5538673", "0.5538644", "0.5516472", "0.551638", "0.55096483", "0.5502937", "0.5491675", "0.5486432", "0.5484619", "0.5468461", "0.5466854", "0.545462", "0.5454385", "0.5431021", "0.5429989", "0.5425655", "0.54231155", "0.54106313", "0.5403692", "0.5395762", "0.5395098", "0.5379561", "0.5376704", "0.5375719", "0.5370126", "0.53674287", "0.5348577", "0.53466254", "0.53357655", "0.53292024", "0.53213394", "0.5320914", "0.53198975", "0.5313879", "0.5311032", "0.5308154", "0.5302975", "0.53005487", "0.52999187", "0.52961975", "0.529584", "0.5294496", "0.5294271", "0.5285794", "0.5284058", "0.5281112", "0.5281067", "0.52707136", "0.5264684", "0.52624214", "0.52585477", "0.5256698", "0.5248658", "0.5247451", "0.52459407", "0.52425975", "0.5242058", "0.5242058", "0.5241001", "0.5229194", "0.5225748", "0.522522", "0.5224385", "0.52212584", "0.5218975", "0.52174103", "0.52128226", "0.52020603", "0.52002716", "0.5200185", "0.5198546", "0.5198546", "0.51964056", "0.51909465", "0.51905227", "0.5189945", "0.51880467", "0.51872796", "0.51870525", "0.5186519", "0.51851374", "0.5183576", "0.5182309", "0.5179763", "0.51775515" ]
0.0
-1
Normalize a port into a number, string, or false.
function normalizePort(val) { var port = parseInt(val, 10); if (isNaN(port)) { // named pipe return val; } if (port >= 0) { // port number return port; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "normalizePort(val){\n /**\n * Normalize a port into a number, string, or false.\n */\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n }", "function normalize_port(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n\tconst port = parseInt(val, 10);\n\n\t// eslint-disable-next-line no-restricted-globals\n\tif (isNaN(port)) {\n\t\t// named pipe\n\t\treturn val;\n\t}\n\n\tif (port >= 0) {\n\t\t// port number\n\t\treturn port;\n\t}\n\n\treturn false;\n}", "function normalizePort(val) {\r\n const parsedPort = parseInt(val, 10);\r\n if (isNaN(parsedPort)) {\r\n // named pipe\r\n return val;\r\n }\r\n if (parsedPort >= 0) {\r\n // port number\r\n return parsedPort;\r\n }\r\n return false;\r\n}", "function normalizePort(val) {\n\tconst port = parseInt(val, 10);\n\n\tif (isNaN(port)) {\n\t\t// named pipe\n\t\treturn val;\n\t}\n\n\tif (port >= 0) {\n\t\t// port number\n\t\treturn port;\n\t}\n\n\treturn false;\n}", "function normalizePort (val) {\n const port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n }", "function normalizePort (val) {\n var port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n }", "function normalizePort(val) {\n const portNum = parseInt(val, 10);\n\n // eslint-disable-next-line no-restricted-globals\n if (isNaN(portNum)) {\n // named pipe\n return val;\n }\n\n if (portNum >= 0) {\n // port number\n return portNum;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val: string) {\n const parsedPort = parseInt(val, 10);\n\n if (isNaN(parsedPort)) {\n // named pipe\n return val;\n }\n\n if (parsedPort >= 0) {\n // port number\n return parsedPort;\n }\n\n return false;\n }", "function normalizePort(val) {\n const port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n }", "function normalizePort (val) {\n var port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n}", "function normalizePort(val) {\n const port = parseInt(val, 10)\n\n // eslint-disable-next-line\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n }", "function normalizePort(val) {\n\tconst port = parseInt(val, 10);\n\tconst isNumber = value => !Number.isNaN(parseFloat(value));\n\n\tif (isNumber(port)) {\n\t\t// named pipe\n\t\treturn val;\n\t}\n\n\tif (port >= 0) {\n\t\t// port number\n\t\treturn port;\n\t}\n\n\treturn false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n \n if (isNaN(port)) {\n // named pipe\n return val;\n }\n \n if (port >= 0) {\n // port number\n return port;\n }\n \n return false;\n }", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) { //eslint-disable-line no-restricted-globals\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n }", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}" ]
[ "0.84491074", "0.8435193", "0.84256953", "0.84031266", "0.83957297", "0.83951354", "0.8388859", "0.83850676", "0.837168", "0.837168", "0.837168", "0.837168", "0.837168", "0.837168", "0.8370838", "0.8368659", "0.8360887", "0.8359801", "0.8358664", "0.83564407", "0.83535725", "0.83533955", "0.83516043", "0.83516043", "0.8351552", "0.8351552", "0.8351552", "0.83515245", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614", "0.83506614" ]
0.83797497
9
Event listener for HTTP server "error" event.
function onError(error) { if (error.syscall !== 'listen') { throw error; } var bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port; // handle specific listen errors with friendly messages switch (error.code) { case 'EACCES': console.error(bind + ' requires elevated privileges'); process.exit(1); break; case 'EADDRINUSE': console.error(bind + ' is already in use'); process.exit(1); break; default: throw error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function httpOnError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n logger.error(error.code + ' not equal listen', 'serverOnErrorHandler', 10);\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(\n error.code + ':elavated privileges required',\n 'serverOnErrorHandler',\n 10\n );\n process.exit(1);\n break;\n case 'EADDRINUSE':\n logger.error(\n error.code + ':port is already in use.',\n 'serverOnErrorHandler',\n 10\n );\n process.exit(1);\n break;\n default:\n logger.error(\n error.code + ':some unknown error occured',\n 'serverOnErrorHandler',\n 10\n );\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n logger.error(error.code + ' not equal listen', 'serverOnErrorHandler', 10)\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(error.code + ':elavated privileges required', 'serverOnErrorHandler', 10);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n logger.error(error.code + ':port is already in use.', 'serverOnErrorHandler', 10);\n process.exit(1);\n break;\n default:\n logger.error(error.code + ':some unknown error occured', 'serverOnErrorHandler', 10);\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n logger.captureError(error.code + ' not equal listen', 'serverOnErrorHandler', 10)\n throw error;\n }\n \n \n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.captureError(error.code + ':elavated privileges required', 'serverOnErrorHandler', 10);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n logger.captureError(error.code + ':port is already in use.', 'serverOnErrorHandler', 10);\n process.exit(1);\n break;\n default:\n logger.captureError(error.code + ':some unknown error occured', 'serverOnErrorHandler', 10);\n throw error;\n }\n }", "function handle_error(error) {\n console.log(\"Error from server\", error);\n}", "error (listener) { this.errorListener = listener }", "function onerror (err) {\n debug('http.ClientRequest \"error\" event: %o', err.stack || err);\n fn(err);\n }", "_onError( e ) {\n let response = this._resolveResponseData();\n let error = this._resolveErrorText( response );\n this._callHandler( 'error', this._xhr, error, response );\n this._onComplete( response );\n }", "function getError() {\n\tvar xmlhttp = new XMLHttpRequest();\n\txmlhttp.addEventListener(\"load\", reqListenerError);\n\txmlhttp.open(\"GET\", \"http://httpstat.us/500\");\n\txmlhttp.send();\n}", "function onError(event) {\n\t\tconsole.log('Client socket: Error occured, messsage: ' + event.data);\n\t\tcastEvent('onError', event);\n\t}", "function onError(error) {\n\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n var counter = error.message + 1\n if (counter < 1000) {\n randomPort = randPort();\n\n port = normalizePort(process.env.PORT || randomPort);\n app.set('port', port);\n console.warn(\"Port Occupied. Running on port\", port);\n\n // Create HTTP server.\n\n server = http.createServer(app);\n server.listen(port);\n server.on('error', function(e) {\n e.message = counter\n return onError(e)});\n server.on('listening', onListening);\n break;\n }\n else {\n console.error(\"Ports full\")\n process.exit(1);\n break;\n }\n default:\n throw error;\n }\n}", "function onError (error) {\n if (error.syscall !== 'listen') {\n throw error\n }\n const bind = typeof port === 'string' ? 'Pipe ' + app.get('port') : 'Port ' + app.get('port')\n // handle specific listen errors\n switch (error.code) {\n case 'EACCES':\n logger.error(util.format(bind, 'requires elevated privileges'))\n console.error(bind + ' requires elevated privileges')\n process.exit(1)\n case 'EADDRINUSE':\n logger.error(util.format(bind, ' is already in use'))\n console.error(bind + ' is already in use')\n process.exit(1)\n default:\n logger.error(util.format('http server: ', error))\n throw error\n }\n}", "onError( error, request, response ) {\n\n\t\tconsole.log( chalk.red.bold( \"Global Error Handler:\" ) );\n\t\tconsole.log( error );\n\n\t\t// If the headers have already been sent, it's too late to adjust the output, so\n\t\t// just end the response so it doesn't hang.\n\t\tif ( response.headersSent ) {\n\n\t\t\treturn( response.end() );\n\n\t\t}\n\n\t\t// Render the not found error page.\n\t\tif ( error.message === \"Not Found\" ) {\n\n\t\t\tresponse.status( 404 );\n\t\t\tresponse.setView( \"common:error.notfound\" );\n\n\t\t} else {\n\n\t\t\t// Render the fatal error page.\n\t\t\tresponse.rc.title = \"Server Error\";\n\t\t\tresponse.rc.description = \"An unexpected error occurred. Our team is looking into it.\";\n\t\t\tresponse.status( 500 );\n\t\t\tresponse.setView( \"common:error.fatal\" );\n\n\t\t}\n\t\t\n\t}", "function onError(error) {\n debug('onError');\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string'\n ? `Pipe ${port}`\n : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(`${bind} requires elevated privileges. Exiting.`, { error, tags: 'exit' });\n exitProcess(110);\n break;\n case 'EADDRINUSE':\n logger.error(`${bind} is already in use. Exiting.`, { error, tags: 'exit' });\n exitProcess(111);\n break;\n default:\n logger.error('HTTP server error', { error, tags: 'server' });\n throw error;\n }\n}", "function onError(error) {\n self.error('Error : ' + error.status + ' ' + error.statusText);\n }", "$errorHandler(e, url, config, request) {\r\n if (e instanceof ResponseError) {\r\n throw e;\r\n }\r\n else {\r\n // Network error!\r\n throw new ResponseError('Unkown Error: ', ResponseErrors.UnknownError, e, {\r\n url, config, request\r\n });\r\n }\r\n }", "error(error) {\n this.__processEvent('error', error);\n }", "function errorHandler(error) {\n console.log(\"error occured\", error);\n alert(\"server not responding, try again later!\")\n}", "_onSocketError(variable, evt) {\n variable._socketConnected = false;\n this.freeSocket(variable);\n // EVENT: ON_ERROR\n initiateCallback(VARIABLE_CONSTANTS.EVENT.ERROR, variable, _.get(evt, 'data') || 'Error while connecting with ' + variable.service, evt);\n }", "function connectionErrorHandler(error) {\n var socket = this\n if (socket.res) {\n if (socket.res.request) {\n socket.res.request.emit('error', error)\n } else {\n socket.res.emit('error', error)\n }\n } else {\n socket._httpMessage.emit('error', error)\n }\n}", "function httpError(response, error, xhr) {\n try {\n $.lib.logError('['+endpoint+'] httpError.response=' + JSON.stringify(response), LOGTAG+'.httpError');\n var processedresponse = processHTTPResponse(false, response, error, xhr);\n if (_.isFunction(onError)) {\n _.defer(function(){ onError(processedresponse); });\n }\n } catch(E) {\n $.lib.logError(E, 'feetapi.httpError');\n }\n }", "function onSocketError(err) {\n let data = _data.get(this);\n\n data.error = err;\n\n _data.set(this, data);\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\r\n if (error.syscall !== 'listen') {\r\n throw error;\r\n }\r\n\r\n // handle specific listen errors with friendly messages\r\n switch (error.code) {\r\n case 'EACCES':\r\n console.error('Port ', port, ' requires elevated privileges.');\r\n process.exit(1);\r\n break;\r\n case 'EADDRINUSE':\r\n console.error('Port ', port, ' is already in use.');\r\n process.exit(1);\r\n break;\r\n default:\r\n console.error('Unknown error code: ', error.code);\r\n throw error;\r\n }\r\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(port + ' requires elevated privileges');\n break;\n case 'EADDRINUSE':\n logger.error(port + ' is already in use');\n break;\n default:\n throw error;\n }\n}", "onError(err) {\n debug$3(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "function onError(error)\n{\n if(error.syscall !== 'listen') {\n throw error;\n }\n\n //\n //\thandle specific listen errors with friendly messages\n //\n switch(error.code)\n {\n case 'EACCES':\n console.error(\"Port %d requires elevated privileges\", port);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(\"Port %d is already in use\", port);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error\n }\n\n const bind = typeof Utils.readConfig('http_port') === 'string'\n ? 'Pipe ' + Utils.readConfig('http_port')\n : 'Port ' + Utils.readConfig('http_port')\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges')\n process.exit(1)\n break\n case 'EADDRINUSE':\n console.error(bind + ' is already in use')\n process.exit(1)\n break\n default:\n throw error\n }\n }", "function onError(error) {\n \n if (error.syscall !== 'listen') {\n throw error\n }\n \n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error('Port ' + port + ' requires elevated privileges')\n process.exit(1)\n break\n case 'EADDRINUSE':\n logger.error('Port ' + port + ' is already in use')\n process.exit(1)\n break\n default:\n throw error\n }\n }", "function request_error_handler(error, script_name)\n{\n\t// Handle individual errors here.\n\tif ( error == 'db_connect' )\n\t\talert('ERROR: Could not process request at this time. Database unavailable.');\n\telse if ( error == 'script_not_found' )\n\t\talert('ERROR: The script specified to handle this request does not exist.');\n\telse if ( error == 'login_required' )\n\t\talert('ERROR: Your session has timed out. Please log in again.');\n\telse if ( error == 'dirty_script_name' )\n\t\talert('ERROR: Invalid characters in script name: '+ script_name);\n\telse if ( error == 'AJAX_failed' )\n\t\talert('ERROR: The AJAX request could not be completed: '+ script_name);\n\telse\n\t\talert('ERROR: '+ error);\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`${bindInfo.portType} ${bindInfo.port} requires elevated privileges`);\n process.exit(1);\n break;\n\n case 'EADDRINUSE':\n console.error(`${bindInfo.portType} ${bindInfo.port} is already in use`);\n process.exit(1);\n break;\n\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`Port ${port} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`Port ${port} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n //console.log(error);\n if (error.syscall !== 'listen') {\n throw error;\n }\n \n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n \n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n server.close();\n //process.exit(1);\n break;\n default:\n throw error;\n }\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n /*! ES6 support */\n<% if (es6) { -%>\n <%- varconst %> bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n<% } else { -%>\n <%- varconst %> bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n<% } -%>\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n<% if (es6) { -%>\n console.error(`${bind} requires elevated privileges`);\n<% } else { -%>\n console.error(bind + ' requires elevated privileges');\n<% } -%>\n process.exit(1);\n // break;\n case 'EADDRINUSE':\n<% if (es6) { -%>\n console.error(`${bind} is already in use`);\n<% } else { -%>\n console.error(bind + ' is already in use');\n<% } -%>\n process.exit(1);\n // break;\n default:\n throw error;\n }\n}", "function handleError(_e,_xhr,_custom) {\n\t\t\tif (_custom) {\n\t\t\t\t_custom(e,xhr);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tTi.API.error('Error: '+JSON.stringify(_e)+'\\nServer response: '+_xhr.responseText);\n\t\t\t\tapp.ui.alert(L('error'), L('error_general'));\n\t\t\t\tTi.App.fireEvent('app:hide.loader');\n\t\t\t}\n\t\t}", "function onConnectionFailed() {\r\n\t\t console.error('Connection Failed!');\r\n\t\t}", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`Port ${error.port} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`Port ${error.port} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onConnectionFailed(){\n\t\t\tconsole.error(\"Connection Failed!\")\n\t\t}", "function errorHandler (error) {\n console.error(error)\n throw new Error('Failed at server side')\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`${port} port requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`${port} port is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "onError(e) {\n this.handleNetworkingError(`Socket error: ${JSON.parse(e)}`);\n this.websocket.close();\n this.scheduleReconnect();\n }", "function onError(error) {\n\tif (error.syscall !== 'listen') {\n\t\tthrow error;\n\t}\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\t\tcase 'EACCES':\n\t\t\tconsole.error('Port ' + port + ' requires elevated privileges');\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tcase 'EADDRINUSE':\n\t\t\tconsole.error('Port ' + port + ' is already in use');\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow error;\n\t}\n}", "[net.onError](err) {\n console.log('SC:error', err);\n }", "function onErrorRequest(error) {\r\n\t\t\tconsole.log(\"err [\" + error.name + \"] msg[\" + error.message + \"]\");\r\n\t\t}", "function on_error(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const port = error.port;\n\n const bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error('These ports may require elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error('These ports may already be in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n}", "function onError(evt) {\n console.log(\"ERROR: \" + evt.data);\n}", "onError(err) {\n this._closeSocket(err.message);\n }", "registerErrorListener() {\n onError(error => {\n console.log(JSON.stringify(error));\n });\n }", "function registerEventError(errorMessage) {\n registerWebview.emit('error', errorMessage);\n}", "function onError(error) { handleError.call(this, 'error', error);}", "onError(err) {\n Socket$1.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "onError(fn) {\n\n this.eventEmitter.on(settings.socket.error, (data) => {\n\n fn(data)\n });\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`{bind} requires elevated privileges`);\n logger.error({\"message\": `${bind} requires elevated privileges`, \"user\": 'system', \"namespace\": 'www.server.bind.privileges'});\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`{bind} is already in use`);\n logger.error({\"message\": `${port} is already in use`, \"user\": 'system', \"namespace\": 'www.server.bind.use'});\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n var exit = false;\n var errorMessage = 'Error: ';\n switch (error.code) {\n case 'EACCES':\n errorMessage += bind + ' requires elevated privileges.';\n exit = true;\n break;\n case 'EADDRINUSE':\n errorMessage += bind + ' is already in use.';\n exit = true;\n break;\n default:\n errorMessage += error.message || 'Something broke.';\n\n console.error(errorMessage);\n\n // If the process is a child process (e.g. started in Gulp)\n // then inform the parent process that the server has errored.\n if (process.send) {\n process.send(startMessage);\n }\n\n // Exit or rethrow.\n if (exit) {\n process.exit(1);\n } else {\n throw error;\n }\n }\n}", "onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n \n var bind = typeof this.port === 'string'\n ? 'Pipe ' + this.port\n : 'Port ' + this.port;\n \n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n }", "function onError(error) {\n debugErr(error)\n if (error.syscall !== 'listen') {\n throw error\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES': throw new Error(config.port + ' requires elevated privileges')\n case 'EADDRINUSE': throw new Error(config.port + ' is already in use')\n default: throw error\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n let bind = typeof webSocketPort === 'string'\n ? 'Pipe ' + webSocketPort\n : 'Port ' + webSocketPort;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError (error) {\n if (error.syscall !== 'listen') {\n throw error\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.log(chalk.white.bgRed(`\\nError: Port ${port} requires elevated privileges\\n`))\n process.exit(1)\n case 'EADDRINUSE':\n console.log(chalk.white.bgRed(`\\nError: Port ${port} is already in use\\n`))\n process.exit(1)\n default:\n console.log(chalk.white.bgRed(`\\nError: ${error}\\n`))\n }\n}", "_onError(event) {\n const span = document.createElement(\"span\");\n span.innerHTML = \"\" + \"Upload failed. Retrying in 5 seconds.\";\n this.node.appendChild(span);\n this.retry = setTimeout(() => this.callbackUpload(), 5000, this.data);\n\n TheFragebogen.logger.error(this.constructor.name + \".callbackUpload()\", \"Upload failed with HTTP code: \" + this.request.status + \". Retrying in 5 seconds.\");\n }", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n switch (error.code) {\n case \"EACCES\":\n console.error(port + \" requires elevated privileges\");\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(port + \" is already in use\");\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n\tif (error.syscall !== 'listen') {\n\t\tthrow error;\n\t}\n\n\tconst bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\tcase 'EACCES':\n\t\tlogger.error(`${bind} requires elevated privileges`);\n\t\tprocess.exit(1);\n\t\tbreak;\n\tcase 'EADDRINUSE':\n\t\tlogger.error(`${bind} is already in use`);\n\t\tprocess.exit(1);\n\t\tbreak;\n\tdefault:\n\t\tthrow error;\n\t}\n}", "function onError(error) {\n if (error.syscall !== 'listen') throw error;\n var bind = typeof port === 'string' ? 'Pipe ' + port: 'Port ' + port;\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.log(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.log(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n console.log('Erro de listening '+error.syscall );\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n log.fatal(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n log.fatal(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n const bind = typeof port === \"string\" ? `Pipe ${port}` : `Port ${port}`;\n\n // manejar errores de escucha específicos con mensajes amigables\n switch (error.code) {\n case \"EACCES\":\n console.error(`${bind}, Requiere Privilegios`);\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(`${bind} Esta en uso`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string'\n ? `Pipe ${port}`\n : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n log.error(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n log.error(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n handleError.call(this, 'error', error);\n }", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n var bind = typeof port === \"string\" ? \"Pipe \" + port : \"Port \" + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case \"EACCES\":\n console.error(bind + \" requires elevated privileges\");\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(bind + \" is already in use\");\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n }", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n const bind = typeof port === \"string\" ? `Pipe ${port}` : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case \"EACCES\":\n console.error(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n\tif (error.syscall !== 'listen') {\n\t\tthrow error;\n\t}\n\n\tconst bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\tcase 'EACCES':\n\t\tconsole.error(`${bind} requires elevated privileges`);\n\t\tprocess.exit(1);\n\t\tbreak;\n\tcase 'EADDRINUSE':\n\t\tconsole.error(`${bind} is already in use`);\n\t\tprocess.exit(1);\n\t\tbreak;\n\tdefault:\n\t\tthrow error;\n\t}\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error\n }\n\n const addr = this.address()\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges')\n process.exit(1)\n break\n case 'EADDRINUSE':\n console.error(bind + ' is already in use')\n process.exit(1)\n break\n default:\n throw error\n }\n}", "function onError(error) {\n\tif (error.syscall !== \"listen\") {\n\t\tthrow error;\n\t}\n\n\tvar bind = typeof port === \"string\" ? \"Pipe \" + port : \"Port \" + port;\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\t\tcase \"EACCES\":\n\t\t\tconsole.error(bind + \" requires elevated privileges\");\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tcase \"EADDRINUSE\":\n\t\t\tconsole.error(bind + \" is already in use\");\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow error;\n\t}\n}", "onRequestError(err) {\n log('request error', err)\n this.emit('error', err)\n if (err.status === 401) this.onUnauthorized()\n else this.reopen()\n }", "function onError(error) {\n\tif (error.syscall !== 'listen') {\n\t\tthrow error;\n\t}\n\n\tconst bind = typeof port === 'string' ? `Pipe ${port}` : `Port '${port}`;\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\t\tcase 'EACCES':\n\t\t\tconsole.error(`${bind} requires elevated privileges`);\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tcase 'EADDRINUSE':\n\t\t\tconsole.error(`${bind} is already in use`);\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow error;\n\t}\n}", "function onError (error) {\n if (error.syscall !== 'listen') {\n throw error\n }\n\n const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n // When things are going wrong, do not write to the log file, since it seems\n // that these messages disappear into a black hole rather than go to the log\n // file. Just write to the console for simplicity.\n case 'EACCES':\n console.error(`${bind} requires elevated privileges`)\n process.exit(1)\n case 'EADDRINUSE':\n console.error(`${bind} is already in use`)\n process.exit(1)\n default:\n throw error\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port; // eslint-disable-line\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(`${bind} requires elevated privileges.`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n logger.error(`${bind} is already in use.`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n var bind = typeof port === \"string\" ? \"Pipe \" + port : \"Port \" + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case \"EACCES\":\n console.error(bind + \" requires elevated privileges\");\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(bind + \" is already in use\");\n process.exit(1);\n break;\n default:\n throw error;\n }\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string'\n ? `Pipe ${port}`\n : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = `${typeof port === 'string' ? 'Pipe' : 'Port'} ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n process.stderr.write(`${bind} requires elevated privileges\\n`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n process.stderr.write(`${bind} is already in use\\n`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = (typeof port === 'string') ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n //process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n //process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n debug(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n debug(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function $onServerUniqueError(error) {\n\n feedConsoleLines.call(this, \"SRV UNIQUE ERR\", error);\n\n}", "function onError(error) {\n\tif (error.syscall !== 'listen') {\n\t\tthrow error;\n\t}\n\n\tconst bind = typeof port === 'string'\n\t\t? 'Pipe ' + port\n\t\t: 'Port ' + port;\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\t\tcase 'EACCES':\n\t\t\tconsole.error(bind + ' requires elevated privileges');\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tcase 'EADDRINUSE':\n\t\t\tconsole.error(bind + ' is already in use');\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow error;\n\t}\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof PORT === 'string' ?\n 'Pipe ' + PORT :\n 'Port ' + PORT;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n let bind = typeof port === \"string\" ? \"Pipe \" + port : \"Port \" + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case \"EACCES\":\n console.error(bind + \" requires elevated privileges\");\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(bind + \" is already in use\");\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n var bind = 'Port ' + _config2.default.port;\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n let bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n notifier.notify('a_6', bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n notifier.notify('a_7', bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n logger.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}" ]
[ "0.71193427", "0.705736", "0.703456", "0.7025231", "0.6965633", "0.68818927", "0.68552595", "0.6830455", "0.6821154", "0.68110627", "0.678838", "0.67825073", "0.6781351", "0.67704874", "0.67664015", "0.6751079", "0.67061967", "0.6701468", "0.66606706", "0.66564983", "0.6645162", "0.66371745", "0.66307956", "0.66169554", "0.6614788", "0.65721726", "0.6563619", "0.65575963", "0.6552374", "0.65444857", "0.65427864", "0.6536863", "0.653472", "0.65340465", "0.65257764", "0.6524727", "0.65198684", "0.6519639", "0.6519639", "0.6519639", "0.65182835", "0.6517875", "0.6497895", "0.64905936", "0.64880335", "0.648673", "0.6476276", "0.64739966", "0.6471079", "0.64705443", "0.6468132", "0.6464946", "0.64604396", "0.64532465", "0.64531595", "0.6447981", "0.64212734", "0.64187276", "0.6403626", "0.6392793", "0.63907397", "0.6386814", "0.63860565", "0.63786453", "0.63735664", "0.63688165", "0.63542706", "0.6352481", "0.63445383", "0.6341312", "0.63394004", "0.6333927", "0.631214", "0.6308931", "0.6298235", "0.62971556", "0.62967896", "0.62952083", "0.62937546", "0.6292308", "0.62889475", "0.6287995", "0.62850904", "0.6284337", "0.62836206", "0.62808937", "0.62791866", "0.627758", "0.6272709", "0.62707484", "0.626718", "0.6258286", "0.6257988", "0.62562275", "0.6255446", "0.62530595", "0.62527025", "0.62509215", "0.62509215", "0.62508434", "0.6250342" ]
0.0
-1
Event listener for HTTP server "listening" event.
function onListening() { var addr = io.address(); var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port; debug('Listening on ' + bind); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onListeningHTTP () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP - Listening on ' + bind)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n log.debug('HTTP server listening on ' + bind);\n }", "function onListening() {\n logger.info('Webserver listening on port ' + server.address().port)\n }", "function onListening() {\n let addr = server.address();\n let bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n //debug('Listening on ' + bind);\n console.log('Http server is listening on ' + bind);\n}", "function onListening() {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP server listening on ' + bind)\n}", "function onListening() {\n var addr = httpsServer.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = httpsServer.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n\t\tvar addr = server.address();\n\t\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\t\tvar fqdn = scheme+\"://\"+host;\n\t\tcrawl.init(fqdn,host,scheme);\n\t}", "function onListening() {\n var addr = http.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n const address = httpServer.address().address;\n console.info(`Listening port ${port} on ${address} (with os.hostname=${os.hostname()})`);\n const entryFqdn = getEntryFqdn(address, port);\n console.info(`Use browser to open: ${entryFqdn}`);\n}", "function onListening() {\n\tdebug('Listening on port ' + server.address().port);\n}", "function httpOnListening() {\n var addr = httpServer.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address()\n const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port\n mainWindow.webContents.send('listening', bind)\n}", "function onListening() {\n CALLBACK();\n const addr = server.address();\n const bind = typeof addr === 'string' ?\n `pipe ${addr}` :\n `port ${addr.port}`;\n debug(`Listening on ${bind}`);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening()\n{\n\tvar addr\t= server.address();\n\tvar bind\t= ('string' === typeof addr) ? 'pipe ' + addr : 'port ' + addr.port;\n\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n Object.keys(httpServers).forEach(key => {\n var httpServer = httpServers[key];\n var addr = httpServer.address()||{};\n var bind = typeof addr === \"string\"\n ? \"pipe \" + addr\n : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n })\n}", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n\tdebug(\"Listening on \" + bind);\n}", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('http://localhost:' + addr.port);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n\n console.log(\"----- onListening\");\n}", "function onListening() {\n var addr = process.env.ADDRESS || http_server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug( 'Listening on ' + bind );\n}", "function onListening() {\n var addr = server.address();\n var bind = (typeof addr === 'string') ? 'pipe ' + addr : 'port ' + addr.port;\n logger.info('>> LISTENING ON ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug_info('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n logger.debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n console.log(\"Listening on \" + bind);\n }", "function onListening() {\n debug('Listening on ' + port);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n\t\t\t'pipe ' + addr : 'port ' + addr.port;\n\t\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening(): void {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? `pipe ${addr}`\n : `port ${addr.port}`;\n debug(`Listening on ${bind}`);\n console.log(`Listening on ${bind}`);\n}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? `pipe ${addr}`\n : `port ${addr.port}`;\n\n debug(`Server listening on ${bind}`);\n logger.info(`Server listening on ${bind}`, { tags: 'server' });\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string' ?\r\n 'pipe ' + addr :\r\n 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n logger.info('Listening on ' + bind);\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "function onListening () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('Listening on', bind)\n }", "_attachListeners () {\n const onListening = () => {\n const address = this._server.address()\n debug(`server listening on ${address.address}:${address.port}`)\n this._readyState = Server.LISTENING\n }\n\n const onRequest = (request, response) => {\n debug(`incoming request from ${request.socket.address().address}`)\n request = Request.from(request)\n response = Response.from(response)\n this._handleRequest(request, response)\n }\n\n const onError = err => {\n this.emit('error', err)\n }\n\n const onClose = () => {\n this._readyState = Server.CLOSED\n }\n\n this._server.on('listening', onListening)\n this._server.on('request', onRequest)\n this._server.on('checkContinue', onRequest)\n this._server.on('error', onError)\n this._server.on('close', onClose)\n this._readyState = Server.READY\n }", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = `${serverConfig.host}:${serverConfig.defaultPort}`;\n\t// const bind = typeof(addr) === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "onListening() {\n var addr = this.server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n let addr = server.address();\n let bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n log('Listening on ' + bind);\n}", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = typeof addr === 'string'\n\t\t? 'pipe ' + addr\n\t\t: 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('demo:server')('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address();\n console.log(`Listening on ${addr.port}`);\n}", "function onListening() {\n var serverURL = \"http://localhost:\" + config.port;\n console.log(\"server listening on \" + serverURL);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "onListening(server) {\n const { port } = server.listeningApp.address();\n console.log('Listening on port:', port);\n }", "function listener() {\r\n if (logged == 1) return;\r\n logged = 1;\r\n cfg.port = app.address().port;\r\n csl.log('Server running on port := ' + cfg.port);\r\n // Log the current configuration\r\n for (var key in cfg) {\r\n if (key != 'spdy' || key != 'https')\r\n csl.log(key + ' : ' + cfg[key]);\r\n }\r\n\r\n // If browser is true, launch it.\r\n if (cfg.browser) {\r\n var browser;\r\n switch (process.platform) {\r\n case \"win32\":\r\n browser = \"start\";\r\n break;\r\n case \"darwin\":\r\n browser = \"open\";\r\n break;\r\n default:\r\n browser = \"xdg-open\";\r\n break;\r\n }\r\n csl.warn('Opening a new browser window...');\r\n require('child_process').spawn(browser, ['http://localhost:' + app.address().port]);\r\n }\r\n }", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function on_listening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\"\n ? \"pipe \" + addr\n : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n\n var addr = this.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log(\"API Listening on port : \" + addr.port);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('API available on: /api/tasks');\n console.log('Socket connection available on: https://10.3.2.52:3333');\n}", "function onListening () {\n const addr = server.address()\n console.log(`Listening on https://localhost:${addr.port}`)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug( 'Listening on ' + bind );\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n info('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}" ]
[ "0.78543603", "0.7739916", "0.76332736", "0.75365347", "0.7531618", "0.7341063", "0.733379", "0.73028886", "0.7302802", "0.7282679", "0.7272048", "0.72311646", "0.72267777", "0.71615416", "0.71260625", "0.7120054", "0.7105148", "0.70975953", "0.7081919", "0.70732343", "0.7071961", "0.70644724", "0.7056824", "0.7052605", "0.7047003", "0.702555", "0.70165515", "0.70119435", "0.7006223", "0.6999816", "0.6998805", "0.69984835", "0.6993336", "0.6992539", "0.69878", "0.69853705", "0.69834304", "0.69833803", "0.69730884", "0.69718415", "0.6971338", "0.6970686", "0.69659597", "0.6965605", "0.69622135", "0.69610804", "0.69610804", "0.69610804", "0.69610804", "0.69610804", "0.6959213", "0.6957496", "0.695542", "0.6953007", "0.6953007", "0.69483477", "0.69388145", "0.6936377", "0.69358873", "0.6935214", "0.6935159", "0.6935082", "0.69344616", "0.6932475", "0.6932475", "0.6932475", "0.6931909", "0.69296336", "0.6929588", "0.69258696", "0.69257134", "0.69255424", "0.69255424", "0.69255424", "0.69255424", "0.69255424", "0.69255424", "0.69255424", "0.69255424", "0.6924427", "0.6921941", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283", "0.6920283" ]
0.0
-1
TODO move this overflow to steroids?
componentDidMount() { html.addClass(document.body, 'overflow-hidden'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount;}", "static get SIZE() { return 2000000; }", "transient final private internal function m170() {}", "_subtractOverflows(length, ...overflows) {\n return overflows.reduce((currentValue, currentOverflow) => {\n return currentValue - Math.max(currentOverflow, 0);\n }, length);\n }", "get _physicalEnd(){return(this._physicalStart+this._physicalCount-1)%this._physicalCount}", "static private internal function m121() {}", "transient protected internal function m189() {}", "getOuterLength() {\n mustInherit();\n }", "function u(e){var t=\"string\"==typeof e?parseInt(e,16):e;return t<65536?x(t):(t-=65536,x(55296+(t>>10),56320+(1023&t)))}", "get newLength() {\n let result = 0;\n for (let i = 0; i < this.sections.length; i += 2) {\n let ins = this.sections[i + 1];\n result += ins < 0 ? this.sections[i] : ins;\n }\n return result;\n }", "function X(){!function(t){$[W++]^=255&t,$[W++]^=t>>8&255,$[W++]^=t>>16&255,$[W++]^=t>>24&255,W>=J&&(W-=J)}((new Date).getTime())}", "function PuckerAndBloatModifier() {\n }", "function makeSmaller() {\n\n}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "function i(t,e,n){var i=t.length>>>0;return e=null==e?n||0:e<0?Math.max(i+e,0):Math.min(e,i),e}", "transient final private protected internal function m167() {}", "function y(e){let t=R,n=D,r=j,s=v,i=M,o=B,a=_,u=new Uint8Array(x.slice(0,R)),d=E,c=E.slice(0,E.length),g=F,l=Y,p=e();return R=t,D=n,j=r,v=s,M=i,B=o,_=a,x=u,Y=l,E=d,E.splice(0,E.length,...c),F=g,P=new DataView(x.buffer,x.byteOffset,x.byteLength),p}", "function r(e,t,n){var r=e.length>>>0;return t=null==t?n||0:t<0?Math.max(r+t,0):Math.min(t,r),t}", "function r(e){return 0>e?(-e<<1)+1:(e<<1)+0}", "function Hx(a){return a&&a.ic?a.Mb():a}", "getInnerLength() {\n mustInherit();\n }", "function r(t,e,n){var r=t.length>>>0;return e=null==e?n||0:e<0?Math.max(r+e,0):Math.min(e,r),e}", "function X(){!function(e){Y[V++]^=255&e,Y[V++]^=e>>8&255,Y[V++]^=e>>16&255,Y[V++]^=e>>24&255,V>=256&&(V-=256)}((new Date).getTime())}", "static final private internal function m106() {}", "static wrap (input, target) {\n if (input >= target) {\n input -= target;\n return Memory.wrap(input, target);\n }\n else if (input < 0) {\n input += target;\n return Memory.wrap(input, target);\n }\n else {\n return input;\n }\n }", "transient private protected internal function m182() {}", "wrap(index) {\n // don't trust % on negative numbers\n while (index < 0) {\n index += this.doubledCapacity;\n }\n return index % this.doubledCapacity;\n }", "function base_w(outlen, input) {\n\t/*\n\tif(8 % WOTSLOGW != 0) {\n\t\tconsole.log(\"SECURITY PROBLEM! WOTSLOGW MUST BE A DIVISOR OF 8!\");\n\t}\n\tthinking about then making an upper library that handles all those functions with objects, so I check that automatically\n\t*/\n\tvar in_ = 0;\n\tvar out = 0;\n\tvar total; // I am not sure about this one\n\tvar bits = 0;\n\tvar output = [];\n\tfor(var consumed = 0; consumed < outlen; consumed++) {\n\t\tif(bits == 0) {\n\t\t\ttotal = input[in_];\n\t\t\tin_ ++;\n\t\t\tbits += 8;\n\t\t}\n\t\tbits -= WOTSLOGW;\n\t\toutput[out] = (total >> bits) & (WOTSW - 1);\n\t\tout++;\n\t}\n\treturn output;\n}", "static transient private protected internal function m55() {}", "function stackoverflow(hay, ...stack) {\n/*I really don't understand this part correctly*/\n function multiply(current, next) {\n return current * next;\n }\n return stack.reduce(multiply, hay);\n}", "function e(){return [0,0,0,1]}", "function fix(v, size) {\n return v < 0 ? (size + 1 + v) : v;\n}", "function z(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}", "function inclinedType2 (size, t) {\n\t\treturn function (x) {\n\t\t\tvar z = x % size;\n\t\t\tz += z < 0 ? size : 0;\n\t\t\tif (z < t) {\n\t\t\t\treturn x - z;\n\t\t\t} else if (z > size - t) {\n\t\t\t\treturn x + size - z;\n\t\t\t}\n\t\t\treturn x;\n\t\t};\n\t}", "size(){ return this.end-this.start }", "function X(){!function(e){H[G++]^=255&e,H[G++]^=e>>8&255,H[G++]^=e>>16&255,H[G++]^=e>>24&255,G>=256&&(G-=256)}((new Date).getTime())}", "function G(){!function(t){W[Y++]^=255&t,W[Y++]^=t>>8&255,W[Y++]^=t>>16&255,W[Y++]^=t>>24&255,Y>=256&&(Y-=256)}((new Date).getTime())}", "function h(){return r.TYPED_ARRAY_SUPPORT?2147483647:1073741823}", "function exponentHeight(){\n return(totalHeight()**2);\n}", "function FlexibleFit() { }", "getBackendFullLen(len){\n\treturn (1+ 2*this.margin_percent/100) * len;\n }", "function intakeBits(amt){\r\n\r\n}", "get optimalSize() {\n return [200, 32];\n }", "function aVeryBigSum(ar) {\n \n}", "function $(){var t;t=(new Date).getTime(),J[W++]^=255&t,J[W++]^=t>>8&255,J[W++]^=t>>16&255,J[W++]^=t>>24&255,W>=X&&(W-=X)}", "static protected internal function m125() {}", "limitx() { return (this.scale - 1) * this.sizex / 2; }", "howMuchMore() {\n return this.maxSize - this.totalSize;\n }", "function expand(x,n) {\n var ans=int2bigInt(0,(x.length>n ? x.length : n)*bpe,0);\n copy_(ans,x);\n return ans;\n }", "static transient private internal function m58() {}", "checkOverflow () {\n if ((this.front === 1 && this.rear === this.maxLength) || (this.front === this.rear + 1)) {\n console.log('CIRCULAR QUEUE OVERFLOW')\n return true\n }\n }", "function f(e,t){var n=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(n>>16)<<16|65535&n}", "function v6_rle_if_shorter(arr){var x,y\n x='rle_dec(['+v6_rle_enc(arr).join(',')+'])'\n y='['+arr.join(',')+']'\n if(y.length - x.length > 16) return x\n return y}", "static transient final private internal function m43() {}", "function Re(){!function t(e){Ce[Te++]^=255&e,Ce[Te++]^=e>>8&255,Ce[Te++]^=e>>16&255,Ce[Te++]^=e>>24&255,Te>=256&&(Te-=256)}((new Date).getTime())}", "static private protected internal function m118() {}", "full_u64() {\n this.throw_if_less_than(8);\n\n let val = 0;\n for (let i = 0; i < 8; i++) {\n val = (val * 256) + this.buffer[this.pos];\n this.pos += 1;\n }\n return val;\n }", "function xx(i){\n \treturn 2*i/width - 1;\n}", "function xx(i){\n \treturn 2*i/width - 1;\n}", "function expand(x, n) {\n var ans = int2bigInt(0, (x.length > n ? x.length : n) * bpe, 0);\n copy_(ans, x);\n return ans;\n }", "function is_overflow(x) {\n return ((x[0] > P26 - 19 &&\n (x[1] & x[3] & x[5] & x[7] & x[9]) === P25 &&\n (x[2] & x[4] & x[6] & x[8]) === P26) ||\n x[9] > P25);\n }", "function Le(){!function t(e){Ie[De++]^=255&e,Ie[De++]^=e>>8&255,Ie[De++]^=e>>16&255,Ie[De++]^=e>>24&255,De>=Ue&&(De-=Ue)}((new Date).getTime())}", "function am1(i,x,w,j,c,n){while(--n>=0){var v=x*this[i++]+w[j]+c;c=Math.floor(v/0x4000000);w[j++]=v&0x3ffffff;}return c;}// am2 avoids a big mult-and-extract completely.", "function clamp_css_byte(e){return e=Math.round(e),0>e?0:e>255?255:e}", "function f(){return{range:function(e,t,a){void 0===t?(t=e,e=0,a=1):a||(a=1);var n=[];if(a>0)for(var r=e;r<t;r+=a)n.push(r);else for(var f=e;f>t;f+=a)\n // eslint-disable-line for-direction\n n.push(f);return n},cycler:function(){return n(Array.prototype.slice.call(arguments))},joiner:function(e){return r(e)}}}", "static mpReduceSize(x) {\n if(!x) {\n throw new Error(\"mpReduceSize incorrect imput\");\n } \n\n while(x.length > 0) {\n if(x[x.length - 1] == 0) {\n x.pop();\n continue;\n }\n break;\n } \n\n if(x.length == 0) {\n x.push(0);\n } \n }", "get lowerArmTwist() {}", "get left () { return this.x - this.size / 2 }", "quotaMysWPass(){\n return math.chain(+this.props.numLocalEmp || 0).multiply(0.666667).floor().done();\n }", "function Oe(){!function t(e){Ie[De++]^=255&e,Ie[De++]^=e>>8&255,Ie[De++]^=e>>16&255,Ie[De++]^=e>>24&255,De>=Le&&(De-=Le)}((new Date).getTime())}", "_mod(val) {\n if (this.pillar === false) return val\n return (val + this.largezero) % this.width\n }", "lengthSq() {\n return this.w * this.w + this.xyz.clone().lengthSq();\n }", "function u(){return s.TYPED_ARRAY_SUPPORT?2147483647:1073741823}", "valueOf() {\n let b = this.buf,\n v = 0;\n for (let i = b.length - 1; i >= 0; --i)\n v = v * max + b[i];\n return v;\n }", "get stride() {}", "_calculateBounds() {\n // FILL IN//\n }", "function Y(){!function(t){q[$++]^=255&t,q[$++]^=t>>8&255,q[$++]^=t>>16&255,q[$++]^=t>>24&255,$>=256&&($-=256)}((new Date).getTime())}", "static transient final private protected internal function m40() {}", "transient final private public function m168() {}", "function cutIt(arr){\n var min = Math.min(...arr.map(({ length }) => length));\n //map over array slice it by min.\n<<<<<<< HEAD\n \n \n}", "function e$1(){return [1,0,0,0,1,0,0,0,1]}", "function normalizeEm (z) {return z / (keyFrame - 1) / n;}", "function e(o247) {\n try {\no247 = o247 | 0;\n}catch(e){}\n try {\no1071 = o247\n}catch(e){}\n }", "static normalizeOffset(base) {\n return Array.from(base, c => normalizePN(c));\n }", "static get END() { return 6; }", "function e$2(e,t,r){const d=e.typedBuffer,f=e.typedBufferStride,n=t.typedBuffer,o=t.typedBufferStride,c=r?r.count:t.count;let u=(r&&r.dstIndex?r.dstIndex:0)*f,p=(r&&r.srcIndex?r.srcIndex:0)*o;for(let s=0;s<c;++s){for(let e=0;e<16;++e)d[u+e]=n[p+e];u+=f,p+=o;}}", "function makeBigger() {\n\n}", "static transient private public function m56() {}", "function erode(input,width,index) {\n if (index % tombola.range(1,width)===0) {\n input = -input;\n }\n return input;\n}", "function e$1(e,t,r){const n=e.typedBuffer,o=e.typedBufferStride,c=t.typedBuffer,d=t.typedBufferStride,f=r?r.count:t.count;let s=(r&&r.dstIndex?r.dstIndex:0)*o,u=(r&&r.srcIndex?r.srcIndex:0)*d;for(let p=0;p<f;++p)n[s]=c[u],s+=o,u+=d;}", "function n(e){return 0>e?(-e<<1)+1:(e<<1)+0}", "function e$1(e,t,n){const d=e.typedBuffer,f=e.typedBufferStride,o=t.typedBuffer,r=t.typedBufferStride,u=n?n.count:t.count;let l=(n&&n.dstIndex?n.dstIndex:0)*f,c=(n&&n.srcIndex?n.srcIndex:0)*r;for(let s=0;s<u;++s)d[l]=o[c],d[l+1]=o[c+1],d[l+2]=o[c+2],d[l+3]=o[c+3],l+=f,c+=r;}", "function r(n,e){0}", "function e$5(e,t,r){const d=e.typedBuffer,f=e.typedBufferStride,n=t.typedBuffer,c=t.typedBufferStride,o=r?r.count:t.count;let u=(r&&r.dstIndex?r.dstIndex:0)*f,p=(r&&r.srcIndex?r.srcIndex:0)*c;for(let s=0;s<o;++s)d[u]=n[p],d[u+1]=n[p+1],d[u+2]=n[p+2],u+=f,p+=c;}", "function am1(i,x,w,j,c,n) {\n\twhile(--n >= 0) {\n\t var v = x*this[i++]+w[j]+c;\n\t c = Math.floor(v/0x4000000);\n\t w[j++] = v&0x3ffffff;\n\t}\n\treturn c;\n }", "length(): number {\n return Math.max(0, this.stop - this.start + 1);\n }", "blockSize() {\n return 8;\n }" ]
[ "0.62269926", "0.5951167", "0.5701363", "0.560616", "0.55644083", "0.5560616", "0.54985994", "0.5494242", "0.54607505", "0.54049695", "0.5374627", "0.53283453", "0.53270745", "0.5299159", "0.5292567", "0.5291579", "0.5278496", "0.5221677", "0.5215693", "0.5212055", "0.52100575", "0.52051806", "0.5202609", "0.5199199", "0.5192477", "0.5189404", "0.5183139", "0.5180702", "0.51806635", "0.5176147", "0.5163915", "0.51404333", "0.5139478", "0.51347476", "0.51344156", "0.5131239", "0.5117108", "0.51165944", "0.5116047", "0.5113942", "0.5106112", "0.51048106", "0.510332", "0.50857556", "0.50768447", "0.5066628", "0.50595474", "0.5053632", "0.5051856", "0.50288886", "0.501513", "0.50147617", "0.50126785", "0.5007314", "0.5003393", "0.5001733", "0.4995532", "0.49864778", "0.49754342", "0.49705282", "0.497028", "0.49695915", "0.49695915", "0.49639463", "0.4959594", "0.4959558", "0.49527982", "0.49497637", "0.49475184", "0.49459434", "0.4939555", "0.49393862", "0.49297628", "0.49297243", "0.4923709", "0.49130216", "0.49121547", "0.48999104", "0.48975787", "0.48972788", "0.48957402", "0.48950633", "0.48918006", "0.48873213", "0.48857233", "0.48855737", "0.48827416", "0.48742506", "0.48688018", "0.4866334", "0.48628837", "0.48592892", "0.4857215", "0.4851039", "0.48484603", "0.4832089", "0.4830794", "0.48271582", "0.48268312", "0.4823319", "0.48229885" ]
0.0
-1
On render, we want to add the navigation
onRender () { let Navigation = new NavigationView(); App.navigationRegion.show(Navigation); Navigation.setItemAsActive("home"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderNavigationMenu() {\n\n }", "function _addNavigation() {}", "createNavigation() {\n var nav = super.createNavigation();\n nav.right.push(new NavButton('Continue', this.next, true, true));\n this.navigation = nav;\n }", "function setNavigation() {\r\n\t\t\tvar i, html = '';\r\n\r\n\t\t\t//generate the buttons\r\n\t\t\tif(o.buttons) {\r\n\t\t\t\t$nav = $('<ul />', {\r\n\t\t\t\t\tid: o.navigationId\r\n\t\t\t\t});\r\n\t\t\t\tfor(i = 0; i < itemNum; i++) {\r\n\t\t\t\t\thtml += '<li><span></span></li>';\r\n\t\t\t\t}\r\n\t\t\t\t$nav.html(html).appendTo($root).fadeIn(700);\r\n\r\n\t\t\t\t$navLi = $nav.find('li');\r\n\t\t\t\t$navLi.eq(0).addClass(o.selectedClass);\r\n\t\t\t}\r\n\r\n\t\t\t//generate the arrows\r\n\t\t\tif(o.arrows) {\r\n\t\t\t\t$prevArrow = $('<div />', {\r\n\t\t\t\t\t'class': o.prevArrowClass\r\n\t\t\t\t}).appendTo($root);\r\n\t\t\t\t$nextArrow = $('<div />', {\r\n\t\t\t\t\t'class': o.nextArrowClass\r\n\t\t\t\t}).appendTo($root);\r\n\t\t\t}\r\n\r\n\t\t}", "createNavigation() {\n var nav = super.createNavigation();\n nav.left.push(\n new NavButton('Back', this.back, !this.isFirstQuestionOfWizard, false, 0));\n nav.left.push(\n new NavButton('Cancel', this.cancel, true, false, 1));\n nav.right.push(\n new NavButton('Continue', this.next, true, false, 1));\n nav.right.push(\n new NavButton('Save and Exit', this.saveAndExit, true, false, 0));\n\n this.navigation = nav;\n }", "createNavigation() {\n var nav = super.createNavigation();\n nav.left.push(new NavButton('Review/Change Responses', this.back, true, false, 0));\n nav.right.push(new NavButton('Submit Assessment', scope.submitAndEnd, true, !this.isValid, 1));\n nav.right.push(new NavButton('Save and Exit', saveAndExit, true, false, 0));\n\n this.navigation = nav;\n }", "function setupNavigation() {\n\tconsole.log('Rendering Page...');\n\tsetToolTab();\n\tsetContextItem();\n}", "createNavigation() {\n var nav = {\n left: [],\n right: []\n };\n nav.right.push(new NavButton('Review Results', scope.review, true, false, 0));\n\n this.navigation = nav;\n }", "render() {\n const { auth } = this.props;\n return (\n <nav>\n <div className=\"nav-wrapper\">\n <Link to={auth ? \"/surveys\" : \"/\"} className=\"left brand-logo\">\n Feedback\n </Link>\n <ul id=\"nav-mobile\" className=\"right \">\n {this.renderContent()}\n </ul>\n </div>\n </nav>\n );\n }", "function add_navigation(){\r\n\t\tif(list_elem_count==0){\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar icon_markup2 = '<div class=\"icon2\" id=\"icon_wrapper\"><svg x=\"0px\" y=\"0px\" width=\"24.3px\" height=\"23.2px\" viewBox=\"0 0 24.3 23.2\" enable-background=\"new 0 0 24.3 23.2\" xml:space=\"preserve\"><polygon class=\"arrow\" fill=\"#ffffff\" points=\"'+ svg_arrow_icon +'\"></svg></div>';\r\n\t\t\r\n $('#2nav .vertab').after(icon_markup2);\r\n $('#2nav .icon2').eq(0).addClass('current_nav');\r\n\t}", "onRender () {\n console.log(this.component);\n if(undefined !== this.component) {\n this.el.querySelector(`[data-id=\"${this.component}\"]`).classList.add(\"active\");\n }\n\n var Navigation = new NavigationView();\n App.getNavigationContainer().show(Navigation);\n Navigation.setItemAsActive(\"components\");\n this.showComponent(this.component);\n\n }", "function setupPublicNavigation() {\n Navigation.clear();\n Navigation.breadcrumbs.add('Openings', '#!/openings', '#!/openings'); // add a breadcrumb\n Navigation.viewTitle.set('View Opening');\n }", "initialize ( ) {\n this.navList = navigationItems;\n // Send JSON city data to prepare navigation items\n this.prepareNavigationPanel(navigationItems);\n }", "function renderNavigation() {\n // CREATE NAVBAR IN DOM from MAIN_LINKS in data.js\n $('#header').append(componentNavbar());\n $('.sidebar-wrapper').append(componentSidebar());\n for (let link of MAIN_LINKS) {\n $('#navbar-list').append(componentNavbarList(link));\n }\n $('#navbar-list').append(\n '<li> <button type=\"button\" id=\"side-bar-button\" class=\"btn btn\"><i class=\"bi bi-cart-fill text-light\"></i></button></li>'\n );\n //SHOW SIDEBAR HANDLER\n $('#side-bar-button').click(function (e) {\n generateTotal();\n $('.sidebar-wrapper').css('display', 'block');\n });\n\n //HIDE SIDEBAR HANDLERS\n // BUTTON\n $('#side-bar-close').click(function (e) {\n //PREVENT CHILD EVENT PROPAGATION HANDLER\n $('.sidebar-wrapper').css('display', 'none');\n });\n // MODAL\n $('.sidebar-wrapper').click(function (e) {\n //PREVENT CHILD EVENT PROPAGATION HANDLER\n $('.sidebar').click(function (e) {\n e.stopPropagation();\n });\n $('.sidebar-wrapper').css('display', 'none');\n });\n // CREATE FOOTER IN DOM\n $('.footer-container').append(componentFooter());\n}", "function buildNavigation() {\n getSectionDetails();\n const nav = document.querySelector('#navbar__list');\n let navigation = '';\n for (let i = 0; i < sectionHeadings.length; i ++){\n // During initialisation, for the first nav item, use active state. For others, use standard state.\n navigation += '<li id=\"'+navIds[i]+'\" class=\"'+ (i === 0 ? NAV_CLASS_NAME_ACTIVE : NAV_CLASS_NAME) +'\" onclick=\"onLinkClicked(this)\" data-section=\"'+sectionIds[i]+'\">'+sectionHeadings[i]+'</li>'\n }\n nav.innerHTML = navigation;\n}", "function app_render_navigation() {\r\n\r\n $('nav').empty();\r\n appData.tagList.forEach(function (value, index) {\r\n let myHTML = `<button class=\"app_nav_cell\" data-index=\"${index}\" value=\"${appData.tagList[index]}\" oncontextmenu=\"app_nav_remove(this)\" onclick=\"app_get_images(this)\">${appData.tagList[index]}</button>`;\r\n $('nav').append(myHTML);\r\n });\r\n}", "function setupNav() {\n Alloy.Globals.Menu.setTitle(\"Task Gallery\");\n Alloy.Globals.Menu.setColor(\"#aaa\");\n\n // Add menu\n Alloy.Globals.Menu.setButton({\n button: 'l1',\n image : \"/images/navigation/ic_chevron_left_white_48dp.png\",\n success: function() {\n log.debug('[Gallery] : Redirecting to Detail Page');\n Alloy.Globals.Menu.setMainContent('TodoListDetail', {todo_id: todoItem.get('todo_id')});\n //Alloy.Globals.Menu.goBack();\n }\n });\n\n Alloy.Globals.Menu.setButton({\n button: 'r2',\n image: \"/images/action/ic_search_white_48dp.png\",\n success: function() {\n if ($.search.height == 0) {\n $.search.height = 44;\n } else {\n $.search.height = 0;\n }\n\n }\n });\n\n Alloy.Globals.Menu.setButton({\n button: 'r1',\n image: \"/images/action/ic_add_white_48dp.png\",\n success: function() {\n require('Camera').promptGalleryOrCamera();\n }\n });\n\n Alloy.Globals.Menu.showButton('r1');\n Alloy.Globals.Menu.hideButton('r2');\n Alloy.Globals.Menu.showButton('l1');\n}", "prepareNavigationPanel (navigationList) {\n let self = this;\n for(let index = 0; index < Object.keys(navigationList[JSON_LABEL]).length; index++) {\n var navigationListItem = document.createElement(\"li\");\n var navigationAnchor = document.createElement(\"a\");\n var navigationLabel = document.createTextNode(navigationList[JSON_LABEL][index][NAVIGATION_DOM_LABEL]);\n \n navigationAnchor.id = navigationList[JSON_LABEL][index][NAVIGATION_DOM_SECTION];\n navigationAnchor.href = \"#\";\n navigationAnchor.setAttribute('data-gmt', navigationList[JSON_LABEL][index][NAVIGATION_GMT_DATA] );\n navigationListItem.addEventListener('click', self.navigate.bind(this));\n navigationAnchor.appendChild( navigationLabel );\n navigationListItem.appendChild( navigationAnchor );\n navigationElement.appendChild( navigationListItem );\n }\n }", "function setupPageNavs () {\n\t\t// For any nested list items, wrap the link text in a span so that we can put a border under the text on hover.\n\t\t$mobilemenu.find(\".ibm-mobilemenu-section li li a\").wrapInner(\"<span>\");\n\n\t\tIBM.common.util.a11y.makeTreeAccessible({\n\t\t\tel: $mobilemenu.find(\".ibm-mobilemenu-pagenav > ul\")\n\t\t});\n\t}", "function rebuildNav( el ) {\n\tnavigation.appendChild( el );\n}", "function _render() {\n _$navbar.setMod(_B_BAR, _M_WEBAPP, _isWebapp);\n _renderBtn(_$btnL);\n _renderBtn(_$btnR);\n _renderDropdown();\n _renderSearch();\n _renderHead();\n }", "function DisplayNav() {\n switch (userInfo.accountType) {\n case 'E':\n return (<EmpNav />)\n\n case 'U':\n return (<UserNav />)\n\n default:\n return (<VisitNav />)\n }\n }", "render() {\n const { classes } = this.props;\n if (this.props.store.loadingRoutes) {\n return (\n <div className=\"scroll-vert\">\n {this.renderLoading()}\n </div>\n );\n }\n else {\n return (\n <List component=\"nav\" className={classes.root}>\n {this.renderRoutes()}\n </List>\n );\n }\n }", "function navigation() {\n\t\n\t/* @TODO: reverse li und stelle angemeldet als nach oben */\n\t//$$('#account ul').insert( $$('#account ul li').reverse() );\n}", "createNavigation() {\n this.prevButton.addEventListener('click', this.prev.bind(this));\n this.nextButton.addEventListener('click', this.next.bind(this));\n }", "function buildNavigation(){\n for (let i=0; i < sectionList.length; i++){\n const newMenuItem = document.createElement('li');\n const sectionName = sectionList[i].getAttribute('data-nav')\n const sectionId = sectionList[i].getAttribute('id')\n newMenuItem.innerHTML = createNavItemHTML(sectionId, sectionName)\n fragment.appendChild(newMenuItem);\n }\n const navBarList = document.getElementById('navbar__list')\n navBarList.appendChild(fragment);\n}", "function buildNav(){\n \n sections.forEach(createLi); // applying the createLi function for each Elements\n navBar.appendChild(docFrag);// now we can add the Fragment With contains all li elements to the navBar\n}", "function addVerticalNavigation(){\n \t\t\t$('body').append('<div id=\"fp-nav\"><ul></ul></div>');\n \t\t\tnav = $('#fp-nav');\n\n \t\t\tnav.css('color', options.navigationColor);\n \t\t\tnav.addClass(options.navigationPosition);\n\n \t\t\tfor (var i = 0; i < $('.fp-section').length; i++) {\n \t\t\t\tvar link = '';\n \t\t\t\tif (options.anchors.length) {\n \t\t\t\t\tlink = options.anchors[i];\n \t\t\t\t}\n\n \t\t\t\tvar li = '<li><a href=\"#' + link + '\"><span></span></a>';\n\n \t\t\t\t// Only add tooltip if needed (defined by user)\n \t\t\t\tvar tooltip = options.navigationTooltips[i];\n \t\t\t\tif (tooltip != undefined && tooltip != '') {\n \t\t\t\t\tli += '<div class=\"fp-tooltip ' + options.navigationPosition + '\">' + tooltip + '</div>';\n \t\t\t\t}\n\n \t\t\t\tli += '</li>';\n\n \t\t\t\tnav.find('ul').append(li);\n \t\t\t}\n \t\t}", "componentDidMount() {\n navRoot.appendChild(this.el);\n }", "function leftNav() {\n\tapp.getView().render('content/folder/customerserviceaboutusleftnav');\n}", "renderNavigationButton() {\n const { showNavigationButton } = this.props;\n const { destinationReached, isNavigation } = this.state;\n\n if (destinationReached || isNavigation || !showNavigationButton) {\n return null;\n }\n\n return this.renderButton('Start Navigation', this.startNavigation);\n }", "function setupNav() {\n\tvar challenges = game.getChallenges();\n\tvar frag = document.createDocumentFragment();\n\tvar challengeNav = document.createElement('nav');\n\tchallengeNav.className = 'nav nav-challenges';\n\tchallenges.forEach(setupChallenge.bind(null, challengeNav));\n\tfrag.appendChild(challengeNav);\n\tgameElement.appendChild(frag);\n}", "function generateNav(callback){\n\t\t\tdocument.getElementById(\"terminal\").innerHTML = framework[\"terminal\"];\n\t\t\tdocument.getElementById(\"terminal-content\").innerHTML = framework[\"nav\"];\n\t\t\tcallback(current_tab);\n\t\t}", "function OsNavAdditionInfo() {\r\n $('.os-menu a[href=\"#\"]').on('click', function (event) {\r\n event.preventDefault();\r\n });\r\n $('.os-menu li').has('ul').addClass('li-node').parent().addClass('ul-node');\r\n //$('.os-menu .mega-menu:not(.menu-fullwidth)').parent().css('position', 'relative')\r\n }", "function setupNav() {\n setupPageSelector();\n setupRecipeSelector();\n}", "function MAIN_NAVIGATION$static_(){ToolbarSkin.MAIN_NAVIGATION=( new ToolbarSkin(\"main-navigation\"));}", "function navigationBar() {\n authToken = localStorage.getItem(\"authToken\");\n $('#container').show();\n\n if (authToken === null) {\n navBar.find('a').hide();\n navBar.find('.active').show();\n showMainView();\n $('#welcome-container').find(\"h2\").show()\n welcomeButtons.show()\n profile.hide()\n } else {\n $('#welcome-container').find(\"h2\").hide()\n welcomeButtons.hide()\n navBar.find('a').show();\n navBar.find('.active').show();\n loadAllListings()\n profile.show();\n profile.find(\"a:first-child\").text(\"Welcome \" + localStorage.getItem(\"username\"))\n }\n }", "render() {\n return (\n <div>\n <nav className=\"navBar\">\n {TokenServices.hasAuthToken()\n ? this.renderHomeLinks()\n : this.renderLoginLinks()}\n </nav>\n </div>\n )\n }", "function displayNavBar () {\n navItems.forEach(item => {\n const newEle = document.createElement('li');\n const newLink = document.createElement('a');\n navigateByClick(newEle,item);\n newLink.textContent = item.getAttribute('data-nav');\n newLink.classList.add('menu__link');\n newEle.appendChild(newLink);\n fragment.appendChild(newEle)\n })\n navList.appendChild(fragment)\n}", "buildNav() {\n this.htmlData.root.innerHTML = this.htmlCode(this.htmlData.data);\n this.initHtmlElements();\n this.addMenuListeners();\n this.htmlData.toggleButtonOpen.addEventListener(\"click\", () =>\n this.buttonListener(event)\n );\n this.htmlData.toggleButtonClose.addEventListener(\"click\", () =>\n this.buttonListener(event)\n );\n }", "constructor() {\n super();\n this._navigationController = new NavigationController();\n this.render();\n this.registerEvents();\n }", "function addVerticalNavigation(){\n $body.append('<div id=\"' + SECTION_NAV + '\"><ul></ul></div>');\n var nav = $(SECTION_NAV_SEL);\n\n nav.addClass(options.navigation.position);\n\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\n var link = '';\n if (options.anchors.length) {\n link = options.anchors[i];\n }\n\n var li = '<li><a href=\"#' + link + '\"><span></span></a>';\n\n // Only add tooltip if needed (defined by user)\n var tooltip = options.navigation.tooltips[i];\n\n\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\n console.log(\"we\");\n li += '<div class=\"' + SECTION_NAV_TOOLTIP + ' ' + options.navigation.position + '\">' + tooltip + '</div>';\n }\n\n li += '</li>';\n\n nav.find('ul').append(li);\n }\n\n nav.find(SECTION_NAV_TOOLTIP_SEL).css('color', options.navigation.textColor);\n\n //centering it vertically\n $(SECTION_NAV_SEL).css('margin-top', '-' + ($(SECTION_NAV_SEL).height()/2) + 'px');\n\n //activating the current active section\n $(SECTION_NAV_SEL).find('li').eq($(SECTION_ACTIVE_SEL).index(SECTION_SEL)).find('a').addClass(ACTIVE);\n\n nav.find('span').css('border-color', options.navigation.bulletsColor);\n }", "function initNavBar() {\n // Get the nav list element\n const navbar = document.querySelector(\"#navbar__list\");\n // Get all sections\n const sections = document.querySelectorAll(\"section\");\n // Iterate through sections to build nav\n for (let i = 0; i < sections.length; i++) {\n // function create nav Item => Create Item in navbar\n const navItem = createNavItem(sections[i]);\n navbar.appendChild(navItem);\n }\n }", "mainNav() {}", "render() {\n return (\n <div className=\"Menu\">\n <nav>\n <ul>\n <li><a href=\"#home\">Home</a></li>\n <li><a href=\"#services\">Services</a></li>\n <li><a href=\"#innovation\">Innovation</a></li>\n <li><a href=\"#guestbook\">Guestbook</a></li>\n </ul>\n </nav>\n </div>\n );\n }", "render() {\n this.configPage();\n history.pushState({ href: '/first-entrance' }, null, '/first-entrance');\n this.wrapper.append(this.main);\n\n this.main.innerHTML = firstTemplate();\n\n document.querySelector('.icon-list').classList.add('active');\n\n this.attachListeners(this.main);\n }", "function loadNavMenu(){\n $('.overlay-menu').append('<h1>Navigation</h1>');\n \n $('.overlay-menu').append('<h2>Arena Mode Comming soon!</h2><h1><i class=\"fa fa-gamepad fa-lg\"></i></h1>')\n //set back button\n createBackBtn(); \n}", "renderNavigation() {\n if (this.state.windowWidth <= 524) {\n return (\n <div className=\"mobile-nav\">\n <p className=\"mobile-bars\" onClick={this.handleNavClick}>\n <i className=\"fa fa-bars\" id=\"hamburger\" aria-hidden=\"true\" />\n </p>\n {this.renderMobileNav()}\n </div>\n );\n }\n return (\n <div className=\"navbar\">\n {this.navigationLinks()}\n </div>\n );\n }", "render() {\n return (\n <View style={Styles.header}>\n <View style={Styles.menu}>\n {this.renderMenuItem(t(\"USERS\"),Styles.menuItemLeft,\n this.props.activeScreen === Screens.USERS_LIST,this.props.gotoUsers)\n }\n {this.renderMenuItem(t(\"PROFILE\"),Styles.menuItemRight,\n this.props.activeScreen === Screens.PROFILE,this.props.gotoProfile)\n }\n </View>\n </View>\n )\n }", "function setNav() {\n\n\t\t\t\tvar $nav = _$parent.find('nav');\n\t\t\t\tvar $contents = _$parent.find('.contents');\n\t\t\t\tvar $btn = $nav.find('p');\n\n\t\t\t\t$btn.on('click',function() {\n\n\t\t\t\t\tvar $target = $(this);\n\n\t\t\t\t\tif ($target.hasClass('active')) return;\n\t\t\t\t\t$contents.removeClass('show');\n\t\t\t\t\t$btn.removeClass('active');\n\t\t\t\t\t$target.addClass('active');\n\t\t\t\t\tvar id = $target.prop('id').split('-')[1];\n\t\t\t\t\t$contents.filter('#contet-' + id).addClass('show');\n\n\t\t\t\t});\n\n\t\t\t\treturn false;\n\t\t\t}", "function _plmNav(navInfo)\r\n{\t\r\n\tif(navInfo!=null)\r\n\t{\r\n\t\tloadWorkArea(navInfo,\"\",\"\",loadNavigationGrid);\r\n\t}\t\r\n}", "function Nav() {\n return (\n\n <nav id=\"nav\" role=\"navigation\">\n <a href=\"#nav\" title=\"Show navigation\">Show navigation</a>\n <a href=\"#\" title=\"Hide navigation\">Hide navigation</a>\n\n <ul>\n <li>\n <Link to=\"/\">Home</Link>\n </li>\n <li>\n <a href=\"/\" aria-haspopup=\"true\"><span>Pages</span></a>\n <ul>\n <li><Link to=\"/overfishing\">Over Fishing</Link></li>\n <li><Link to=\"/pollution\">Pollution</Link></li>\n <li><Link to=\"/redtide\">Red Tide</Link></li>\n <li><Link to=\"/messageboard\">Message Board</Link></li>\n <li><Link to =\"/interactivegame\">Interactive Game</Link></li>\n \n </ul>\n </li>\n\n <li>\n <Link to=\"/flashCard\">Quiz</Link>\n </li>\n <li><Link to=\"/login\">Log In</Link></li>\n </ul>\n\n </nav>\n \n );\n\n}", "render() {\n let appContainer = document.querySelector('#tabsBoxApp');\n let template = require('./views/TabsBoxComponent.hbs');\n let navigationLinks = this.navigation.getNavigationLinks();\n\n appContainer.innerHTML = template({'links': navigationLinks});\n\n this.navigation.addNavigationClickActions();\n\n }", "function onNavigation() {\r\n var targetId = this.getPageObjectId();\r\n if (targetId == this.previousId)\r\n return;\r\n this.previousId = targetId;\r\n\r\n // Completion callback for breadcrumb request.\r\n function processBreadcrumbs(bc) {\r\n if (!this.getRootNode()) // initial rendering race condition\r\n return;\r\n\r\n var rootOfThisTree = this.getRootNode().get(\"id\"),\r\n path = \"\";\r\n\r\n // The bc path returned from the service starts at the repository root. If the\r\n // root of this content tree is not the bc path, then we ignore this navigation.\r\n var onPath;\r\n if (rootOfThisTree == \"root\") {\r\n onPath = true;\r\n path = \"/root\"; // $NON-NLS-1$\r\n }\r\n else\r\n onPath = false;\r\n\r\n for (var i=0; i < bc.total; ++i) {\r\n var crumbId = bc.items[i].id;\r\n\r\n if ((crumbId == rootOfThisTree))\r\n onPath = true;\r\n\r\n if (onPath)\r\n path = path.concat(\"/\", crumbId);\r\n }\r\n\r\n // the bc path does not include the target of the navigation, so add it\r\n // before calling selectPath\r\n path = path.concat(\"/\", targetId);\r\n\r\n if (onPath) {\r\n // Use the selectPath method of the Tree to expand to the target node.\r\n this.selectPath(path, \"id\", \"/\", onPathExpanded, this);\r\n }\r\n }\r\n\r\n if (targetId && (targetId.indexOf(\"08\") != 0)) // ignore business objects navigations\r\n getBreadcrumbsForObject(targetId, processBreadcrumbs, this);\r\n }", "_initNavigation() {\n this.sliderIndex = 0;\n const navLeft = this.sliderElement.querySelector(\".slider-nav-left\");\n const navRight = this.sliderElement.querySelector(\".slider-nav-right\");\n\n navLeft.addEventListener(\"click\", this._handleLeftNav.bind(this));\n navRight.addEventListener(\"click\", this._handleRightNav.bind(this));\n }", "open_side_nav() {\n var navButton = document.getElementsByClassName('js-drawer-open-left')[0];\n recreate_node(navButton, true);\n this.make_logo_home();\n var navDrawer = document.getElementById('NavDrawer');\n navDrawer.style.minWidth = '0px';\n navDrawer.style.width = '0px';\n navDrawer.style.display = 'block';\n navDrawer.style.left = '0';\n var navContainer = document.getElementById('NavContainer');\n var horizontalMenu = document.createElement('ul');\n horizontalMenu.id = 'od-nav-menu';\n var menuItems = navContainer.getElementsByClassName('mobile-nav__item')\n for (var i = 0; i < menuItems.length; i++) {\n horizontalMenu.appendChild(menuItems.item(i).cloneNode(true));\n }\n navDrawer.insertBefore(horizontalMenu, document.getElementById('SearchContainer'));\n navContainer.remove();\n if (window.location.href.indexOf(\"collections\") > -1\n && window.location.href.indexOf(\"products\") < 0) {\n try {\n document.getElementsByClassName('fixed-header')[0].style.paddingTop = '0px';\n } catch (error) {\n console.log(error);\n }\n } else {\n document.getElementById('PageContainer').style.marginTop = '130px';\n }\n var logo = document.getElementsByClassName('site-header__logo')[0];\n logo.style.display = 'none';\n logo.style.height = '0px';\n }", "function createNav() {\n for(const section of sections) {\n const navLink = `<a href=\"#${section.id}\" class=\"menu__link ${section.className}\" data-link=\"${section.dataset.nav}\"><li>${section.dataset.nav}</li></a>`;\n navPosition.insertAdjacentHTML('beforeend', navLink);\n }\n}", "function navigationBar (){\n navigation.classList.add('nav');\n content.appendChild(navigation);\n \n homeBtn();\n menuBtn();\n drinksBtn();\n accomodationBtn();\n contactsBtn();\n}", "render() {\n return html`\n <nav class=\"nav\">\n <div class=\"toogle\">\n <vaadin-drawer-toggle></vaadin-drawer-toggle>\n <h2>Otolum</h2>\n </div>\n <div class=\"social\">\n <iron-icon icon=\"vaadin:grid-small\" @click=\"${this.messageOptions}\"></iron-icon>\n <iron-icon icon=\"vaadin:calc-book\" model-user=\"${this.user._id}\" @click=\"${this.goToMyList}\"></iron-icon>\n <iron-icon icon=\"vaadin:inbox\" @click=\"${this.exportList}\"></iron-icon>\n <h4>${this.user.name}</h4>\n </div>\n <vaadin-dialog id=\"dialog\"></vaadin-dialog>\n </nav>\n `;\n }", "render() {\n let link = window.location.href;\n let selected = null;\n this.state.pages.forEach((page) => {\n if (link.includes(page.url)) {\n selected = page.url;\n }\n });\n if (!selected) {\n selected = \"about\";\n }\n return (\n <div className=\"mobnav-container\">\n <div className=\"mobnav-top-row\">\n <Link to=\"/\">\n <img\n className=\"mobnav-logo\"\n src={images.logo}\n onClick={() => {\n this.forceUpdate();\n }}\n alt=\"\"\n />\n </Link>\n <img\n className=\"menu-button\"\n onClick={() => {\n this.setState(function (state) {\n return { open: !state.open };\n });\n }}\n src={images.menu}\n alt=\"\"\n />\n </div>\n {this.state.open && ( //renders buttons only if open\n <div className=\"mobnav-buttons-container\">\n <div className=\"collapse-container\">\n {this.state.pages.map((data) => {\n return (\n <Link to={\"/\" + data.url} style={{ textDecoration: \"none\" }}>\n <NavButton\n mobile={true}\n pagename={data.title}\n switchPage={() => {\n this.forceUpdate();\n }}\n selected={selected === data.url}\n />\n </Link>\n );\n })}\n </div>\n </div>\n )}\n </div>\n );\n }", "function addVerticalNavigation(){\n var navigation = document.createElement('div');\n navigation.setAttribute('id', SECTION_NAV);\n\n var divUl = document.createElement('ul');\n navigation.appendChild(divUl);\n\n appendTo(navigation, $body);\n var nav = $(SECTION_NAV_SEL)[0];\n\n addClass(nav, 'fp-' + options.navigationPosition);\n\n if(options.showActiveTooltip){\n addClass(nav, SHOW_ACTIVE_TOOLTIP);\n }\n\n var li = '';\n\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\n var link = '';\n if (options.anchors.length) {\n link = options.anchors[i];\n }\n\n li += '<li><a href=\"#' + link + '\"><span class=\"fp-sr-only\">' + getBulletLinkName(i, 'Section') + '</span><span></span></a>';\n\n // Only add tooltip if needed (defined by user)\n var tooltip = options.navigationTooltips[i];\n\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\n li += '<div class=\"' + SECTION_NAV_TOOLTIP + ' fp-' + options.navigationPosition + '\">' + tooltip + '</div>';\n }\n\n li += '</li>';\n }\n $('ul', nav)[0].innerHTML = li;\n \n //activating the current active section\n\n var bullet = $('li', $(SECTION_NAV_SEL)[0])[index($(SECTION_ACTIVE_SEL)[0], SECTION_SEL)];\n addClass($('a', bullet), ACTIVE);\n }", "function addVerticalNavigation(){\n var navigation = document.createElement('div');\n navigation.setAttribute('id', SECTION_NAV);\n\n var divUl = document.createElement('ul');\n navigation.appendChild(divUl);\n\n appendTo(navigation, $body);\n var nav = $(SECTION_NAV_SEL)[0];\n\n addClass(nav, 'fp-' + options.navigationPosition);\n\n if(options.showActiveTooltip){\n addClass(nav, SHOW_ACTIVE_TOOLTIP);\n }\n\n var li = '';\n\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\n var link = '';\n if (options.anchors.length) {\n link = options.anchors[i];\n }\n\n li += '<li><a href=\"#' + link + '\"><span class=\"fp-sr-only\">' + getBulletLinkName(i, 'Section') + '</span><span></span></a>';\n\n // Only add tooltip if needed (defined by user)\n var tooltip = options.navigationTooltips[i];\n\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\n li += '<div class=\"' + SECTION_NAV_TOOLTIP + ' fp-' + options.navigationPosition + '\">' + tooltip + '</div>';\n }\n\n li += '</li>';\n }\n $('ul', nav)[0].innerHTML = li;\n \n //activating the current active section\n\n var bullet = $('li', $(SECTION_NAV_SEL)[0])[index($(SECTION_ACTIVE_SEL)[0], SECTION_SEL)];\n addClass($('a', bullet), ACTIVE);\n }", "render() {\n return (\n <nav className=\"c-nav\">\n <ul className=\"c-nav__list\">\n <li className=\"c-nav__home\">\n <a href=\"/\"><img className=\"c-nav__logo\" src={logo} alt=\"hn-logo\" /></a>\n </li>\n <li className=\"l-list-container c-nav__search\">\n <Search changeSearch={this.props.changeOption} />\n </li>\n </ul>\n </nav>\n )\n }", "render() {\n return (\n <div id=\"navMenu\" className=\"o-navbar\">\n <NavList />\n\n <Search />\n </div>\n )\n }", "_render() {\n const paginationNavElem = document.createElement('nav')\n const pageBtnFragment = document.createDocumentFragment()\n\n this._pagination.append(paginationNavElem)\n paginationNavElem.className = 'pagination-nav'\n\n for (let i = 1; i < this._numPages + 1; i++) {\n const pageBtn = document.createElement('button')\n\n pageBtn.className = 'pagination-nav__btn'\n pageBtn.textContent = i\n\n pageBtnFragment.appendChild(pageBtn)\n }\n\n paginationNavElem.appendChild(pageBtnFragment)\n\n this._bindEvents()\n this._setSelectedPage()\n }", "render() {\n return (\n <div>\n <RightNavigationMenu mapLayer={this.props.mapLayer} gsMapMatch={this.props.gsMapMatch} sstMapMatch={this.props.sstMapMatch} toggleRightNav={this.props.toggleRightNav} siteLayout={this.props.siteLayout} />\n <RightMinNavigation toggleRightNav={this.props.toggleRightNav} siteLayout={this.props.siteLayout} />\n </div>\n );\n }", "function build_Nav(){\n \n for(section of sections){\n let anchor = document.createElement(\"a\");\n //anchor.href = \"#\" + section.id;\n anchor.classList.add(\"menu__link\");\n anchor.innerHTML = section.getAttribute(\"data-nav\");\n frag.appendChild(anchor);\n }\n \n list.innerHTML = \"\";\n list.appendChild(frag);\n list.style.display = \"none\";\n }", "onRegisterClicked(){\r\n //this.Nav.push(RegisterPage);\r\n }", "render() {\n return(\n <div>\n <NavigationBar selectedHeader={this.selectedHeader.bind(this)}/>\n {this.state.navHeaderSelected == 0 && <Home/>}\n {this.state.navHeaderSelected == 1 && <Playlist/>}\n </div>\n );\n }", "renderHomeLinks() {\n return (\n <div className='navContents'>\n {TokenServices.hasAuthToken() && <Nickname />}\n <div role=\"navigation\" className=\"burgerIcon\" id=\"burger\" onClick={this.burgerClick}> &#9776; </div>\n <ul aria-live=\"polite\" className=\"links null\" id=\"links\" onClick={this.burgerClick}>\n <li><Link to='/contacts'>Contacts</Link></li>\n <li><Link to='/alerts'>My Alerts</Link></li>\n <li><Link to='/delete-account'>Settings</Link></li>\n <li><Link onClick={this.signOut} to='/auth/login' >Log Out</Link></li>\n </ul>\n </div>\n )\n }", "function addVerticalNavigation(){\r\n var navigation = document.createElement('div');\r\n navigation.setAttribute('id', SECTION_NAV);\r\n\r\n var divUl = document.createElement('ul');\r\n navigation.appendChild(divUl);\r\n\r\n appendTo(navigation, $body);\r\n var nav = $(SECTION_NAV_SEL)[0];\r\n\r\n addClass(nav, 'fp-' + options.navigationPosition);\r\n\r\n if(options.showActiveTooltip){\r\n addClass(nav, SHOW_ACTIVE_TOOLTIP);\r\n }\r\n\r\n var li = '';\r\n\r\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\r\n var link = '';\r\n if (options.anchors.length) {\r\n link = options.anchors[i];\r\n }\r\n\r\n li += '<li><a href=\"#' + link + '\"><span class=\"fp-sr-only\">' + getBulletLinkName(i, 'Section') + '</span><span></span></a>';\r\n\r\n // Only add tooltip if needed (defined by user)\r\n var tooltip = options.navigationTooltips[i];\r\n\r\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\r\n li += '<div class=\"' + SECTION_NAV_TOOLTIP + ' fp-' + options.navigationPosition + '\">' + tooltip + '</div>';\r\n }\r\n\r\n li += '</li>';\r\n }\r\n $('ul', nav)[0].innerHTML = li;\r\n \r\n //activating the current active section\r\n\r\n var bullet = $('li', $(SECTION_NAV_SEL)[0])[index($(SECTION_ACTIVE_SEL)[0], SECTION_SEL)];\r\n addClass($('a', bullet), ACTIVE);\r\n }", "createNavigation(data) {\n\n var config = data.config\n //Routes structure\n var routes = {};\n var defaultRoute = data.navigation.menus[0].name;\n\n //Initialize the global design - user in other components on render\n var design = data.design;\n css.dynamic = data.design;\n AppEventEmitter.emit('colors.loaded');\n isReqUserVarification = data.config.userVarification\n allowedUsers = data.config.allowedUsers\n\n Config.config = data.config\n\n //Loop in the menus, for each item create StackNavigator with routes\n //Basicaly, for each item, create his appropriate screens inside StackNavigator\n //The master-detail type is the core one - contains Master, Categories , Master Sub and Details sceen\n //Other screens like cart and orders contains single windows\n data.navigation.menus.map((item, index) => {\n\n\n //Each menu has stack nav with 3 routes, if type is master-detail or undefined\n if (item.type == \"cart\" || item.sectionType == \"cart\") {\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n Cart: { screen: ({ navigation }) => (<MyCartSreen data={item} navigation={navigation} design={design} isRoot={true} config={config} />) },\n }, {\n initialRouteName: \"Cart\",\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.sectionType == \"web\") {\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n Web: { screen: ({ navigation }) => (<MyWebSreen data={item} navigation={navigation} design={design} isRoot={true} fromNotification={false} />) },\n }, {\n initialRouteName: \"Web\",\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.type == \"orders\" || item.sectionType == \"orders\") {\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n Orders: { screen: ({ navigation }) => (<MyOrdersSreen data={item} navigation={navigation} design={design} isRoot={true} />) },\n OrderDetail: { screen: ({ navigation }) => (<MyOrderDetailSreen data={item} navigation={navigation} design={design} />) },\n }, {\n initialRouteName: \"Orders\",\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.type == \"map\" || item.sectionType == \"map\") {\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n Map: { screen: ({ navigation }) => (<MyMapSreen data={item} navigation={navigation} design={design} isRoot={true} />) },\n DetailsFromMap: { screen: ({ navigation }) => (<MyDetailsSreen data={item} navigation={navigation} design={design} />) },\n Gallery: { screen: ({ navigation }) => (<MyGallerySreen data={item} navigation={navigation} design={design} />) },\n }, {\n initialRouteName: \"Map\",\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.type == \"notifications\" || item.sectionType == \"notifications\") {\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n Notifications: { screen: ({ navigation }) => (<MyNotificationsSreen data={item} navigation={navigation} design={design} isRoot={true} config={config} />) },\n Web: { screen: ({ navigation }) => (<MyWebSreen data={item} navigation={navigation} design={design} fromNotification={true} />) },\n }, {\n initialRouteName: \"Notifications\",\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.type == \"addNewItem\" || item.sectionType == \"addNewItem\") {\n //Create the required screens in StackNavigator\n\n var theScreen = createStackNavigator({\n\n Form: { screen: ({ navigation }) => (<MyFormScreen data={item} navigation={navigation} design={design} isRoot={true} formSetup={item.formSetup} collectionName={item.data_point} />) },\n }, {\n initialRouteName: \"Form\",\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.type == \"addContact\" || item.sectionType == \"addContact\") {\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n AddContact: { screen: ({ navigation }) => (<MyAddContactSreen data={item} navigation={navigation} design={design} isRoot={true} config={config} />) },\n CreateGroupChat: { screen: ({ navigation }) => (<MyCreateGroupChatSreen data={item} navigation={navigation} design={design} />) },\n Chat: { screen: ({ navigation }) => (<MyChatSreen data={item} navigation={navigation} design={design} />) },\n Profile: { screen: ({ navigation }) => (<MyProfileSreen data={item} navigation={navigation} design={design} />) },\n ProfileSettings: { screen: ({ navigation }) => (<MyProfileSettingsSreen data={item} navigation={navigation} design={design} isReqUserVarification={isReqUserVarification} allowedUsers={allowedUsers} />) },\n ListOfUsers: { screen: ({ navigation }) => (<MyListOfUsersSreen data={item} navigation={navigation} design={design} />) },\n Chats: { screen: ({ navigation }) => (<MyChatsSreen data={item} navigation={navigation} design={design} />) },\n }, {\n initialRouteName: \"AddContact\",\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.type == \"profile\" || item.sectionType == \"profile\") {\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n Login: {\n screen: ({ }) => (<MyLoginSreen isReqUserVarification={isReqUserVarification} allowedUsers={allowedUsers} />), navigationOptions: ({ navigation }) => ({\n title: '',\n header: null,\n })\n },\n Chat: { screen: ({ navigation }) => (<MyChatSreen data={item} navigation={navigation} design={design} />) },\n Profile: { screen: ({ navigation }) => (<MyProfileSreen data={item} navigation={navigation} design={design} isRoot={true} />) },\n ProfileSettings: { screen: ({ navigation }) => (<MyProfileSettingsSreen data={item} navigation={navigation} design={design} isReqUserVarification={isReqUserVarification} allowedUsers={allowedUsers} />) },\n ListOfUsers: { screen: ({ navigation }) => (<MyListOfUsersSreen data={item} navigation={navigation} design={design} />) },\n ForgetPassword: { screen: ForgetPassword },\n SignUp: { screen: SignUp },\n Login: {\n screen: ({ }) => (<MyLoginSreen isReqUserVarification={isReqUserVarification} allowedUsers={allowedUsers} />), navigationOptions: ({ navigation }) => ({\n title: '',\n header: null,\n })\n },\n\n }, {\n initialRouteName: \"Profile\",\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n }\n else if (item.type == \"scanner\" || item.sectionType == \"scanner\") {\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n Scanner: { screen: ({ navigation }) => (<MyScannerScreen data={item} navigation={navigation} design={design} isRoot={true} />) },\n OrderAction: { screen: ({ navigation }) => (<MyDetailsFromScanner data={item} navigation={navigation} design={design} />) },\n }, {\n initialRouteName: \"Scanner\",\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.type == \"chats\" || item.sectionType == \"chats\") {\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n Chats: { screen: ({ navigation }) => (<MyChatsSreen data={item} navigation={navigation} design={design} isRoot={true} />) },\n Chat: { screen: ({ navigation }) => (<MyChatSreen data={item} navigation={navigation} design={design} />) },\n Profile: { screen: ({ navigation }) => (<MyProfileSreen data={item} navigation={navigation} design={design} />) },\n Login: {\n screen: ({ }) => (<MyLoginSreen isReqUserVarification={isReqUserVarification} allowedUsers={allowedUsers} />), navigationOptions: ({ navigation }) => ({\n title: '',\n header: null,\n })\n },\n }, {\n initialRouteName: 'Chats',\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.type == \"comments\" || item.sectionType == \"comments\") {\n //Create the required screens in StackNavigator\n\n var theScreen = createStackNavigator({\n\n Comments: { screen: ({ navigation }) => (<MyCommentsSreen data={item} navigation={navigation} design={design} id={item.objectIdToShow} path=\"comments/\" public={true} />) },\n Profile: { screen: ({ navigation }) => (<MyProfileSreen data={item} navigation={navigation} design={design} />) },\n Login: {\n screen: ({ }) => (<MyLoginSreen isReqUserVarification={isReqUserVarification} allowedUsers={allowedUsers} />), navigationOptions: ({ navigation }) => ({\n title: '',\n header: null,\n })\n },\n\n }, {\n initialRouteName: 'Comments',\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.type == \"listOfUsers\" || item.sectionType == \"listOfUsers\") {\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n\n ListOfUsers: { screen: ({ navigation }) => (<MyListOfUsersSreen data={item} navigation={navigation} design={design} isRoot={true} />) },\n\n Chat: { screen: ({ navigation }) => (<MyChatSreen data={item} navigation={navigation} design={design} />) },\n Profile: { screen: ({ navigation }) => (<MyProfileSreen data={item} navigation={navigation} design={design} />) },\n Login: {\n screen: ({ }) => (<MyLoginSreen isReqUserVarification={isReqUserVarification} allowedUsers={allowedUsers} />), navigationOptions: ({ navigation }) => ({\n title: '',\n header: null,\n })\n },\n }, {\n initialRouteName: 'ListOfUsers',\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n } else if (item.type == \"\" || item.type == null || item.type == \"master-detail\" || item.sectionType == \"master-detail\" || item.type == \"wish-list\" || item.sectionType == \"wish-list\") {\n\n //Default\n\n var initialRootName = item.initialRootName != null ? item.initialRootName : \"Master\"\n\n //In case categories are the one that should be shown first\n if (item.category_first) {\n initialRootName = \"Categories\"\n } else if (item.subMenus && item.subMenus.length > 0) {\n //When we have sub menus\n initialRootName = \"MasterSUB\"\n } else if (item.goDirectlyToDetails) {\n //Goes directly to details\n\n initialRootName = \"Details\"\n }\n\n console.log(JSON.stringify(item))\n //Create the required screens in StackNavigator\n var theScreen = createStackNavigator({\n Master: { screen: ({ navigation }) => (<MyMastSreen data={item} navigation={navigation} design={design} isRoot={true} />) },\n Home: { screen: ({ navigation }) => (<MyHomeSreen data={item} navigation={navigation} design={design} isRoot={true} />) },\n LocationScreen: { screen: ({ navigation }) => (<MyLocationScreen data={item} navigation={navigation} design={design} isRoot={true} />) },\n Categories: { screen: ({ navigation }) => (<MyCategoriesSreen data={item} navigation={navigation} design={design} isRoot={item.category_first} subMenus={[]} />) },\n Review: { screen: ({ navigation }) => (<MyReviewSreen data={item} navigation={navigation} design={design} isRoot={false} subMenus={[]} />) },\n MasterSUB: { screen: ({ navigation }) => (<MyCategoriesSreen data={{ 'categorySetup': item }} navigation={navigation} design={design} isRoot={true} subMenus={item.subMenus} />) },\n Details: { screen: ({ navigation }) => (<MyDetailsSreen data={item} navigation={navigation} design={design} isRoot={true} />) },\n Gallery: { screen: ({ navigation }) => (<MyGallerySreen data={item} navigation={navigation} design={design} />) },\n ForgetPassword: { screen: ForgetPassword },\n SignUp: { screen: SignUp },\n WebSub: { screen: ({ navigation }) => (<MyWebSreen data={item} navigation={navigation} design={design} isRoot={true} fromNotification={true} />) },\n NotificationsSub: { screen: ({ navigation }) => (<MyNotificationsSreen data={item} navigation={navigation} design={design} isRoot={false} />) },\n OrdersSub: { screen: ({ navigation }) => (<MyOrdersSreen data={item} navigation={navigation} design={design} isRoot={false} />) },\n OrderDetail: { screen: ({ navigation }) => (<MyOrderDetailSreen data={item} navigation={navigation} design={design} />) },\n ProfileSettingsSub: { screen: ({ navigation }) => (<MyProfileSettingsSreen data={item} navigation={navigation} design={design} isRoot={false} />) },\n SubProfile: { screen: ({ navigation }) => (<MyProfileSreen data={item} navigation={navigation} design={design} isRoot={false} />) },\n ProfileSettings: { screen: ({ navigation }) => (<MyProfileSettingsSreen data={item} navigation={navigation} design={design} />) },\n ListOfUsersSub: { screen: ({ navigation }) => (<MyListOfUsersSreen data={item} navigation={navigation} design={design} />) },\n Chats: { screen: ({ navigation }) => (<MyChatsSreen data={item} navigation={navigation} design={design} />) },\n Chat: { screen: ({ navigation }) => (<MyChatSreen data={item} navigation={navigation} design={design} />) },\n Form: { screen: ({ navigation }) => (<MyFormScreen data={item} navigation={navigation} design={design} />) },\n\n }, {\n //initialRouteName:item.category_first?\"Categories\":(item.subMenus&&(item.subMenus.length>0?\"MasterSUB\":\"Details\")),\n initialRouteName: initialRootName,\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n });\n }\n\n //Add navigation options to each StackNavigator\n //Create icon and name\n theScreen.navigationOptions = {\n drawerLabel: item.name,\n tabBarLabel: css.dynamic.general.hideTabIconName ? \" \" : item.name,\n drawerIcon: ({ tintColor }) => (\n <NavigationIcon icon={item.icon} size={24} tintColor={tintColor} />\n ),\n tabBarIcon: ({ focused, tintColor }) => (\n <NavigationIcon focused={focused} icon={item.icon} tintColor={tintColor} />\n )\n };\n\n //For each item, inside the routes, add the route with givven name\n routes[item.name] = {\n path: '/' + item.name,\n screen: theScreen,\n }\n });\n //END of the loop of menus\n //At this point we have all the routes created.\n\n //=== LAYOUT CREATION =======\n //Advance or simple coloring\n var tintColor = design.general && design.general.coloring && design.general.coloring == \"advanced\" ? design.sideMenu.activeTintColor : design.general.buttonColor;\n\n this.loginNavi = createAppContainer(createStackNavigator({\n ForgetPassword: { screen: ForgetPassword },\n SignUp: { screen: SignUp },\n Login: { screen: Login },\n }, {\n initialRouteName: 'Login',\n headerMode: \"none\",\n navigationOptions: {\n headerTintColor: 'blue',\n }\n }));\n if (design.general && design.general.layout && design.general.layout == \"tabs\") {\n\n //TABS\n this.navi = createAppContainer(createBottomTabNavigator(\n routes,\n {\n\n initialRouteName: defaultRoute,\n tabBarPosition: 'bottom',\n swipeEnabled: false,\n lazyLoad: true,\n animationEnabled: false,\n\n tabBarOptions: {\n showIcon: true,\n showLabel: !design.general.hideTabIconName,\n activeTintColor: tintColor,\n inactiveTintColor: design.sideMenu.inactiveTintColor,\n indicatorStyle: {\n backgroundColor: tintColor\n },\n\n style: {\n backgroundColor: design.general.backgroundColor,\n\n },\n },\n contentOptions: {\n activeTintColor: tintColor,\n activeBackgroundColor: design.sideMenu.activeBackgroundColor,\n inactiveTintColor: design.sideMenu.inactiveTintColor,\n inactiveBackgroundColor: design.sideMenu.inactiveBackgroundColor\n },\n }\n ));\n\n } else if (design.general && design.general.layout && design.general.layout == \"grid\") {\n console.log(JSON.stringify(routes))\n //GRID Navigation\n\n //Options for nav\n var navigationOptions = {\n header: null,\n };\n\n\n theGridScreen = createStackNavigator({\n GridView: { screen: ({ navigation }) => (<MyGridScreen data={data} navigation={navigation} design={design} isRoot={true} />) },\n }, {\n initialRouteName: \"GridView\",\n headerMode: \"none\",\n navigationOptions: navigationOptions\n });\n\n routes['ourGridInitalView'] = {\n path: '/ourGridInitalView',\n screen: theGridScreen,\n }\n\n this.navi = createStackNavigator(\n routes,\n {\n initialRouteName: \"ourGridInitalView\",\n navigationOptions: navigationOptions\n }\n )\n } else {\n //SIDE Navigation\n this.navi = createAppContainer(createDrawerNavigator(\n routes,\n {\n initialRouteName: defaultRoute,\n contentComponent: props =>\n <ScrollView style={{ backgroundColor: design.sideMenu.sideNavBgColor }}>\n <View style={css.static.imageLogoHolder}>\n <Image style={css.layout.profileImageEdit} source={this.state.avatar} ></Image>\n </View>\n <View style={css.layout.sideNavTxtParent}>\n <Text style={css.layout.sideNavText}>{this.state.name}</Text>\n <Text style={css.layout.sideNavText}>{this.state.bio}</Text>\n </View>\n\n <DrawerItems {...props}></DrawerItems>\n </ScrollView>,\n contentOptions: {\n activeTintColor: tintColor,\n activeBackgroundColor: design.sideMenu.activeBackgroundColor,\n inactiveTintColor: design.sideMenu.inactiveTintColor,\n inactiveBackgroundColor: design.sideMenu.inactiveBackgroundColor\n },\n }\n ));\n }\n\n //=== END LAYOUT ============\n\n //Notify the state that we have the routes and drwer created, it should rerender the initial screen\n this.setState({\n metaLoaded: true,\n meta: data,\n })\n }", "function updatePageNavigation() {\n const Navigation = MonitoringConsole.Model.Settings.Navigation;\n let panelConsole = $('#console');\n if (Navigation.isCollapsed()) {\n panelConsole.removeClass('state-show-nav');\n } else {\n if (!panelConsole.hasClass('state-show-nav')) {\n panelConsole.addClass('state-show-nav'); \n }\n }\n $('#NavSidebar').replaceWith(Components.createNavSidebar(createNavSidebarModel()));\n }", "attach() {\n if (this.#id)\n V2Web.addNavigation(this.#title, '#' + this.#id);\n\n document.body.appendChild(this.#section);\n }", "renderNavMenu(){\n let navBarMenu = this.state.navBarMenu;\n let navBarSelections = navBarMenu.map((navBarSelection, index) => {\n let activeClass = navBarSelection.active ? \" activated\" : \"\";\n return (\n <a href={`#${navBarSelection.id}`} className={`Banner-Menu-Selection ${activeClass}`} onClick={()=>this.updateNavMenu(index)}>\n <div className=\"Banner-Menu-Selection__Name\">{navBarSelection.name}</div>\n </a>\n )\n })\n return (\n <div id=\"Banner-Menu-Endless\" className=\"Endless-Detail__Banner-Menu\">\n <nav className=\"Endless-Detail__Container Banner-Menu-Wrapper\">\n {navBarSelections}\n </nav>\n </div>\n )\n }", "render() {\n console.log(\"bsi\",buildStyleInterpolator)\n return (\n <Navigator\n configureScene={this.configureScene}\n style={{ backgroundColor: 'white', }}\n initialRoute={{ name:'Login' }}\n renderScene={this.renderScene}\n navigationBar={\n <Navigator.NavigationBar\n routeMapper={{\n LeftButton: (route, navigator, index, navState) =>\n { return; },\n RightButton: (route, navigator, index, navState) =>\n { return; },\n Title: (route, navigator, index, navState) =>\n { return (<Text style={styles.navBarText}>Compass</Text>); },\n }}\n style={styles.navBar}\n />\n }\n />\n\n )\n }", "render(){\n return (\n <nav>\n <ul className=\"navbar\">\n <Link to='/' style={{textDecoration: \"none\"}}>\n <li className=\"title\">Tick-it</li>\n </Link>\n {this.linkButton()}\n </ul>\n </nav>\n )\n }", "render() {\n return (\n <div className=\"\">\n <List component=\"nav\">\n <ListItem >\n <ListItemText primary=\"Bright Events (Andela)\" >\n <img src={logo} alt=\"\" style={{ width: 30 }} />\n </ListItemText>\n <Divider />\n </ListItem>\n </List>\n <Divider />\n {\n !this.auth.loggedIn() &&\n <List >\n <ListItem button component={Link} to=\"/\">\n <ListItemIcon>\n <ListIcon />\n </ListItemIcon>\n <ListItemText primary=\"Recent Events\" />\n </ListItem>\n <ListItem button component={Link} to=\"/login\">\n <ListItemIcon>\n <LoginIcon />\n </ListItemIcon>\n <ListItemText primary=\"Login/Signup\" />\n </ListItem>\n\n </List>\n }\n {\n this.auth.loggedIn() &&\n <List >\n <ListItem button component={Link} to=\"/\">\n <ListItemIcon>\n <ListIcon />\n </ListItemIcon>\n <ListItemText primary=\"Recent Events\" />\n </ListItem>\n <ListItem button component={Link} to=\"/my-events\">\n <ListItemIcon>\n <EventIcon />\n </ListItemIcon>\n <ListItemText primary=\"My Events\" />\n </ListItem>\n <ListItem button>\n <ListItemIcon>\n <FavIcon />\n </ListItemIcon>\n <ListItemText primary=\"RSVP\" />\n </ListItem>\n </List>\n }\n <Divider />\n\n <List\n component=\"nav\"\n style={{\n position: 'absolute', right: 0, bottom: 0, left: 0,\n}}\n >\n <Divider />\n <ListItem button>\n <ListItemIcon>\n <BugIcon />\n </ListItemIcon>\n <ListItemText primary=\"Report A Problem\" />\n </ListItem>\n <ListItem button>\n <ListItemIcon>\n <ContactsIcon />\n </ListItemIcon>\n <ListItemText primary=\"Contact Us\" />\n </ListItem>\n </List>\n </div>\n\n );\n }", "get navigation() {\r\n return new Navigation(this);\r\n }", "render() {\n\n return(\n\n <div>\n <div className='navBar'>\n <div className='navBar-left'>\n PRT Customers App\n </div>\n\n <div className='navBar-right'>\n <NavLink \n to='/addCustomer'\n className='nav-link'\n activeClassName='nav-link-active'\n >\n <Icon.UserPlus size={ 18.5 } /> &nbsp; Add Customer\n </NavLink>\n <NavLink \n to='/customerList'\n className='nav-link'\n activeClassName='nav-link-active'\n >\n <Icon.List size={ 18.5 } /> &nbsp; Customers List\n </NavLink>\n </div>\n </div> \n </div>\n );\n }", "render() {\n return (\n <NavCol>\n <NavCol.Link to=\"/registrering/kunde\">\n <ion-icon name=\"person-add\" />\n Registrer kunde\n </NavCol.Link>\n\n <NavCol.Link to=\"/registrering/sykkel\">\n <ion-icon name=\"bicycle\" />\n Registrer sykkel\n </NavCol.Link>\n\n <NavCol.Link to=\"/registrering/utstyr\">\n <ion-icon name=\"cube\" />\n Registrer utstyr\n </NavCol.Link>\n\n <NavCol.Link to=\"/registrering/ansatt\">\n <ion-icon name=\"contact\" />\n Registrer ansatt\n </NavCol.Link>\n\n <NavCol.Link to=\"/registrering/lokasjon\">\n <ion-icon name=\"business\" />\n Registrer lokasjon\n </NavCol.Link>\n </NavCol>\n );\n }", "function BuildNavigationMenu() {\r\n let content = '';\r\n const sectionsList = getAllSections();\r\n sectionsList.forEach(function (section) {\r\n const newLi = this.document.createElement('li');\r\n newLi.id = `li${section.id}`;\r\n newLi.dataset.section = section.id;\r\n newLi.innerHTML = `<a id='aSection${liCount}' href='#${section.id}' data-section='${section.id}' class='menu__link'> ${section.dataset.nav} </a>`;\r\n liCount++;\r\n content += newLi.outerHTML;\r\n })\r\n this.document.querySelector('#navbar__list').innerHTML = content;\r\n}", "function onPageLoad() {\r\n genNavBar();\r\n}", "render() {\n return this._getARNavigator();\n }", "function buildNav() {\n for (let i = 0; i < navElements.length; i++) {\n const newMenuItem = document.createElement('li');\n const sectionName = navElements[i].getAttribute('data-nav');\n const sectionId = navElements[i].getAttribute('id');\n newMenuItem.innerHTML = createNavItemHTML(sectionId, sectionName)\n fragment.appendChild(newMenuItem);\n }\n navList.appendChild(fragment);\n}", "function PagesNavigation() {\n\n}", "displaySideNav(){\n if(this.state.showSideNav){\n console.log('side nav show')\n this.state.showSideNav();\n }\n }", "function addVerticalNavigation(){\n $body.append('<div id=\"' + SECTION_NAV + '\"><ul></ul></div>');\n var nav = $(SECTION_NAV_SEL);\n\n nav.addClass(function() {\n return options.showActiveTooltip ? SHOW_ACTIVE_TOOLTIP + ' ' + options.navigationPosition : options.navigationPosition;\n });\n\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\n var link = '';\n if (options.anchors.length) {\n link = options.anchors[i];\n }\n\n var li = '<li><a href=\"#' + link + '\"><span></span></a>';\n\n // Only add tooltip if needed (defined by user)\n var tooltip = options.navigationTooltips[i];\n\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\n li += '<div class=\"' + SECTION_NAV_TOOLTIP + ' ' + options.navigationPosition + '\">' + tooltip + '</div>';\n }\n\n li += '</li>';\n\n nav.find('ul').append(li);\n }\n\n //centering it vertically\n $(SECTION_NAV_SEL).css('margin-top', '-' + ($(SECTION_NAV_SEL).height()/2) + 'px');\n\n //activating the current active section\n $(SECTION_NAV_SEL).find('li').eq($(SECTION_ACTIVE_SEL).index(SECTION_SEL)).find('a').addClass(ACTIVE);\n }", "function addVerticalNavigation(){\n $body.append('<div id=\"' + SECTION_NAV + '\"><ul></ul></div>');\n var nav = $(SECTION_NAV_SEL);\n\n nav.addClass(function() {\n return options.showActiveTooltip ? SHOW_ACTIVE_TOOLTIP + ' ' + options.navigationPosition : options.navigationPosition;\n });\n\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\n var link = '';\n if (options.anchors.length) {\n link = options.anchors[i];\n }\n\n var li = '<li><a href=\"#' + link + '\"><span></span></a>';\n\n // Only add tooltip if needed (defined by user)\n var tooltip = options.navigationTooltips[i];\n\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\n li += '<div class=\"' + SECTION_NAV_TOOLTIP + ' ' + options.navigationPosition + '\">' + tooltip + '</div>';\n }\n\n li += '</li>';\n\n nav.find('ul').append(li);\n }\n\n //centering it vertically\n $(SECTION_NAV_SEL).css('margin-top', '-' + ($(SECTION_NAV_SEL).height()/2) + 'px');\n\n //activating the current active section\n $(SECTION_NAV_SEL).find('li').eq($(SECTION_ACTIVE_SEL).index(SECTION_SEL)).find('a').addClass(ACTIVE);\n }", "function buildNavBar() {\n // loops over each section in sections\n for (let i=0; i<sections.length; i++) {\n const sectionName = sections[i].dataset.nav;\n const sectionId = sections[i].id;\n //creates new <li> element in the nav ul\n const tab = document.createElement('li');\n //ammends the innerHTML of li item to include link\n tab.innerHTML = `<a id=\"nav_${sectionId}\" class=\"menu__link\" href=\"#${sectionId}\">${sectionName}</a>`;\n // tab.innerHTML = `<a id=\"${sectionId}\" class=\"menu__link\" href=\"#${sectionId}\">${sectionName}</a>`;\n //appends the finished li to the parent ul\n nav.appendChild(tab);\n }\n}", "render() {\n return this.state.isLoading ? (\n <div className={styles.loading}>Dogz not out yet</div>\n ) : (\n <nav>\n <ul className={styles.list}>\n {this.state.breeds.map((breed, i) => (\n <li className={styles.listItem} key={i}>\n <Link to={`/${breed.path}`} className={styles.link}>\n {breed.displayName}\n </Link>\n </li>\n ))}\n </ul>\n </nav>\n );\n }", "function addVerticalNavigation(){\r\n var navigation = document.createElement('div');\r\n navigation.setAttribute('id', SECTION_NAV);\r\n\r\n var divUl = document.createElement('ul');\r\n navigation.appendChild(divUl);\r\n\r\n appendTo(navigation, $body);\r\n var nav = $(SECTION_NAV_SEL)[0];\r\n\r\n addClass(nav, 'fp-' + options.navigationPosition);\r\n\r\n if(options.showActiveTooltip){\r\n addClass(nav, SHOW_ACTIVE_TOOLTIP);\r\n }\r\n\r\n var li = '';\r\n\r\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\r\n var link = '';\r\n if (options.anchors.length) {\r\n link = options.anchors[i];\r\n }\r\n\r\n li += '<li><a href=\"#' + link + '\"><span></span></a>';\r\n\r\n // Only add tooltip if needed (defined by user)\r\n var tooltip = options.navigationTooltips[i];\r\n\r\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\r\n li += '<div class=\"' + SECTION_NAV_TOOLTIP + ' fp-' + options.navigationPosition + '\">' + tooltip + '</div>';\r\n }\r\n\r\n li += '</li>';\r\n }\r\n $('ul', nav)[0].innerHTML = li;\r\n\r\n //centering it vertically\r\n css($(SECTION_NAV_SEL), {'margin-top': '-' + ($(SECTION_NAV_SEL)[0].offsetHeight/2) + 'px'});\r\n\r\n //activating the current active section\r\n\r\n var bullet = $('li', $(SECTION_NAV_SEL)[0])[index($(SECTION_ACTIVE_SEL)[0], SECTION_SEL)];\r\n addClass($('a', bullet), ACTIVE);\r\n }", "render() {\n return (\n <nav ref=\"root\"\n id={`${this.state.ids.toJS().join(' ')}`}\n className={`${this.state.classes.toJS().join(' ')}`}\n role=\"tablist\">\n {this.props.children}\n </nav>\n );\n }", "function renderNavBar() {\n\t //if navBar, delete\n\t var oldNav = document.querySelector('.cat-nav-bar');\n\n\t if (oldNav) {\n\t oldNav.parentNode.removeChild(oldNav);\n\t }\n\n\t var newNavBar = createNavBar(cats);\n\n\t catHolderMaster.appendChild(newNavBar);\n\n\t}", "function setNavPlacementInDom () {\n var isFirst = navContainer[0].firstElementChild === nav[0];\n if (mobileSize && isFirst) { // move to last\n nav.remove();\n navContainer.append(nav);\n } else if (!mobileSize && !isFirst) { // move to first\n nav.remove();\n navContainer.prepend(nav);\n }\n }", "function addVerticalNavigation(){\r\n $body.append('<div id=\"' + SECTION_NAV + '\"><ul></ul></div>');\r\n var nav = $(SECTION_NAV_SEL);\r\n\r\n nav.addClass(function() {\r\n return options.showActiveTooltip ? SHOW_ACTIVE_TOOLTIP + ' ' + options.navigationPosition : options.navigationPosition;\r\n });\r\n\r\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\r\n var link = '';\r\n if (options.anchors.length) {\r\n link = options.anchors[i];\r\n }\r\n\r\n var li = '<li><a href=\"#' + link + '\"><span></span></a>';\r\n\r\n // Only add tooltip if needed (defined by user)\r\n var tooltip = options.navigationTooltips[i];\r\n\r\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\r\n li += '<div class=\"' + SECTION_NAV_TOOLTIP + ' ' + options.navigationPosition + '\">' + tooltip + '</div>';\r\n }\r\n\r\n li += '</li>';\r\n\r\n nav.find('ul').append(li);\r\n }\r\n\r\n //centering it vertically\r\n $(SECTION_NAV_SEL).css('margin-top', '-' + ($(SECTION_NAV_SEL).height()/2) + 'px');\r\n\r\n //activating the current active section\r\n $(SECTION_NAV_SEL).find('li').eq($(SECTION_ACTIVE_SEL).index(SECTION_SEL)).find('a').addClass(ACTIVE);\r\n }", "function addVerticalNavigation(){\r\n $body.append('<div id=\"' + SECTION_NAV + '\"><ul></ul></div>');\r\n var nav = $(SECTION_NAV_SEL);\r\n\r\n nav.addClass(function() {\r\n return options.showActiveTooltip ? SHOW_ACTIVE_TOOLTIP + ' ' + options.navigationPosition : options.navigationPosition;\r\n });\r\n\r\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\r\n var link = '';\r\n if (options.anchors.length) {\r\n link = options.anchors[i];\r\n }\r\n\r\n var li = '<li><a href=\"#' + link + '\"><span></span></a>';\r\n\r\n // Only add tooltip if needed (defined by user)\r\n var tooltip = options.navigationTooltips[i];\r\n\r\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\r\n li += '<div class=\"' + SECTION_NAV_TOOLTIP + ' ' + options.navigationPosition + '\">' + tooltip + '</div>';\r\n }\r\n\r\n li += '</li>';\r\n\r\n nav.find('ul').append(li);\r\n }\r\n\r\n //centering it vertically\r\n $(SECTION_NAV_SEL).css('margin-top', '-' + ($(SECTION_NAV_SEL).height()/2) + 'px');\r\n\r\n //activating the current active section\r\n $(SECTION_NAV_SEL).find('li').eq($(SECTION_ACTIVE_SEL).index(SECTION_SEL)).find('a').addClass(ACTIVE);\r\n }", "function addVerticalNavigation(){\r\n $body.append('<div id=\"' + SECTION_NAV + '\"><ul></ul></div>');\r\n var nav = $(SECTION_NAV_SEL);\r\n\r\n nav.addClass(function() {\r\n return options.showActiveTooltip ? SHOW_ACTIVE_TOOLTIP + ' ' + options.navigationPosition : options.navigationPosition;\r\n });\r\n\r\n for (var i = 0; i < $(SECTION_SEL).length; i++) {\r\n var link = '';\r\n if (options.anchors.length) {\r\n link = options.anchors[i];\r\n }\r\n\r\n var li = '<li><a href=\"#' + link + '\"><span></span></a>';\r\n\r\n // Only add tooltip if needed (defined by user)\r\n var tooltip = options.navigationTooltips[i];\r\n\r\n if (typeof tooltip !== 'undefined' && tooltip !== '') {\r\n li += '<div class=\"' + SECTION_NAV_TOOLTIP + ' ' + options.navigationPosition + '\">' + tooltip + '</div>';\r\n }\r\n\r\n li += '</li>';\r\n\r\n nav.find('ul').append(li);\r\n }\r\n\r\n //centering it vertically\r\n $(SECTION_NAV_SEL).css('margin-top', '-' + ($(SECTION_NAV_SEL).height()/2) + 'px');\r\n\r\n //activating the current active section\r\n $(SECTION_NAV_SEL).find('li').eq($(SECTION_ACTIVE_SEL).index(SECTION_SEL)).find('a').addClass(ACTIVE);\r\n }", "function process_navigation() {\r\n\tlet html = \"<ul class='navtree'>\";\r\n\tfunction open(linkName, signature, level) {\r\n\t\thtml += \"<li>\";\r\n\t\thtml += \"<i class='fa fa-angle-right accordion-toggle'></i>\";\r\n\t\tif (signature)\t\r\n\t\t\thtml += `<a class='navlink navlink--lvl${level}' page='${signature}'>${escape_html(linkName)}</a>`;\r\n\t\telse\r\n\t\t\thtml += `<span class='navlink navlink--lvl${level}'>${escape_html(linkName)}</span>`;\r\n\t\thtml += \"<ul class='accordion'>\";\r\n\t\treturn html;\r\n\t}\r\n\t\r\n\tfunction close() {\r\n\t\thtml += \"</ul>\";\r\n\t\thtml += \"</li>\";\r\n\t}\r\n\t\r\n\tfunction build(member) {\r\n\t\tif (member.childcount === 0) {\r\n\t\t\thtml += `<li>\r\n\t\t\t\t\t\t<a class='navlink navlink--lvl3' page='${member.signature}'>\r\n\t\t\t\t\t\t\t${escape_html(member.name)}\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t</li>`;\r\n\t\t} else {\r\n\t\t\topen(member.name, member.signature, 3);\r\n\t\t\tconst childs = findChilds(member);\r\n\t\t\tfor (const type of Object.keys(childs)) {\r\n\t\t\t\topen(SECTION_NAMES[type], null, 3);\r\n\t\t\t\tfor (const child of childs[type])\r\n\t\t\t\t\tbuild(child);\r\n\t\t\t\tclose();\r\n\t\t\t}\r\n\t\t\tclose();\r\n\t\t}\r\n\t}\r\n\t\r\n\tfor (const member of ROOT_MEMBERS) {\r\n\t\tbuild(member);\r\n\t\thtml += \"<hr/>\";\r\n\t}\t\r\n\thtml += \"</ul>\";\r\n\t\r\n\tconst navigation = $('#navigation');\r\n\tnavigation.html(html);\r\n\t\r\n\tprocess_accordions(navigation);\r\n\tprocess_links(navigation);\r\n}", "constructor(props, context) {\n super(props, context);\n\n //this._onPushRoute = this.props.onNavigationChange(val);\n this._onPopRoute = this.props.onNavigationChange.bind(null, 'pop');\n this._renderScene = this._renderScene.bind(this);\n }" ]
[ "0.7938753", "0.78489083", "0.7383111", "0.7350041", "0.72935796", "0.7271455", "0.7252207", "0.71440786", "0.68863344", "0.66939944", "0.66918534", "0.6647934", "0.66293293", "0.6626447", "0.6612093", "0.65801877", "0.648965", "0.6448731", "0.6408896", "0.6405626", "0.6403043", "0.6402464", "0.6383518", "0.6375858", "0.63730913", "0.6360291", "0.6327007", "0.63256437", "0.63190246", "0.63096523", "0.629619", "0.6292379", "0.6290284", "0.6274956", "0.6246547", "0.6239895", "0.62231266", "0.6207958", "0.61952084", "0.6173061", "0.616429", "0.6163223", "0.6160535", "0.61397403", "0.61381996", "0.61378455", "0.6133071", "0.6113512", "0.6109377", "0.6104157", "0.6103563", "0.61016744", "0.6085485", "0.608146", "0.6078517", "0.6077538", "0.607721", "0.60749125", "0.60421795", "0.60392135", "0.60372955", "0.60372955", "0.6036382", "0.6030099", "0.6027982", "0.60273224", "0.6009178", "0.6005717", "0.6004508", "0.59978473", "0.5997823", "0.5996281", "0.5995769", "0.59928197", "0.5988924", "0.59789413", "0.5964765", "0.596388", "0.59628326", "0.59615225", "0.5959273", "0.59556353", "0.5938186", "0.5936022", "0.59285384", "0.592293", "0.5920055", "0.59182227", "0.59182227", "0.59158117", "0.59149504", "0.5909674", "0.590731", "0.59059244", "0.590529", "0.59040195", "0.59040195", "0.59040195", "0.59000784", "0.5897318" ]
0.75566185
2
Add Items To Basket
function addToBasket() { counter++; $("#counter").html(counter).animate({ 'opacity': '0' }, 300, function () { $("#counter").delay(300).animate({ 'opacity': '1' }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function AddItem(item){\n console.log(\"Adding \" + item.Name + \" to the basket!\");\n basket.push(item);\n}", "function addItem(item) {\n basket.push(item);\n return true;\n}", "function addBasket() {\n if (basket.length === 0 || (basket.find(x => x.name === item.name)) === undefined) {\n item.quantity = updatedQuantity\n basket.push(item)\n } else {\n for (let i=0; i < basket.length; i++) {\n if (basket[i].name === item.name) {\n basket[i].quantity = basket[i].quantity + updatedQuantity\n } \n }\n }\n productTotal();\n basketCount();\n localStorage.setItem(\"savedBasket\", JSON.stringify(basket));\n}", "function addItemToCart() {}", "function addItemToCart() {}", "function addItemToBasket(item) {\n const parent = $(\"#order\");\n\n // Add item\n basket.push(item);\n parent.append(\"<li id='ordermenuitem-\" + item.id\n + \"' class='list-group-item list-group-item-action'>\\n\"\n + \" <span class='bold'>\" + item.name + \"</span>\"\n + \" <span class='span-right'>£\" + item.price + \"</span>\\n\"\n + \" <br>\\n\"\n + \" <span id='omi-instructions-\" + item.id\n + \"'><span id='omi-instructions-\" + item.id + \"-text'>\"\n + item.instructions + \"</span></span>\\n\"\n + \" <span class='span-right'><i id='omi-edit-\" + item.id\n + \"' class='fa fa-edit fa-lg edit' onclick='showEditOrderMenuItem(\"\n + item.id + \", \\\"\" + item.instructions\n + \"\\\");'></i><i class='fa fa-times fa-lg remove' onclick='confirmRemoveOrderMenuItem(\"\n + item.id + \");'></i></span>\\n\"\n + \"</li>\");\n}", "add(event, item) {\n event.preventDefault();\n this.props.addToBasket({\n product_id: item.product_id,\n product_name: item.product_name,\n product_images: item.product_images,\n product_price: item.product_price\n })\n }", "addItemsToCart() {\n\n Model.addItemsToCart(this.currentItems);\n }", "function addToBasket(prodID, prodName, prodColour, prodSize, prodPrice, prodImage){\n let basket = getBasket();//Load or create basket\n\n //Add product to basket\n basket.push({id: prodID, name: prodName, colour:prodColour, size:prodSize, price:prodPrice, image_url:prodImage});\n\n //Store in local storage\n sessionStorage.basket = JSON.stringify(basket);\n\n //Display basket in page.\n loadBasket();\n}", "function addToBasket(detail) { }", "function addItemToCart(user, item) {}", "function addBasket(basket, move) {\n basket.find(\"ul\").append('<li data-id=\"' + move.attr(\"data-id\") + '\">' + '<span class=\"name\">' + move.find(\"h3\").html() + '</span>' + '<input class=\"count\" value=\"1\" type=\"text\">' + '<button class=\"delete\">&#10005;</button>');\n }", "function plusItem() {\n const productId = this.name;\n const cartList = JSON.parse(sessionStorage.getItem(\"shoppingCartItems\"));\n const item = cartList.find(product => product.id == productId);\n cartList.push(item);\n sessionStorage.setItem(\"shoppingCartItems\", JSON.stringify(cartList));\n shoppingCartCount();\n populateShoppingCartPage();\n}", "addItem(newItem) {\n for (let index in this.items) {\n let item = this.items[index];\n if (item.id === newItem.id) {\n item.quantity += newItem.quantity;\n this.updateTotal();\n return;\n }\n }\n\n this.items.push(newItem);\n this.updateTotal();\n }", "function addItem(){\n var itemName = $(\"#spinlabel\").html();\n var quantity = $(\"#spin\").val();\n for(var i = 0; i < CurrentShoppingListArray.length; i++){\n if(itemName == CurrentShoppingListArray[i].name){\n CurrentShoppingListArray[i].quantity = parseInt(CurrentShoppingListArray[i].quantity) + parseInt(quantity);\n return;\n }\n }\n var tempItem = new Item(itemName, quantity);\n CurrentShoppingListArray.push(tempItem);\n}", "addItem(item) {\n this.items.push(item);\n // tegye közzé a frissített elemek listáját, hogy frissítse a Cart topic-ot\n // amikor a cart tartalma frissült\n PubSub.publish(\"updateCart\", this.getItems());\n }", "function addItem(item) {\n var foundItem = false;\n\n // if there's another item exactly like this one, update its quantity\n _.each(bag.getItems(), function(curItem) {\n if (curItem.name == item.name && curItem.size == item.size &&\n curItem.price == item.price && curItem.color == item.color) {\n curItem.quantity += item.quantity;\n foundItem = true;\n }\n });\n\n // otherwise, add a new item\n if (!foundItem) {\n bag.addItem(item);\n } else {\n var items = bag.getItems();\n\n // item was updated, re-render\n renderItems(items);\n renderTotalQuantityAndPrice(items);\n }\n }", "function addToBasketClicked(event) {\n event.preventDefault()\n itemID = event.target.dataset.id\n item = products[itemID]\n for (i=0; i<basketList.length; i++) {\n if (basketList[i] === item.name) {\n alert('Item Already Added To Basket')\n return\n }\n }\n console.log(item.name + ' added to basket')\n\n const basketSection = document.querySelector('#basket')\n const basketArticle = document.createElement('article')\n const basketFigure = document.createElement('figure')\n basketFigure.classList.add('product-in-basket')\n\n const basketImage = document.createElement('img')\n basketImage.classList.add('basket-image')\n basketImage.src = item.imagePath\n basketImage.alt = item.name\n\n const basketProductName = document.createElement('figcaption')\n basketProductName.classList.add('basket-product-name')\n basketProductName.textContent = item.name\n\n const basketQuantity = document.createElement('input')\n basketQuantity.classList.add('basket-quantity')\n basketQuantity.type = 'number'\n basketQuantity.name = 'quantity'\n basketQuantity.defaultValue = 1\n basketQuantity.min = 1\n let quantity = basketQuantity.value\n basketQuantity.addEventListener('input', function(event) {\n event.preventDefault()\n console.log(item.name + ' Quantity Increased')\n quantity = basketQuantity.value\n basketPriceSymbol.textContent = '£'\n basketPrice.textContent = (quantity * item.price).toFixed(2)\n basketPriceSymbol.appendChild(basketPrice)\n updateTotal(itemID)\n })\n\n const basketPriceSymbol = document.createElement('figcaption')\n basketPriceSymbol.classList.add('basket-price-symbol')\n basketPriceSymbol.textContent = '£'\n const basketPrice = document.createElement('span')\n basketPrice.classList.add('basket-price')\n basketPrice.textContent = (quantity * item.price).toFixed(2)\n\n const basketRemove = document.createElement('button')\n basketRemove.classList.add('basket-remove')\n basketRemove.type = 'button'\n basketRemove.textContent = 'REMOVE'\n basketRemove.addEventListener('click', function(event) {\n event.preventDefault()\n console.log('Remove Item Clicked')\n basketArticle.innerHTML = ''\n const index = basketList.indexOf(item.name)\n basketList.splice(index, 1)\n updateTotal(itemID)\n if (basketList.length === 0) {\n const defaultBasket = document.createElement('p')\n defaultBasket.setAttribute('id', 'empty-basket')\n defaultBasket.textContent = 'Your Basket Is Currently Empty'\n basketSection.appendChild(defaultBasket)\n basketTotalAmount.textContent = ''\n basketTotalSection.innerHTML = ''\n }\n })\n\n if (basketList.length === 0) {\n basketSection.innerHTML = ''\n }\n\n basketFigure.appendChild(basketRemove)\n basketSection.appendChild(basketArticle)\n basketArticle.appendChild(basketFigure)\n basketFigure.appendChild(basketImage)\n basketFigure.appendChild(basketProductName)\n basketFigure.appendChild(basketQuantity)\n basketFigure.appendChild(basketPriceSymbol)\n basketPriceSymbol.appendChild(basketPrice)\n basketTotalSection.appendChild(basketTotalArticle)\n basketTotalArticle.appendChild(basketTotalAmount)\n\n updateTotal(itemID)\n\n basketList.push(item.name)\n}", "function addToBasket(prodID, prodName, prodPrice){\n //Get basket from local storage or create one if it does not exist\n var basketArray;\n if(sessionStorage.basket === undefined || sessionStorage.basket === \"\"){\n basketArray = [];\n }\n else {\n basketArray = JSON.parse(sessionStorage.basket);\n }\n \n //Add product to basket\n basketArray.push({id: prodID, name: prodName, price: prodPrice});\n \n //Store in local storage\n sessionStorage.basket = JSON.stringify(basketArray);\n \n //Display basket in page.\n loadBasket(); \n}", "add(id, product) {\n // if an item exists in the cart\n const item = this.items[id]\n ? new CartItem(this.items[id])\n : new CartItem({ id, product });\n\n // increment the items quantity\n item.qty += 1;\n // Update the items price\n item.price = item.product.price * item.qty;\n\n this.items = {\n ...this.items,\n [id]: item\n };\n }", "function addItemToShoppingList(itemName) {\n store.push({id: cuid(), name: itemName, checked: false});\n}", "function addToBasket(product) {\n // defines the new product\n var newProduct = {\n productID: product.productID,\n productName: product.productName,\n productDesc: product.productDesc,\n productPrice: product.productPrice,\n productStock: product.productStock,\n quantity: elementWithId('quantity').value\n };\n\n // checks if localStorage is defined\n if (localStorage.BASKET) {\n var basket = JSON.parse(localStorage.BASKET);\n var productInBasket = false;\n // loop through products in basket\n for (var i = 0; i < basket.length; i++) {\n\n var basketProduct = JSON.parse(basket[i]);\n\n // if the product is already in the basket, add the new quantity\n if (basketProduct.productName === newProduct.productName) {\n var quantityInBasket = parseInt(basketProduct.quantity);\n productInBasket = true;\n basketProduct.quantity = parseInt(basketProduct.quantity) +\n parseInt(newProduct.quantity);\n basket[i] = JSON.stringify(basketProduct);\n }\n }\n if (!productInBasket) {\n // adds the new product to the basket\n basket.push(JSON.stringify(newProduct));\n }\n\n localStorage.BASKET = JSON.stringify(basket);\n } else {\n // new basket\n var newBasket = [];\n newBasket.push(JSON.stringify(newProduct));\n localStorage.BASKET = JSON.stringify(newBasket);\n }\n updateBasketCost();\n // shows the product\n ajaxGet('api/product/?productID=' + product.productID, showProduct);\n}", "function addItem(item) {\n backpack.push(item);\n}", "function addItemToEbay() {\r\n addToEbay.value = '1';\r\n }", "function addItemToShoppingList(itemName) {\n console.log(`Adding \"${itemName}\" to shopping list`);\n STORE.items.push({name: itemName, checked: false});\n}", "_addNewItem() {\n // Add new Item from Order's Items array:\n this.order.items = this.order.items.concat([this.item]);\n // Update current Order:\n this.orderService.setCurrentOrder(this.order);\n this._closeAddNewItem();\n }", "function addItem(item) {\n if (isFull(basket) === true) {\n console.log(`Basket is currently full. Could not add ${item}`);\n return false;\n } else {\n basket.push(item);\n return true;\n }\n}", "function addToOrder(itemId, instructions) {\n const dataToSend = JSON.stringify({\n menuItemId: itemId,\n instructions: instructions,\n orderId: sessionStorage.getItem(\"orderId\")\n });\n\n post(\"/api/authTable/addItemToOrder\", dataToSend, function (data) {\n if (data !== \"failure\") {\n const item = JSON.parse(data);\n addItemToBasket(item);\n calculateTotal();\n }\n })\n}", "function addItem(id) { \n $.each(products, function (key, item) {\n if (item.id === id) {\n order.push(item);\n numberOfItems++;\n } \n });\n $('#orderItems').empty();\n $('<span>Items in Cart ' + numberOfItems + '</span>').appendTo($('#orderItems'));\n}", "addItem(name, quantity, pricePerUnit) {\n this.items.push({\n name,\n quantity,\n pricePerUnit\n })\n }", "function addItems() {\n\t\t\t\tvar form = $(psForms.shift());\n\t\t\t\tvar itemid = form.find(\"input[name='pid']\").val();\n\n\t\t\t\t$.ajax({\n\t\t\t\t\tdataType : \"html\",\n\t\t\t\t\turl: addProductUrl,\n\t\t\t\t\tdata: form.serialize()\n\t\t\t\t})\n\t\t\t\t.done(function (response) {\n\t\t\t\t\t// success\n\t\t\t\t\tminiCartHtml = response;\n\t\t\t\t})\n\t\t\t\t.fail(function (xhr, textStatus) {\n\t\t\t\t\t// failed\n\t\t\t\t\tvar msg = app.resources.ADD_TO_CART_FAIL;\n\t\t\t\t\t$.validator.format(msg, itemid);\n\t\t\t\t\tif(textStatus === \"parsererror\") {\n\t\t\t\t\t\tmsg+=\"\\n\"+app.resources.BAD_RESPONSE;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmsg+=\"\\n\"+app.resources.SERVER_CONNECTION_ERROR;\n\t\t\t\t\t}\n\t\t\t\t\twindow.alert(msg);\n\t\t\t\t})\n\t\t\t\t.always(function () {\n\t\t\t\t\tif (psForms.length > 0) {\n\t\t\t\t\t\taddItems();\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tquickView.close();\n\t\t\t\t\t\tminicart.show(miniCartHtml);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}", "add_item(item){\n this.cart.push(item);\n }", "function addItemToCart(user, item) {\n\n}", "addItem(item) {\n\t // makes a copy of state\n\t const newItems = this.state.inventoryItems;\n\t // add new item\n\t const timestamp = Date.now();\n\t newItems[`item-${timestamp}`] = item;\n\t // // set state\n\t this.setState({\n\t\t\t\tinventoryItems: newItems\n\t\t\t})\n\t }", "function addItem() {\n\t\t\tvar order = ordersGrid.selection.getSelected()[0];\n\n\t\t\titensStore.newItem({\n\t\t\t\tpi_codigo: \"new\" + itensCounter,\n\t\t\t\tpi_pedido: order ? order.pe_codigo : \"new\",\n\t\t\t\tpi_prod: \"\",\n\t\t\t\tpi_quant: 0,\n\t\t\t\tpi_moeda: \"R$\",\n\t\t\t\tpi_preco: 0,\n\t\t\t\tpi_valor: 0,\n\t\t\t\tpi_desc: 0,\n\t\t\t\tpi_valort: 0,\n\t\t\t\tpr_descr: \"\",\n\t\t\t\tpr_unid: \"\"\n\t\t\t});\n\t\t\t\n\t\t\titensCounter = itensCounter + 1;\n\t\t}", "buyItems(item){\n let shopSells = new Shop('magic shop', 'sells magic things')\n this.items.push(item);\n shopSells.sellItems(item);\n }", "function addItem(buttonID) {\n\tvar quant = 1;\n\tvar exists = false;\n\tvar name = itemList[buttonID][0];\n\tvar price = itemList[buttonID][1];\n\tif (shopList.length !== 0) {\n\t\tfor (i = 0; i < shopList.length; i ++) {\n\t\t\tif (shopList[i][0] === name) {\n\t\t\t\tshopList[i][2] += quant;\n\t\t\t\texists = true;\n\t\t\t}\n\t\t}\n\t}\n\tconsole.log(shopList);\n\t\n\tif (!exists) {\n\t\tvar newItem = [name, price, quant];\n\t\tshopList.push(newItem);\n\t}\n\tnumItems++;\n\tupdateItemInfo(numItems, name, price);\n\tshopList.sort();\n}", "function addItem( item ){\n cart.push(item);\n return cart;\n}", "add(state, product) {\n\t state.productList.push(product)\n\t}", "function addSelectedItemToCart() {\n // TODO: suss out the item picked from the select list\n let selectedItem = event.target.items.value;\n console.log(selectedItem);\n // TODO: get the quantity\n let quantity = event.target.quantity.value;\n // TODO: using those, add one item to the Cart\n \n \n carts.addItem(selectedItem,quantity); \n console.log(carts.items);\n \n}", "addItem(i,q){\n this.itemList.push(i);\n this.itemQuantity.push(q);\n }", "addItem(i,q){\n this.itemList.push(i);\n this.itemQuantity.push(q);\n }", "addItem(state, payload) {\n state.items.push(payload)\n\n return state\n }", "onAddItem () {\n const newItem = this.get('bunsenModel').items.type === 'object' ? {} : ''\n const items = this.get('items')\n const index = items.length\n\n items.pushObject(newItem)\n this.notifyParentOfNewItem(newItem, index)\n }", "add(type, id) {\n let key = this.getKey(type)\n // First see if product is already present\n let item = this.getItem(type, id)\n\n if (!item) {\n this.items[key].push(id)\n }\n\n this.update();\n }", "addToCart(itemOptions) {\n this.store.cart.products.push({\n product_id: itemOptions.item,\n price: itemOptions.price || 0,\n total: itemOptions.price || 0,\n quantity: itemOptions.quantity || 1,\n offer: itemOptions.offer || null,\n materials: itemOptions.config ? itemOptions.config.split(',') : [],\n description: \"\",\n comment: itemOptions.comment\n });\n }", "function addToCarts(id){\r\n if(!data[id].itemInCart){\r\n cartList = [...cartList,data[id]];\r\n addItem();\r\n\r\n alert('item add to your cart');\r\n }\r\n else{\r\n alert('Your item is already there');\r\n }\r\n data[id].itemInCart = true;\r\n}", "setBasket(state,data){\r\n\t\t\tstate.basket = data;\r\n\t\t}", "addAnItem(item) {\n this.setState((state) => ({items: state.items.concat(item)}));\n }", "function addItem() {\n\n console.log('adding', { amount }, { name });\n\n dispatch({\n type: 'ADD_ITEM', payload: {\n name: name,\n amount: amount,\n list_id: id,\n }\n })\n //reset local state of new item textfield to allow for more items to be added\n setName('');\n setAmount(1);\n }", "addBoothToCart(product, subitem){\n this.cart.forEach(m => {\n if ( m.booths && m.id == product.id ){\n this.total -= m.price;\n this.cart = this.cart.filter(n => n.id !== m.id);\n }\n if ( m.notify ){\n this.cart = this.cart.filter(n => !n.notify);\n }\n })\n product.booths.booths = true;\n product.booths.quantity++;\n product.booths.name = subitem.name;\n product.booths.price = subitem.price;\n cartitem = Object.assign({}, product.booths);\n this.cart.push(cartitem);\n this.total += cartitem.price;\n }", "putin(item) {\n if (this.open = true) {\n this.item.push(item);\n alert(\"Item has been added to the backpack.\");\n }\n }", "function addToCart(payload) {\n const inCart = cartItems.findIndex((item) => item.beer === payload.beer);\n if (inCart === -1) {\n //add\n console.log(payload);\n const nextPayload = { ...payload };\n nextPayload.amount = payload.amount;\n setCartItems((prevState) => [...prevState, nextPayload]);\n } else {\n //it exists, modify amount\n const nextCart = cartItems.map((item) => {\n if (item.beer === payload.beer) {\n item.amount += payload.amount;\n }\n return item;\n });\n setCartItems(nextCart);\n }\n }", "async putBasket() {\n let el;\n // find all required options\n for(var i = 1; i < 10; i++) {\n try {\n el = await this.findByXPath(\"(//select[@required='true']/option[last()])[\" + i + \"]\")\n await el.click();\n }catch(err) {\n break;\n }\n }\n\n // find \"put in basket\" button\n el = await this.findByXPath(\"//*[@onclick=\\\"product_submit(2, '/exec/front/order/basket/', this)\\\"]\");\n await el.click();\n\n // 장바구니에 동일한 상품이 있습니다. 장바구니에 추가하시겠습니까?\n try {\n el = await this.getAlert();\n await el.accept();\n }catch(err) {}\n }", "function exo03_addToBasket(){\n \n var itemAjout3 = document.getElementById(\"exo03_item\").value;\n \n var testItem = isAlreadyIn(basket3,itemAjout3);\n\n if( testItem === false){\n \n basket3.push(itemAjout3);\n compteItems.push(1);\n \n majVue3();\n \n }else{\n \n for(var i = 0 ; i < basket3.length ; i++){\n if(itemAjout3 === basket3[i]){\n compteItems[i] = compteItems[i] + 1;\n showJustTheLine(i);\n }\n }\n }\n}", "function exo01_addToBasket(){\n //Get la value de l'input exo01_item\n var itemAjout = document.getElementById(\"exo01_item\").value;\n //Push les elements dans la liste \n basket.push(itemAjout); \n // Call ma fonction majVue\n majVue();\n \n}", "function addSelectedItemToCart() {\n // TODO: suss out the item picked from the select list\n var product = event.target.items.value;\n var quantity = event.target.quantity.value;\n cart.addItem(product, quantity);\n counter++;\n console.log(counter);\n // TODO: get the quantity\n // TODO: using those, add one item to the Cart\n}", "handleAddItemToCart(item, quantity){\n var buyableItem = new BuyableItem(item, quantity);\n currentCart.push(buyableItem);\n this.setState({cartQuantity : this.calculateCartQuantity(currentCart)})\n localStorage.setItem(\"cart\", JSON.stringify(currentCart));\n this.readFromCart();\n }", "function add(item) {\n data.push(item);\n console.log('Item Added...');\n }", "function addProduct(){\n var returnedItem = chooseProduct(this);\n for(var i = 0; i < bowlarray.length; i++){\n if(bowlarray[i]._id === returnedItem._id){\n $(DOMvariables.alertheader).text(\"Выбранный вами продукт уже есть в миске\");\n return;\n }\n }\n $(DOMvariables.alertheader).text(defaulttext);\n bowlarray.push(returnedItem);\n $(DOMvariables.bowlcolumn).render({bowllist: bowlarray}, bowlRender);\n $(\"#bowlcolumn\").find(\"header\").text(\"Итог: \" + sum + \" кал.\");\n }", "addOne(item) {\n const newItems = this.state.inventoryItems;\n newItems[item].quantity = parseInt(newItems[item].quantity);\n newItems[item].quantity = (newItems[item].quantity + 1);\n this.setState({\n inventoryItems: newItems\n })\n }", "addToCart(items) {\n console.log(\"items\", items);\n API.userItemsToCart(items)\n .then(res => {\n console.log(res, \"working at addtocart\");\n this.setState({ itemsToCart: items });\n })\n .catch(err => console.log(err))\n }", "function addToBasket(id){\n let object = {}\n console.log(id)\n fetch(`https://my-final-project-backend.herokuapp.com/view-animal/${id}`, {\n headers: {\n // 'Authorization': `jwt ${mystorage.getItem('jwt-token')}`\n }\n })\n .then(response => response.json())\n .then(data => {\n console.log(data);\n object['id'] = data['data'][0];\n object['type'] = data['data'][3];\n object['breed'] = data['data'][2];\n object['image'] = data['data'][8];\n object['name'] = data['data'][1];\n object['price'] = data['data'][6]\n console.log(object);\n for (let item in basket){\n console.log(item)\n if (object['name'] == basket[item]['name']){\n basket[item]['quantity'] += object['quantity'];\n basket[item]['totalprice'] += object['totalprice'];\n console.log(basket)\n myStorage.setItem('basket', JSON.stringify(basket))\n idStorage.setItem('id', data['data'][0])\n alert('Basket has been updated')\n return\n };\n } \n basket = basket.concat(object)\n console.log(basket)\n myStorage.setItem('basket', JSON.stringify(basket))\n alert('Animal has been added to your basket successfully')\n })\n}", "function addItemToCart(name, price, count) {\n for (var i in cart) {\n if (cart[i].name === name) {\n cart[i].count += count;\n saveCart();\n displayCart();\n return;\n }\n }\n var item = new Item(name, price, count);\n cart.push(item);\n saveCart();\n displayCart();\n }", "handleAddClick() {\n var isProductInCart = false;\n var newCart = this.state.cart.slice();\n var product = this.state.products[this.state.value];\n /*Searchs for the product in the cart*/\n\n var newProduct = {\n id: product.id,\n name: product.name,\n price: product.price,\n description: product.description,\n quantity: this.state.quantity\n };\n for (let i = 0; i < newCart.length; i++) {\n if (product.id == newCart[i].id) {\n newCart[i].quantity += this.state.quantity;\n isProductInCart = true;\n }\n }\n /*if is not there add it*/\n if (!isProductInCart) newCart.push(newProduct);\n this.setState({ cart: newCart });\n }", "add() {\n\t\torinoco.cart.add({ imageUrl: this.imageUrl, name: this.name, price: this.price, _id: this._id });\n\t}", "add(index, type){\n this.setState(prevState => ({\n basket:[...prevState.basket, this.state[type][index]]\n }))\n }", "function trackBasketItem(objectName, count) {\n\n\t\tfor (var i = 0; i < count; i++) {\n\t\t\tobjectName.addToBasket();\n\t\t}\n\n\t\tconsole.log(itemInBasket);\n\t}", "function loadBasket() {\n const basket = SDK.Storage.load(\"basket\") || [];\n let total = 0;\n\n basket.forEach(entry => {\n let subtotal = entry.item.itemPrice * entry.count;\n total += subtotal;\n $modalTbody.append(`\n <tr>\n <td></td>\n <td>${entry.item.itemName}</td>\n <td>${entry.count}</td>\n <td>kr. ${entry.item.itemPrice}</td>\n <td>kr. ${subtotal}</td>\n </tr> \n `);\n });\n\n $modalTbody.append(`\n <tr>\n <td colspan=\"3\"></td>\n <td><b>Total</b></td>\n <td>kr. ${total}</td>\n </tr>\n `);\n\n\n }", "addItem(count, unit, ingredient) {\n const item = {\n // we need each item to have a unique id, so that we can update/delete them. We are including a library to add unique ids\n id: uniqid(),\n count,\n unit,\n ingredient\n }\n // push newly-created item into items array and return the newly created item\n this.items.push(item)\n return item\n }", "function addItem(){\n var item = document.getElementById(\"newItemName\")\n itemsInCart.push(item.value)\n\n var quantity = document.getElementById(\"quantity\")\n quantityPerItem.push(parseInt(quantity.value))\n\n var price = document.getElementById(\"pricePerUnit\")\n var totalPrice = price * quantity\n pricePerItem.push(parseInt(totalPrice.value))\n\n addItemToCart()\n\n}", "handleAddItem() {\n const transactionState = this.props.transactionState;\n const items = transactionState.transactionItems;\n items[items.length - 1].item = {\n name: this.state.name,\n category: this.state.category,\n gender: this.state.gender,\n typeColor: this.state.typeColor,\n size: this.state.size,\n location: this.state.location,\n };\n items[items.length - 1].quantityChanged = this.state.quantity;\n items[items.length - 1].recipient = this.state.recipient;\n this.props.setTransactionState(transactionState);\n }", "addNewItem(state, payload) {\n //update GUI\n state.items.unshift(payload)\n }", "function addOneItemToCart() {\n var itemID = $(this).attr(\"id\");\n var positionInCart = itemID.slice(12, itemID.length);\n cartItems[positionInCart][3] += 1;\n updateCartDetails();\n}", "addItem(newItemData, listId){\n \n \n let list = _store.State.lists.find(list => list.id == listId)\n\n console.log(_store.State.lists)\n list.items.push(newItemData)\n _store.saveState()\n }", "function addToBasket(selectedProduct) {\n // 1. Pick up the button element from HTML.\n const button = document.getElementById(\"add-to-basket\");\n // 2. Create click event.\n button.addEventListener(\"click\", function (event) {\n event.preventDefault();\n // 3. Add an alert if color is not selected.\n const selectedColor = getSelectedColor();\n if (selectedColor === \"Sélectionner la couleur\") {\n alert(\"Veuillez sélectionner une couleur.\");\n } else {\n // 4. Otherwise, declare a variable called basket which is an empty object {key:value}.\n let basket = {};\n // 5. Get data from the local storage.\n // 5.1. First check if there is already an item called 'localStorageBasket' in the local storage.\n if (localStorage.getItem(\"localStorageBasket\")) {\n // 5.2. If so, get the item 'localStorageBasket' which is in string format then convert it into a JavaScript object stored in the object basket.\n basket = JSON.parse(localStorage.getItem(\"localStorageBasket\"));\n }\n // 6. Check if the newly selected product is already in the basket.\n // If so, we only increment the quantity otherwise we add a new {key:value} pair to the object basket.\n // 6.1. Create the key corresponding to the selected product.\n const basketKey = selectedProduct._id + selectedColor;\n // 6.2. does the key already exist?\n if (basketKey in basket) {\n // 6.3. Access to the value of the key and store it in a variable.\n let productAlreadyInBasket = basket[basketKey];\n // 6.4. Increment the quantity.\n productAlreadyInBasket.productQuantity++;\n } else {\n // 6.5. Create new object key:value pair defining the selected product. This will be the value of the key to be added to basket objet.\n let selectedProductInBasket = {\n productName: selectedProduct.name,\n productId: selectedProduct._id,\n productColor: selectedColor,\n productPrice: selectedProduct.price / 100,\n productQuantity: 1,\n };\n // 7. Add new {key:value} pair into the object basket.\n basket[basketKey] = selectedProductInBasket;\n }\n // 8. Convert the JavaScript object into a string and store it creating a new {key:value} pair into the local storage.\n localStorage.setItem(\"localStorageBasket\", JSON.stringify(basket));\n // 9. Redirect to basket page.\n redirectToBasketPage();\n }\n });\n}", "function addItemToCart(item, itemQuantity){\n if(isNaN(itemQuantity)){\n itemQuantity = 1; \n }\n var itemIsNew = true; \n cart.forEach(function (cartItem){\n if(cartItem.name === item.name){\n cartItem.quantity += itemQuantity; \n updateQuantityDisplay(cartItem); \n return itemIsNew = false\n } \n })\n if(itemIsNew){\n cart.push(item); \n item.quantity = itemQuantity; \n displayItem(item, itemQuantity, \".cart-container\")\n }\n}", "addToCart(item) {\n const nameKey = item.name;\n // If the item that is being added to the cart is already in the cart,\n // we increment the numInCart variable to show that an additional unit\n // is being added\n if (nameKey in this.state.aggregatedItems) {\n let currAggregatedItems = this.state.aggregatedItems;\n let currPrice = currAggregatedItems[nameKey].price;\n let currNumInCart = currAggregatedItems[nameKey].numInCart;\n let currImage = currAggregatedItems[nameKey].image;\n let currShelfLife = currAggregatedItems[nameKey].shelf_life;\n let currType = currAggregatedItems[nameKey].type;\n\n currAggregatedItems[nameKey] = {\n numInCart: currNumInCart + 1,\n price: currPrice,\n image: currImage,\n type: currType,\n shelf_life: currShelfLife\n };\n this.setState({\n aggregatedItems: currAggregatedItems\n })\n // If it is not already in the cart, we need to add this key-value pair to the \n // aggregatedItems state variable. We do so using the setState function\n } else {\n let currAggregatedItems = this.state.aggregatedItems;\n currAggregatedItems[nameKey] = {\n numInCart: 1,\n price: item.price,\n image: item.image,\n shelf_life: item.shelf_life,\n type: item.type\n\n }\n this.setState({\n aggregatedItems: currAggregatedItems\n })\n }\n }", "function addOrder(){\n var li, pa, inum, ides;\n item=JSON.parse(sto.getItem('items'));\n for (i=0; i<items.length; i++){\n if (item[items[i]] != null && item[items[i]] !== \"\"){\n // declare the items elements\n li= document.createElement('li');\n pa= document.createElement('p');\n inum= document.createElement('i');\n ides= document.createElement('i');\n // Define item and quantity\n li.classList.add('review-item');\n li.id= items[i];\n inum.innerText=item[items[i]];\n ides.innerText=\" x \"+items[i];\n pa.append(inum);\n pa.append(ides);\n\n // Add elements to list\n li.append(pa);\n document.querySelector('#review-list').append(li);\n }\n }\n }", "addItem () {\n this.products.push({\n id: this.products.length + 1,\n name: '',\n count: 0,\n price: 0\n })\n }", "function addToCart() {\n var itemID = $(this).attr(\"id\");\n var alreadyInCart = false;\n for (var i = 0; i < cartItems.length; i++) {\n if (itemID == cartItems[i][0]) {\n alreadyInCart = true;\n cartItems[i][3] += 1;\n }\n }\n if (alreadyInCart == false) {\n for (var i = 0; i < shopItems.length; i++) {\n if (itemID == shopItems[i][0]) {\n var applianceID = shopItems[i][0];\n var applianceName = shopItems[i][1];\n var appliancePrice = shopItems[i][2];\n var applianceQuantity = 1;\n itemID = [\n applianceID,\n applianceName,\n appliancePrice,\n applianceQuantity,\n ];\n }\n }\n cartItems.push(itemID);\n }\n\n updateCartDetails();\n}", "function add_and_save(id) {\n retrieve_item();\n // console.log(qty);\n qty[id]++;\n //console.log(qty);\n save_item();\n}", "addToCart(text, price)\n {\n let count = 1;\n let item = {Name:text, Count:count, Price:price};\n let fl=1;\n for (i = 0; i < cart.length; i++) {\n if(cart[i].Name === text)\n {\n cart[i].Count=cart[i].Count+1;\n cart[i].Price=Number(cart[i].Price)+Number(price);\n fl=0;\n break;\n\n }\n }\n if(fl==1){\n cart.push(item);\n }\n // for(i=0; i<cart.length; i++){\n // console.log(\"item: \"+i+\" is \"+cart[i].Name+\" count \"+cart[i].Count+\" price \"+cart[i].Price); \n // }\n window.alert('Added to cart.');\n this.render();\n }", "addItem (count, unit, ingredient) {\n const item = {\n id: uniqid(),\n count,\n unit,\n ingredient\n }\n this.items.push(item);\n\n //persist data in local storage\n this.persistData();\n\n return item;\n }", "function add(item){\n repository.push(item);\n }", "addToCart(newItem) {\n let itemExisted = false\n let updatedCart = this.state.cart.map(item => {\n if (newItem === item.sku) {\n itemExisted = true\n return { sku: item.sku, quantity: ++item.quantity }\n } else {\n return item\n }\n })\n if (!itemExisted) {\n updatedCart = [...updatedCart, { sku: newItem, quantity: 1 }]\n }\n this.setState({ cart: updatedCart })\n // Store the cart in the localStorage.\n // localStorage.setItem('stripe_checkout_items', JSON.stringify(updatedCart))\n }", "function addItem(item){\n if (isFull() === true){\n console.log(`${item} cannot be added, basket is full. Returning false.`);\n return false\n } else {\n basket.push(item);\n console.log(`${item} successfully added to basket. Returning true`)\n return true;\n }\n}", "function addItem(id) {\n // clear session storage\n // sessionStorage.clear();\n\n // check to see if a cart key exists in session storage\n if (sessionStorage.getItem('cart')) {\n // if it does, set a local cart variable to work with, using the parsed string //JSON is js library\n var cart = JSON.parse(sessionStorage.getItem('cart'));\n } else {\n // if it does not exist, set an empty array\n var cart = [];\n }\n\n // loop through global products variable and push to Cart\n for (let i in products) {\n if (products[i].id == id) {\n cart.push(products[i]);\n break;\n }\n }\n\n // // call total function to update\n // calcTotal();\n\n // store the cart into the session storage\n sessionStorage.setItem('cart', JSON.stringify(cart));\n }", "function addToCart(newItem, itemQuantity, itemPrice) {\n\n for (let i = 0; i < cartItems.length; i++) {\n if (cartItems[i].item === newItem) {\n cartItems[i].quantity += itemQuantity;\n total()\n\n return\n }\n }\n\n setCartItems([...cartItems, {\n item: newItem,\n quantity: itemQuantity,\n price: itemPrice\n }])\n\n\n total()\n }", "function addItem() {\n\n}", "function addToInventory() {\n inquirer\n .prompt([\n {\n name: \"itemId\",\n type: \"input\",\n message: \"Please, enter the ID of the product that you want add more:\"\n },\n {\n name: \"quantity\",\n type: \"input\",\n message: \"Please, enter the quantity:\"\n }\n ])\n .then(function(answerInventory) {\n connection.query(\n \"UPDATE products SET stock_quantity = stock_quantity + \" +\n answerInventory.quantity +\n \" WHERE item_id = \" +\n answerInventory.itemId\n );\n viewProducts();\n });\n}", "function addItem(id, article, author, words, shares) \n{\n let datenkorbArray = JSON.parse(localStorage.getItem('databasket_js_1')) || []; \n var newItem = \n { \n\t\"id\" : id, \n\t\"article\": article,\n\t\"author\": author, \t\n\t\"words\": words, \n\t\"shares\": shares\n } \n \n //pushs item on a array\n datenkorbArray.push(newItem);\n //saves entry in the localStorage\n localStorage.setItem('databasket_js_2', JSON.stringify(datenkorbArray));\n}", "addItem(i, q)\n {\n this.itemList.unshift(i); //String\n this.itemQuantity.unshift(q); //Integer\n }", "addItem(item) {\n this.items.push(item)\n }", "function addBasket(data) {\n cameraButton.addEventListener('click', () => {\n //Création du panier dans le localStorage s'il n'existe pas déjà\n if (typeof localStorage.getItem(\"basket\") !== \"string\") {\n let basket = [];\n localStorage.setItem(\"basket\", JSON.stringify(basket));\n }\n //récupération des info du produit\n let produit = {\n 'image' : data.imageUrl,\n 'id' : data._id,\n 'name' : data.name,\n 'lense' : document.querySelector(\"option:checked\").innerText,\n 'price' : data.price,\n 'description' : data.description,\n 'quantity' : cameraQuantity.value,\n }\n console.log(produit);\n //création d'une variable pour manipuler le panier\n let basket = JSON.parse(localStorage.getItem(\"basket\"));\n //Vérification que l'item n'existe pas déjà dans le panier\n let isThisItemExist = false;\n let existingItem;\n for (let i = 0; i < basket.length; i++) {\n if (produit.id === basket[i].id && produit.lense === basket[i].lense) {\n isThisItemExist = true;\n existingItem = basket[i];\n }\n }\n //Ajouter la caméra au panier\n if (isThisItemExist === false) {\n basket.push(produit);\n localStorage.setItem(\"basket\", JSON.stringify(basket));\n alert(\"Votre article à bien été mis au panier\")\n } else {\n existingItem.quantity = parseInt(existingItem.quantity, 10) + parseInt(produit.quantity, 10);\n localStorage.setItem(\"basket\", JSON.stringify(basket));\n alert(\"La quantité du produit à bien été mise à jour\")\n }\n displayBasket();\n })\n}", "function loadItems() {\n $itemList.empty();\n\n SDK.Items.getItems((err, items) => {\n if (err) throw err;\n\n\n items.forEach((item) => {\n\n //Sort items to a specific type\n if (item.itemType === type) {\n\n\n const itemHtml = `\n <div class=\"col-lg-4 item-container\">\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">${item.itemName}</h3>\n </div>\n <div class=\"panel-body\">\n <div class=\"col-lg-8\">\n <dl>\n <dt>Description</dt>\n <dd>${item.itemDescription}</dd>\n </dl>\n </div>\n </div>\n <div class=\"panel-footer\">\n <div class=\"row\">\n <div class=\"col-lg-4 price-label\">\n <p>Kr. <span class=\"price-amount\">${item.itemPrice}</span></p>\n </div>\n <div class=\"col-lg-8 text-right\">\n <button class=\"btn btn-success purchase-button\" data-item-id=\"${item.itemId}\">Add to basket</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n `;\n\n $itemList.append(itemHtml);\n\n }\n });\n //Function to add items to basket\n $(\".purchase-button\").click(function () {\n const itemId = $(this).data(\"item-id\");\n const item = items.find((item) => item.itemId === itemId);\n SDK.Items.addToBasket(item);\n $(\"#purchase-modal\").modal(\"toggle\");\n });\n\n\n });\n }", "addGood(state,id){\r\n\t\t\tstate.basket.unshift({id:id,count:1})\r\n var flag = false;\r\n for (var i = 1; i < state.basket.length; i++){\r\n if (state.basket[i].id == state.basket[0].id){\r\n flag=true \r\n break \r\n }\r\n }\r\n if (flag == true){\r\n state.basket[0].count = state.basket[0].count + state.basket[i].count\r\n state.basket.splice(i,1)\r\n }\r\n\t\t\tthis.dispatch(\"basket/saveBasket\")\r\n\t\t}", "addItem(count, unit, ingredient){\n const item = {\n id: uniqid(),\n count,\n unit,\n ingredient\n }\n this.items.push(item);\n return item;\n }", "function addItem (name, quantity) {\n if(cart[name] == undefined) {\n createItem(name);\n }\n cart[name] = cart[name] + quantity;\n}", "function addItemToStore(object) {\n // Push new item object to datastore\n STORE.push(object);\n}", "function addToCart(item) {\n\t// create item in cart\n\tconst row = document.createElement('tr');\n\n\trow.innerHTML = `\n\t\t<td>\n\t\t\t<img src=\"${item.image}\">\n\t\t</td>\n\t\t<td>\n\t\t\t${item.title}\n\t\t</td>\n\t\t<td class=\"data-price\" data-price=\"${item.priceData}\">\n\t\t\t${item.price}\n\t\t</td>\n\t\t<td>\n\t\t\t<ion-icon name=\"close\" class=\"remove\" data-id=\"${item.id}\"></ion-icon>\n\t\t</td>\n\t`;\n\n\tshoppingCartCont.appendChild(row);\n\n\t// calculate price\n\tcalculatePrice(item);\n\n\t// update count of items in 'itemAmount'\n\titemAmount.innerHTML = shoppingCartCont.childElementCount;\n\n\t// apply 'in basket' effect\n\tif (shoppingCartCont.childElementCount > 0) {\n\t\titemAmount.classList.add('active');\n\t}\n\n\t// save item into local storage\n\tsaveIntoStorage(item);\n}" ]
[ "0.7838967", "0.77334374", "0.76741815", "0.75713176", "0.75713176", "0.75122786", "0.7508432", "0.7376564", "0.7300375", "0.7285014", "0.7016026", "0.70135903", "0.6987162", "0.69486344", "0.6901546", "0.688844", "0.68761504", "0.6863176", "0.68565804", "0.68457323", "0.6844116", "0.6838899", "0.6831783", "0.68283314", "0.6805306", "0.68004787", "0.67968404", "0.6753957", "0.67413396", "0.6729569", "0.67228156", "0.6709208", "0.66937584", "0.6683174", "0.6682335", "0.6658024", "0.665725", "0.6647064", "0.66414577", "0.66345185", "0.6626609", "0.6626609", "0.6608597", "0.6591382", "0.6586067", "0.65851164", "0.65825534", "0.65631586", "0.6556359", "0.65388", "0.6520981", "0.65202504", "0.6517199", "0.6516578", "0.6515608", "0.65065956", "0.6495878", "0.6487021", "0.6485669", "0.6484837", "0.648083", "0.64683133", "0.6468243", "0.64629585", "0.64598715", "0.6457786", "0.64515287", "0.6449856", "0.6436238", "0.6421807", "0.6407919", "0.6407471", "0.64069", "0.64063376", "0.64046776", "0.64039654", "0.6402815", "0.6397031", "0.6384626", "0.6382526", "0.6379253", "0.63791996", "0.63743955", "0.6358162", "0.635316", "0.63445044", "0.63246316", "0.6324192", "0.632289", "0.6319726", "0.63192296", "0.63149065", "0.63147527", "0.6307278", "0.63058937", "0.63016415", "0.63016033", "0.6301376", "0.62968296", "0.6283584", "0.6281803" ]
0.0
-1
drawCards makes the cards appear on the page and passes values to the score arrays
function drawCards(data) { getJSON(drawApi + data.deck_id + "/?count=4", function (cardData) { console.log(cardData); console.log(cardData.cards[0]); //creating score arrays // but parses NaN if a face card... playerScore = playerScore.concat(parseInt(cardData.cards[0].value)); playerScore = playerScore.concat(parseInt(cardData.cards[1].value)); houseScore = houseScore.concat(parseInt(cardData.cards[2].value)); houseScore = houseScore.concat(parseInt(cardData.cards[3].value)); //totals the score arrays playerScoreTotal = playerScore.reduce(function(prev, curr){ return prev + curr; }); houseScoreTotal = houseScore.reduce(function(prev, curr){ return prev + curr; }); //Lucas inspired code below for dealing with face values. Doesnt quite work right now. Just makes playerScoreTotal === 20 //if(cardData.cards[0].value === "King" || "Queen" || "Jack") { //playerScoreTotal += 10; //} //if(cardData.cards[1].value === "King" || "Queen" || "Jack") { //playerScoreTotal += 10; //} ////End Lucas inspiration appendPlayerCard(cardData); appendDealerCard(cardData); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function compDraw() {\n compHand.push(getCard());\n compHand.push(getCard());\n compScore = getCompScore();\n while (compScore < 15) {\n compHand.push(getCard());\n compScore = getCompScore();\n }\n updatePage();\n compareScore();\n updatePage();\n}", "function playerCards() {\r\n var playerCard = randomCard();\r\n var cardSRC = dealCard(playerCard.cardimg);\r\n playerarea.appendChild(cardSRC);\r\n updatePlayerScore(playerCard.value, playerCard.secondValue);\r\n\r\n }", "function draw() {\r\n $(\"#name\").text(name + \"'s Card\");\r\n \r\n var myCard = Math.floor(Math.random() * 14) // gives a random number between 0-12 \r\n var computer = Math.floor(Math.random() * 14) // gives a random number between 0-12 \r\n\r\n $(\"#mycardimg\").attr(\"src\", cards[myCard])\r\n $(\"#computercardimg\").attr(\"src\", cards[computer])\r\n\r\n if (myCard > computer) {\r\n // i won this round\r\n //alert(`I won! ${cards[myCard]} ${cards[computer]}`)\r\n myScore++;\r\n }\r\n else if (myCard < computer) {\r\n // computer won this round\r\n //alert(`Computer won! ${cards[myCard]} ${cards[computer]}`)\r\n computerScore++;\r\n }\r\n\r\n $(\"#myscore\").text(myScore)\r\n $(\"#compscore\").text(computerScore)\r\n\r\n}", "drawCards() {\n let g = this,\n cxt = g.context,\n cards = window._main.cards;\n for (let card of cards) {\n card.draw(cxt);\n }\n }", "function updateScorecard() {\r\n\tvar i = strokesDisp.length - 1;\r\n\tif (hole != 10) {\r\n\t\ttotal = total + strokesDisp[i];\r\n\t}\r\n\tsw = total - TOTAL_PAR[i];\r\n\r\n\t// different colors if over or under par\r\n\tif (total > TOTAL_PAR[i]) {\r\n\t\tparScore.addColor('#228B22', 0);\r\n\t\tparScore.fontSize = 20 * HR;\r\n\t\tparScore.setText('+' + sw);\r\n\t} else if (total < TOTAL_PAR[i]) {\r\n\t\tparScore.addColor('#ff0000', 0);\r\n\t\tparScore.fontSize = 20 * HR;\r\n\t\tparScore.setText(sw);\r\n\t} else if (total == TOTAL_PAR[i]) {\r\n\t\tparScore.addColor('#000000', 0);\r\n\t\tparScore.fontSize = 21 * HR;\r\n\t\tparScore.setText('E');\r\n\t}\r\n\tif (strokesDisp.length < 9) {\r\n\t\tparScore.fontSize = 25 * HR;\r\n\t\tparScore.y = scorecard.y - 152 * HR + 48 * HR * i;\r\n\t} else {\r\n\t\tparScore.y = scorecard.y + 310 * HR;\r\n\t}\r\n\r\n\t// score on each hole shown on scorecard\r\n\tif (strokesDisp.length >= 9) {\r\n\t\tscorecolor();\r\n\t\tscore9.setText(strokesDisp[8])\r\n\t\tscore10.setText(total)\r\n\t\tif (total - TOTAL_PAR[i] > 0) {\r\n\t\t\tscore10.addColor('#228B22', 0);\r\n\t\t} else if (total - TOTAL_PAR[i] == 0) {\r\n\t\t\tscore10.addColor('#000000', 0);\r\n\t\t} else if (total - TOTAL_PAR[i] < 0) {\r\n\t\t\tscore10.addColor('#ff0000', 0);\r\n\t\t}\r\n\t} else if (strokesDisp.length >= 8) {\r\n\t\tscorecolor();\r\n\t\tscore8.setText(strokesDisp[7])\r\n\t} else if (strokesDisp.length >= 7) {\r\n\t\tscorecolor();\r\n\t\tscore7.setText(strokesDisp[6])\r\n\t} else if (strokesDisp.length >= 6) {\r\n\t\tscorecolor();\r\n\t\tscore6.setText(strokesDisp[5])\r\n\t} else if (strokesDisp.length >= 5) {\r\n\t\tscorecolor();\r\n\t\tscore5.setText(strokesDisp[4])\r\n\t} else if (strokesDisp.length >= 4) {\r\n\t\tscorecolor();\r\n\t\tscore4.setText(strokesDisp[3])\r\n\t} else if (strokesDisp.length >= 3) {\r\n\t\tscorecolor();\r\n\t\tscore3.setText(strokesDisp[2])\r\n\t} else if (strokesDisp.length >= 2) {\r\n\t\tscorecolor();\r\n\t\tscore2.setText(strokesDisp[1])\r\n\t} else if (strokesDisp.length >= 1) {\r\n\t\tscore1.setText(strokesDisp[0])\r\n\t\tif (strokesDisp[i] - TOTAL_PAR[i] > 0) {\r\n\t\t\tscore1.addColor('#228B22', 0);\r\n\t\t} else if (strokesDisp[i] - TOTAL_PAR[i] == 0) {\r\n\t\t\tscore1.addColor('#000000', 0);\r\n\t\t} else if (strokesDisp[i] - TOTAL_PAR[i] < 0) {\r\n\t\t\tscore1.addColor('#ff0000', 0);\r\n\t\t}\r\n\t}\r\n\r\n\t// sets color of number on scorecard\r\n\tfunction scorecolor() {\r\n\t\tfor (var i = 1; i < allScores.length - 1; i++) {\r\n\t\t\tif (strokesDisp[i] - (TOTAL_PAR[i] - TOTAL_PAR[i - 1]) > 0) {\r\n\t\t\t\tallScores[i].addColor('#228B22', 0);\r\n\t\t\t} else if (strokesDisp[i] - (TOTAL_PAR[i] - TOTAL_PAR[i - 1]) == 0) {\r\n\t\t\t\tallScores[i].addColor('#000000', 0);\r\n\t\t\t} else if (strokesDisp[i] - (TOTAL_PAR[i] - TOTAL_PAR[i - 1]) < 0) {\r\n\t\t\t\tallScores[i].addColor('#ff0000', 0);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "draw () {\n\t\t\n\t\tthis._size_elements ()\n\n\t\tvar i = 0\n\t\tthis._figures.forEach (f => {\n\t\t\t\n\t\t\t// Draw non playable cards\n\t\t\tvar card = this._deck_blue [f]\n\t\t\tvar [x, y] = this.get_slot_coo (i, 2.5)\n\t\t\tif (card.slot >= 0) {\n\t\t\t\t[x, y] = this.get_slot_coo (card.slot, 1)\n\t\t\t}\n\t\t\tcard.set_pos_size (x, y)\n\t\t\tcard.draw ()\n\t\t\t\n\t\t\t// Draw playable cards\n\t\t\tvar card = this._deck_red [f]\n\t\t\tvar [x, y] = this.get_slot_coo (i, -1.5)\n\t\t\tif (card.slot >= 0) {\n\t\t\t\t[x, y] = this.get_slot_coo (card.slot, 0)\n\t\t\t}\n\t\t\tcard.set_pos_size (x, y)\n\t\t\tcard.draw ()\n\n\t\t\t// Draw help text of car is highlighted\n\t\t\tif (card.is_highlighted ()) {\n\t\t\t\tvar key = `help_${f}`\n\t\t\t\tvar font_size = this.context.canvas.width / 50\n\t\t\t\tvar [x, y] = this.get_slot_coo (0, 1.75)\n\t\t\t\tthis._draw_banner (this._language [key], \"rgba(0, 0, 0, 0.6)\", y, font_size)\n\t\t\t}\n\t\t\t\n\t\t\ti += 1\n\t\t})\n\n\t\tthis._draw_scores ()\n\t\t\t\t\n\t\t// Draw winner banner\n\t\tif (this._winner != -1) {\n\t\t\t\n\t\t\tvar [x, y] = this.get_slot_coo (0, 1.75)\n\n\t\t\tif (this._winner == this._swap_color)\n\t\t\t\tthis._draw_banner (this._language.red_wins, \"rgba(200, 0, 0, 0.6)\", y, -1)\n\n\t\t\telse if (this._winner == (1-this._swap_color))\n\t\t\t\tthis._draw_banner (this._language.blue_wins, \"rgba(0, 0, 200, 0.6)\", y, -1)\n\t\t\t\n\t\t\telse if (this._winner == 2)\n\t\t\t\tthis._draw_banner (this._language.drawn, \"rgba(200, 200, 200, 0.6)\", y, -1)\n\t\t}\n\t}", "function scoreCard(){\n showVariables();\n $(\"#score\").html(\"Your total score is : \"+score);\n $(\"#corrAns\").html(\"Number of correct answers : \"+correctAnswers);\n\n }", "calculateCards()\n {\n this.currentScore=0;\n for(let i=0;i<this.cards.length;i++) \n { \n \n if(this.cards[i].cardVisable===true)\n {\n this.getCardValue(this.cards[i].cardText.split('-')[0]);\n }\n }\n \n \n }", "drawCards(){\t\n\t\tlet deck = this.state.playerDeck;\n\t\t\n\t\tif(deck.size() === 0){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// shuffle deck first?\n\t\tlet max = this.state.handSize;\n\t\tif(deck.size() <= 2 && deck.size() >= 1){\n\t\t\tmax = deck.length;\n\t\t}\n\t\t\n\t\t// if player already has some cards, the number of cards drawn can't exceed handSize!\n\t\t// also increment player's number of moves \n\t\tlet cardsDrawn = [...this.state.playerHand]; // making a copy \n\t\tfor(let i = 0; i < max; i++){\n\t\t\tcardsDrawn.push(deck.remove());\n\t\t}\n\t\t\n\t\t// should have console refresh and cards displayed should also update \n\t\tthis.setState((state) => { \n\t\t\tlet copy = [...state.consoleMsgs]; \n\t\t\tcopy.push(\"player drew \" + cardsDrawn.length + \" cards!\");\n\t\t\t\n\t\t\t// subtract 1 because drawing cards itself costs a move \n\t\t\treturn {'consoleMsgs': copy, 'playerHand': cardsDrawn, 'playerMoves': this.state.playerMoves + cardsDrawn.length - 1}; \n\t\t});\n\t}", "function refresh(){\n\t\tpoker._firstCard = firstCard.number; \n\t\tpoker._secondCard = secondCard.number; \n\t\tpoker._thirdCard = thirdCard.number; \n\t\tpoker._fourthCard = fourthCard.number; \n\t\tpoker._fifthCard = fifthCard.number; \n\t\t\n\t\tctx = Canvas[0].getContext(\"2d\");\n\t\tvar canCardWidth = Canvas.width()/5;\n\t\tvar cardImgWidth = cardImg.width/13;\n\t\tvar cardImgHeight = cardImg.height/4;\n\t\t\n\t\t\n\t\tctx.drawImage(cardImg,firstCard.x*cardImgWidth,firstCard.y*cardImgHeight,cardImgWidth,cardImgHeight,0*canCardWidth,0,canCardWidth,Canvas.height());\n\t\tctx.drawImage(cardImg,secondCard.x*cardImgWidth,secondCard.y*cardImgHeight,cardImgWidth,cardImgHeight,1*canCardWidth,0,canCardWidth,Canvas.height());\n\t\tctx.drawImage(cardImg,thirdCard.x*cardImgWidth,thirdCard.y*cardImgHeight,cardImgWidth,cardImgHeight,2*canCardWidth,0,canCardWidth,Canvas.height());\n\t\tctx.drawImage(cardImg,fourthCard.x*cardImgWidth,fourthCard.y*cardImgHeight,cardImgWidth,cardImgHeight,3*canCardWidth,0,canCardWidth,Canvas.height());\n\t\tctx.drawImage(cardImg,fifthCard.x*cardImgWidth,fifthCard.y*cardImgHeight,cardImgWidth,cardImgHeight,4*canCardWidth,0,canCardWidth,Canvas.height());\n\t\tif(draw == 0){\n\t\t\tisWinner();\n\t\t\tpayout();\n\t\t\tflashText(Winner);\n\t\t\t$(\"#commandbutton_2\").on(\"click\",commandButtonHandle).removeClass(\"disabled\");\n\t\t\t$(\"#commandbutton_3\").on(\"click\",commandButtonHandle).removeClass(\"disabled\");\n\t\t\t$(\"#commandbutton_4\").on(\"click\",commandButtonHandle).removeClass(\"disabled\");\n\t\t}\n\t\t\n\t}", "function drawCards(amountOfCards, playerPressed) {\n\n\t\tconst url = `https://deckofcardsapi.com/api/deck/${deckId}/draw/?count=${amountOfCards}`\n\n\t\tlet player1Hand;\n\t\tlet player2Hand;\n\n\t\tfetch(url)\n\t\t\t.then(res => res.json()) // parse response as JSON\n\t\t\t.then(data => {\n\t\t\t\t// console.log(data.cards[0])\n\n\t\t\t\t// display seperate card based on which player pressed it\n\t\t\t\tif (playerPressed == \"player1\") {\n\t\t\t\t\tdocument.querySelector('#card1').src = data.cards[0].image;\n\t\t\t\t\tplayer1Hand = data.cards[0].value;\n\t\t\t\t\tconsole.log(player1Hand);\n\t\t\t\t} else if (playerPressed == \"player2\") {\n\t\t\t\t\tdocument.querySelector('#card2').src = data.cards[0].image;\n\t\t\t\t\tplayer2Hand = data.cards[0].value;\n\t\t\t\t\tconsole.log(player2Hand);\n\t\t\t\t}\n\n\t\t\t\t// win condition\n\t\t\t\tif (player1Hand == \"JACK\") {\n\t\t\t\t\tdocument.querySelector(\"#win-container\").innerHTML = \"PLAYER 1 WINS\";\n\t\t\t\t} else if(player2Hand == \"JACK\") {\n\t\t\t\t\tdocument.querySelector(\"#win-container\").innerHTML = \"PLAYER 2 WINS\";\n\t\t\t\t}\n\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tconsole.log(`error ${err}`)\n\t\t\t});\n\n\t}", "function start(){\r\n\tdocument.getElementById(\"btnDraw\").style.display = \"inline-block\";\r\n\tdocument.getElementById(\"btnHold\").style.display = \"inline-block\";\r\n\t\r\n\t//dealer gets 2 cards\r\n\tvar dealer = document.getElementById(\"dealerScore\");\r\n\r\n\tvar dealerArr = [drawRandomCard(deck), drawRandomCard(deck)];\r\n\tconsole.log(dealerArr);\r\n\r\n\tdealerScore = dealerArr[0] + dealerArr[1]; //the sum of two cards\r\n\tconsole.log(dealerScore);\r\n\r\n\tdealer.innerHTML = dealerScore;\t\r\n\r\n\tdocument.getElementById(\"dealer1\").src = deckImg[dealerArr[0] -1 ];\r\n\tdocument.getElementById(\"dealer2\").src = deckImg[dealerArr[1] -1 ];\r\n\r\n\t//player gets 2 cards\r\n\tvar player = document.getElementById('playerScore');\r\n\tvar playerArr = [drawRandomCard(deck), drawRandomCard(deck)];\r\n\tconsole.log(playerArr);\r\n\r\n\tplayerScore = playerArr[0] + playerArr[1];//the sum of two cards\r\n\tconsole.log(playerScore);\r\n\r\n\tplayer.innerHTML = playerScore;\r\n\r\n\tdocument.getElementById(\"player1\").src = deckImg[playerArr[0] -1];\r\n\tdocument.getElementById(\"player2\").src = deckImg[playerArr[1] -1];\r\n\r\n\tdocument.getElementById(\"reload\").style.display = \"none\";\r\n\r\n\tif(dealerScore > 21)\r\n\t{\r\n\t\tdocument.getElementById(\"playerLabel\").innerHTML = \"Player has won this Hand!\";\r\n\t\tdocument.getElementById(\"playerLabel\").style.backgroundColor = \"green\";\r\n\t\tdocument.getElementById(\"btnDraw\").style.display = \"none\";\r\n\t\tdocument.getElementById(\"btnHold\").style.display = \"none\";\r\n\t}\r\n\r\n\tif(playerScore > 21)\r\n\t{\r\n\t\tdocument.getElementById(\"dealerLabel\").innerHTML = \"Dealer has won this Hand!\";\r\n\t\tdocument.getElementById(\"dealerLabel\").style.backgroundColor = \"green\";\r\n\t\tdocument.getElementById(\"btnDraw\").style.display = \"none\";\r\n\t\tdocument.getElementById(\"btnHold\").style.display = \"none\";\r\n\t}\r\n}", "function drawCard() {\n var card = draw.pop();\n if (card) {\n discard.push(card);\n showCard(card);\n } else {\n shuffleCards();\n drawCard();\n }\n }", "function playerDraw() {\n updatePage();\n if (confirm('Do you want to draw a card?'+ playerScore)){\n playerHand.push(getCard());\n playerScore = getPlayerScore();\n updatePage();\n console.log(playerHand);\n updatePage();\n console.log(playerScore);\n playerDraw();\n }\n}", "addCardsByScore() { \n const score = this.getTotal();\n if (score.strong/score.total >= 0.7) {\n this.addNewCards(score.total);\n }\n }", "_draw_scores () {\n\n\t\tvar cw = this._deck_blue ['musician'].w\n\t\tvar ch = this._deck_blue ['musician'].h\n\t\tvar colors = [\"rgba(200, 0, 0, 0.6)\", \"rgba(0, 0, 200, 0.6)\"]\n\n\t\tvar font_height = ch/3\n\t\tcanvas.style.font = this.context.font;\n\t\tcanvas.style.fontSize = `${font_height}px`;\n\t\tthis.context.font = canvas.style.font;\n\t\tthis.context.textAlign = \"center\";\n\t\tthis.context.textBaseline = \"middle\"; \n\n\t\tfor (let i = 0; i < this._scores.length; i +=1) {\n\n\t\t\tvar [x0, y0] = this.get_slot_coo (i, 0)\n\t\t\tvar [x1, y1] = this.get_slot_coo (i, 1)\n\t\t\tif (this._scores [i] > 0) {\n\t\t\t\t\n\t\t\t\tthis.context.fillStyle = colors [this._swap_color]\n\t\t\t\tthis.context.fillRect (x0 - cw/2, y0-cw/4, cw, cw/2);\n\t\t\t\tthis.context.fillStyle = \"white\";\n\t\t\t\tthis.context.fillText (`+${this._scores [i]}`, x0, y0); \t\n\n\t\t\t\tthis.context.fillStyle = \"rgba(0, 0, 0, 0.4)\"\n\t\t\t\tthis.context.fillRect (x1 - cw/2, y1-ch/2, cw, ch);\n\t\t\t}\n\t\t\tif (this._scores [i] < 0) {\n\t\t\t\t\n\t\t\t\tthis.context.fillStyle = colors [1 - this._swap_color]\n\t\t\t\tthis.context.fillRect (x1 - cw/2, y1-cw/4, cw, cw/2);\n\t\t\t\tthis.context.fillStyle = \"white\";\n\t\t\t\tthis.context.fillText (`+${-this._scores [i]}`, x1, y1); \t\n\n\t\t\t\tthis.context.fillStyle = \"rgba(0, 0, 0, 0.4)\"\n\t\t\t\tthis.context.fillRect (x0 - cw/2, y0-ch/2, cw, ch);\n\t\t\t}\n\t\t}\n\t}", "function drawScoreBoard(){\r\n context.font = \"Bold 25px Courier New\";\r\n context.fillStyle = \"#000000\";\r\n scoreBoard = cars.slice();\r\n scoreBoard.sort(function(a, b){\r\n return b.score - a.score;\r\n });\r\n for (var i = 0; i < 5; i++) {\r\n if (i > scoreBoard.length -1 ){break;}\r\n if (scoreBoard[i] == null){break;}\r\n var j = i+1\r\n context.fillText(j + \":\" + scoreBoard[i].name+ \": \"+scoreBoard[i].score, 0, 25 + (i*25));\r\n }\r\n}", "function draw() {\n CANVAS_CTX.clearRect(0, 0, BOARDER_WIDTH, BOARDER_HEIGHT);\n drawBoard();\n drawPoints();\n drawPacman();\n drawGhosts();\n drawApple();\n drawTimeBonus();\n\n $('#lblScore').val(score.toString());\n}", "function _scorecards() {\n data.scorecards = [];\n data.partnersToMakers.forEach(maker => {\n data.partnersToTakers.forEach(taker => {\n data.scorecards.push(new Scorecard(\"scorecard\" + data.scorecards.length, maker, taker, data.fieldsToTags));\n });\n });\n }", "function draw() {\r\n \r\n /* Get a random card and display in card-container */\r\n getNextCard();\r\n\r\n /* Update playerlist with current playerInTurn */ \r\n refreshPlayerList();\r\n\r\n /* Update message text with current playerInTurn */ \r\n refreshMessageText();\r\n\r\n /* Advance to next player */\r\n advancePlayerInTurn();\r\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 drawCards(amountOfCards,sort) {\r\n if (amountOfCards <= deckOfCards.length) {\r\n for (var i = 0; i < amountOfCards; i++) {\r\n hand.push(deckOfCards.shift());\r\n }\r\n if (sort) {\r\n sortCards(hand);\r\n }\r\n }\r\n}", "function drawCard(data) {\n document.getElementById('calledUNO').style.display = 'none';\n document.getElementById('unoButton').style.display = 'block';\n\n //reorganize own cards\n ownCards = $('#ownCards');\n ownCards.html(\"\");\n document.getElementById('minEmptyIndex').value = 0;\n var cards = data['own_cards'];\n if (cards.length > 10) {\n $('#cardDistance').val(\"45\");\n }\n for (var i = 0; i < cards.length; i++) {\n var isNew = false;\n for (var j = 0; j < data['added_cards'].length; j++) {\n if (data['added_cards'][j].id == cards[i].id) {\n isNew = true;\n }\n }\n if (isNew) {\n // console.log(\"new card:\" + cards[i].color + \"_\" + cards[i].card_type);\n getOneCard(cards[i], \"bounce\");\n } else {\n getOneCard(cards[i], \"\");\n }\n }\n\n}", "function drawcards(cards, suits) {\n var lines = [\"\", \"\", \"\", \"\", \"\"];\n var value = [];\n if (cards.length == 1) { //if only one card is passed we draw the first card face down\n lines = [\".---.\", \"|///|\", \"|///|\", \"|///|\", \"'---'\"];\n }\n //topline\n for (i = 0; i < cards.length; i++) {\n lines[0] += \".---.\";\n }\n lines[0] += \"</br>\";\n\n //2nd line (contains value)\n for (i = 0; i < cards.length; i++) {\n lines[1] += \"|\" + cardvalue(cards[i]);\n if (cardvalue(cards[i]) == 10) {\n lines[1] += \" |\";\n } else {\n lines[1] += \"&nbsp; |\";\n }\n }\n lines[1] += \"</br>\";\n\n //3rd line (contains suit)\n for (i = 0; i < cards.length; i++) {\n\n lines[2] += \"| \" + suits[i] + \" |\";\n }\n lines[2] += \"</br>\";\n\n //4th line (contains value)\n for (i = 0; i < cards.length; i++) {\n if (cardvalue(cards[i]) == 10) {\n lines[3] += \"| \" + cardvalue(cards[i]) + \"|\";\n } else {\n lines[3] += \"| &nbsp;\" + cardvalue(cards[i]) + \"|\";\n }\n\n }\n lines[3] += \"</br>\";\n\n //bottom line\n for (i = 0; i < cards.length; i++) {\n lines[4] += \"'---'\";\n }\n lines[4] += \"</br>\";\n return lines[0] + lines[1] + lines[2] + lines[3] + lines[4];\n}", "function shuffleCards() {\n\n\tpairCards = 0;\n\tscore = 50;\n\tcounter = 0;\n\tpreviousCard = null;\n\tcurrentCard = null;\n\tinterval = null;\n\n\t//Shuffle array of cards\n\tcards.sort(function() { return Math.random() - 0.5;});\n\n\t//Get back div of cards\n\tvar elements = $(\".card\");\n\n\t//Assignment initial values and events\n\tfor (var i = 0; i < elements.length; i++) {\n\n\t\telements[i].style.transition = \"none\";\n\t\telements[i].style.backgroundImage = reverse;\n\t\telements[i].addEventListener(\"click\", clickCard, true);\n\t\telements[i].style.visibility = \"visible\";\n\t\t//console.log(\"Event asociated to \" + elements[i].id);\n\t}\n\n\t//Enable delay's trainsition effect to avoid show the cards\n\tsetTimeout(enableTransition, 500);\n\n\t//Show the initial score\n\tshowScore();\n\tdocument.getElementById(\"clock\").innerHTML = \"00:0\";\n}", "function drawBoard(cards) {\n\tctx.save();\n\n\t// Drawing the bakground:\n\n\theight = canvas.height;\n\t// Assume we are not as tall as we are wide\n\twidth = canvas.width;\n\n\tctx.fillStyle = BACKGROUNDCOLOR;\n\tdrawRoundRect(ctx, 0, 0, width, height, 5, true, false);\n\n\n\n\t// Drawing the cards\n\twidth = (height / DESIRED_ASPECT_RATIO);\n\n\tlet numCards = cards.length;\n\tlet rows = 3;\n\tlet columns = numCards / rows;\n\n\t// adjust display width if more than the expected number of columns.\n\twidth = (width * columns / 4.0);\n\n\t// calculate board offset, to keep centered.\n\t// Must be done after expanding for more cards\n\tboardOffset = (canvas.width - width) / 2;\n\n\t// must be done after expanding for more cards.\n\tlet cardWidth = (width / columns);\n\tlet cardHeight = (height / rows);\n\n\tctx.translate(boardOffset, 0);\n\n\tlet i, j;\n\tfor (i = 0; i < columns; i++) {\n\t\tfor (j = 0; j < rows; j++) {\n\t\t\tctx.save();\n\t\t\tctx.translate(i * cardWidth, j * cardHeight);\n\t\t\tdrawCard(\n\t\t\t\tctx,\n\t\t\t\tcards[i * rows + j],\n\t\t\t\ti * rows + j,\n\t\t\t\tcardWidth,\n\t\t\t\tcardHeight,\n\t\t\t\tselectedCards\n\t\t\t);\n\t\t\tctx.restore()\n\t\t}\n\t}\n\tctx.restore()\n}", "function renderGame(){\nplCardEl.textContent = \"Your Cards: \" \nfor(let i = 0; i < plcards.length; i++) {\n plCardEl.textContent += plcards[i] + \" \"\n}\nplSumEl.textContent = \"Your Sum: \" + plcardSum\n\n\ndealerCardEl.textContent = \"Dealer Cards: \" \nfor(let i = 0; i < dlcards.length; i++) {\n dealerCardEl.textContent += dlcards[i] + \" \"\n}\ndealerSumEl.textContent = \"Dealer Sum: \" + dealercardSum\n\nif (plcardSum <= 20){\n headerEl.textContent = \"Draw a new card\"\n \n}\nelse if (plcardSum === 21){\n headerEl.textContent = \"You've got Blackjack.\"\n hasBlackJack = true\n}\nelse {\nheaderEl.textContent = \"Bust, sucks for you.\"\nisAlive = false\n}\n}", "function drawBoard() {\n w = Math.round(boardDiv.width());\n h = Math.round(boardDiv.height());\n ctx.clearRect(0,0,w,h);\n\n const margin = 10;\n const thickness = 2;\n const shapeH = 100;\n const shapeW = 2*shapeH;\n\n let cw = Math.round(card.w);\n let ch = Math.round(card.h());\n let pad = Math.round(card.pad());\n\n let posX = card.posX(0);\n let posY = card.posY(0);\n\n $(\".card\").remove();\n\n for (let row=0; row<board.h; row++) {\n for (let col=0; col<board.w; col++) {\n let x = Math.round(posX[col]);\n let y = Math.round(posY[row]);\n let i = card.rowcol2i(row,col);\n\n if (i >= board.inPlayMain.length) {\n break;\n }\n drawCard(ctx, x,y, x+cw, y+ch, card.thickness, board.inPlayMain[i]);\n\n $(\"#div_game\").append($(buildDiv(x,y,cw,ch,i,false)));\n }\n }\n\n let f = Math.round(card.posExtra(0,0));\n let l = undefined, x = undefined, y = undefined;\n if (board.w == 4) {\n l = posY;\n } else {\n l = posX\n }\n for (let k=0; k<board.inPlayExtra.length; k++) {\n if (board.w == 4) {\n x = f;\n y = Math.round(l[k]);\n } else {\n x = Math.round(l[k]);\n y = f;\n }\n drawCard(ctx, x, y, x+cw, y+ch, card.thickness, board.inPlayExtra[k]);\n\n $(\"#div_game\").append($(buildDiv(x,y,cw,ch,k,true)));\n }\n\n if (isSetAvailable()) {\n log(\"A set is available / \" + board.deck.length + \" cards unseen\");\n } else {\n log(\"A set is not available / your score: \" + String((81-(board.deck.length+board.inPlayExtra.length+board.inPlayMain.length))/3));\n }\n}", "function scorecard() {\n document.getElementById('wins').innerHTML = wins;\n document.getElementById('losses').innerHTML = losses;\n document.getElementById('guessesLeft').innerHTML = (\" \" + guessesLeft);\n document.getElementById('guessLog').innerHTML = (\" \" + guessedLetters);\n }", "function drawCard()\n{\n\tif (alreadyDrawn.length == cards.cards.length) {\n\t\talreadyDrawn = [];\n\t}\n\tvar random = Math.floor(Math.random() * cards.cards.length);\n\twhile (alreadyDrawn.includes(random)) {\n\t\trandom = Math.floor(Math.random() * cards.cards.length);\n\t}\n\trenderCard(cards.cards[random]);\n\talreadyDrawn.push(random);\n}", "function correct() {\n if (iScore == 0){\n cScore = cScore +1\n cScoreDisplay.innerText = cScore\n }else{\n cScore = cScore +1\n iScore = iScore -1\n cScoreDisplay.innerText = cScore\n iScoreDisplay.innerText = iScore\n } \n if (cards.length||0) {\n cpile.push(display)[0]\n display.splice(0,1)\n display.push((cards)[0])\n cards.splice(0,1)\n aDisplay.textContent = display[0].A\n qDisplay.textContent = display[0].Q\n }else {\n display.splice(0,1)\n aDisplay.textContent = \"COMPLETE!\"\n qDisplay.textContent = \"COMPLETE!\"\n document.querySelector('#cor').disabled = true\n }\n}", "function startGame() {\n let list = [...Array(imageList.length).keys()];\n list = list.concat(list);\n shuffleList(list);\n\n // first half\n for (let i = 0; i < list.length / 2; i++) {\n let card = createCard(list[i]);\n cardList.appendChild(card);\n }\n\n // add score keeper\n let score = document.createElement('div');\n score.setAttribute('id', 'score');\n score.value = 0;\n score.innerHTML = `${score.value}`;\n cardList.appendChild(score);\n\n // second half\n for (let i = list.length / 2; i < list.length; i++) {\n let card = createCard(list[i]);\n cardList.appendChild(card);\n }\n}", "function flashCardRunner(flashCards)\n {\n canvas.clear()\n var flashCards = $(\".blue\").map(function()\n {\n return $(this).attr('id');\n }).get();\n var totalFlashCards = flashCards.length;\n var thisCardNumber = 0;\n var theCard;\n for (var i = 0; i <= flashCards.length; i++)\n {\n theCard = flashCards[i];\n renderImage(theCard, totalFlashCards, thisCardNumber);\n thisCardNumber += 1;\n }\n }", "function assignCards() {\n playerCards.push(playingDeck[0]);\n playerScore += getCardNumericValue(playingDeck[0]);\n document.getElementById('player-score').innerText = \"Player Score: \" + playerScore\n playerCardAdder(playingDeck[0].value, playingDeck[0].suit);\n playingDeck.shift(0);\n\n dealerCards.push(playingDeck[0]);\n dealerScore += getCardNumericValue(playingDeck[0]);\n document.getElementById('dealer-score').innerText = \"Dealer Score: \" + dealerScore + \"+\"\n dealerCardAdder(playingDeck[0].value, playingDeck[0].suit);\n playingDeck.shift(0);\n\n playerCards.push(playingDeck[0]);\n playerScore += getCardNumericValue(playingDeck[0]);\n document.getElementById('player-score').innerText = \"Player Score: \" + playerScore\n playerCardAdder(playingDeck[0].value, playingDeck[0].suit);\n playingDeck.shift(0);\n\n dealerCards.push(playingDeck[0]);\n dealerScore += getCardNumericValue(playingDeck[0]);\n dealerCardAdder(playingDeck[0].value, playingDeck[0].suit);\n playingDeck.shift(0);\n\n return playingDeck;\n}", "render() {\n this.shuffleCards();\n return (\n <div className=\"App\" >\n <Scoreboard\n score={this.state.score}\n topscore={this.state.topScore}\n message={this.state.message}\n />\n <div className=\"cardCanvas\">\n {this.state.cards.map(card => (\n <Card\n key={card.id}\n id={card.id}\n imageurl={card.imageurl}\n clickHandler={this.cardClickHandler}\n />\n ))}\n </div>\n </div>\n );\n }", "function drawCards () {\r\n for ( let i = 0; i < cards.length; i++ ) {\r\n let element = document.createElement(\"div\");//Create a new div element\r\n \r\n element.className = \"card\";//Add the text node to the newly created div\r\n element.innerHTML = \"\";//Turn down all cards\r\n element.index = i;//Store cards number as \"index\"\r\n element.onclick = click;//Call the following click() function once a user clicks a card\r\n \r\n $field.appendChild( element );\r\n }\r\n}", "function drawCard(ctx, card, index, cardWidth, cardHeight, selectedCards) {\n\t// IF NO CARDS PRESENT\n\tif (card == null) {\n\t\tctx.fillStyle = '#000';\n\t} else {\n\t\tctx.fillStyle = CARD_BACKGROUNDCOLOR;\n\t}\n\n\tdrawRoundRect(\n\t\tctx,\n\t\tCARD_PADDING_X,\n\t\tCARD_PADDING_Y,\n\t\t(cardWidth) - CARD_PADDING_X * 2,\n\t\tcardHeight - CARD_PADDING_Y * 2,\n\t\tCARD_PADDING_X, // radius\n\t\ttrue,\n\t\tfalse\n\t);\n\n\tif (card == null) {\n\t\treturn;\n\t}\n\n\n\t// All of these should be values from 0-2\n\tcolorIndex = Math.log2(card.array[0]);\n\tpaintIndex = Math.log2(card.array[1]);\n\tshapeIndex = Math.log2(card.array[2]);\n\tnumber = Math.log2(card.array[3]);\n\n\t// split the card into 5, vertically.\n\tshapeHeight = cardHeight / 5;\n\n\t// draw 1-3 shapes, depending on number\n\tnumber += 1; // now it's 1-3\n\n\t//get total height of area covered by shapes\n\ttotalArea = shapeHeight * number;\n\t//center that total area\n\tstartDrawingFrom = cardHeight / 2 - totalArea / 2;\n\n\tlet i;\n\tfor (i = 0; i < number; i++) {\n\t\tdrawShape(\n\t\t\tctx,\n\n\t\t\tSHAPE_PADDING_X,\n\t\t\tstartDrawingFrom + shapeHeight * i + SHAPE_PADDING_Y,\n\t\t\t(cardWidth) - SHAPE_PADDING_X * 2,\n\t\t\tshapeHeight - SHAPE_PADDING_Y * 2,\n\n\t\t\tshapeIndex,\n\t\t\tcolorIndex,\n\t\t\tpaintIndex\n\t\t);\n\t}\n\n\n\t// Draw the outline in the correct color:\n\t// Black if normal, yellow if selected, grey if hinted.\n\n\tif (selectedCards.includes(index)) {\n\t\tctx.strokeStyle = '#EE0';\n\t} else {\n\t\tctx.strokeStyle = '#000';\n\t}\n\n\t// DRAW BORDER\n\tdrawRoundRect(\n\t\tctx,\n\t\tCARD_PADDING_X,\n\t\tCARD_PADDING_Y,\n\t\t(cardWidth) - CARD_PADDING_X * 2,\n\t\tcardHeight - CARD_PADDING_Y * 2,\n\t\tCARD_PADDING_X, // radius\n\t\tfalse,\n\t\ttrue\n\t);\n}", "function guessCards(c) {\n console.log(\"locking cards\");\n guessedCards.push(selectedCards[0]);\n guessedCards.push(selectedCards[1]);\n console.log(guessedCards);\n selectedCards[0].classList.add(\"match\",\"animated\",\"flash\");\n selectedCards[1].classList.add(\"match\",\"animated\",\"flash\");\n selectedCards[0].classList.remove(\"hide\");\n selectedCards[1].classList.remove(\"hide\");\n clearAllArrays();\n /* + if all cards have matched, display a message with the final score (put this functionality in another function that you call from this one)*/\n // if (guessedCards.length === deckOfCards.length)\n if (guessedCards.length === deckOfCards.length) {\n stopCounting();\n winmessage();\n } else {\n console.log(\"one less to go!\");\n }\n}", "function draw(){\n\t\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\t\tvar keys = Object.keys(players);\n\n\t\tfor(var i = 0; i < keys.length; i++){\n\t\t\tvar drawCall = players[ keys[i] ];\n\t\t\tif(drawCall.hit > 0){\n\t\t\t\tctx.fillStyle = \"rgb(\" + (255 - drawCall.color.r) + \", \" + (255 -drawCall.color.g) + \", \" + (255 -drawCall.color.b) + \")\";\n\t\t\t}\t\n\t\t\telse{\t\t\n\t\t\t\tctx.fillStyle = \"rgb(\" + drawCall.color.r + \", \" + drawCall.color.g + \", \" + drawCall.color.b + \")\";\n\t\t\t}\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(drawCall.pos.x, drawCall.pos.y, drawCall.radius, 0, Math.PI * 2, false);\n\t\t\tctx.fill();\n\t\t\tctx.stroke();\n\t\t\tctx.closePath();\n\t\t\tif(drawCall.name == user.name){\n\t\t\t\tcurrentScore = drawCall.score;\n\t\t\t\tif(highScore < currentScore){\n\t\t\t\t\thighScore = currentScore;\n\t\t\t\t}\n\t\t\t\tdocument.querySelector('#highScore').innerHTML = 'High Score: ' + highScore;\n\t\t\t\tdocument.querySelector('#currentScore').innerHTML = 'Current Score: ' + currentScore;\n\t\t\t\tdocument.querySelector('#score').value = highScore;\n\t\t\t}\n\t\t}\n\n\t\tfor(var i = 0; i<arrayBullets.length; i++){\n\t\t\tctx.fillStyle = 'black';\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(arrayBullets[i].pos.x, arrayBullets[i].pos.y, arrayBullets[i].radius, 0, Math.PI*2, false);\n\t\t\tctx.fill();\n\t\t\tctx.closePath();\n\t\t}\n\t}", "function displayCards() {\n\n // Resize the container of the cards\n switch (parseInt(pairs)) {\n case 2:\n // For 2 pairs only (4 cards)\n var boxWidth = 250;\n break;\n\n case 3, 4:\n // For 3 pairs (6 cards) and 4 pairs (8 cards)\n var boxWidth = 370;\n break;\n\n default:\n // For 5 pairs or more\n var boxWidth = 490;\n break;\n }\n\n //console.log(\"Pairs: \" + pairs + \" Width: \" + boxWidth);\n\n // Set the with of the cards grid\n $(\"#gifBox\").css(\"width\", boxWidth);\n\n // Remove all the existing cards\n $(\"#gifs\").html(\"\");\n\n // For each GIF append an element to the DOM\n for (var c in cardsArray) {\n\n // Create a CARD div\n var cardDiv = $(\"<div>\").addClass(\"card m-2\");\n\n // Append the character image to the front of the card, but HIDE this image - this to mimic the fact of the card being \"facing donw\"\n var cardImg = $(\"<img>\").attr(\"src\", cardsArray[c]).attr(\"id\", \"frnt\" + c).css(\"display\", \"none\").addClass(\"staticgif card-img-top\").appendTo(cardDiv);\n\n // Append the image of the back if the card - this to mimic the fact of the card being \"facing donw\"\n var cardback = $(\"<img>\").attr(\"src\", \"./assets/images/card_back.png\").attr(\"id\", \"back\" + c).attr(\"data-url\", cardsArray[c]).addClass(\"staticgif card-img-top\").appendTo(cardDiv);\n\n // Append each card\n $(\"#gifs\").append(cardDiv);\n };\n\n // Start the countdown clock for the TIMED and CHALLENGE modes \n if (mode === 'timed' || mode === 'challenge') {\n console.log(\"calling the clock with \" + time + \" seconds\");\n timerRun(time);\n\n $(\"#box-clock\").show();\n\n } else {\n\n };\n\n\n\n\n }", "function displayCards() {\n\t\t// Resize the container of the cards\n\t\tswitch (parseInt(pairs)) {\n\t\t\tcase 2:\n\t\t\t\t// For 2 pairs only (4 cards)\n\t\t\t\tvar boxWidth = 250;\n\t\t\t\tbreak;\n\n\t\t\tcase (3, 4):\n\t\t\t\t// For 3 pairs (6 cards) and 4 pairs (8 cards)\n\t\t\t\tvar boxWidth = 370;\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// For 5 pairs or more\n\t\t\t\tvar boxWidth = 490;\n\t\t\t\tbreak;\n\t\t}\n\n\t\t//console.log(\"Pairs: \" + pairs + \" Width: \" + boxWidth);\n\n\t\t// Set the with of the cards grid\n\t\t$(\"#gifBox\").css(\"max-width\", boxWidth);\n\n\t\t// Remove all the existing cards\n\t\t$(\"#gifs\").html(\"\");\n\n\t\t// For each GIF append an element to the DOM\n\t\tfor (var c in cardsArray) {\n\t\t\t// Create a CARD div\n\t\t\tvar cardDiv = $(\"<div>\").addClass(\"card m-2\");\n\n\t\t\t// Append the character image to the front of the card, but HIDE this image - this to mimic the fact of the card being \"facing donw\"\n\t\t\tvar cardImg = $(\"<img>\")\n\t\t\t\t.attr(\"src\", cardsArray[c])\n\t\t\t\t.attr(\"id\", \"frnt\" + c)\n\t\t\t\t.css(\"display\", \"none\")\n\t\t\t\t.addClass(\"staticgif card-img-top\")\n\t\t\t\t.appendTo(cardDiv);\n\n\t\t\t// Append the image of the back if the card - this to mimic the fact of the card being \"facing donw\"\n\t\t\tvar cardback = $(\"<img>\")\n\t\t\t\t.attr(\"src\", \"./assets/images/card_back.png\")\n\t\t\t\t.attr(\"id\", \"back\" + c)\n\t\t\t\t.attr(\"data-url\", cardsArray[c])\n\t\t\t\t.addClass(\"staticgif card-img-top\")\n\t\t\t\t.appendTo(cardDiv);\n\n\t\t\t// Append each card\n\t\t\t$(\"#gifs\").append(cardDiv);\n\t\t}\n\n\t\t// Start the countdown clock for the TIMED and CHALLENGE modes\n\t\tif (mode === \"timed\" || mode === \"challenge\") {\n\t\t\t// console.log(\"calling the clock with \" + time + \" seconds\");\n\n\t\t\ttimerRun(time);\n\n\t\t\t$(\"#box-clock\").show();\n\t\t} else {\n\t\t}\n\t}", "calculateScore() {\n\n let totalScore = 0; \n\n for (let i = 0; i < 5; i++) {\n this.chooseCard(card); \n }\n\n }", "function drawCard(card) {\n\tlet cardHolder = document.createElement('div');\n\tcardHolder.classList.add('card');\n\n\tlet backCard = document.createElement('div');\n\tbackCard.classList.add('backCard');\n\tcardHolder.appendChild(backCard);\n\t// There are no images for all cards (no imageUrl)\n\tlet image = document.createElement(\"img\");\n\tbackCard.appendChild(image);\n\tif (card.imageUrl == undefined) {\n\t\timage.setAttribute(\"src\", \"assets/arena.jpg\");\n\t} else {\n\t\timage.setAttribute(\"src\", card.imageUrl);\n\t};\n\n\tlet frontCard = document.createElement('div');\n\tfrontCard.classList.add('frontCard');\n\tcardHolder.appendChild(frontCard);\n\n\tlet nameC = document.createElement('h3');\n\tnameC.innerText = card.name;\n\tnameC.classList.add('h3-title');\n\tfrontCard.appendChild(nameC);\n\n\tlet artist = document.createElement('p');\n\tartist.innerHTML = `<p>Artist: ${card.artist}</p>`;\n\tartist.classList.add('artist');\n\tfrontCard.appendChild(artist);\n\n\tlet types = document.createElement('p');\n\ttypes.innerText = (card.types) ? card.types.join(', ') : null;\n\tfrontCard.appendChild(types);\n\n\tlet set = document.createElement('p');\n\tset.innerText = card.setName;\n\tfrontCard.appendChild(set);\n\n\tlet colors = document.createElement('p');\n\tcolors.innerText = (card.colors) ? card.colors.join(', ') : null;\n\tfrontCard.appendChild(colors);\n\n\treturn cardHolder;\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 calculateScore() {\n\t\t//console.log(\"Deck constructor called\");\n\t\tvar score = 0;\n\t\t//var noOfAces = 0;\n\t\tvar haveAce = false;\n\t\tconsole.log(\"total cards with hand\" + cards.length);\n\t\tfor (var i =0; i < cards.length; i++) {\n\t\t // if(card.faceValue == faceValue.ace)\n\t\t /*if(card.faceValue == faceValue.ace){\n\t\t noOfAces = noOfAces + 1;\n\t\t\t }*/\n\t\t\t// console.log(\"facevalue: \" + cards[i].suitType + cards[i].faceValue);\n\t\t\t \n\t\t\t// console.log(\"faceValue.ace :\" + faceValue.ace);\n\t\t\t var cardScore = faceValue[cards[i].faceValue];\n\t\t\t if(cardScore == faceValue.ace){\n\t\t\t haveAce = true;\n\t\t\t }\n\t\t\t score += cardScore;\n\t\t}\n\t\t\n\t\tif((score + 10 <= 21) && haveAce){\n\t\t score =score+ 10;\n\t\t}\n\t\t\n\t\tconsole.log(\"current score of \" + name + \" is \" + score);\n\t\t//return score;\n\t\tcurrentScore = score;\n\t}", "function blackjackHit(){\n let card = randomCard();\n showCard(card,YOU);\n //showCard(DEALER);\n //getting score of card\n updateScore(card,YOU) \n showScore(YOU);\n\n // console.log(YOU['score'])\n\n\n}", "function draw() {\n // draws background rooms and handles movement from one to another\n adventureManager.draw();\n\n // Only draw scorecard on certain screens\n if( adventureManager.getStateName() === \"Splash\" ||\n adventureManager.getStateName() === \"Instructions\" ||\n adventureManager.getStateName() === \"Characters\" ||\n adventureManager.getStateName() === \"Four\" ||\n adventureManager.getStateName() === \"Five\" ||\n adventureManager.getStateName() === \"Eight\" ||\n adventureManager.getStateName() === \"Eleven\") {\n ;\n }\n else {\n stressCard.draw();\n }\n\n // draw the p5.clickables in front\n clickablesManager.draw();\n}", "function setUpDraw(deckId) {\n $.getJSON(`https://deckofcardsapi.com/api/deck/${deckId}/draw/?count=4`, function(data) {\n console.log('data: ', data)\n // put first two cards in player array\n let hand1 = data.cards.slice(0, 2)\n let hand2 = data.cards.slice(2, 4)\n setUpHand(cardsPlayer1, hand1, 'p1')\n setUpHand(cardsPlayer2, hand2, 'p2')\n })\n $(\"#p1-draw\").click(function() {\n //draw player one\n player1Draw(deckId)\n })\n $(\"#p2-draw\").click(function() {\n player2Draw(deckId)\n })\n\n}", "function makeBonusCards(cards){\r\n\r\n\tvar bonus1 = new BonusCard(\"bonusCard1\", \"\", 4, [[\"Earth\",\"Fire\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Fire\"]], g_images.bonusCard1); \r\n\tvar bonus2 = new BonusCard(\"bonusCard2\", \"\", 4, [[\"Water\",\"Air\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Water\",\"Air\"]], g_images.bonusCard2); \r\n\tvar bonus3 = new BonusCard(\"bonusCard3\", \"\", 4, [[\"Fire\",\"Air\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Fire\",\"Air\"]], g_images.bonusCard3); \r\n\tvar bonus4 = new BonusCard(\"bonusCard4\", \"\", 5, [[\"Air\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Air\",\"Nlights\"]], g_images.bonusCard4); \r\n\tvar bonus5 = new BonusCard(\"bonusCard5\", \"\", 5, [[\"Earth\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Nlights\"]], g_images.bonusCard5); \r\n\r\n\tvar bonus6 = new BonusCard(\"bonusCard6\", \"\", 3, [[\"Air\",\"Air\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Air\",\"Air\"]], g_images.bonusCard6); \r\n\tvar bonus7 = new BonusCard(\"bonusCard7\", \"\", 3, [[\"Water\",\"Water\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Water\",\"Water\"]], g_images.bonusCard7); \r\n\tvar bonus8 = new BonusCard(\"bonusCard8\", \"\", 3, [[\"Fire\",\"Fire\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Fire\",\"Fire\"]], g_images.bonusCard8); \r\n\tvar bonus9 = new BonusCard(\"bonusCard9\", \"\", 4, [[\"Earth\",\"Air\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Air\"]], g_images.bonusCard9); \r\n\tvar bonus10 = new BonusCard(\"bonusCard10\", \"\", 5, [[\"Water\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Water\",\"Nlights\"]], g_images.bonusCard10); \r\n\t\r\n\tvar bonus11 = new BonusCard(\"bonusCard11\", \"\", 4, [[\"Earth\",\"Water\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Water\"]], g_images.bonusCard11); \r\n\tvar bonus12 = new BonusCard(\"bonusCard12\", \"\", 6, [[\"Nlights\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t[\"Nlights\",\"Nlights\"]], g_images.bonusCard12); \r\n\tvar bonus13 = new BonusCard(\"bonusCard13\", \"\", 5, [[\"Water\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Nlights\",\"Water\"]], g_images.bonusCard13); \r\n\tvar bonus14 = new BonusCard(\"bonusCard14\", \"\", 5, [[\"Fire\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Fire\",\"Nlights\"]], g_images.bonusCard14); \r\n\tvar bonus15 = new BonusCard(\"bonusCard15\", \"\", 5, [[\"Fire\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Nlights\",\"Fire\"]], g_images.bonusCard15); \r\n\t\r\n\tvar bonus16 = new BonusCard(\"bonusCard16\", \"\", 5, [[\"Earth\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t[\"Nlights\",\"Earth\"]], g_images.bonusCard16); \r\n\tvar bonus17 = new BonusCard(\"bonusCard17\", \"\", 5, [[\"Air\",\"Nlights\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Nlights\",\"Air\"]], g_images.bonusCard17); \r\n\tvar bonus18 = new BonusCard(\"bonusCard18\", \"\", 2, [[\"Water\",\"Air\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Fire\"]], g_images.bonusCard18); \r\n\tvar bonus19 = new BonusCard(\"bonusCard19\", \"\", 3, [[\"Earth\",\"Earth\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Earth\",\"Earth\"]], g_images.bonusCard19); \r\n\tvar bonus20 = new BonusCard(\"bonusCard20\", \"\", 4, [[\"Water\",\"Fire\"],\r\n\t\t\t\t\t\t\t\t\t\t\t\t[\"Water\",\"Fire\"]], g_images.bonusCard20); \r\n\r\n\t//Make a deck with 20 bonus point cards\r\n\tvar bonusDeckState = [\r\n\t\t\t\t\tbonus1, bonus2, bonus3, bonus4, bonus5, \r\n\t\t\t\t\tbonus6, bonus7, bonus8, bonus9, bonus10, \r\n\t\t\t\t\tbonus11, bonus12, bonus13, bonus14, bonus15, \r\n\t\t\t\t\tbonus16, bonus17, bonus18, bonus19, bonus20\r\n\t\t\t\t\t];\r\n\r\n\r\n\tvar bonusBoardState = [];\r\n\r\n\tfor (var i = 0; i < cards; i++) {\r\n\t\t//Draw a random card\r\n\t\tvar randomNumber = Math.floor(Math.random() * (numberOfBonusCards-1));\r\n\t\t//add that card to the game board\r\n\t\tbonusBoardState[i] = bonusDeckState[randomNumber];\r\n\t\t//remove that card from the deck\r\n\t\tbonusDeckState.splice(randomNumber,1);\r\n\t\tnumberOfBonusCards--;\r\n\t\t};\r\n\t \r\n\treturn bonusBoardState;\r\n}", "function firstDraw () {\n // each player starts with 4 cards\n // so draw 4 cards for the player\n }", "function drawFlipCard(cards) {\n\n _.each(cards, function(card) {\n\n var $tmplFlipCard = $($(\"#templateFlipCard\").html());\n\n // Set the name of the card for Google Analytics\n $(\"#data-cardname\", $tmplFlipCard).html(card.name);\n\n // Set the question for the front of the card\n $(\".question\", $tmplFlipCard).html(card.question)\n\n // Set the back content of the card\n $(\".back1\", $tmplFlipCard).html(card.back1);\n $(\".back2\", $tmplFlipCard).html(card.back2);\n $(\".back3\", $tmplFlipCard).html(card.back3);\n $(\".back4\", $tmplFlipCard).html(card.back4);\n $(\".back5\", $tmplFlipCard).html(card.back5);\n\n\n\n\n $(\"img.background-image\", $tmplFlipCard).attr(\"src\", \"img/training/\" + card.image);\n\n // _NOW_ we add this template to the training page\n $(\"#flipCardList\").append($tmplFlipCard);\n\n });\n\n // Flip Cards Flipping Script\n // ====================================\n $('.flip').on('click', function(event) {\n $(event.target).parents('.card').toggleClass('flipped');\n });\n\n}", "display() {\n if (this.cards.length) {\n // show the top card and make all cards move towards the position\n // of the deck\n this.cards[0].display(this.pos.x, this.pos.y, true);\n this.cards.forEach(c => c.approach(this.pos));\n } else {\n //show the empty slot\n stroke(0);\n strokeWeight(3);\n fill(255, 255, 255, 100);\n rect(this.pos.x, this.pos.y, CARDWIDTH, CARDHEIGHT);\n }\n }", "function startGame(){\n\t\t\t\t\n\t\t\t\tuiTimer.html(\"0 seconds\");\n\t\t\t\tuiPlayerScore.html(\"\");\n\t\t\t\tuiGameInfo.show();\n\t\t\t\tuiGamerestart.show();\n\t\t\t\tuiLogo.show();\n\t\t\t\tuiCards.show();\n\t\t\t\t\n\t\t\t\tgametimer = 0;\n\t\t\t\tpalyerscore=0;\n\t\t\t\tcardsmatched = 0;\n\t\t\t \t\n\t\t\t\tif (playGame == false) {\n\t\t\t \t\t\tplayGame = true;\n\t\t\t\t\t\tmatchingGame.deck.sort(shuffle);\n\t\t\t\t\t\tfor(var i=0;i<15;i++){\n\t\t\t\t\t\t\t\t$(\".card:first-child\").clone().appendTo(\"#cards\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// initialize each card's position\n\t\t\t\t\t\t\tuiCards.children().each(function(index) {\n\t\t\t\t\t\t\t\t// align the cards to be 4x4 ourselves.\n\t\t\t\t\t\t\t\t$(this).css({\n\t\t\t\t\t\t\t\t\t\"left\" : ($(this).width() + 10) * (index % 4),\n\t\t\t\t\t\t\t\t\t\"top\" : ($(this).height() + 10) * Math.floor(index / 4)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// get a pattern from the shuffled deck\n\t\t\t\t\t\t\t\tvar pattern = matchingGame.deck.pop();\n\t\t\t\t\t\t\t\t// visually apply the pattern on the card's back side.\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(pattern==\"color1\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[0]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(pattern==\"color2\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[1]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(pattern==\"color3\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[2]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(pattern==\"color4\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[3]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(pattern==\"color5\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[4]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(pattern==\"color6\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[5]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(pattern==\"color7\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[6]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(pattern==\"color8\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[7]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// embed the pattern data into the DOM element.\n\t\t\t\t\t\t\t\t$(this).attr(\"data-pattern\",pattern);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\t\n\t\t\n\t\t\tvar cards = document.getElementById(\"cards\").getElementsByClassName(\"card\");\n\t\t\t//default select first card\n\t\t\t$(cards[0]).addClass(\"active\");\t\t\t\t\t\n\t\t\t\t \ttimer();\n\t\t\t\t};\t\t\t \n\t\t\t }", "draw(){\n let cardNumber = Math.round(Math.random() * 77);\n return this.cards[cardNumber];\n }", "function draw() {\n if (playGame === \"P\") {\n\n\n //put backcground image\n background(hauntedImage);\n\n\n //put in all the things the predators need to do\n for (let i = 0; i < predatorGroup.length; i++) {\n predatorGroup[i].handleInput();\n predatorGroup[i].move();\n predatorGroup[i].handleEating(preyGroup[0]);\n predatorGroup[i].handleEating(preyGroup[1]);\n predatorGroup[i].handleEating(preyGroup[2]);\n predatorGroup[i].display();\n\n }\n //put all needed for prey to excit\n for (let i = 0; i < preyGroup.length; i++) {\n preyGroup[i].move();\n preyGroup[i].display();\n\n }\n\n //put scoreboard in display\n //replace with the array group\n scoreBoard.updateScores(predatorGroup[0].score, predatorGroup[1].score, predatorGroup[2].score);\n scoreBoard.display();\n //display gameover\n checkGameOver();\n // display start page\n } else if (playGame === \"S\") {\n startScreen.display();\n\n\n }\n //add a gameover page in diplay\n else if (playGame === \"E\") {\n endScreen.display();\n\n }\n}", "function scoreDisplay() {\n\t$('.scores').replaceWith(\n\t\t`<ul class=\"scores\">\n <li>Cards in Deck: ${numberOfCards}</li>\n <li>Correct guesses: ${correctGuesses}</li>\n <li>Incorrect guesses: ${incorrectGuesses}</li>\n </ul>`\n\t);\n\tif ($('.hints').hasClass('hidden')) {\n\t\t$('.hints').replaceWith(\n\t\t\t`<ul class=\"hints hidden\">\n <li>Higher Card Probability: ${highProb}%</li>\n <li>Lower Card Probability: ${lowProb}%</li>\n <li>Same Card Probability: ${sameProb}%</li>\n </ul>`\n\t\t);\n\t} else {\n\t\t$('.hints').replaceWith(\n\t\t\t`<ul class=\"hints\">\n <li>Higher Card Probability: ${highProb}%</li>\n <li>Lower Card Probability: ${lowProb}%</li>\n <li>Same Card Probability: ${sameProb}%</li>\n </ul>`\n\t\t);\n\t}\n\n\tif (numberOfCards === 0) {\n\t\t$('#cardForm').addClass('hidden');\n\t\tcardBack = './Images/EmptyBack.png';\n\t\tdisplayResults();\n\t}\n}", "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}", "async function getCards(cards = []) {\n console.log(cards);\n let [{ image: image1, value: value1, code: code1 }] = await drawFromPile(\n \"player1\"\n );\n let [{ image: image2, value: value2, code: code2 }] = await drawFromPile(\n \"player2\"\n );\n\n document.querySelector(\"#playerOne\").src = image1;\n document.querySelector(\"#playerTwo\").src = image2;\n const val1 = cardValue(value1);\n const val2 = cardValue(value2);\n if (val1 > val2) {\n deck.player1.push(code1, code2, ...cards);\n document.querySelector(\"h3\").innerHTML = `Player 1 wins!`;\n } else if (val1 < val2) {\n deck.player2.push(code1, code2, ...cards);\n document.querySelector(\"h3\").innerHTML = `Player 2 wins!`;\n } else {\n document.querySelector(\"h3\").innerHTML = `WAR WERE DECLARED!`;\n declareWar([...cards, code1, code2]);\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 dealCards() {\n $(\"#playerCard1\").html(\"<img src='assets/playing_card_images/\" +\n player.cardArr[0].value + \"_of_\" + player.cardArr[0].cardSuits.toLowerCase() + \".png'/>\")\n\n $(\"#playerCard2\").html(\"<img src='assets/playing_card_images/\" +\n player.cardArr[1].value + \"_of_\" + player.cardArr[1].cardSuits.toLowerCase() + \".png'/>\")\n\n $(\"#dealerCard1\").html(\"<img src='assets/playing_card_images/\" +\n dealer.cardArr[0].value + \"_of_\" + dealer.cardArr[0].cardSuits.toLowerCase() + \".png'/>\")\n\n cardCounterPlayer = 3;\n\n cardCounterDealer = 2;\n\n $(\"#hit\").click(function() {\n player.cardArr.push(getCard())\n cardScores(player.cardArr[player.cardArr.length - 1], player)\n console.log(\"player hand =\" + player.handTotal)\n console.log(\"dealer hand =\" + dealer.handTotal)\n //console.log(roundWinner())\n console.log(hitWinLogic())\n $(\"#playerscore\").html(player.moneyScore)\n $(\"#playerHandScore\").html(player.handTotal)\n $(\"#dealerHandScore\").html(dealer.handTotal)\n $(\"#playerCard\" + cardCounterPlayer).html(\"<img src='assets/playing_card_images/\" +\n player.cardArr[player.cardArr.length - 1].value + \"_of_\" + player.cardArr[player.cardArr.length - 1].cardSuits.toLowerCase() + \".png'/>\")\n cardCounterPlayer++;\n gameWinner();\n });\n\n $(\"#stay\").click(function() {\n //cardScores(dealer.cardArr[0], dealer)//originally 1\n while (dealer.handTotal < 17) {\n dealer.cardArr.push(getCard())\n console.log(dealer.cardArr)\n cardScores(dealer.cardArr[dealer.cardArr.length - 1], dealer)\n $(\"#dealerCard\" + cardCounterDealer).html(\"<img src='assets/playing_card_images/\" +\n dealer.cardArr[dealer.cardArr.length - 1].value + \"_of_\" + dealer.cardArr[dealer.cardArr.length - 1].cardSuits.toLowerCase() + \".png'/>\")\n cardCounterDealer++;\n //dealer.handTotal = dealer.handTotal + cardval\n }\n console.log(\"dealer hand =\" + dealer.handTotal)\n console.log(\"player hand =\" + player.handTotal)\n roundWinner()\n $(\"#playerHandScore\").html(player.handTotal)\n $(\"#dealerHandScore\").html(dealer.handTotal)\n $(\"#playerscore\").html(player.moneyScore)\n //$(\"#hit\").off()\n gameWinner();\n });\n}", "function renderGame(){\r\n\r\n\r\n \r\n//step 4 is chaging the values innside the html when button is clicked \r\n // step5 use textContent istead of innerText because it gives proper spacing \r\n cardId.textContent = \"Cards: \" \r\n \r\n for (let i = 0 ;i <cards.length;i++){\r\n cardId.textContent += cards[i] + \" \"\r\n }\r\n\r\n sumId.innerText = \"Sum : \" + sum\r\n if (sum <= 20){\r\n message = \"do u wanna to draw a new card\"\r\n gameOver = false\r\n }else if(sum===21){\r\n message = \"you have a blackjack\"\r\n gameOver = false\r\n }else{\r\n message = \"Game over, You lost\"\r\n gameOver = true\r\n }\r\n\r\n messageId.innerText = message\r\n \r\n}", "draw(){\n\t\tvar communityNewHand = this.state.communityCards;\n\t\tif (communityNewHand[0] === 'deck2'){\n\t\t\t// start over and push 3 cards off the top of the deck onto the array\n\t\t\tcommunityNewHand = [cards.deck.shift(),cards.deck.shift(),cards.deck.shift()]\t\t\n\t\t}else{\n\t\t\t// push\n\t\t\tcommunityNewHand.push(cards.deck.shift());\n\t\t}\n\t\tthis.setState({\n\t\t\tcommunityCards: communityNewHand\n\t\t})\n\t}", "function newCard() {\n//draw a new card by pushing a card into the deck\n//then add this card into the sum\nif( isAlive === true && hasBlackJack === false) {\n let newPlCardDrawn = getPlayerRandomCard()\n let newDlCardDrawn = getDealerRandomCard()\n plcardSum += newPlCardDrawn\n dealercardSum += newDlCardDrawn\n plcards.push(newPlCardDrawn)\n dlcards.push(newDlCardDrawn)\n \n renderGame()\n}\n}", "function draw() {\n // --Background\n\n background(38, 41, 50);\n canvBack.show();\n\n // -- Spaceship\n ship.show();\n ship.move();\n\n // -- Invaders\n for (var i = invaderNum - 1; i >= 0; i--) {\n if (invaderArr[i].alive) {\n invaderArr[i].show();\n invaderArr[i].move();\n invaderArr[i].checkCrossed();\n if (invaderArr[i].didCross()) {\n document.getElementById(\"livestext\").innerHTML = game.lives;\n }\n }\n }\n // -- Bullets\n for (var i = bullets.length - 1; i > 0; i--) {\n bullets[i].move();\n bullets[i].show();\n for (var j = invaderNum - 1; j >= 0; j--) {\n if (invaderArr[j].alive && bullets[i].hits(invaderArr[j])) {\n bullets.splice(i, 1);\n invaderArr[j].die();\n game.score += 10;\n document.getElementById(\"scoretext\").innerHTML = game.score;\n break;\n }\n }\n }\n}", "function $renderCards(cards){\r\n\t// Number of top cards to display\r\n\tlet counter = STORE.displayedCards;\r\n\tlet topCards = [];\r\n\t// Empty the container in case we refresh\r\n\t$('#clash-cards').empty();\r\n\t// Loop through the array of cards to render applicable data\r\n\tcards.forEach(card => {\r\n\t\t// If the counter hits 0, stop displaying cards\r\n\t\tif(counter > 0){\r\n\t\t\ttopCards.push(card.id);\r\n\t\t\t// Basic DOM object we create and appending info to it\r\n\t\t\tlet $card = $(`<div class=\"card\" data-id=\"${card.id}\">`);\r\n\t\t\t$card.append(`<p class=\"name\">${card.name}</p>`);\r\n\t\t\t$card.append(`<img class=\"app-card\" src=\"${card.cardImg}\" alt=\"${card.name}\">`);\r\n\t\t\t$card.append(`<p class=\"percent\">Win-Rate: <span class=\"perc\">${card.winPerc}%</span></p>`);\r\n\t\t\t$card.append(`<p class=\"use-rate\">Use-Rate: <span class=\"usage\">${card.useRate}%</span></p>`);\r\n\t\t\t// Render the card to the DOM\r\n\t\t\t$('#clash-cards').append($card);\r\n\t\t\t// Remove one from the counter (if 0, stop rendering)\r\n\t\t\tcounter--;\r\n\t\t}\r\n\t})\r\n\treturn topCards;\r\n}", "function draw() {\n if (isGameOver) {\n return;\n }\n\n context.fillStyle = CLEAR_COLOR;\n context.fillRect(0, 0, WIDTH, HEIGHT);\n\n for (var id in gameObjects) {\n if (gameObjects.hasOwnProperty(id) && gameObjects[id] instanceof GameObject) {\n gameObjects[id].draw(context);\n }\n }\n\n context.fillStyle = \"#FFF\";\n context.font = \"bold 14px 'Roboto Condensed',Arial,sans-serif\";\n context.fillText(\"Score: \" + score, 24, 24);\n }", "function passCards()\n {\n DOM.cardsContainer.classList.remove(CSS.hidden);\n DOM.container.classList.remove(CSS.container.pause);\n DOM.container.classList.add(CSS.container.game);\n state.screen = \"GAME\";\n\n if (state.newGame)\n {\n useMemorisingTimeId = cards[0].addEventListener(\"move\", useMemorisingTime);\n }\n else\n {\n state.cardsTurnable = true;\n }\n\n if (state.turnedCard)\n {\n state.turnedCard.turn(true);\n }\n\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].move(\n DOM.game.field.rows[cards[counter].dataset.position.row].cells[cards[counter].dataset.position.col],\n {height: sizes.card.height + \"PX\", width: sizes.card.width + \"PX\"},\n true\n );\n }\n\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, false);\n desk.removeEventListener(\"closeFan\", passCardsId);\n }", "draw() {\n const cards = document.querySelectorAll(\".memory-card\");\n let backs = document.getElementsByClassName(\"back-face\");\n for (let i = 0; i < cards.length; i++) {\n let card = this.deck.getCardByIndex(i);\n card.setElement(cards[i]);\n backs[i].src = this.deck.getCardByIndex(i).image;\n }\n let that = this;\n this.deck.cards.forEach((card) =>\n card.element.addEventListener(\"click\", function (e) {\n that.evalClick(this);\n })\n );\n }", "function showScoreCard() {\n clearPrompt();\n $(\"#points\").text(\"\");\n $(\"#score\").text(\"\");\n $(\"#rightAnswers\").text(\"Correct Answers: \" + correct);\n $(\"#wrongAnswers\").text(\"Incorrect Answers: \" + incorrect);\n $(\"#totalScore\").text(\"Total Score: \" + score);\n var playAgainButton = $(\"<button>\");\n playAgainButton.addClass(\"playAgain btn btn-outline-dark btn-lg btn-block\");\n playAgainButton.text(\"Play Again?\");\n $(\"#playAgainButtonSection\").append(playAgainButton);\n correct = 0;\n incorrect = 0;\n score = 0;\n }", "function drawHand(hand, y)\n{\n // X values for 5 cards evenly spread across the canvas\n let xValues = [ 10, 130, 250, 370, 490 ];\n\n for (let i = 0; i < hand.length; i++)\n {\n hand[i].drawCard(xValues[i], y);\n }\n}", "function startGame() {\n\n\t// Duplication of the array.\n\tconst dubCards = card.slice();\n\tconst cards = card.concat(dubCards);\n\n\tcards.sort(() => 0.5 - Math.random());\n\n\tcreateCards(cards);\n\n\tconst cardsDiv = document.querySelectorAll('.card');\n\tcardsDiv.forEach(card => card.addEventListener('click', flipCard));\n\n}", "draw(){\n this._context.fillStyle = '#000';\n this._context.fillRect(0, 0, canvas.width, canvas.height);\n \n // draw ball and players\n this.drawRectangle(this.ball) \n this.players.forEach(player => this.drawRectangle(player));\n\n //draw score\n this.drawScore();\n }", "function draw(){\r\n ctx.fillStyle = '#70c5ce';\r\n ctx.fillRect(0, 0, cWidth, cHeight);\r\n bg.draw();\r\n pipes.draw();\r\n fg.draw();\r\n kca.draw();\r\n bird.draw();\r\n getReady.draw();\r\n gameOver.draw();\r\n score.draw();\r\n \r\n\r\n}", "function scoreDraw() {\n let healthElement = document.getElementById(\"healthcheckup\");\n let moodElement = document.getElementById(\"moodcheckup\");\n let nameElement = document.getElementById(\"name\");\n let drinkcountElement = document.getElementById(\"drinkcounter\");\n let modsElement = document.getElementById(\"modstotalcheckup\");\n let foodElement = document.getElementById(\"foodcheckup\");\n let waterElement = document.getElementById(\"watercheckup\");\n let coffeeElement = document.getElementById(\"coffeecheckup\")\n nameElement.textContent = `Name: ${target.name}`;\n moodElement.textContent = `Mood: ${target.moodScore.toString()}`;\n healthElement.textContent = `Health: ${target.healthScore.toString()}`;\n drinkcountElement.textContent = `Number of Drinks: ${target.hits}`;\n modsElement.textContent = `Modifiers Total: ${modsTotal}`;\n foodElement.textContent = `Food: ${foodCount.toString()}`;\n waterElement.textContent = `Water: ${waterCount.toString()}`;\n coffeeElement.textContent = `Coffee: ${coffeeCount}`;\n\n}", "function newGame() {\n document.getElementById('display').style.display = \"flex\"\n document.getElementById('new-game').style.display = \"none\"\n document.getElementById('hit').style.display = \"inline\"\n document.getElementById('stay').style.display = \"inline\"\n console.log(assignCards());\n console.log(playerCards);\n console.log(dealerCards);\n console.log(\"Player Score: \" + playerScore);\n console.log(\"Dealer Score: \" + dealerScore);\n dealerCardAdder(\"Back\", \"Yellow\", \"hidden\");\n}", "function checkScore(){\r\n\tif(snake[0].x*snakew==food[0].x && snake[0].y*snakeh==food[0].y)\r\n\t{\r\n\t\t\r\n\t\tfood.pop();\r\n\t\tctx.clearRect(0,0,cvs.width,cvs.height);\r\n\t\tnewfood();\r\n\t\tincreaseSize();\r\n\t\tscore++;\r\n\t\teat.play();\r\n\t\tfor(j=0;j<snake.length;j++)\r\n\t{\r\n\t\tdrawSnake(snake[j].x,snake[j].y);\r\n\t}\r\n drawFood();\r\n\t\t//document.write('score++');\r\n\t\t\r\n\t\t\r\n\t}\r\n scores.innerHTML=\"Score \"+score;\r\n}", "function renderWinnings() {\n var myXpos = canvas.width / 3 - playingCard.width - 90;\n var myYpos = canvas.height / 3 * 2 - playingCard.height / 2;\n var theirXpos = canvas.width / 3 * 2 + playingCard.width + 30;\n var theirYpos = canvas.height / 3 - playingCard.height / 2;\n var offset = 0;\n var increment = 2;\n var myCurrentWinnings = myWinnings;\n var theirCurrentWinnings = theirWinnings;\n \n ctx.beginPath();\n ctx.font = \"20px Pacifico\" || \"20px cursive\";\n ctx.fillStyle = colorThemeSecondary;\n ctx.fillText(\"My winnings\", myXpos - playingCard.width - 80, myYpos + playingCard.height / 2);\n ctx.closePath();\n myCurrentWinnings.forEach(function (card) {\n renderPlayingCard(myXpos - offset, myYpos - offset, playingCard.frontColor, cardInitial(card.name));\n offset = offset + increment;\n });\n offset = 0;\n ctx.beginPath();\n ctx.font = \"20px Pacifico\" || \"20px cursive\";\n ctx.fillStyle = colorThemeSecondary;\n ctx.fillText(\"Their winnings\", theirXpos + playingCard.width + 50, theirYpos + playingCard.height / 2);\n ctx.closePath();\n theirCurrentWinnings.forEach(function (card) {\n renderPlayingCard(theirXpos - offset, theirYpos - offset, playingCard.frontColor, cardInitial(card.name));\n offset = offset + increment;\n });\n }", "function updateCards(){\n\tshuffle(cards);\n\tfor (i = 0; i < symbol.length; i++) {\n\t\tsymbol[i].children[0].className = 'fa ' + cards[i];\n\t\tsymbol[i].className = 'card';\n\t}\n\tmin = 0;\n\tmatches = 0;\n\tsec = 0;\n\tmoves = 0;\n\tchecking = [];\n\tparents = [];\n\tgstars = 3;\n\tdocument.querySelector('.time').innerHTML = min + ':0' + sec;\n\tdocument.querySelector('.moves').innerHTML = moves;\n\tdocument.querySelector('.stars').innerHTML = \"<li><i class=\\\"fa fa-star\\\"></i></li><li><i class=\\\"fa fa-star\\\"></i></li><li><i class=\\\"fa fa-star\\\"></i></li>\" ;\n}", "function displayCards() {\n shuffle(cardImage);\n for (let i = 0; i < cards.length; i++) {\n cards[i].innerHTML = `<i class=\"fa ${cardImage[i]}\"></i>`;\n cards[i].classList.remove('open', 'match', 'unmatched', 'off');\n cards[i].classList.add('animated', 'rubberBand');\n setTimeout(function() {\n cards[i].classList.remove('animated', 'rubberBand');\n }, 2000);\n }\n moves = 0;\n matchList = 0;\n count.innerHTML = 0;\n for (let i = 0; i < starCount.length; i++) {\n starCount[i].style.display = 'inline-block';\n }\n clearInterval(timeCounter);\n second = 00;\n min = 0;\n countUp();\n pauseTimer.style.display = 'inline-block';\n startGame.textContent = 'Restart!';\n scorePanel.style.display = 'flex';\n playTimer.style.display = 'none';\n closed = true;\n openCards = [];\n closeModal();\n timer.innerText = 'Your time is: 0:00';\n gameStarted = true;\n}", "function toPlayer() {\n let dealCard = $.getJSON('https://deckofcardsapi.com/api/deck/' + deckID + '/draw/?count=1');\n dealCard.done(function(data) {\n if (dealCard.status !== 200) {\n return;\n }\n let cardImg = (dealCard.responseJSON.cards[0].image)\n let cardValue = (dealCard.responseJSON.cards[0]['value'])\n if (cardValue === \"JACK\") {\n cardValue = \"10\"\n }\n if (cardValue === \"QUEEN\") {\n cardValue = \"10\"\n }\n if (cardValue === \"KING\") {\n cardValue = \"10\"\n }\n if (cardValue === \"ACE\") {\n cardValue = \"11\"\n } else {\n cardValue = cardValue\n }\n cardValue = parseInt(cardValue)\n playerScore.push(cardValue)\n totalPlayerScore = playerScore.reduce(function(sum, value) {\n return sum + value\n }, 0)\n\n console.log(playerScore)\n $('#players-cards').append(`<img src=\"${cardImg}\">`)\n automateAce()\n console.log('player score is :' + totalPlayerScore)\n if (totalPlayerScore > 21) {\n window.alert('You busted...you lose!')\n location.reload()\n }\n })\n }", "function dealCards(){\n var card1 = deck.pop()\n \n var card2 = deck.pop() \n \n var card3 = deck.pop()\n \n var card4 = deck.pop()\n \n playerCards.push(card1)\n playerCards.push(card2)\n dealerCards.push(card3)\n dealerCards.push(card4)\n //1st player card\n var playerHand = document.getElementById(\"player-hand\")\n var image1 = document.createElement(\"img\")\n var card1img = card1.imageurl\n image1.setAttribute(\"src\", card1img)\n playerHand.append(image1)\n //2nd player card\n var image2 = document.createElement(\"img\")\n var card2img= card2.imageurl\n image2.setAttribute(\"src\",card2img)\n playerHand.append(image2)\n //1st dealer card\n var dealerHand = document.getElementById(\"dealer-hand\")\n var image3 = document.createElement(\"img\")\n var card3img = card3.imageurl\n image3.setAttribute(\"src\",card3img)\n dealerHand.append(image3)\n //2nd dealer card\n var image4 = document.createElement(\"img\")\n var card4img = card4.imageurl\n image4.setAttribute(\"src\",card4img)\n dealerHand.append(image4)\n //count points and display on HTML \n playerPoints += card1.points\n playerPoints += card2.points\n dealerPoints += card3.points\n dealerPoints += card4.points\n dealerPointsDiv.textContent=dealerPoints\n playerPointsDiv.textContent=playerPoints\n \n win()\n busted()\n \n}", "function updateScore() {\n if (draw) {\n document.getElementById(\"current_score\").innerHTML = score;\n }\n return;\n}", "function initCards(){\n\t\t\tvar counter = 0;\n\t\t\tvar value = 1;\n\t\t\t$(\".wrap-fields ul.fields\").empty();\n\t\t\tfor(var i=0; i<settings.cardcnt; i++){\n\t\t\t\tcards[i] = value;\n\t\t\t\t// Create list element for every card\n\t\t\t\t// I already load the cards into the DOM here to have the pictures in the browser cache!\n\t\t\t\t// The cards will be shuffled afterwards, so even if they are in the DOM the user does not know the final positions!\n\t\t\t\t// This could be avoided by using a colour array instead of images!!\n\t\t\t\t$(\".wrap-fields ul.fields\").append('<li class=\"field\" data-index=\"' + i + '\"><div class=\"card back\"><img src=\"img/card_bg.gif\" alt=\"Card Back\" /></div><div class=\"card front\"><img src=\"img/colour' + value + '.gif\" alt=\"Colour ' + value + ' Front\" /></div></li>');\n\t\t\t\tcounter++;\n\t\t\t\tif(counter > 1){\n\t\t\t\t\tcounter = 0;\n\t\t\t\t\tvalue++;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function showStatus() {\n if (!gameStarted) {\n textArea.innerText = 'Welcome to Blackjack!';\n return;\n }\n \n let dealerCardString = '';\n let dealerCardPicture = '';\n \n for ( let i = 0; i < dealerCards.length; i++ ) {\n dealerCardPicture = getCardString(dealerCards[i]);\n dealerCardString += dealerCardPicture + '\\n'; \n //code to display the card\n //var CardPicture = document.createElement('./Cards/' + dealerCardPicture + '.png');\n dealerCardPicture = ''; \n }\n \n let playerCardString = '';\n \n for ( let i = 0; i < playerCards.length; i++ ) {\n playerCardString += getCardString(playerCards[i]) + '\\n';\n }\n \n updateScores();\n \n textArea.innerText = \n 'Dealer has:\\n' + \n dealerCardString + \n '(score: ' + dealerScore + ')\\n\\n' +\n \n 'Player has:\\n' +\n playerCardString +\n '(score: ' + playerScore + ')\\n\\n';\n \n if ( gameOver ) {\n if (playerWon) {\n textArea.innerText += \"YOU WIN!\";\n }\n else {\n textArea.innerText += \"DEALER WINS\";\n }\n newGameButton.style.display = 'inline';\n hitButton.style.display = 'none';\n stayButton.style.display = 'none';\n }\n \n /*for (var i = 0; i < deck.length; i++) {\n textArea.innerText += '\\n' + getCardString(deck[i]);\n }*/\n}", "function initCards(cards) {\n for (var i = 0; i < cards.length; i++) {\n getOneCard(cards[i], \" animated flipInX fast\");\n }\n}", "function startGame(){\n playerCards.innerHTML = \"\";\n message.innerText = \" \";\n \n for( i = 0; i < playerHand.length; i++) {\n let firstCard = document.createElement(\"img\");\n firstCard.setAttribute(\"src\", playerHand[i].imagePath);\n playerCards.appendChild(firstCard);\n }\n dealerCards.innerHTML = \"\";\n for( i = 0; i < dealerHand.length; i++) {\n let backOfCard = document.createElement(\"img\");\n backOfCard.setAttribute(\"src\", \"images/cards/blue_back.png\");\n dealerCards.appendChild(backOfCard);\n let secondCard = document.createElement(\"img\");\n secondCard.setAttribute(\"src\", dealerHand[i].imagePath);\n dealerCards.appendChild(secondCard);\n }\n checkScore();\n console.log(playerHand);\n}", "function Blackjack() {\n // create a new 52 card deck for one player.\n PlayingCards.call(this, 1);\n // initialize score for player\n this.score = 0;\n // Initialize player hand. Is a 2D array where the outer array length represents num players (only one in this case).\n this.hand = [[]];\n this.get_score = function (card_name) {\n var blackjack_deck = new PlayingCards();\n var player_hand = this.hand;\n var card_score = 0;\n card_name = player_hand[0][player_hand[0].length - 1];\n card_name = card_name.split(' ');\n card_name = card_name[0].toString();\n var face_cards = ['Queen', 'Jack', 'King'];\n for (var i = 0, j = 13; i < j; i++) {\n if (card_name === blackjack_deck.ranks[i]) {\n if (face_cards.includes(card_name)) {\n card_score = 10;\n }\n else {\n card_score = i + 1;\n }\n break;\n }\n }\n this.score += card_score;\n console.log(\"score is \" + this.score.toString());\n };\n /** Deals one card to a player. Adds that card to player's score. */\n this.hit = function () {\n this.dealOne(0, this.hand);\n this.get_score(this.hand);\n };\n // Deal two cards to hand. \n this.hit();\n console.assert(this.score > 0);\n this.hit();\n console.assert(this.score > 0);\n this.win_lose = function () {\n if (this.score == 21) {\n console.log(\"21!\");\n }\n if (this.score > 21) {\n console.log(\"busted!\");\n }\n };\n}", "function renderGame(){\n cardsEl.textContent=\"Cards: \" \n for (let i = 0; i < cards.length; i++){\n cardsEl.textContent += cards[i] + \" \"\n }\n sumEl.textContent =\"Sum: \" + sum\n if (sum <= 20){\n message = (\"Draw a new card?\"); \n } else if (sum===21){\n message = (\"You Won! You've got Blackjack!\");\n hasBlackJack = true\n }else {\n message = (\"You Lost!\");\n isAlive = false\n }\n messageEl.textContent = message\n}", "function initializeCard() {\n var cardInfo = getStats();\n cardInfo.push(getRandomImage());\n cardInfo.push(getRandomName());\n enemyCards.push(cardInfo);\n}", "function evalCards() {\n\n}", "function drawCards(event) {\n var board = $(\"#board\");\n event.positions.forEach(function(pos, index) {\n var value = event.cards[index].value;\n animationQueue.add(function() {\n console.log(\"[START] \"+event.reason+\" draw event for card \"+pos)\n // just in case...\n $(\"#slot_\"+pos).remove();\n var card = $(createCard(pos, value));\n card\n .one(\"webkitAnimationEnd oanimationend msAnimationEnd animationend\", function() {\n $(this).removeClass(\"highlight\");\n console.log(\"[END] \"+event.reason+\" draw event for card \"+pos)\n animationQueue.next();\n })\n .addClass(\"highlight\");\n board.append(card);\n return false;\n });\n console.log(\"[QUEUED] \"+event.reason+\" draw event for card \"+pos)\n });\n // update cards number in deck\n $(\"#deck\").text(event.nbCardsBeforeDraw - event.cards.length);\n}", "function showScoreBoard() {\n let title = level >= 15 ? 'Congrats, you won!' : 'Ah, you lost!',\n titleX = level >= 15 ? 152 : 220,\n titleY = 280,\n totalScore = level * 60 + GemsCollected.blue * 30 + GemsCollected.green * 40 + GemsCollected.orange * 50,\n scoreBoard = Resources.get('images/score-board.jpg'),\n starResource = Resources.get('images/Star.png'),\n gemBlueResource = Resources.get('images/Gem-Blue.png'),\n gemGreenResource = Resources.get('images/Gem-Green.png'),\n gemOrangeResource = Resources.get('images/Gem-Orange.png'),\n offset = 70;\n // Draw image assets\n ctx.drawImage(scoreBoard, (canvas.width - scoreBoard.width) / 2, (canvas.height - scoreBoard.height - offset) / 2);\n ctx.drawImage(starResource, 175, 260 - offset, starResource.width / 1.5, starResource.height / 1.5);\n ctx.drawImage(gemBlueResource, 180, 345 - offset, gemBlueResource.width / 1.8, gemBlueResource.height / 1.8);\n ctx.drawImage(gemGreenResource, 180, 425 - offset, gemGreenResource.width / 1.8, gemGreenResource.height / 1.8);\n ctx.drawImage(gemOrangeResource, 180, 505 - offset, gemOrangeResource.width / 1.8, gemOrangeResource.height / 1.8);\n // Draw text\n ctx.font = \"50px Gaegu\";\n ctx.fillStyle = \"#fff\";\n ctx.strokeStyle = \"#000\";\n ctx.lineWidth = 3;\n ctx.strokeText(title, titleX, titleY - offset);\n ctx.fillText(title, titleX, titleY - offset);\n ctx.font = \"45px Gaegu\";\n ctx.strokeText(level + ' x 60 = ' + level * 60, 270, 340 - offset);\n ctx.fillText(level + ' x 60 = ' + level * 60, 270, 340 - offset);\n ctx.strokeText(GemsCollected.blue + ' x 30 = ' + GemsCollected.blue * 30, 270, 420 - offset);\n ctx.fillText(GemsCollected.blue + ' x 30 = ' + GemsCollected.blue * 30, 270, 420 - offset);\n ctx.strokeText(GemsCollected.green + ' x 40 = ' + GemsCollected.green * 40, 270, 500 - offset);\n ctx.fillText(GemsCollected.green + ' x 40 = ' + GemsCollected.green * 40, 270, 500 - offset);\n ctx.strokeText(GemsCollected.orange + ' x 50 = ' + GemsCollected.orange * 50, 270, 580 - offset);\n ctx.fillText(GemsCollected.orange + ' x 50 = ' + GemsCollected.orange * 50, 270, 580 - offset);\n ctx.strokeText('_______', 270, 640 - offset);\n ctx.fillText('_______', 270, 640 - offset);\n ctx.strokeText('Total: ' + totalScore.toString(), 270, 640 - offset);\n ctx.fillText('Total: ' + totalScore.toString(), 270, 640 - offset);\n ctx.strokeText('Spacebar to restart', 170, 680);\n ctx.fillText('Spacebar to restart', 170, 680);\n }", "function draw() {\n\t\n\t//checks width and height of grid sections\n\tvar tw = canvas.width/grid.w;\n\tvar th = canvas.height/grid.h;\n\t\n\t//draws in sections of grid\n\tfor (var x=0; x < grid.w; x++) {\n\t\tfor (var y=0; y < grid.h; y++) {\n\t\t//checks grid section for proper fill\n\t\t\tswitch (grid.get(x, y)) {\n\t\t\t\tcase emptyFill:\n\t\t\t\t\tctx.fillStyle = \"#ff0000\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase snakeFill:\n\t\t\t\t\tctx.fillStyle = \"#000000\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase foodFill:\n\t\t\t\t\tctx.fillStyle = \"#00ff00\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\tctx.fillRect(x*tw, y*th, tw, th);\n\t\t}\n\t}\n\n\t//draws score\n\tctx.fillStyle = \"#000000\";\n\tctx.fillText(\"Score: \" + score, 10, canvas.height-10);\n}", "function updateGameDisplay() {\n // grab our card wrapper elements\n const pCardWrapper = document.getElementById('player-card-wrapper');\n const dCardWrapper = document.getElementById('dealer-card-wrapper');\n\n // remove all cards from them\n pCardWrapper.innerHTML = '';\n dCardWrapper.innerHTML = '';\n\n // give dealer their cards\n // draw new div elements for each card\n game.dealerPile.cards.forEach((c) => {\n // create div element\n const card = document.createElement('div');\n // give div a class 'card'\n card.classList.add('card');\n\n // give the card its text content, accounting for the 0 represented as a 10 thing\n card.innerHTML = c.value == 0 ? '10 of ' + c.suit : c.value + ' of ' + c.suit;\n\n // add the card to the appropriate wrapper element\n dCardWrapper.appendChild(card);\n });\n\n // give player their cards\n game.playerPile.cards.forEach((c) => {\n\n const card = document.createElement('div');\n\n card.classList.add('card');\n\n card.innerHTML = c.value == 0 ? '10 of ' + c.suit : c.value + ' of ' + c.suit;\n\n pCardWrapper.appendChild(card);\n });\n\n // update the score information\n document.getElementById('info-banner').innerHTML = `Games Won: ${game.gamesWon}, Games Lost: ${game.gamesLost}`;\n}", "function draw() {\n if (animate) {\n h++;\n if (h > 360) {\n h = 0;\n }\n\n fill(h, s, b);\n rect(cardX, cardY, 100, 140, 5);\n cardX += speedX;\n cardY += speedY;\n speedY += gravity;\n if (cardY + 140 > height) {\n cardY = height - 140;\n speedY *= -0.8;\n }\n if (cardX > width || cardX + cardW < 0) {\n index++;\n cardCount++;\n if (cardCount == 52) {\n background('green');\n sound.play();\n lonely();\n animate = false;\n }\n if (index > 3) {\n index = 0;\n }\n speedX = random(-12, 6);\n while (speedX > -2 && speedX < 2) {\n speedX = random(-12, 6);\n }\n cardX = origins[index];\n cardY = 20;\n\n }\n }\n}", "function DealDraw() {\n if(nDraws > 0) {\n // there is still a draw left\n myHand[0].Draw(myDeck);\n nDraws--;\n if( nDraws == 0) {\n addToScore(pokerRank[myHand[0].getRank()][0]);\n setDealDraw(\"deal.gif\");\n }\n } else {\n myDeck = new Deck();\n myHand = new Array(1);\n\n myDeck.shuffle();\n myHand[0] = new Hand(1);\n myHand[0].Deal(myDeck);\n nDraws = 3;\n addToScore(-1); // deduct one for bet amount\n setDealDraw(\"draw.gif\");\n }\n}", "function renderPlayerHand(myCards) {\n var offsetX = 20;\n if (myCards.length % 2 === 0) {\n var xpos = canvas.width / 2 - (myCards.length / 2 * (playingCard.width + offsetX)) + offsetX / 2;\n } else {\n var xpos = canvas.width / 2 - (myCards.length + 1) / 2 * playingCard.width + playingCard.width / 2 - offsetX * (myCards.length - 1) / 2;\n }\n var ypos = canvas.height - playingCard.height - 20;\n playerHandCollision = []\n for (var i = 0; i < cardNames.length; i++) {\n for (var j = 0; j < myCards.length; j++) {\n if (cardNames[i] === myCards[j].name) {\n var cardObj = {};\n cardObj.name = cardNames[i];\n cardObj.initial = cardInitial(cardNames[i]);\n cardObj.suit = myCards[j].suit;\n cardObj.value = cardValues[i];\n cardObj.left = xpos;\n cardObj.top = ypos;\n playerHandCollision.push(cardObj);\n renderPlayingCard(cardObj.left, cardObj.top, playingCard.frontColor, cardObj.initial);\n xpos = xpos + playingCard.width + offsetX;\n }\n }\n }\n }", "function displayCards() {\n // aus HTML wird card-container in cardContainerDiv gespeichert\n let cardContainerDiv = document.getElementById(\"card-container\");\n // Geht jede Karten auf der Spielfläche durch und stellt sie dann dar\n for (let i = 0; i < cardPool.length; i++) {\n // ein neues div wird erstellt und in cardDiv gespeichert\n let cardDiv = document.createElement(\"div\");\n // für css zum gestalten\n cardDiv.setAttribute(\"class\", \"card-div\");\n // neues img element wird erstellt und in cardImg gespeichert\n let cardImg = document.createElement(\"img\");\n // Das Sakura Bild (Kartenrückseite) wird dem cardImg zugewiesen\n cardImg.src = \"./pictures/ui/sakura.png\";\n // --Jede Rückseite bekommen verschiedene id's || warum i? Damit das onCardClick() weiß an welcher Position die Karte im cardPool array war\n cardImg.setAttribute(\"id\", i.toString());\n // für css\n cardImg.setAttribute(\"class\", \"card-image\");\n // beim klicken wird onCardClick() aufgerufen\n cardImg.addEventListener(\"click\", onCardClick);\n // cardImg ist ein Unterelement von cardDiv\n cardDiv.appendChild(cardImg);\n // cardDiv ist ein Unterelement von cardContainerDiv\n cardContainerDiv.appendChild(cardDiv);\n }\n }", "function scoreCrib() {\n if (findWinner()) {\n return;\n }\n var computerPoints = 0;\n var playerPoints = 0;\n crib.push(communityCard);\n if (cribOwner == \"computer\") {\n computerPoints += scoreAll(crib);\n computerScore += computerPoints;\n $('#instruction p').text(\"Crib was worth \" + computerPoints + \" points for the computer.\");\n drawScore();\n } else if (cribOwner == \"player\") {\n playerPoints += scoreAll(crib);\n playerScore += playerPoints;\n $('#instruction p').text(\"Crib was worth \" + playerPoints + \" points for the player.\");\n drawScore();\n } else {\n //go to next phase\n }\n}", "function drawScore() {\n document.getElementById('score').innerText = score.toString();\n }" ]
[ "0.766761", "0.7229308", "0.72034293", "0.7196926", "0.7116544", "0.7034283", "0.69938654", "0.69877", "0.6843904", "0.6836858", "0.68336296", "0.68256485", "0.6782215", "0.6779211", "0.6725816", "0.6724083", "0.66940165", "0.6660893", "0.66430736", "0.6641876", "0.66317105", "0.66021436", "0.65855026", "0.6585163", "0.6582712", "0.6569612", "0.6567627", "0.6561725", "0.65600836", "0.65474916", "0.6535991", "0.64979666", "0.649646", "0.64809597", "0.648077", "0.6476577", "0.6470059", "0.64568305", "0.6440985", "0.6440515", "0.643994", "0.6438695", "0.6435277", "0.6415743", "0.639774", "0.63928825", "0.6392441", "0.6382161", "0.63767964", "0.6373593", "0.63729775", "0.63585573", "0.6357801", "0.6355299", "0.63413095", "0.63358086", "0.6296311", "0.62894106", "0.6281797", "0.62721616", "0.626991", "0.6266253", "0.6258365", "0.62555456", "0.62533045", "0.6252796", "0.6245823", "0.6241135", "0.6229243", "0.6228069", "0.6220662", "0.6217116", "0.6214234", "0.62107563", "0.6210567", "0.62056506", "0.61907405", "0.6186656", "0.61838275", "0.6183385", "0.61823416", "0.6180303", "0.6179761", "0.6172006", "0.6168845", "0.6157588", "0.6157061", "0.61549574", "0.6154948", "0.61537766", "0.61477333", "0.61460733", "0.6139441", "0.61351573", "0.61341184", "0.6132466", "0.6115352", "0.61152166", "0.6109706", "0.61012757" ]
0.7484573
1
working on drawing 2 cards per player on the start game click
function appendPlayerCard(cardData){ draw.on("click", function() { var $table=$("table"); $table.append("<tr></tr>"); var $target=$("tr:last"); $target.append("<td>" + "<img src=" + cardData.cards[0].image + "></img>" + "</td>"); $target.append("<td>" + "<img src=" + cardData.cards[1].image + "></img>" + "</td>"); $target.append("<td>" + playerScoreTotal + "</td>"); if(cardData.cards[0].value + cardData.cards[1].value <= 21){ alert("Blackjack! Player Wins!"); } }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function firstDraw () {\n // each player starts with 4 cards\n // so draw 4 cards for the player\n }", "drawStage () {\n for (let i = 0; i < 2; i++) {\n const card = this.game.decks.player.draw()\n if (card.type === 'epidemic') {\n this.game.epidemic()\n }\n this.player.pickUp(card)\n }\n\n this.drawn = 1\n }", "function startGame()\n{\n\tcreateDeck();\n\tshuffleDeck();\n\tcreatePlayers(2);\n\n\tdrawCard(0, 0);\n\tdrawCard(1, 0);\n\tdrawCard(0, 0);\n\tdrawCard(1, 0);\n\n\n\n\tdisplayCards();\n\tdisplayOptions();\n}", "function draw() {\r\n \r\n /* Get a random card and display in card-container */\r\n getNextCard();\r\n\r\n /* Update playerlist with current playerInTurn */ \r\n refreshPlayerList();\r\n\r\n /* Update message text with current playerInTurn */ \r\n refreshMessageText();\r\n\r\n /* Advance to next player */\r\n advancePlayerInTurn();\r\n}", "function start() {\n let container = document.getElementById(\"playersCards\");\n for (let i = 0; i < 2; i++) {\n let card = Math.ceil(Math.random() * 11);\n card = aceSituation(card);\n pCardsArray.push(card);\n console.log(pCardsArray)\n let image = createCard(card);\n container.appendChild(image);\n PLAYERTOTAL += card;\n }\n document.getElementById(\"start\").style.display=\"none\";\n document.getElementById(\"playerTotal\").innerHTML = PLAYERTOTAL;\n document.getElementById(\"hit-placeholder\").innerHTML ='<button onclick=\"hit()\" id=\"hit\">Hit</button>';\n document.getElementById(\"stand-placeholder\").innerHTML = '<button id=\"stand\" onclick=\"stand()\">Stand</button>';\n}", "function startGame() {\n playerOneCards = [];\n playerTwoCards = [];\n assignCards();\n updateCurrentCards();\n if(gamesPlayed === 0){\n gamesPlayed++;\n let i = 0;\n card1Back.classList.add('hiddenLeft'); \n displayCard(i); \n }\n else {\n gamesPlayed++;\n let i = 0; \n displayCard(i);\n startButton.innerText = 'START';\n card1Back.classList.add('hiddenLeft');\n card1.classList.remove('hiddenLeft');\n card2.classList.remove('hiddenRight');\n }\n\n\n}", "function startGame() {\n createButtons();\n createCards();\n}", "function startGame() {\n createButtons();\n createCards();\n}", "function startGame() {\n createButtons(gameButtons);\n createCards();\n}", "function StartPlaying(){\n \n gameStart.hide();\n gameEnd.hide(); \n \n moves.show();\n statusTab.show();\n board.show();\n \n numberOfMoves = 0;\n cardsmatched = 0;\n \n movesMade.html(numberOfMoves);\n \n if (playGame == false) {\n \n playGame = true;\n images.array.sort(Shuffle);\n \n for(var i = 0; i < images.array.length - 1; i++){\n $(\".card:first-child\").clone().appendTo(\"#board\");\n }\n\n board.children().each(function(index) {\n $(this).css({\"left\" : ($(this).width() + 20) * (index % 6),\n \"top\" : ($(this).height() + 20) * Math.floor(index / 6)});\n \n faceValue = images.array.pop();\n $(this).find(\".back\").addClass(faceValue);\n $(this).attr(\"data-pattern\",faceValue);\n $(this).click(SelectCard);\n });\t\t\t\t\t\t\t\t\t\t\t \n }\t\t\t \n }", "function setUpDraw(deckId) {\n $.getJSON(`https://deckofcardsapi.com/api/deck/${deckId}/draw/?count=4`, function(data) {\n console.log('data: ', data)\n // put first two cards in player array\n let hand1 = data.cards.slice(0, 2)\n let hand2 = data.cards.slice(2, 4)\n setUpHand(cardsPlayer1, hand1, 'p1')\n setUpHand(cardsPlayer2, hand2, 'p2')\n })\n $(\"#p1-draw\").click(function() {\n //draw player one\n player1Draw(deckId)\n })\n $(\"#p2-draw\").click(function() {\n player2Draw(deckId)\n })\n\n}", "drawCards() {\n let g = this,\n cxt = g.context,\n cards = window._main.cards;\n for (let card of cards) {\n card.draw(cxt);\n }\n }", "function distributeNewCards()\n {\n if (Game.lastTimedEvent === 0)\n {\n Game.lastTimedEvent = Game.frameCounter;\n }\n\n if (Game.frameCounter === Game.lastTimedEvent + 60)\n {\n for (let i = 0; i < Game.userHand.cards.length; i++)\n {\n Game.userHand.cards[i].selected = false;\n }\n\n drawNormalHand();\n Game.counter++;\n }\n }", "startGame () {\n this.setState({ gamestarted: true });\n this.drawCards('player');\n setTimeout(() => {\n this.drawCards('dealer');\n setTimeout(() => {\n this.drawCards('player');\n setTimeout(() => {\n this.drawCards('dealer');\n }, 1200);\n }, 1200);\n }, 1200);\n }", "function compDraw() {\n compHand.push(getCard());\n compHand.push(getCard());\n compScore = getCompScore();\n while (compScore < 15) {\n compHand.push(getCard());\n compScore = getCompScore();\n }\n updatePage();\n compareScore();\n updatePage();\n}", "function createPokerEvents()\n {\n // canvasObjs[0] (Menu button) is still there so start from 1\n\n // PLAY chip\n canvasObjs[1] = new CanvasObject(75, DEFAULT_CANVAS_SIZE - 75, 0, 0, CHIP_RADIUS);\n canvasObjs[1].clickCallback = function()\n {\n Game.counter++;\n }\n canvasObjs[1].hoverCallback = function()\n {\n if (Game.handValue > 0)\n {\n drawChip(75, DEFAULT_CANVAS_SIZE - 75, 'DISCARD', '#0000AA');\n }\n else\n {\n drawChip(75, DEFAULT_CANVAS_SIZE - 75, 'PLAY', '#0000AA');\n }\n }\n canvasObjs[2] = new CanvasObject(100, 150, 75, 150);\n canvasObjs[2].clickCallback = function()\n {\n let card = Game.userHand.cards[0];\n if (card.selected)\n {\n Game.handValue--;\n card.selected = false;\n } \n else if (Game.handValue < 4)\n {\n Game.handValue++;\n card.selected = true;\n }\n\n if (Game.RGBTitleScreen.mobile) canvasObjs[2].isHovered = false;\n }\n canvasObjs[2].hoverCallback = function()\n {\n drawHandWithHover(0);\n }\n canvasObjs[3] = new CanvasObject(175, 150, 75, 150);\n canvasObjs[3].clickCallback = function()\n {\n let card = Game.userHand.cards[1];\n if (card.selected)\n {\n Game.handValue--;\n card.selected = false;\n } \n else if (Game.handValue < 4)\n {\n Game.handValue++;\n card.selected = true;\n }\n\n if (Game.RGBTitleScreen.mobile) canvasObjs[3].isHovered = false;\n }\n canvasObjs[3].hoverCallback = function()\n {\n drawHandWithHover(1);\n }\n canvasObjs[4] = new CanvasObject(250, 150, 75, 150);\n canvasObjs[4].clickCallback = function()\n {\n let card = Game.userHand.cards[2];\n if (card.selected)\n {\n Game.handValue--;\n card.selected = false;\n } \n else if (Game.handValue < 4)\n {\n Game.handValue++;\n card.selected = true;\n }\n\n if (Game.RGBTitleScreen.mobile) canvasObjs[4].isHovered = false;\n }\n canvasObjs[4].hoverCallback = function()\n {\n drawHandWithHover(2);\n }\n canvasObjs[5] = new CanvasObject(325, 150, 75, 150);\n canvasObjs[5].clickCallback = function()\n {\n let card = Game.userHand.cards[3];\n if (card.selected)\n {\n Game.handValue--;\n card.selected = false;\n } \n else if (Game.handValue < 4)\n {\n Game.handValue++;\n card.selected = true;\n }\n\n if (Game.RGBTitleScreen.mobile) canvasObjs[5].isHovered = false;\n }\n canvasObjs[5].hoverCallback = function()\n {\n drawHandWithHover(3);\n }\n canvasObjs[6] = new CanvasObject(400, 150, 100, 150);\n canvasObjs[6].clickCallback = function()\n {\n let card = Game.userHand.cards[4];\n if (card.selected)\n {\n Game.handValue--;\n card.selected = false;\n } \n else if (Game.handValue < 4)\n {\n Game.handValue++;\n card.selected = true;\n }\n\n if (Game.RGBTitleScreen.mobile) canvasObjs[6].isHovered = false;\n }\n canvasObjs[6].hoverCallback = function()\n {\n drawHandWithHover(4);\n }\n }", "function startGame() {\n\n\t// Duplication of the array.\n\tconst dubCards = card.slice();\n\tconst cards = card.concat(dubCards);\n\n\tcards.sort(() => 0.5 - Math.random());\n\n\tcreateCards(cards);\n\n\tconst cardsDiv = document.querySelectorAll('.card');\n\tcardsDiv.forEach(card => card.addEventListener('click', flipCard));\n\n}", "drawPlayerCards(recreateEvents = true) {\n const player1CardWeapon = document.querySelector('#player-cards #player1 .weapon');\n const player2CardWeapon = document.querySelector('#player-cards #player2 .weapon');\n const player1Image = document.querySelector('#player-cards #player1 .player-logo');\n const player2Image = document.querySelector('#player-cards #player2 .player-logo');\n const buttonAttaquerPlayer1 = document.querySelector('#player-cards #player1 #player1-attaquer');\n const buttonDefendrePlayer1 = document.querySelector('#player-cards #player1 #player1-defendre');\n const buttonAttaquerPlayer2 = document.querySelector('#player-cards #player2 #player2-attaquer');\n const buttonDefendrePlayer2 = document.querySelector('#player-cards #player2 #player2-defendre');\n\n\n player1Image.setAttribute('src', this.players[0].image)\n player2Image.setAttribute('src', this.players[1].image)\n\n player1CardWeapon.innerHTML = `\n <img src=\"${this.players[0].weapon.image}\" width=\"100\"/>\n Degat: ${this.players[0].weapon.degat} / Points: ${this.players[0].points <= 0 ? 0 : this.players[0].points}\n `\n\n player2CardWeapon.innerHTML = `\n <img src=\"${this.players[1].weapon.image}\" width=\"100\"/>\n Degat: ${this.players[1].weapon.degat} / Points: ${this.players[1].points <= 0 ? 0 : this.players[1].points} \n `\n\n if (this.combat && recreateEvents) {\n\n this.tourParTour()\n\n /* On rend actif nos boutons en ajoutant un évènement click */\n\n buttonAttaquerPlayer1.addEventListener('click', () => {\n this.joueurAttaquer(this.players[0], this.players[1])\n })\n\n buttonDefendrePlayer1.addEventListener('click', () => {\n this.joueurDefendre(this.players[0], this.players[1])\n })\n\n buttonAttaquerPlayer2.addEventListener('click', () => {\n this.joueurAttaquer(this.players[1], this.players[0])\n })\n\n buttonDefendrePlayer2.addEventListener('click', () => {\n this.joueurDefendre(this.players[1], this.players[0])\n })\n\n }\n }", "function startGame() {\n createButtons();\n const cards = createCardsArray();\n appendCardsToDom(cards);\n}", "function Card1click(){\n console.log(\"card 1 clickt\");\n if(currentplayer)\n setcardstate(0, 0, 1);\n else\n setcardstate(0, 0, 2);\n}", "draw() {\n const cards = document.querySelectorAll(\".memory-card\");\n let backs = document.getElementsByClassName(\"back-face\");\n for (let i = 0; i < cards.length; i++) {\n let card = this.deck.getCardByIndex(i);\n card.setElement(cards[i]);\n backs[i].src = this.deck.getCardByIndex(i).image;\n }\n let that = this;\n this.deck.cards.forEach((card) =>\n card.element.addEventListener(\"click\", function (e) {\n that.evalClick(this);\n })\n );\n }", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function drawCard()\n{\n\tif (alreadyDrawn.length == cards.cards.length) {\n\t\talreadyDrawn = [];\n\t}\n\tvar random = Math.floor(Math.random() * cards.cards.length);\n\twhile (alreadyDrawn.includes(random)) {\n\t\trandom = Math.floor(Math.random() * cards.cards.length);\n\t}\n\trenderCard(cards.cards[random]);\n\talreadyDrawn.push(random);\n}", "function startGame() {\n shuffle(cardIcons);\n for(let i = 0; i < cardIcons.length; i++) {\n const card = document.createElement(\"li\");\n card.classList.add(\"card\");\n card.innerHTML = `<i class=\"${cardIcons[i]}\"></i>`;\n deckOfCards.appendChild(card);\n click(card);\n }\n }", "function startGame() {\n noGameCards();\n createCardLayout(app.gameCards);\n let cards = shuffleArray(app.cardArray);\n\n cards.forEach(element => {\n app.game.appendChild(element);\n });\n}", "function createCard(context, elem, randomColor, randomShape, randomNum) { \n \n // Declare a variable that temporarily stores the properties of the new play card\n let cardResults = [randomColor, randomShape, randomNum];\n\n // If the play card properties are not prespecified, draw them randomly by drawing random numbers\n if(randomColor == null && randomShape == null && randomNum == null){\n do{\n randomColor = randomNumber(0, 3);\n randomShape = randomNumber(0, 3);\n randomNum = randomNumber(0, 3);\n\n cardResults = [randomColor, randomShape, randomNum];\n }\n // Keep doing this for as long as the properties of this new card match the properties of the previous card or one of the key cards\n while(compareArrays(cardResults,result) == true || compareArrays(cardResults,cardOne) == true || compareArrays(cardResults,cardTwo) == true || compareArrays(cardResults,cardThree) == true || compareArrays(cardResults,cardFour) == true);;\n }\n\n // Translate the numbers in the matching color, shape, number from the allCards array\n let color = allCards[0][randomColor];\n let shape = allCards[1][randomShape];\n let number = allCards[2][randomNum];\n \n // Draw a blank card\n drawCard(context, elem, 0, 0, \"white\")\n \n // Draw the shape that is chosen, in the chosen quantity\n // First check shape, than number\n context.beginPath();\n switch (shape) {\n case \"circle\":\n switch (number) {\n case 1:\n drawCircle(context, elem, 50,50,15);\n break;\n case 2:\n drawCircle(context, elem, 50,25,15);\n drawCircle(context, elem, 50,70,15);\n break;\n case 3:\n drawCircle(context, elem, 75,25,15);\n drawCircle(context, elem, 50,50,15);\n drawCircle(context, elem, 25,75,15);\n break;\n case 4:\n drawCircle(context, elem, 25,20,15);\n drawCircle(context, elem, 25,80,15);\n drawCircle(context, elem, 75,80,15);\n drawCircle(context, elem, 75,20,15);\n break;\n } \n break;\n \n case \"square\":\n switch (number) {\n case 1:\n drawSquare(context, elem, 36,38,26,23);\n break;\n case 2:\n drawSquare(context, elem, 36,15,26,23);\n drawSquare(context, elem, 36,65,26,23);\n break;\n case 3:\n drawSquare(context, elem, 65,10,26,23);\n drawSquare(context, elem, 36,40,26,23);\n drawSquare(context, elem, 10,70,26,23);\n break;\n case 4:\n drawSquare(context, elem, 10,10,26,23);\n drawSquare(context, elem, 65,10,26,23);\n drawSquare(context, elem, 10,70,26,23);\n drawSquare(context, elem, 65,70,26,23);\n break;\n } \n break;\n \n case \"triangle\":\n switch (number) {\n case 1:\n drawTriangle(context, elem, 30, 32, 18);\n break;\n case 2:\n drawTriangle(context, elem, 30, 10, 18);\n drawTriangle(context, elem, 30, 60, 18);\n break;\n case 3:\n drawTriangle(context, elem, 60, 8, 18);\n drawTriangle(context, elem, 32, 35, 18);\n drawTriangle(context, elem, 5, 62, 18);\n break;\n case 4:\n drawTriangle(context, elem, 5, 5, 18);\n drawTriangle(context, elem, 58, 5, 18);\n drawTriangle(context, elem, 5, 65, 18);\n drawTriangle(context, elem, 58, 65, 18);\n break;\n }\n break;\n\n case \"heart\":\n switch (number) {\n case 1:\n drawHeart(context, elem, 48, 38, 32, 27)\n break;\n case 2:\n drawHeart(context, elem, 48, 15, 32, 27)\n drawHeart(context, elem, 48, 60, 32, 27)\n break;\n case 3:\n drawHeart(context, elem, 75, 10, 32, 27)\n drawHeart(context, elem, 48, 36, 32, 27)\n drawHeart(context, elem, 25, 65, 32, 27)\n break;\n case 4:\n drawHeart(context, elem, 22, 10, 32, 27)\n drawHeart(context, elem, 75, 10, 32, 27)\n drawHeart(context, elem, 22, 65, 32, 27)\n drawHeart(context, elem, 75, 65, 32, 27)\n break;\n }\n break;\n }\n \n // Fill the drawing with the prespecified color\n context.closePath();\n context.fillStyle = color;\n context.fill();\n \n // Store the properties of the new play card in the results variable\n result = cardResults;\n}", "function startGame(){\n\t\t\t\t\n\t\t\t\tuiTimer.html(\"0 seconds\");\n\t\t\t\tuiPlayerScore.html(\"\");\n\t\t\t\tuiGameInfo.show();\n\t\t\t\tuiGamerestart.show();\n\t\t\t\tuiLogo.show();\n\t\t\t\tuiCards.show();\n\t\t\t\t\n\t\t\t\tgametimer = 0;\n\t\t\t\tpalyerscore=0;\n\t\t\t\tcardsmatched = 0;\n\t\t\t \t\n\t\t\t\tif (playGame == false) {\n\t\t\t \t\t\tplayGame = true;\n\t\t\t\t\t\tmatchingGame.deck.sort(shuffle);\n\t\t\t\t\t\tfor(var i=0;i<15;i++){\n\t\t\t\t\t\t\t\t$(\".card:first-child\").clone().appendTo(\"#cards\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// initialize each card's position\n\t\t\t\t\t\t\tuiCards.children().each(function(index) {\n\t\t\t\t\t\t\t\t// align the cards to be 4x4 ourselves.\n\t\t\t\t\t\t\t\t$(this).css({\n\t\t\t\t\t\t\t\t\t\"left\" : ($(this).width() + 10) * (index % 4),\n\t\t\t\t\t\t\t\t\t\"top\" : ($(this).height() + 10) * Math.floor(index / 4)\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// get a pattern from the shuffled deck\n\t\t\t\t\t\t\t\tvar pattern = matchingGame.deck.pop();\n\t\t\t\t\t\t\t\t// visually apply the pattern on the card's back side.\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(pattern==\"color1\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[0]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(pattern==\"color2\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[1]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(pattern==\"color3\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[2]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(pattern==\"color4\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[3]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(pattern==\"color5\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[4]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tif(pattern==\"color6\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[5]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(pattern==\"color7\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[6]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(pattern==\"color8\"){\n\t\t\t\t\t\t\t\t$(this).find(\".back\").addClass(pattern).css({\"background-color\":\"\"+cardcolor[7]+\"\"});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t// embed the pattern data into the DOM element.\n\t\t\t\t\t\t\t\t$(this).attr(\"data-pattern\",pattern);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\t\n\t\t\n\t\t\tvar cards = document.getElementById(\"cards\").getElementsByClassName(\"card\");\n\t\t\t//default select first card\n\t\t\t$(cards[0]).addClass(\"active\");\t\t\t\t\t\n\t\t\t\t \ttimer();\n\t\t\t\t};\t\t\t \n\t\t\t }", "function startGame() {\n for (let card of cards) {\n card.className = \"card\";\n card.isClicked = 0;\n }\n openCards = [];\n shuffleDeck(cards);\n resetCounter();\n updateStars(stars, 3);\n stopTimer();\n updateTimer(0);\n closePopup();\n}", "start() {\n this.deck.shuffle();\n this.draw();\n this.matched = [];\n this.clicked = [];\n this.updateTurns(true);\n }", "function takeCards()\n {\n if (state.turnedCard)\n {\n state.turnedCard.turn(true);\n }\n\n showMenuId = cards[0].addEventListener(\"move\", showMenu);\n\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \"PX\", height: sizes.desk.height + \"PX\"}, true);\n }\n }", "function gameStart(){\n shuffleCards ();\n for (let i = 0; i < 16; i++) {\n let cards = document.createElement('li');\n cards.classList.add('card');\n\n// Declare the variable to create the symbols within the card, and create the card to be used\n let symbolList = document.createElement('i');\n symbolList.classList.add('fa');\n symbolList.classList.add(symbols[i]);\n\n listofCards.appendChild(symbolList);\n\n // move the card to the deck to be showed to the user\n cards.appendChild(symbolList);\n\t\tdocument.getElementById('deck').appendChild(cards);\n\n // the selecting of each card by a click\n select(cards);\n }\n}", "draw () {\n\t\t\n\t\tthis._size_elements ()\n\n\t\tvar i = 0\n\t\tthis._figures.forEach (f => {\n\t\t\t\n\t\t\t// Draw non playable cards\n\t\t\tvar card = this._deck_blue [f]\n\t\t\tvar [x, y] = this.get_slot_coo (i, 2.5)\n\t\t\tif (card.slot >= 0) {\n\t\t\t\t[x, y] = this.get_slot_coo (card.slot, 1)\n\t\t\t}\n\t\t\tcard.set_pos_size (x, y)\n\t\t\tcard.draw ()\n\t\t\t\n\t\t\t// Draw playable cards\n\t\t\tvar card = this._deck_red [f]\n\t\t\tvar [x, y] = this.get_slot_coo (i, -1.5)\n\t\t\tif (card.slot >= 0) {\n\t\t\t\t[x, y] = this.get_slot_coo (card.slot, 0)\n\t\t\t}\n\t\t\tcard.set_pos_size (x, y)\n\t\t\tcard.draw ()\n\n\t\t\t// Draw help text of car is highlighted\n\t\t\tif (card.is_highlighted ()) {\n\t\t\t\tvar key = `help_${f}`\n\t\t\t\tvar font_size = this.context.canvas.width / 50\n\t\t\t\tvar [x, y] = this.get_slot_coo (0, 1.75)\n\t\t\t\tthis._draw_banner (this._language [key], \"rgba(0, 0, 0, 0.6)\", y, font_size)\n\t\t\t}\n\t\t\t\n\t\t\ti += 1\n\t\t})\n\n\t\tthis._draw_scores ()\n\t\t\t\t\n\t\t// Draw winner banner\n\t\tif (this._winner != -1) {\n\t\t\t\n\t\t\tvar [x, y] = this.get_slot_coo (0, 1.75)\n\n\t\t\tif (this._winner == this._swap_color)\n\t\t\t\tthis._draw_banner (this._language.red_wins, \"rgba(200, 0, 0, 0.6)\", y, -1)\n\n\t\t\telse if (this._winner == (1-this._swap_color))\n\t\t\t\tthis._draw_banner (this._language.blue_wins, \"rgba(0, 0, 200, 0.6)\", y, -1)\n\t\t\t\n\t\t\telse if (this._winner == 2)\n\t\t\t\tthis._draw_banner (this._language.drawn, \"rgba(200, 200, 200, 0.6)\", y, -1)\n\t\t}\n\t}", "function start () {\n\n if(startGame === 0){\n startTimer()\n startGame++\n }\n\n let mainEvent = $(this).parent().attr('id')\n firstSecondparents.push(mainEvent)\n\n let sibling = $(this).siblings().attr('id')\n firstSecondPickId.push(sibling)\n\n let siblingInfo = document.getElementById(sibling).childNodes[0].innerHTML\n\n count++\n\n if (count === 1) {\n //pushes the sibling class name of the clicked element in an array\n let changeClasses = document.getElementById(mainEvent)\n changeClasses.setAttribute('class', 'styleColWrapperFlip')\n let siblingFirstInfo = document.getElementById(sibling).childNodes[0].className\n firstSecondPick.push(siblingFirstInfo)\n\n }\n else if (count === 2) {\n /* pushes the sibling class name of the \n * clicked element in an array and checks if the element in the array are equal\n */\n let siblingSecondInfo = document.getElementById(sibling).childNodes[0].className\n firstSecondPick.push(siblingSecondInfo)\n\n let secondElement = firstSecondPick.pop()\n let booleanResult = firstSecondPick.includes(secondElement)\n\n if(!booleanResult){\n numberofClicks++\n \n if(numberofClickedCards.length === 0){\n numberofClickedCards.push(secondElement)\n numberofClickedCards.push(firstSecondPick[0])\n }\n else{\n \n if(numberofClickedCards.includes(secondElement) || numberofClickedCards.includes(firstSecondPick[0]))\n {\n numberofClickedSecondCards.push(secondElement)\n numberofClickedSecondCards.push(firstSecondPick[0])\n }\n else{ \n numberofClickedCards.push(secondElement)\n numberofClickedCards.push(firstSecondPick[0])\n }\n }\n\n }\n if(booleanResult){\n numberOfMoves++\n\n }else{\n if(numberofClickedSecondCards.includes(secondElement) || numberofClickedSecondCards.includes(firstSecondPick[0])){\n\n }else{\n\n numberOfMoves++\n }\n\n }\n\n \n /*checks if the number of times you open a card , either wrong or right and ahows the stars \n * stars are determined based on if the number of open cards fall in those ranges below\n */\n if(numberofClicks <= 12){\n numberOfStars = 3\n }\n else if(numberofClicks <= 22){\n document.getElementById('full-rating1').style.display='none'\n document.getElementById('star1').style.display=''\n numberOfStars = 2\n }\n else if(numberofClicks >= 28){\n document.getElementById('full-rating1').style.display='none'\n document.getElementById('full-rating2').style.display='none'\n document.getElementById('star1').style.display=''\n document.getElementById('star2').style.display=''\n numberOfStars = 1\n }\n document.getElementById(\"move\").innerHTML = numberOfMoves\n\n if (booleanResult) {\n\n firstSecondPickId.forEach(theId => {\n document.getElementById(`${theId}`).style.background = 'linear-gradient(#506d71, #e86722, #8b5338)'\n })\n\n firstSecondparents.forEach(theParents => {\n let changeParentClasses = document.getElementById(theParents)\n changeParentClasses.setAttribute('class', 'styleColWrapperFlip')\n })\n\n while (firstSecondPickId.length > 0 || firstSecondPick > 0 || firstSecondparents > 0) {\n firstSecondPickId.pop()\n firstSecondPick.pop()\n firstSecondparents.pop()\n }\n count = 0\n numberOfOpenCards++\n \n /* checks the the number of open cards equals 8 \n * and call the function that ends the game \n */\n if( maxNumberOfOpenCards === numberOfOpenCards ){\n \n endOfGame()\n completeGame()\n numberofClickedCards = []\n numberofClickedSecondCards = []\n numberofClicks = 0 \n }\n }\n else {\n\n let changeSecondParent = document.getElementById(firstSecondparents[1])\n changeSecondParent.setAttribute('class', 'styleColWrapperFlipError')\n\n firstSecondPickId.forEach(theId => {\n document.getElementById(`${theId}`).style.background = 'linear-gradient(red, grey)'\n let animatedMove = document.getElementById(`${theId}`)\n\n })\n\n function timer() {\n \n setTimeout(function () {\n let changeSecondParentFlip = document.getElementById(firstSecondparents[1])\n changeSecondParentFlip.setAttribute('class', 'styleColWrapperFlip2')\n\n let changeFirstParent = document.getElementById(firstSecondparents[0])\n changeFirstParent.setAttribute('class', 'styleColWrapperFlip2')\n\n while (firstSecondPickId.length > 0 || firstSecondPick > 0 || firstSecondparents > 0 ) {\n firstSecondPickId.pop()\n firstSecondPick.pop()\n firstSecondparents.pop()\n }\n },\n 20)\n }\n\n timer()\n\n count = 0\n }\n }\n}", "function startGame() {\n generateCards();\n addStars();\n $('#moves').html('0');\n $('.card').click(cardToggle);\n}", "function drawCard() {\n var card = draw.pop();\n if (card) {\n discard.push(card);\n showCard(card);\n } else {\n shuffleCards();\n drawCard();\n }\n }", "function readyCards() {\n // When the begin button is pressed, the board is revealed.\n for (let i = 0; i <= 4; i++) {\n // The cards are spread out onto the board. To create a second row, a wrap will occur.\n }\n}", "function initGame() {\n startTimer();\n $(\".card\").on(\"click\", function (evt){\n /** asks if there is already one upturned card\n * display the card's symbol\n * (put this functionality in another function that you call from this one) */\n const hasClassShow = ($(listOfCards).hasClass(\"show\"));\n const hasTwoCardsOrMore = (listOfCards.length >= 2);\n const stopTurn = console.log('cards stop turning on click');\n hasClassShow ? (hasTwoCardsOrMore ? stopTurn : (showCard(this), cardMatch(listOfCards))): showCard(this);\n });\n}", "function refresh(){\n\t\tpoker._firstCard = firstCard.number; \n\t\tpoker._secondCard = secondCard.number; \n\t\tpoker._thirdCard = thirdCard.number; \n\t\tpoker._fourthCard = fourthCard.number; \n\t\tpoker._fifthCard = fifthCard.number; \n\t\t\n\t\tctx = Canvas[0].getContext(\"2d\");\n\t\tvar canCardWidth = Canvas.width()/5;\n\t\tvar cardImgWidth = cardImg.width/13;\n\t\tvar cardImgHeight = cardImg.height/4;\n\t\t\n\t\t\n\t\tctx.drawImage(cardImg,firstCard.x*cardImgWidth,firstCard.y*cardImgHeight,cardImgWidth,cardImgHeight,0*canCardWidth,0,canCardWidth,Canvas.height());\n\t\tctx.drawImage(cardImg,secondCard.x*cardImgWidth,secondCard.y*cardImgHeight,cardImgWidth,cardImgHeight,1*canCardWidth,0,canCardWidth,Canvas.height());\n\t\tctx.drawImage(cardImg,thirdCard.x*cardImgWidth,thirdCard.y*cardImgHeight,cardImgWidth,cardImgHeight,2*canCardWidth,0,canCardWidth,Canvas.height());\n\t\tctx.drawImage(cardImg,fourthCard.x*cardImgWidth,fourthCard.y*cardImgHeight,cardImgWidth,cardImgHeight,3*canCardWidth,0,canCardWidth,Canvas.height());\n\t\tctx.drawImage(cardImg,fifthCard.x*cardImgWidth,fifthCard.y*cardImgHeight,cardImgWidth,cardImgHeight,4*canCardWidth,0,canCardWidth,Canvas.height());\n\t\tif(draw == 0){\n\t\t\tisWinner();\n\t\t\tpayout();\n\t\t\tflashText(Winner);\n\t\t\t$(\"#commandbutton_2\").on(\"click\",commandButtonHandle).removeClass(\"disabled\");\n\t\t\t$(\"#commandbutton_3\").on(\"click\",commandButtonHandle).removeClass(\"disabled\");\n\t\t\t$(\"#commandbutton_4\").on(\"click\",commandButtonHandle).removeClass(\"disabled\");\n\t\t}\n\t\t\n\t}", "function addCardsToPlayerAfterHit(shuffledCards) {\n addCardsToPlayer(shuffledCards, 1);\n addPlayerCardsToPlayerArea();\n\n}", "function startGame(){\n\n // create the grid array\n gridCardsArray = createGrid();\n\n // start cards with objects IDs and Icon values\n initCards();\n\n}", "function init() {\n canvas = $(\"#board\").get(0);\n ctx = canvas.getContext(\"2d\");\n boardDiv = $(\"#div_game\");\n\n for (let color of [cRed, cGreen, cPurple]) {\n for (let shape of [sDiamond, sWave, sOval]) {\n for (let fill of [fEmpty, fPartial, fSolid]) {\n for (let count of [1, 2, 3]) {\n //console.log(count + \" \" + color + \" \" + fill + \" \" + shape);\n board.deck.push({color: color, shape: shape, fill: fill, count: count});\n }\n }\n }\n }\n shuffle(board.deck);\n\n while (board.inPlayMain.length < 12) {\n board.inPlayMain.push(board.deck.pop());\n console.log(\"Board now has \" + board.inPlayMain.length + \" inPlayMain\");\n }\n\n if (!isSetAvailable()) {\n needExtraCards();\n }\n\n resizedWindow();\n drawBoard();\n\n //canvas.onclick = clickedBoard;\n}", "draw(){\n\t\tvar communityNewHand = this.state.communityCards;\n\t\tif (communityNewHand[0] === 'deck2'){\n\t\t\t// start over and push 3 cards off the top of the deck onto the array\n\t\t\tcommunityNewHand = [cards.deck.shift(),cards.deck.shift(),cards.deck.shift()]\t\t\n\t\t}else{\n\t\t\t// push\n\t\t\tcommunityNewHand.push(cards.deck.shift());\n\t\t}\n\t\tthis.setState({\n\t\t\tcommunityCards: communityNewHand\n\t\t})\n\t}", "function drawOnDeck() {\n\t\tclearDeck()\n\t\tvar onDeckCanvas = document.getElementsByClassName(\"tetron-next-piece\")[0]\n\t\tvar ctx = onDeckCanvas.getContext(\"2d\");\n\t\tpieceOnDeck.draw(ctx, 2)\n\n\t}", "function reStartGame(){\n\t\t\t\t\n\t\t\t\tplayGame = false;\n\t\t\t\tuiCards.html(\"<div class='card'><div class='face front'></div><div class='face back'></div></div>\");\n\t\t\t\tclearTimeout(scoreTimeout);\n\t\t\t\tmatchingGame.deck = ['color1', 'color1','color2', 'color2','color3', 'color3','color4', 'color4','color5', 'color5','color6', 'color6',\n\t\t\t\t'color7', 'color7','color8', 'color8']\t\t\t\n\t\t\t\tstartGame();\n\n}", "function gameRound1() {\r\n if (this.id == \"btnRed\") {\r\n if (activePlayerCount < playerCount) {\r\n showingCard();\r\n checkRed();\r\n deleteCard();\r\n nextPlayer();\r\n } else if (activePlayerCount == playerCount) {\r\n showingCard();\r\n checkRed();\r\n deleteCard();\r\n nextPlayerRound();\r\n round1.style.display = \"none\";\r\n round2.style.display = \"block\";\r\n }\r\n }\r\n\r\n if (this.id == \"btnBlack\") {\r\n if (activePlayerCount < playerCount) {\r\n showingCard();\r\n checkBlack();\r\n deleteCard();\r\n nextPlayer();\r\n } else if (activePlayerCount == playerCount) {\r\n showingCard();\r\n checkBlack();\r\n deleteCard();\r\n nextPlayerRound();\r\n round1.style.display = \"none\";\r\n round2.style.display = \"block\";\r\n }\r\n }\r\n}", "function showPlayerCardHit(source) {\n for (let i = 0; i < 1; i++) {\n const cardToShow = cardsDealtPlayer[i];\n const $newCard = $(\"<div></div>\");\n $(\"#player-jumbotron\").append(`<img class=\"playerCard\" src=${cardsDealtPlayer[cardsDealtPlayer.length - 1].cardImageSource}>`);\n }\n }", "function player2TurnNext(){\n deck1.style.display = \"none\";\n deck2.style.display = \"inline-flex\";\n deck2.id = \"cardsrightnew\";\n\n twoCard1.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n twoCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n twoCard2.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n twoCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n twoCard3.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n twoCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n twoCard4.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n twoCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinner();\n });\n twoCard5.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n twoCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n}", "function player1TurnNext(){\n deck2.style.display = \"none\";\n deck1.style.display = \"inline-flex\";\n deck1.id = \"cardsleftnew\";\n\n oneCard1.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n oneCard2.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n oneCard3.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n oneCard4.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinner();\n });\n oneCard5.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n}", "function startGame() {\n let list = [...Array(imageList.length).keys()];\n list = list.concat(list);\n shuffleList(list);\n\n // first half\n for (let i = 0; i < list.length / 2; i++) {\n let card = createCard(list[i]);\n cardList.appendChild(card);\n }\n\n // add score keeper\n let score = document.createElement('div');\n score.setAttribute('id', 'score');\n score.value = 0;\n score.innerHTML = `${score.value}`;\n cardList.appendChild(score);\n\n // second half\n for (let i = list.length / 2; i < list.length; i++) {\n let card = createCard(list[i]);\n cardList.appendChild(card);\n }\n}", "function player2Turn2(){\n deck2.style.display = \"inline-flex\";\n deck2.id = \"cardsrightnew\";\n\n //sets up the cards in the player's hand\n setPlayerCard();\n twoCard1.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard2.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard3.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard4.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard5.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n //if user clicks on the card, replace the card with a new one\n //once player one has chosen their card, the winner will be selected \n twoCard1.addEventListener(\"click\", function(e){\n e.preventDefault();\n setPlayerCard();\n twoCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n selWinner();\n });\n twoCard2.addEventListener(\"click\", function(e){\n e.preventDefault();\n setPlayerCard();\n twoCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n selWinner();\n });\n twoCard3.addEventListener(\"click\", function(e){\n e.preventDefault();\n setPlayerCard();\n twoCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n selWinner();\n });\n twoCard4.addEventListener(\"click\", function(e){\n e.preventDefault();\n setPlayerCard();\n twoCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n selWinner();\n });\n twoCard5.addEventListener(\"click\", function(e){\n e.preventDefault();\n setPlayerCard();\n twoCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n selWinner();\n });\n}", "function startGame(deckInfo) {\n\tdeckID = deckInfo.deck_id;\n\tdrawCard('https://deckofcardsapi.com/api/deck/' + deckID + '/draw/?count=1');\n}", "function startGame() {\n intro.style.display = \"none\";\n heading.style.display = \"block\";\n cards.style.display = \"grid\";\n\n generateCards();\n}", "function FirstToPlay() {\n document.getElementById(\"playerBottomImg\").style.borderColor = cardRed;\n document.getElementById(\"playerLeftImg\").style.borderColor = cardGreen;\n document.getElementById(\"playerTopImg\").style.borderColor = cardYellow;\n document.getElementById(\"playerRightImg\").style.borderColor = cardBlue;\n document.getElementById(\"playerTopScore\").style.opacity = 1;\n document.getElementById(\"playerLeftScore\").style.opacity = 1;\n document.getElementById(\"playerRightScore\").style.opacity = 1;\n document.getElementById(\"playerBottomScore\").style.opacity = 1;\n document.getElementById(\"layer\").open = true;\n var c1 = document.getElementById(\"player1-slot0\");\n var c2 = document.getElementById(\"player2-slot0\");\n var c3 = document.getElementById(\"player3-slot0\");\n var c4 = document.getElementById(\"player4-slot0\");\n var draw = false;\n do {\n RenderizeCard(c1); RenderizeCard(c2); RenderizeCard(c3); RenderizeCard(c4);\n setTimeout(function () {\n c2.style.backgroundImage = GetImage(c2.style.backgroundColor, c2.innerHTML);\n c3.style.backgroundImage = GetImage(c3.style.backgroundColor, c3.innerHTML);\n c4.style.backgroundImage = GetImage(c4.style.backgroundColor, c4.innerHTML);\n }, 200)\n var P1Value = GetValueOfCard(c1)\n var P2Value = GetValueOfCard(c2)\n var P3Value = GetValueOfCard(c3)\n var P4Value = GetValueOfCard(c4)\n var name\n\n if (P1Value > P2Value && P1Value > P3Value && P1Value > P4Value) {\n startingPlayer = 1; draw = false; name = player1Name.innerHTML + \" BEGIN!\";\n }\n else if (P2Value > P1Value && P2Value > P3Value && P2Value > P4Value) {\n startingPlayer = 2; draw = false; name = player2Name.innerHTML + \" BEGINS!\";\n }\n else if (P3Value > P1Value && P3Value > P2Value && P3Value > P4Value) {\n startingPlayer = 3; draw = false; name = player3Name.innerHTML + \" BEGINS!\";\n }\n else if (P4Value > P1Value && P4Value > P2Value && P4Value > P3Value) {\n startingPlayer = 4; draw = false; name = player4Name.innerHTML + \" BEGINS!\";\n }\n else { draw = true }\n\n setTimeout(function () { ShowLabel(name.toUpperCase()) }, 1000)\n\n }\n while (draw === true);\n }", "startGame() {\n if (this.#gameStarted) {\n throw new Error(\"Game was already started\");\n }\n this.#gameStarted = true;\n \n let firstCard = this.drawNewCard(); // player's\n let secondCard = this.drawNewCard(); // dealer's (face down)\n let thirdCard = this.drawNewCard(); // player's\n let fourthCard = this.drawNewCard(); // dealer's\n \n this.#playerCards.push(firstCard,thirdCard);\n this.#dealerCards.push(secondCard, fourthCard);\n\n this.updateDealerPoints();\n this.updatePlayerPoints();\n \n if (this.#playerHigh === 21) {\n this.#playerTurnsOver = true;\n this.#gotBlackjack = true;\n this.dealerFinish();\n }\n return [firstCard, thirdCard];\n }", "function setupNewGame() {\n var divAllCards = document.getElementsByClassName(\"allCards\")[0];\n var divCard, imgCard, divCounter, textCounter;\n for (var i = 0; i < gifs.length; i++) {\n divCard = document.createElement(\"div\");\n imgCard = document.createElement(\"img\");\n divCard.className = \"card\";\n imgCard.className = \"cardImg\";\n imgCard.id = \"card\" + i;\n imgCard.src = backOfCard;\n imgCard.setAttribute(\"data-matched\", false);\n imgCard.addEventListener(\"click\", cardClick);\n divCard.appendChild(imgCard);\n divAllCards.appendChild(divCard);\n }\n // add the counter in the middle\n var allCards = document.getElementsByClassName(\"card\");\n divCounter = document.createElement(\"div\");\n divCounter.className = \"counter\";\n textCounter = document.createTextNode(totalCardsShown);\n divCounter.appendChild(textCounter);\n divAllCards.insertBefore(divCounter, allCards[numOfUniqueCards]);\n}", "function player1Turn(){\n deck2.style.display = \"none\";\n deck1.style.display = \"inline-flex\";\n deck1.id = \"cardsleftnew\";\n\n oneCard1.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n setTimeout(function(){player2TurnNext();}, 2000);\n });\n oneCard2.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n setTimeout(function(){player2TurnNext();}, 2000);\n });\n oneCard3.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n setTimeout(function(){player2TurnNext();}, 2000);\n });\n oneCard4.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n setTimeout(function(){player2TurnNext();}, 2000);\n });\n oneCard5.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n setTimeout(function(){player2TurnNext();}, 2000);\n });\n}", "startingHand(player) {\n for (let i = 0; i > 7; i++) {\n if (player === true) {\n this.draw(true)\n // playerhand[i]=playerDeck[i];\n // deck.shift();\n // playerDeck.shift();\n\n } else {\n this.draw(false)\n // aihand[i]=aiDeck[i];\n // deck.shift();\n // aiDeck.shift();\n }\n }\n }", "function player2Turn(){\n deck1.style.display = \"none\";\n deck2.style.display = \"inline-flex\";\n deck2.id = \"cardsrightnew\";\n\n twoCard1.addEventListener(\"click\", function(e){\n e.preventDefault();\n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n setTimeout(function(){player1TurnNext();}, 2000);\n });\n twoCard2.addEventListener(\"click\", function(e){\n e.preventDefault();\n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n setTimeout(function(){player1TurnNext();}, 2000);\n });\n twoCard3.addEventListener(\"click\", function(e){\n e.preventDefault();\n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n setTimeout(function(){player1TurnNext();}, 2000);\n });\n twoCard4.addEventListener(\"click\", function(e){\n e.preventDefault();\n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n setTimeout(function(){player1TurnNext();}, 2000);\n });\n twoCard5.addEventListener(\"click\", function(e){\n e.preventDefault();\n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n setTimeout(function(){player1TurnNext();}, 2000);\n });\n}", "function startGame() {\n\n // hide and display cards and buttons accordingly\n\n document.querySelectorAll(\".title\").forEach(title => title.classList.remove(\"title-animated\"));\n\n document.querySelectorAll(\".counter\").forEach(counter => counter.classList.remove(\"hide\"));\n \n startButton.classList.add(\"hide\");\n \n actionButtons.forEach(button => button.classList.remove(\"hide\"));\n\n document.querySelector(\".card-backside-player1\").classList.add(\"hide\");\n document.querySelector(\".player1-card\").classList.remove(\"hide\");\n \n playBirds();\n\n // select random card from cardDeck and assign a card to both players\n \n cardPlayer1 = cards[Math.floor(Math.random() * cards.length)];\n cardPlayer2 = cards[Math.floor(Math.random() * cards.length)];\n\n while (cardPlayer1 === cardPlayer2) {\n cardPlayer2 = cards[Math.floor(Math.random() * cards.length)];\n \n } \n\n // pass card values to both player cards in DOM\n \n document.querySelector(\"#animal-name-player1\").innerHTML = cardPlayer1.name;\n document.querySelector(\"#animal-img-player1\").src = cardPlayer1.image;\n document.querySelector(\"#speed-player1 span\").innerHTML = cardPlayer1.topSpeed;\n document.querySelector(\"#fear-player1\").innerHTML = cardPlayer1.fearFactor;\n document.querySelector(\"#cute-player1\").innerHTML = cardPlayer1.cuteness;\n document.querySelector(\"#life-player1 span\").innerHTML = cardPlayer1.lifeSpan;\n \n document.querySelector(\"#animal-name-player2\").innerHTML = cardPlayer2.name;\n document.querySelector(\"#animal-img-player2\").src = cardPlayer2.image;\n document.querySelector(\"#speed-player2 span\").innerHTML = cardPlayer2.topSpeed;\n document.querySelector(\"#fear-player2\").innerHTML = cardPlayer2.fearFactor;\n document.querySelector(\"#cute-player2\").innerHTML = cardPlayer2.cuteness;\n document.querySelector(\"#life-player2 span\").innerHTML = cardPlayer2.lifeSpan;\n \n\n}", "function drawCards(amountOfCards, playerPressed) {\n\n\t\tconst url = `https://deckofcardsapi.com/api/deck/${deckId}/draw/?count=${amountOfCards}`\n\n\t\tlet player1Hand;\n\t\tlet player2Hand;\n\n\t\tfetch(url)\n\t\t\t.then(res => res.json()) // parse response as JSON\n\t\t\t.then(data => {\n\t\t\t\t// console.log(data.cards[0])\n\n\t\t\t\t// display seperate card based on which player pressed it\n\t\t\t\tif (playerPressed == \"player1\") {\n\t\t\t\t\tdocument.querySelector('#card1').src = data.cards[0].image;\n\t\t\t\t\tplayer1Hand = data.cards[0].value;\n\t\t\t\t\tconsole.log(player1Hand);\n\t\t\t\t} else if (playerPressed == \"player2\") {\n\t\t\t\t\tdocument.querySelector('#card2').src = data.cards[0].image;\n\t\t\t\t\tplayer2Hand = data.cards[0].value;\n\t\t\t\t\tconsole.log(player2Hand);\n\t\t\t\t}\n\n\t\t\t\t// win condition\n\t\t\t\tif (player1Hand == \"JACK\") {\n\t\t\t\t\tdocument.querySelector(\"#win-container\").innerHTML = \"PLAYER 1 WINS\";\n\t\t\t\t} else if(player2Hand == \"JACK\") {\n\t\t\t\t\tdocument.querySelector(\"#win-container\").innerHTML = \"PLAYER 2 WINS\";\n\t\t\t\t}\n\n\t\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tconsole.log(`error ${err}`)\n\t\t\t});\n\n\t}", "function startGame() {\n for (var i = 0; i < letters.length; i++) {\n var div = $('<div>');\n div.attr('id', i);\n div.addClass(\"column\");\n div.appendTo($(\"div#game\"));\n }\n cardClick();\n}", "function setupCard(gameCanvas) {\r\n /*Size of image*/\r\n var height = 465;\r\n var width = 415;\r\n var cord = [], x, y, gridPos;\r\n var i = 0; //Loop counter\r\n \r\n /*Add the card to the canvas*/\r\n card = new imageLib(gameCanvas, width, height, 200, 10);\r\n card.oldPosX = 150;\r\n card.oldPosY = 200;\r\n \r\n /*Save current location on the canvas*/\r\n card.addImg(gameImage.loadedImg[\"card1\"]);\r\n \r\n /*Save all frames*/\r\n card.frameNum = 4;\r\n card.frameCount = 1;\r\n \r\n //var w = [0, 150, 150, 150, 150];\r\n //var h = [0, 150, 150, 150, 150];\r\n \r\n for (i = 1; i <= card.frameNum; i++) {\r\n card.frame[\"card\"+i] = {\r\n image: gameImage.loadedImg[\"card\"+i],\r\n width: width,\r\n height: height\r\n };\r\n }\r\n \r\n // for (i = 1; i <= card.frameNum; i++) {\r\n // card.frame[\"card\"+i] = {\r\n // image: gameImage.loadedImg[\"card\"+i],\r\n // width: w[i],\r\n // height: h[i]\r\n // };\r\n // }\r\n}", "function player1Turn2(){\n deck1.style.display = \"inline-flex\";\n deck1.id = \"cardsleftnew\";\n\n //sets up the cards in the player's hand\n setPlayerCard();\n oneCard1.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard2.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard3.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard4.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard5.src = `images/${gameData.playerCards[randPlay]}`;\n \n //if user clicks on the card, replace the card with a new one\n //once player one has chosen their card, the winner will be selected \n oneCard1.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n selWinner();\n });\n oneCard2.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n selWinner();\n });\n oneCard3.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n selWinner();\n });\n oneCard4.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n selWinner();\n });\n oneCard5.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n selWinner();\n });\n}", "function PlayerTurn() {\n var canPlay = false; document.getElementById(\"layer\").open = true;\n\n if (plus2counter !== 0 && plus4counter === 0) {\n for (x = 0; x < 20; x++) {\n let card = document.getElementById(\"player\" + player + \"-slot\" + x);\n if (IsPlus2(card) || IsPlus4(card)) { canPlay = true; counter = 1; break; }\n }\n }\n else if (plus4counter !== 0) {\n for (x = 0; x < 20; x++) {\n let card = document.getElementById(\"player\" + player + \"-slot\" + x);\n if (IsPlus4(card)) { canPlay = true; counter = 1; break; }\n }\n }\n else { canPlay = true; }\n\n if (canPlay) { if (player === 1) { HighlightPlayableCards(); } else { setTimeout(CPUPlay, 1100) } }\n else {\n setTimeout(function () {\n let numberOfCards = (plus2counter * 2) + (plus4counter * 4);\n DrawCard(numberOfCards); plus4counter = 0; plus2counter = 0; soundDraw.play();\n PlayerAction(player, \"+\" + numberOfCards); CallNextPlayer();\n }, 400)\n }\n }", "function drawCard(player)\n{\n\tconsole.log(\"Drawing a card\");\n\tvar key = Object.keys(player.deck);\n\tconsole.log(\"Num cards in deck \" + key.length);\n\t\n\tfor(var i = 0;i<key.length;i++)\n\t{\n\t\tconsole.log(\"Looping to draw a card \" + i);\n\t\tif(!(JSON.stringify(player.deck[i]) === JSON.stringify({})))\n\t\t{\n\t\t\tconsole.log(\"Card Name: \" + player.deck[i].name);\n\t\t\tplayer.cardsInHand.push(player.deck[i]);\n\t\t\t//player.deck.splice(0,1);\n\t\t\tplayer.deck[i] = {};\n\t\t\tbreak;\n\t\t}\n\t}\n\tupdatePlayer(player);\n\t\n\tvar opp = findOpponent(player, player.socket);\n\tplayer.socket.emit(\"updateCards\", \n\t{\n\t\tplayer: player.cardsInHand,\n\t\topp: Object.keys(opp.cardsInHand).length,\n\t\tdeck: getNumCardsInDeck(player.deck),\n\t\toppDeck: getNumCardsInDeck(opp.deck)\n\t});\n\t\n\topp.socket.emit(\"updateCards\", \n\t{\n\t\tplayer: opp.cardsInHand,\n\t\topp: Object.keys(player.cardsInHand).length,\n\t\tdeck: getNumCardsInDeck(opp.deck),\n\t\toppDeck: getNumCardsInDeck(player.deck)\n\t});\n}", "deal () {\n for (let i = 0; i < 2; i++) {\n this.dealPlayerCard();\n this.playerCardReveal();\n $(\".player-card-back\").attr(\"class\", \"card\");\n };\n this.dealDealerCard();\n this.dealerCardReveal();\n $(\".dealer-card-back\").eq(0).attr(\"class\", \"card\");\n $(\".card .card-img-top\").css({\"width\":\"118px\", \"height\":\"118px\"});\n this.dealDealerCard();\n $(\"#player-hand-value\").text(`Hand Value: ${this.playerHandValue()}`)\n }", "function draw(firstdude){\n $('#start').hide();\n if (firstdude==1) {\n player1 = true;\n }\n else if (firstdude == 2) {\n player2 = true;\n }\n var width = canvas.width();\n var blockSize = width/board.length;\n var context = canvas[0].getContext('2d');\n context.setTransform(1, 0, 0, 1, 0, 0);\n context.clearRect(0, 0, width, width);\n context.fillStyle=\"slategrey\";\n //Loop through the board array drawing the walls and the goal\n for(var y = 0; y < board.length; y++){\n for(var x = 0; x < board[y].length; x++){\n //Draw a wall whenever x = 1,\n if(board[y][x] === 1){\n context.drawImage(wall, x*blockSize, y*blockSize, blockSize, blockSize)\n }\n //Draw the goal where it is '-1' in the array\n else if(board[y][x] === -1){\n context.beginPath();\n context.drawImage(food, x*blockSize, y*blockSize, blockSize, blockSize)\n }\n }\n }\n //Draw the player\n context.beginPath();\n var half = blockSize/2;\n context.fillStyle = \"rgba(255, 204, 0, 1)\";\n context.arc(player.x*blockSize+half, player.y*blockSize+half, half, 0, 2*Math.PI);\n context.fill();\n }", "function startGame() {\n cardList.forEach(function(card) {\n trueCardArr.push(createCardList(card));\n });\n shuffle(trueCardArr);\n\tcreateGameBoard();\n //deck.getElementsByTagName('li').firstChild.setAttribute('display', 'none');\n\t// Initialize clock\n}", "function drawBoard() {\n w = Math.round(boardDiv.width());\n h = Math.round(boardDiv.height());\n ctx.clearRect(0,0,w,h);\n\n const margin = 10;\n const thickness = 2;\n const shapeH = 100;\n const shapeW = 2*shapeH;\n\n let cw = Math.round(card.w);\n let ch = Math.round(card.h());\n let pad = Math.round(card.pad());\n\n let posX = card.posX(0);\n let posY = card.posY(0);\n\n $(\".card\").remove();\n\n for (let row=0; row<board.h; row++) {\n for (let col=0; col<board.w; col++) {\n let x = Math.round(posX[col]);\n let y = Math.round(posY[row]);\n let i = card.rowcol2i(row,col);\n\n if (i >= board.inPlayMain.length) {\n break;\n }\n drawCard(ctx, x,y, x+cw, y+ch, card.thickness, board.inPlayMain[i]);\n\n $(\"#div_game\").append($(buildDiv(x,y,cw,ch,i,false)));\n }\n }\n\n let f = Math.round(card.posExtra(0,0));\n let l = undefined, x = undefined, y = undefined;\n if (board.w == 4) {\n l = posY;\n } else {\n l = posX\n }\n for (let k=0; k<board.inPlayExtra.length; k++) {\n if (board.w == 4) {\n x = f;\n y = Math.round(l[k]);\n } else {\n x = Math.round(l[k]);\n y = f;\n }\n drawCard(ctx, x, y, x+cw, y+ch, card.thickness, board.inPlayExtra[k]);\n\n $(\"#div_game\").append($(buildDiv(x,y,cw,ch,k,true)));\n }\n\n if (isSetAvailable()) {\n log(\"A set is available / \" + board.deck.length + \" cards unseen\");\n } else {\n log(\"A set is not available / your score: \" + String((81-(board.deck.length+board.inPlayExtra.length+board.inPlayMain.length))/3));\n }\n}", "drawCards(){\t\n\t\tlet deck = this.state.playerDeck;\n\t\t\n\t\tif(deck.size() === 0){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// shuffle deck first?\n\t\tlet max = this.state.handSize;\n\t\tif(deck.size() <= 2 && deck.size() >= 1){\n\t\t\tmax = deck.length;\n\t\t}\n\t\t\n\t\t// if player already has some cards, the number of cards drawn can't exceed handSize!\n\t\t// also increment player's number of moves \n\t\tlet cardsDrawn = [...this.state.playerHand]; // making a copy \n\t\tfor(let i = 0; i < max; i++){\n\t\t\tcardsDrawn.push(deck.remove());\n\t\t}\n\t\t\n\t\t// should have console refresh and cards displayed should also update \n\t\tthis.setState((state) => { \n\t\t\tlet copy = [...state.consoleMsgs]; \n\t\t\tcopy.push(\"player drew \" + cardsDrawn.length + \" cards!\");\n\t\t\t\n\t\t\t// subtract 1 because drawing cards itself costs a move \n\t\t\treturn {'consoleMsgs': copy, 'playerHand': cardsDrawn, 'playerMoves': this.state.playerMoves + cardsDrawn.length - 1}; \n\t\t});\n\t}", "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 dealFirstHand() {\n addRemoveButtons();\n for (var i = 0; i < 2; i++) { // 2 cards to each player\n for (var x = 0; x < players.length; x++) {\n let card = deck.pop();\n players[x].Hand.push(card);\n renderCard(card, x);\n updatePoints();\n }\n }\n updateDeck();\n}", "function Hit(){\r\n \r\n // shuffle the deck before hitting\r\n ShuffleDeck();\r\n\r\n // create element img to show the card while hitting\r\n var img = document.createElement('img'); \r\n\r\n // pop the card from the deck\r\n var card = deck.pop();\r\n\r\n // find the identity of the card\r\n var identity = card.Identity;\r\n\r\n // find the weight associated with the card and added it to player point\r\n player1Point += card.Weight;\r\n\r\n var path = \"../resources/JPEG/\"+identity+\".jpg\";\r\n img.src = path;\r\n\r\n document.getElementById('player1').appendChild(img); \r\n\r\n // call UpdatePoint() to show the points of both the player to screen\r\n UpdatePoint();\r\n if(player1Point == 21 && player2Point == 21){\r\n End();\r\n }\r\n else if(player1Point == 21){\r\n winner = 1;\r\n End();\r\n \r\n }\r\n else if(player1Point > 21){\r\n winner = 2;\r\n End();\r\n \r\n }\r\n}", "function drawCard(data) {\n document.getElementById('calledUNO').style.display = 'none';\n document.getElementById('unoButton').style.display = 'block';\n\n //reorganize own cards\n ownCards = $('#ownCards');\n ownCards.html(\"\");\n document.getElementById('minEmptyIndex').value = 0;\n var cards = data['own_cards'];\n if (cards.length > 10) {\n $('#cardDistance').val(\"45\");\n }\n for (var i = 0; i < cards.length; i++) {\n var isNew = false;\n for (var j = 0; j < data['added_cards'].length; j++) {\n if (data['added_cards'][j].id == cards[i].id) {\n isNew = true;\n }\n }\n if (isNew) {\n // console.log(\"new card:\" + cards[i].color + \"_\" + cards[i].card_type);\n getOneCard(cards[i], \"bounce\");\n } else {\n getOneCard(cards[i], \"\");\n }\n }\n\n}", "function player2Initial() {\n deck2.id = \"cardsrightnew\";\n\n //sets the cards in the players hand\n setPlayerCard();\n twoCard1.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard2.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard3.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard4.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard5.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n //if card is selected by user, replace the card with a new one and move to next player\n twoCard1.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n setTimeout(function(){player1Turn2();}, 2000);\n });\n twoCard2.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n setTimeout(function(){player1Turn2();}, 2000);\n });\n twoCard3.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n setTimeout(function(){player1Turn2();}, 2000);\n });\n twoCard4.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n setTimeout(function(){player1Turn2();}, 2000);\n });\n twoCard5.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n setTimeout(function(){player1Turn2();}, 2000);\n });\n}", "_draw(num = 2) {\n let numToDraw = Math.min(this.drawPile.length, num);\n for (let i = 0; i < numToDraw; i++) {\n let card = getRandom(this.drawPile);\n if (card) {\n this.hand.push(card);\n this.drawPile.splice(this.drawPile.indexOf(card), 1);\n }\n }\n }", "function draw(res) { \n let min = res.length > 6 ? 100 : 0\n let max = res.length > 6 ? 200 : res.length \n for (let i = min ; i < max; i++) {\n \n single_card = {\n id: res[i][\"id\"],\n symbol: res[i][\"symbol\"],\n name: res[i][\"name\"] \n }\n drawn_cards_arr.push(single_card) \n\n //create elements\n let symbol_and_tog_div = $(\"<div></div>\")\n symbol_and_tog_div.addClass(\"d-flex justify-content-between\") \n\n let symbol_holder = $(\"<h5></h5>\").text(res[i][\"symbol\"]) // i (symbol)\n symbol_holder.addClass(\"card-title searchRef\")\n \n let toggel_holder_div = $(\"<div></div>\")\n toggel_holder_div.addClass(\"form-check form-switch\")\n \n let toggle_switch = $(\"<input></input>\") \n toggle_switch.addClass(\"form-check-input\")\n toggle_switch.attr(\"type\",\"checkbox\")\n toggle_switch.attr(\"id\",\"flexSwitchCheckDefault\")\n // toggle_switch.attr(\"cheked\",false)\n toggle_switch.addClass(\"togg\"+res[i][\"id\"].toString())\n \n let name_holder = $(\"<p></p>\").text(res[i][\"name\"]) // i (name)\n name_holder.addClass(\"card-text searchRef\")\n\n let more_info_btn = $(\"<butoon></butoon>\").text(\"More Info\")\n more_info_btn.addClass(\"btn btn-primary more_info_btn\")\n more_info_btn.attr(\"id\",res[i][\"id\"]) //i insert id to more info btn \n\n let panel_div = $(\"<div></div>\") //more info panel\n panel_div.addClass(\"panel\")\n let panel_id_concat = res[i][\"id\"].toString() + \"panel\" //i \n panel_div.attr(\"id\",panel_id_concat) // insert id+\"panel\" to panel's div\n\n let hide_market_data_btn = $(\"<butoon></butoon>\").text(\"Hide market data\")\n hide_market_data_btn.addClass(\"hide_market_data_btn btn btn-secondary\")\n\n let eur_market_data = $(\"<h6></h6>\").text(\"Loading eur data\")\n eur_market_data.addClass(\"eur\")\n\n let usd_market_data = $(\"<h6></h6>\").text(\"Loading usd data\")\n usd_market_data.addClass(\"usd\")\n\n let ils_market_data = $(\"<h6></h6>\").text(\"Loading ils data\")\n ils_market_data.addClass(\"ils\")\n \n let coin_thumb = $(\"<img></img>\")\n\n\n let card_budy_div = $(\"<div></div>\")\n card_budy_div.addClass(\"card-body\")\n\n let loadermini = $(\"<img></img>\")\n loadermini.attr(\"class\",\"loadingmini\")\n loadermini.attr(\"src\",\"./img/loading.gif\")\n\n let main_card_div = $(\"<div></div>\")\n main_card_div.addClass(\"card col-lg-3 col-md-4 col-sm-6 text-white bg-dark border-primary\") \n\n //Append\n toggel_holder_div.append(toggle_switch)\n symbol_and_tog_div.append(symbol_holder,toggel_holder_div)\n\n panel_div.append(hide_market_data_btn,eur_market_data,usd_market_data,ils_market_data,coin_thumb)\n\n card_budy_div.append(symbol_and_tog_div,name_holder,more_info_btn,panel_div,loadermini)\n main_card_div.append(card_budy_div)\n $(\"#row_id\").append(main_card_div) \n }//end of draw for loop\n \n console.log(\"this is drawn_cards_arr\");\n console.log(drawn_cards_arr);\n //--------------------------------------------------------------------------------------more info click-----------\n $(\".more_info_btn\").click(function(){\n \n //console.dir(this.id+\"panel\") \n \n updateJasonParse()\n let flag = false\n let flag_update_or_push = false\n \n //Grabbing html elements\n let eurHolder = $(this).next().children().next()\n let usdHolder = $(this).next().children().next().next()\n let ilsHolder = $(this).next().children().next().next().next()\n let thumbHolder = $(this).next().children().next().next().next().next() \n \n //Using existing market data if it's \"fresh\"\n for (let i = 0; i < market_data_arr.length; i++) {\n if (market_data_arr[i][\"id\"] == this.id && ( (new Date().getTime() - market_data_arr[i][\"time_stamp\"])/1000 < 120) ) {\n \n eurHolder.text(\"EUR: €\"+market_data_arr[i][\"eur\"])\n usdHolder.text(\"USD: $\"+market_data_arr[i][\"usd\"])\n ilsHolder.text(\"ILS: ₪\"+market_data_arr[i][\"ils\"])\n thumbHolder.attr(\"src\",market_data_arr[i][\"thumb\"])\n\n flag = true\n } \n }\n \n // $.get: when data is old or a new data is requierd. if flag == false then $.get is executed\n if (flag == false) { \n $.get(`https://api.coingecko.com/api/v3/coins/`+this.id,function(res){\n //console.log(res)\n // console.log(res.id)\n // console.log(res.market_data.current_price.usd)\n // console.log(res.image.thumb)\n \n $(document).ajaxStart(function(){\n $(\".loadingmini\").show();\n });\n $(document).ajaxStop(function(){\n $(\".loadingmini\").hide();\n });\n \n //update or push a new record (coin)\n // if a record exists, then : 1. update it with fresh market data. 2. save arr to local storage\n for (let i = 0; i < market_data_arr.length; i++) {\n if (market_data_arr[i][\"id\"] == this.id) {\n \n market_data_arr[i][\"eur\"] = res.market_data.current_price.eur\n market_data_arr[i][\"usd\"] = res.market_data.current_price.usd\n market_data_arr[i][\"ils\"] = res.market_data.current_price.ils\n\n localStorage.setItem('l_c_market_data',JSON.stringify(market_data_arr)) // Save market_data_arr to local storage()\n flag_update_or_push = true\n } \n }\n // when market data is old or does not exist, then create a new record > 1. new object 2. push to arr 3. save to local storage\n if (flag_update_or_push == false) { \n // create single coin object\n single_coin ={\n id: res.id,\n eur: res.market_data.current_price.eur,\n usd: res.market_data.current_price.usd,\n ils: res.market_data.current_price.ils,\n time_stamp: new Date().getTime(),\n thumb: res.image.thumb,\n }\n market_data_arr.push(single_coin) // Add single coin to market_data_arr\n localStorage.setItem('l_c_market_data',JSON.stringify(market_data_arr)) // Save market_data_arr to local storage\n } else {\n flag_update_or_push = false\n }\n //localStorage.setItem('l_c_market_data',JSON.stringify(market_data_arr)) // Save market_data_arr to local storage \n //updateJasonParse()\n \n // <h5> update\n eurHolder.text(\"EUR: €\"+res.market_data.current_price.eur)\n usdHolder.text(\"USD: $\"+res.market_data.current_price.usd)\n ilsHolder.text(\"ILS: ₪\"+res.market_data.current_price.ils)\n thumbHolder.attr(\"src\",res.image.thumb)\n }) // end of $.get\n } else{\n flag = false\n } // end of if (for $.get)\n\n console.log(market_data_arr);\n\n $(\"#\"+this.id+\"panel\").slideDown(\"slow\")\n $(\"#\"+this.id).hide(500);\n }); // ------------------------------------------------------------ End of: \"more info\" click ---------------------\n \n //-------------------------------------------------------------------------Hide market date ----------------------- \n $(\".hide_market_data_btn\").click(function(){\n //console.log($(this).parent().attr(\"id\"));\n $(\"#\"+$(this).parent().attr(\"id\")).slideUp(\"slow\"); // slide panel up\n $(\"#\"+$(this).parent().prev().attr(\"id\")).show(\"slow\"); \n });\n \n //-------------------------------------------------------------------------Toggle ----------------------------------\n $(\".form-check-input\").change(function () {\n \n // find out if it's true OR false\n let switchStatus = false;\n if ($(this).is(':checked')) {\n switchStatus = $(this).is(':checked');\n //alert(switchStatus);// To verify\n }\n else {\n switchStatus = $(this).is(':checked');\n //alert(switchStatus);// To verify\n }\n console.log(switchStatus);\n\n \n //this: coin id \n chosenId = $(this).parent().parent().next().next().attr(\"id\") \n console.log(\"chosenId: \"+chosenId);\n \n //last toggle that change <input> grabbing\n lastToggChange = $(\"#\"+chosenId).parent().children().children().next().children()\n console.log(lastToggChange); \n \n console.log(\"this is: drawn_cards_arr *before* updating 'this' change in draw_cards_arr\"); \n console.log(drawn_cards_arr); \n \n temp5arr = []\n temp5arr = drawn_cards_arr.filter(fav=>fav.is_favorite==true)\n console.log(\"this is temp5arr before:\");\n console.log(temp5arr);\n console.log(\"Length temp5arr before = \"+temp5arr.length);\n\n //if: how to update drawn_cards_arr\n if (switchStatus == false || (temp5arr.length < 5 && switchStatus == true) ) {\n for (let i = 0; i < drawn_cards_arr.length; i++) {\n if (chosenId == drawn_cards_arr[i][\"id\"] ) {\n drawn_cards_arr[i][\"is_favorite\"] = switchStatus\n } \n }\n } else if (temp5arr.length == 5 && switchStatus == true) {\n $(\"#modalBody\").empty();\n $(\"#submitBtn\").attr('disabled', 'disabled');\n\n for (let i = 0; i < temp5arr.length; i++) { \n \n //create elements for div modal\n let p_symbol = $(\"<p></p>\").text(temp5arr[i][\"symbol\"]) // i\n p_symbol.addClass(\"fs-3\")\n \n let p_id = $(\"<p></p>\").text(temp5arr[i][\"id\"]) // i\n p_id.addClass(\"fs-7\")\n p_id.addClass(\"d-none\")\n\n let togg = $('<input class=\"toggleInModal\"></input>')\n\n togg.on('click', (e) => {\n const checked = $(e.target).attr('checked');\n\n if (checked === 'checked') {\n $(e.target).attr('checked', false);\n } else {\n $(e.target).attr('checked', true);\n }\n\n const toggleElements = $('.toggleInModal');\n\n const checkedToggles = toggleElements.toArray().filter((el) => $(el).attr('checked') === 'checked');\n\n if (checkedToggles.length !== 5) {\n $(\"#submitBtn\").removeAttr('disabled');\n } else {\n $(\"#submitBtn\").attr('disabled', 'disabled');\n }\n });\n\n togg.addClass(\"form-check-input\")\n togg.attr(\"id\",\"flexSwitchCheckDefault\")\n togg.attr(\"type\",\"checkbox\")\n // togg.attr(\"checked\",\"checked\")\n togg.attr(\"checked\",true)\n togg.addClass(\"modal_checkbox\")\n \n let div_togg_wrapper = $(\"<div></div>\")\n div_togg_wrapper.addClass(\"form-check form-switch mt-2\")\n \n let p_and_toggDiv_wrapper = $(\"<div></div>\")\n p_and_toggDiv_wrapper.addClass(\"d-flex justify-content-around\")\n \n //Append\n div_togg_wrapper.append(togg)\n p_and_toggDiv_wrapper.append(p_symbol, p_id, div_togg_wrapper)\n $(\"#modalBody\").append(p_and_toggDiv_wrapper)\n \n //Show div modal\n $(\"#mainDivModal\").removeClass(\"d-none\") \n $(\"#mainDivModal\").addClass(\"d-fixed\")\n $(\"#conta_of_cards\").hide(1000)\n \n } // end of for loop: drawing 5 favorites\n } // end else if\n \n localStorage.setItem('l_s_drawn_cards_arr',JSON.stringify(drawn_cards_arr)) // Save drawn_cards_arr to local storage\n // console.log(\"this is drawn_cards_arr *after* updating :\");\n // console.log(drawn_cards_arr);\n \n temp5arr = []\n temp5arr = drawn_cards_arr.filter(fav=>fav.is_favorite==true)\n console.log(\"this is temp5arr after:\");\n console.log(temp5arr);\n console.log(\"Length temp5arr after = \"+temp5arr.length);\n temp5arr = []\n \n \n }) // -----------------------------------end of toggle change -----------------------------------------------\n \n // --------------------------------------Start: Search ---------------------------------------------------\n $(\"#searchBtn\").on(\"click\", function() {\n let value = $(\".form-control\").val().toLowerCase();\n console.log(value);\n //console.log(allList);\n \n // let filteredResults = allList.filter(s=>s.symbol == value)\n let filteredResults = allList.filter(s=>s.symbol.includes(value))\n console.log(\"filteredResults:\");\n console.log(filteredResults);\n \n $(\"#row_id\").empty()\n\n draw(filteredResults)\n \n $(\".loadingmini\").hide()\n \n // $(\".searchRef\").filter(function() {\n // $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)\n // });\n });// -----------------------------End: Search ---------------------------------------------------------\n }//----------------------------------------end of draw function -----------------------------------------------------", "function startGame(){\n \n isAlive = true\n let plfirstCard = getPlayerRandomCard()\n let plsecondCard = getPlayerRandomCard()\n\n let dlfirstCard = getDealerRandomCard()\n let dlsecondCard = getDealerRandomCard()\n\n plcards = [plfirstCard, plsecondCard]\n dlcards = [dlfirstCard, dlsecondCard]\n plcardSum = plfirstCard + plsecondCard\n dealercardSum = dlfirstCard + dlsecondCard\n renderGame()\n}", "function start(){\r\n\tdocument.getElementById(\"btnDraw\").style.display = \"inline-block\";\r\n\tdocument.getElementById(\"btnHold\").style.display = \"inline-block\";\r\n\t\r\n\t//dealer gets 2 cards\r\n\tvar dealer = document.getElementById(\"dealerScore\");\r\n\r\n\tvar dealerArr = [drawRandomCard(deck), drawRandomCard(deck)];\r\n\tconsole.log(dealerArr);\r\n\r\n\tdealerScore = dealerArr[0] + dealerArr[1]; //the sum of two cards\r\n\tconsole.log(dealerScore);\r\n\r\n\tdealer.innerHTML = dealerScore;\t\r\n\r\n\tdocument.getElementById(\"dealer1\").src = deckImg[dealerArr[0] -1 ];\r\n\tdocument.getElementById(\"dealer2\").src = deckImg[dealerArr[1] -1 ];\r\n\r\n\t//player gets 2 cards\r\n\tvar player = document.getElementById('playerScore');\r\n\tvar playerArr = [drawRandomCard(deck), drawRandomCard(deck)];\r\n\tconsole.log(playerArr);\r\n\r\n\tplayerScore = playerArr[0] + playerArr[1];//the sum of two cards\r\n\tconsole.log(playerScore);\r\n\r\n\tplayer.innerHTML = playerScore;\r\n\r\n\tdocument.getElementById(\"player1\").src = deckImg[playerArr[0] -1];\r\n\tdocument.getElementById(\"player2\").src = deckImg[playerArr[1] -1];\r\n\r\n\tdocument.getElementById(\"reload\").style.display = \"none\";\r\n\r\n\tif(dealerScore > 21)\r\n\t{\r\n\t\tdocument.getElementById(\"playerLabel\").innerHTML = \"Player has won this Hand!\";\r\n\t\tdocument.getElementById(\"playerLabel\").style.backgroundColor = \"green\";\r\n\t\tdocument.getElementById(\"btnDraw\").style.display = \"none\";\r\n\t\tdocument.getElementById(\"btnHold\").style.display = \"none\";\r\n\t}\r\n\r\n\tif(playerScore > 21)\r\n\t{\r\n\t\tdocument.getElementById(\"dealerLabel\").innerHTML = \"Dealer has won this Hand!\";\r\n\t\tdocument.getElementById(\"dealerLabel\").style.backgroundColor = \"green\";\r\n\t\tdocument.getElementById(\"btnDraw\").style.display = \"none\";\r\n\t\tdocument.getElementById(\"btnHold\").style.display = \"none\";\r\n\t}\r\n}", "createCards() {\n this.memoryNames.forEach((name) => {\n const card = document.createElement('img');\n card.classList.add('card-image');\n card.alt = name;\n this.showFrontSide(card);\n card.classList.add('preventClick');\n setTimeout(() => card.classList.remove('preventClick'), 6000);\n setTimeout(() => this.showBackSide(card), 6000);\n card.style.order = Math.floor(Math.random() * 10);\n card.onclick = () => this.cardClickHandler(event);\n card.ondragstart = () => false;\n this.gameContainer.appendChild(card);\n });\n }", "function draw() {\n if (animate) {\n h++;\n if (h > 360) {\n h = 0;\n }\n\n fill(h, s, b);\n rect(cardX, cardY, 100, 140, 5);\n cardX += speedX;\n cardY += speedY;\n speedY += gravity;\n if (cardY + 140 > height) {\n cardY = height - 140;\n speedY *= -0.8;\n }\n if (cardX > width || cardX + cardW < 0) {\n index++;\n cardCount++;\n if (cardCount == 52) {\n background('green');\n sound.play();\n lonely();\n animate = false;\n }\n if (index > 3) {\n index = 0;\n }\n speedX = random(-12, 6);\n while (speedX > -2 && speedX < 2) {\n speedX = random(-12, 6);\n }\n cardX = origins[index];\n cardY = 20;\n\n }\n }\n}", "function player1Initial() {\n deck1.id = \"cardsleftnew\";\n\n //sets the cards in the players hand\n setPlayerCard();\n oneCard1.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard2.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard3.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard4.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard5.src = `images/${gameData.playerCards[randPlay]}`;\n \n //if card is selected by user, replace the card with a new one and move to next player\n oneCard1.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n setTimeout(function(){player2Turn2();}, 2000);\n });\n oneCard2.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n setTimeout(function(){player2Turn2();}, 2000);\n });\n oneCard3.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n setTimeout(function(){player2Turn2();}, 2000);\n });\n oneCard4.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n setTimeout(function(){player2Turn2();}, 2000);\n });\n oneCard5.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n setTimeout(function(){player2Turn2();}, 2000);\n });\n}", "function startGame() {\n // hide welcome card\n welcomeCard.setAttribute(\"style\", \"display: none\");\n // display first question card\n qCards.setAttribute(\"style\", \"display: show\");\n displayQuestion();\n}", "function playerCards() {\r\n var playerCard = randomCard();\r\n var cardSRC = dealCard(playerCard.cardimg);\r\n playerarea.appendChild(cardSRC);\r\n updatePlayerScore(playerCard.value, playerCard.secondValue);\r\n\r\n }", "function turnCard(){\n\tif (this.classList.contains('open')) { //to avoid double click on the opened card...\n\t\n\t} else {\n\t\tif (animationFinished == false) { //to avoid to click on the third card before finishing matchCheck...\n\t\t} else {\n\t\t\tthis.classList.add('open', 'show');\n\t\t\tclickedCount ++;\n\t\t\tmoves.textContent = clickedCount;\n\t\t\topenedCard.push(this);\n\t\t\tif (openedCard.length === 2) {\n\t\t\t\tanimationFinished = false; \n\t\t\t\tmatchCheck(); \n\t\t\t} //once the second card was turned, call matchCheck...\n\t\t};\n\t};\n}", "function addTheListeners(clickableCards){\r\n\r\nclickableCards[0].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(1);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n cardPos2=pos;\r\n }else{\r\n cardPos=pos;\r\n }\r\n if(clickableCards[0].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[0].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(1);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[1].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(2);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n }else{\r\n cardPos=pos;\r\n }\r\n\r\n if(clickableCards[1].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[1].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(2);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[2].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(3);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n }else{\r\n cardPos=pos;\r\n }\r\n\r\n if(clickableCards[2].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[2].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(3);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[3].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(4);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n }else{\r\n cardPos=pos;\r\n }\r\n\r\n if(clickableCards[3].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[3].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(4);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[4].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(5);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n }else{\r\n cardPos=pos;\r\n }\r\n\r\n if(clickableCards[4].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[4].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(5);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[5].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(6);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n }else{\r\n cardPos=pos;\r\n }\r\n\r\n if(clickableCards[5].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[5].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(6);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[6].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(7);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n }else{\r\n cardPos=pos;\r\n }\r\n\r\n if(clickableCards[6].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[6].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(7);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[7].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(8);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n }else{\r\n cardPos=pos;\r\n }\r\n\r\n if(clickableCards[7].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[7].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(8);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[8].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(9);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n }else{\r\n cardPos=pos;\r\n }\r\n\r\n if(clickableCards[8].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[8].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(9);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[9].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(10);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n }else{\r\n cardPos=pos;\r\n }\r\n\r\n if(clickableCards[9].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[9].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(10);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[10].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(11);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n }else{\r\n cardPos=pos;\r\n }\r\n\r\n if(clickableCards[10].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[10].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(11);\r\n findPairs(clickableCards);\r\n});\r\nclickableCards[11].addEventListener(\"click\",function(){\r\n let pos=randomPositions.indexOf(12);\r\n let cardPos;\r\n if(pos>=6){\r\n cardPos=pos-6;\r\n cardPos2=pos;\r\n }else{\r\n cardPos=pos;\r\n }\r\n if(clickableCards[11].src.includes(\"/style/backs/gray_back.png\")){\r\n clickableCards[11].src=\"./style/PNG/\"+cardsInGame[cardPos]+\".png\";\r\n }\r\n pairs.push(cardsInGame[cardPos]);\r\n pairsPos.push(12);\r\n findPairs(clickableCards);\r\n});\r\n\r\n\r\n}", "function startGame () {\r\n if (GameStarted === false) {\r\n DrawPile = shuffle(DrawPile)\r\n\r\n DiscardPile = dealCard(1)\r\n HumanPlayerPile = dealCard(7)\r\n ComputerPlayerPile = dealCard(7)\r\n\r\n // Presents Human Player's Pile AS A LIST OF CLICKABLE CARD IMAGES\r\n HumanPlayerPile.forEach(function (card, index) {\r\n\r\n var img = document.createElement('img')\r\n img.src = card.image\r\n img.id = 'hp'+index\r\n listHumanPlayerPile.appendChild(img)\r\n\r\n HumanPlayerCardsArr[index] = document.querySelector('#hp'+index)\r\n HumanPlayerCardsArr[index].onclick = function (e) {\r\n console.log(\"click!\")\r\n if (whichPlayerTurn === Human) {\r\n // ensures human player's click does not activate play if computer is still calculating playing \r\n var humanDiscardSuccessful = playCard(Human, parseInt(e.target.id.substring(2,e.target.id.length))) //input: player & card clicked\r\n if (humanDiscardSuccessful) { // let Computer play only if Human has completed discarding a valid card\r\n whichPlayerTurn = Computer\r\n var computerDiscardSuccessful = playCard(Computer,null)\r\n if (computerDiscardSuccessful) {\r\n whichPlayerTurn = Human\r\n }\r\n }\r\n }\r\n return false // so as not to follow thru if click cancelled\r\n }\r\n\r\n })\r\n\r\n\r\n // Presents Computer Player's Pile AS A LIST\r\n ComputerPlayerPile.forEach(function (card, index) {\r\n\r\n var img = document.createElement('img')\r\n img.src = 'graphics/cover.png'\r\n img.id = 'cp'+index\r\n listComputerPlayerPile.appendChild(img)\r\n })\r\n\r\n // Presents opening card from Draw Pile\r\n DiscardPile.forEach(function (card, index) {\r\n var img = document.createElement('img')\r\n img.src = card.image\r\n img.id = 'dp'+index\r\n listDiscardPile.appendChild(img)\r\n })\r\n\r\n GameStarted = true\r\n\r\n window.setTimeout(function () {\r\n GameMessage.innerHTML = 'Human Player, awaiting your play...'\r\n }, 500)\r\n }\r\n} // end of startGame", "function renderOpponentHand(n) {\n var offsetX = 20;\n if (n % 2 === 0) {\n var xpos = canvas.width / 2 - (n / 2 * (playingCard.width + offsetX)) + offsetX / 2;\n } else {\n var xpos = canvas.width / 2 - (n + 1) / 2 * playingCard.width + playingCard.width / 2 - offsetX * (n - 1) / 2;\n }\n var ypos = 20;\n opponentHandCollision = [];\n for (var i = 0; i < n; i++) {\n var cardObj = {};\n cardObj.left = xpos;\n cardObj.top = ypos;\n opponentHandCollision.push(cardObj);\n renderPlayingCard(cardObj.left, cardObj.top);\n xpos = xpos + playingCard.width + offsetX;\n }\n }", "function addMyCards(card, divName, pos) {\r\n let strs = card.split(\" \");\r\n let num = strs[0];\r\n let type = strs[1];\r\n\r\n // add points of my cards\r\n if (divName == \"my-cards\") {\r\n if (parseInt(num) > 10) {\r\n sum += 10\r\n } else {\r\n sum += parseInt(num)\r\n }\r\n }\r\n if (sum > 21) { // if exceed disable the draw btn\r\n $(\"#game-draw\").addClass(\"disabled\")\r\n $(\"#game-draw\").prop(\"disabled\", true)\r\n }\r\n\r\n // add padding\r\n if ($(\"#\" + divName).children().length == 0) {\r\n let interval = \" <div class=\\\"col-sm-1\\\">\" +\r\n \" </div>\"\r\n $(\"#\" + divName).append(interval)\r\n }\r\n let cardName = type + \"-\" + num + \".jpg\";\r\n let newCard;\r\n // hide first card on the opponents' deck\r\n if (divName === \"opponent-cards\" && $(\"#\" + divName).children().length == 1) {\r\n newCard = \"<img src=\\\"\" + CARD_STATIC_URL\r\n + \"blue-card.png\" + \"\\\" class=\\\"col-sm-2 cards img-rounded\\\">\"\r\n } else {\r\n newCard = \"<img src=\\\"\" + CARD_STATIC_URL\r\n + cardName + \"\\\" class=\\\"col-sm-2 cards img-rounded\\\">\"\r\n }\r\n if (pos == -1) {\r\n $(\"#\" + divName).append(newCard)\r\n } else if (pos == 0) {\r\n $(\"#\" + divName + \" img:nth-child(2)\").before(newCard)\r\n }\r\n}", "function displayCards() {\n\n // Resize the container of the cards\n switch (parseInt(pairs)) {\n case 2:\n // For 2 pairs only (4 cards)\n var boxWidth = 250;\n break;\n\n case 3, 4:\n // For 3 pairs (6 cards) and 4 pairs (8 cards)\n var boxWidth = 370;\n break;\n\n default:\n // For 5 pairs or more\n var boxWidth = 490;\n break;\n }\n\n //console.log(\"Pairs: \" + pairs + \" Width: \" + boxWidth);\n\n // Set the with of the cards grid\n $(\"#gifBox\").css(\"width\", boxWidth);\n\n // Remove all the existing cards\n $(\"#gifs\").html(\"\");\n\n // For each GIF append an element to the DOM\n for (var c in cardsArray) {\n\n // Create a CARD div\n var cardDiv = $(\"<div>\").addClass(\"card m-2\");\n\n // Append the character image to the front of the card, but HIDE this image - this to mimic the fact of the card being \"facing donw\"\n var cardImg = $(\"<img>\").attr(\"src\", cardsArray[c]).attr(\"id\", \"frnt\" + c).css(\"display\", \"none\").addClass(\"staticgif card-img-top\").appendTo(cardDiv);\n\n // Append the image of the back if the card - this to mimic the fact of the card being \"facing donw\"\n var cardback = $(\"<img>\").attr(\"src\", \"./assets/images/card_back.png\").attr(\"id\", \"back\" + c).attr(\"data-url\", cardsArray[c]).addClass(\"staticgif card-img-top\").appendTo(cardDiv);\n\n // Append each card\n $(\"#gifs\").append(cardDiv);\n };\n\n // Start the countdown clock for the TIMED and CHALLENGE modes \n if (mode === 'timed' || mode === 'challenge') {\n console.log(\"calling the clock with \" + time + \" seconds\");\n timerRun(time);\n\n $(\"#box-clock\").show();\n\n } else {\n\n };\n\n\n\n\n }", "function gameStart() {\n\tfor (let i = 0; i < deck.length; i++) {\n\t\tlet cardFront = document.createElement('img');\n\t\tcardFront.setAttribute('class', 'box');\n\t\tcardFront.setAttribute('data-number', i);\n\t\tcardFront.setAttribute('src', deck[i].image);\n\t\tgameBoard.appendChild(cardFront);\n\t}\n}", "function createBoard()\n\t{ \n\t\tfor (var i = 0; i < cards.length; i++) {\n\t var cardElement = document.createElement('img');\n\t cardElement.setAttribute('src', \"images/back.png\");\n\t //I add this random function to let the game become more excited \n\t var ran= Math.floor(Math.random() * 4); \n\t cardElement.setAttribute('data-id', ran);\n\t document.getElementById('game-board').appendChild(cardElement);\n\t cardElement.addEventListener('click',flipCard);\n\t}\n}", "function initGame() {\n document.querySelector('.overlay').style.display = 'none';\n document.querySelector('.deck').innerHTML = '';\n shuffle(possibleCards);\n opened = [];\n numStars = 3;\n numMoves = 0;\n numMatch = 0;\n resetTimer();\n runTimer();\n printStars();\n printMoves();\n\n\n for(i=0;i<numCards;i++) {\n document.querySelector('.deck').innerHTML += `<li class=\"card\"><img src=\"img/animal/${possibleCards[i]}.svg\"/></li>`;\n };\n\n\n\n// ============================================\n// Set up event listener\n// 1. Click a card, if it's already shown, quit function\n// 2. If it's not shown, show the card, add it to opened array. \n// 3. If there's already an item in the opened array, check if it's match. \n// 4. run match or unmatch function, clear opened array for the next match check.\n// 5. Calculate the stars for each move.\n// 6. If reach maximum pairs, end the game, show congrats message\n// ============================================\n\n document.querySelectorAll(\".card\").forEach((card) => {\n card.addEventListener(\"click\", function () {\n\n if (card.classList.contains('show')){\n return; // exit function if the card is already opened.\n }\n\n card.classList.add('show','animated','flipInY');\n\n let currentCard = card.innerHTML;\n opened.push(currentCard);\n\n\n if(opened.length > 1) {\n if(currentCard === opened[0]) {\n match();\n }else {\n unmatch();\n }\n };\n \n starCount(); \n printMoves();\n\n\n if(numMatch === maxMatch ) {\n stopTimer();\n congrats();\n }\n\n })\n });\n\n}", "function game (){\n $( \".card\" ).on( \"click\", function() {\n $( this ).addClass(\"open\");\n openCards.push( $( this ));\n puntua();\n allAction();\n complete();\n });\n}", "function renderWinnings() {\n var myXpos = canvas.width / 3 - playingCard.width - 90;\n var myYpos = canvas.height / 3 * 2 - playingCard.height / 2;\n var theirXpos = canvas.width / 3 * 2 + playingCard.width + 30;\n var theirYpos = canvas.height / 3 - playingCard.height / 2;\n var offset = 0;\n var increment = 2;\n var myCurrentWinnings = myWinnings;\n var theirCurrentWinnings = theirWinnings;\n \n ctx.beginPath();\n ctx.font = \"20px Pacifico\" || \"20px cursive\";\n ctx.fillStyle = colorThemeSecondary;\n ctx.fillText(\"My winnings\", myXpos - playingCard.width - 80, myYpos + playingCard.height / 2);\n ctx.closePath();\n myCurrentWinnings.forEach(function (card) {\n renderPlayingCard(myXpos - offset, myYpos - offset, playingCard.frontColor, cardInitial(card.name));\n offset = offset + increment;\n });\n offset = 0;\n ctx.beginPath();\n ctx.font = \"20px Pacifico\" || \"20px cursive\";\n ctx.fillStyle = colorThemeSecondary;\n ctx.fillText(\"Their winnings\", theirXpos + playingCard.width + 50, theirYpos + playingCard.height / 2);\n ctx.closePath();\n theirCurrentWinnings.forEach(function (card) {\n renderPlayingCard(theirXpos - offset, theirYpos - offset, playingCard.frontColor, cardInitial(card.name));\n offset = offset + increment;\n });\n }", "function isTwoCards() {\n\n // add card to array of cards in play\n // 'this' hasn't been covered in this prework, but\n // for now, just know it gives you access to the card the user clicked on\n \n //have to fix reset on number of lives still\n \n \t\t\n\n var cardType = this.getAttribute('data-card');\n var cardId = this.getAttribute('id');\n\n\n if (lastCardClikedID==cardId){\n \talert('Naughty you clicked the same card twice');\n \tlastCardClikedID=cardId;\n }\t\n\n else {\n \n \t \tif (cardType==='king'){\n\tthis.innerHTML = '<img src=\"images/KDiamonds 12.png\" alt=\"King of Diamonds\" title =\"king\"/>';}\n\telse if (cardType==='queen')\n\t{\n\t\tthis.innerHTML = '<img src=\"images/QDiamonds 12.png\" alt=\"Queen of Diamonds\" title = \"queen\" />';\n\t}\n\n\n cardsInPlay.push(cardType);\n \n // if you have two cards in play check for a match\n\n\n\n if (cardsInPlay.length === 2) {\n\n // pass the cardsInPlay as an argument to isMatch function\n isMatch(cardsInPlay, numberOfClicks, numberOfCards);\n\n\n // clear cards in play array for next try\n cardsInPlay = [];\n \n\n\n }\n\n lastCardClikedID=cardId;\n numberOfClicks+=1;\n\n\n if(numberOfClicks>(numberOfCards*2)-1){\n \talert('Game Over');\n \tnumberOfClicks=0;\n \treStart();\n }\n\t\t\n }\n\n}", "startGame() {\n this.cardToCheck = null;\n // Number of flips at start is reset to 0\n this.totalClicks = 0;\n // Timer resets with each new game\n this.timeRemaining = this.totalTime;\n this.busy = true;\n // This allows the cards to shuffle at the start of each game \n setTimeout(() => {\n this.shuffleCards();\n this.countDown = this.startCountDown();\n this.busy = false;\n }, 500);\n // This hides the card faces at the start of each game\n this.hideCards();\n this.timer.innerText = this.timeRemaining;\n this.ticker.innerText = this.totalClicks;\n }", "function presentCards (playingCol) {\n let lastCard = playingCol.row.length - 1;\n playingCol.row[lastCard].faceDown = false;\n for (let x = 0; x < playingCol.row.length; x++){\n console.log(playingCol.row[x].faceDown);\n if (playingCol.row[x].faceDown === true){\n $('#playingCol' + playingCol.num).append(\"<img class = 'card' id='\" + playingCol.row[x].number + playingCol.row[x].suit +\"' src='cardimg/deck-haunted-house.png' />\")\n } else {\n $('#playingCol' + playingCol.num).append(\"<img class = 'card' id='\" + playingCol.row[x].number + playingCol.row[x].suit +\"' src='img/\" + playingCol.row[x].number + \"_of_\" + playingCol.row[x].suit + \".jpeg' draggable='true' ondragstart='drag(event)' ondragstart='drag(event)' />\")\n }\n }\n }", "function handleCardClick(event) {\n // you can use event.target to see which element was clicked\n console.log(\"you just clicked\", event.target);\n if (faceUpPair.length < 2) {\n if (!event.target.style.backgroundColor){\n // reveal card\n event.target.style.backgroundColor = event.target.getAttribute('data-color');\n if (!faceUpLock){\n // synchronize on write\n faceUpLock = true;\n faceUpPair.push(event.target); // add card to array\n faceUpLock = false;\n }\n // increment score\n score++;\n currScore.innerText = score;\n //console.log(faceUpPair);\n }\n }\n if (faceUpPair.length == 2) {\n //console.log(faceUpPair);\n if (faceUpPair[0].style.backgroundColor !== faceUpPair[1].style.backgroundColor) {\n if (!faceUpLock){\n // lock faceUpPair until after timeout\n faceUpLock = true;\n setTimeout(() => {\n // hide cards\n for (let card of faceUpPair){\n card.style.backgroundColor = \"\";\n }\n faceUpPair = [];\n faceUpLock = false;\n }, 1000);\n }\n } else {\n if (!faceUpLock){\n // synchronize on write\n faceUpLock = true;\n faceUpPair = [];\n faceUpLock = false;\n }\n }\n }\n //console.log(\"Game Over: \", isGameOver());\n // show restart button if game over\n if (isGameOver() && !gameSetup.querySelector(\"#restart\")){\n if (localStorage.bestScore){\n const lowestScore = score < localStorage.bestScore ? score : localStorage.bestScore;\n localStorage.setItem(\"bestScore\", lowestScore);\n }\n else {\n localStorage.setItem(\"bestScore\", score);\n }\n bestScore.innerText = localStorage.bestScore; // update display\n gameSetup.querySelector('#setup-restart').appendChild(createRestartBtn());\n }\n}", "function newGame() {\r\n resetGame();\r\n for (var i = 0; i < 2; i++) {\r\n playerCards();\r\n }\r\n dealerCards();\r\n dealerarea.appendChild(backCard());\r\n checkBlackJack();\r\n }", "function showCard(event) {\n if (cardPair.length < 1) {\n gameTime();\n }\n if (cardPair.length < 2) {\n event.target.classList.add('show', 'open');\n }\n}" ]
[ "0.81398606", "0.7585327", "0.7387898", "0.7329736", "0.7280708", "0.7217901", "0.71504796", "0.71504796", "0.71462345", "0.71050453", "0.71044344", "0.7079055", "0.7078316", "0.7043312", "0.7030819", "0.7026582", "0.7023886", "0.7023472", "0.7014926", "0.6997523", "0.6987462", "0.6985609", "0.69851065", "0.69832873", "0.6961593", "0.6932946", "0.6931716", "0.6927237", "0.6926757", "0.6903625", "0.68879616", "0.68797624", "0.6879191", "0.6874886", "0.6858334", "0.6858217", "0.6856682", "0.6853416", "0.68521464", "0.6839606", "0.6828111", "0.68217665", "0.6819151", "0.68063617", "0.68029267", "0.6801399", "0.6800057", "0.67971057", "0.6784262", "0.6783603", "0.67689234", "0.67679924", "0.6766563", "0.6760857", "0.67599076", "0.6759657", "0.6754992", "0.67498785", "0.6746336", "0.674248", "0.67421013", "0.67380285", "0.6736482", "0.67328477", "0.67324257", "0.6725109", "0.6714445", "0.6712601", "0.6710689", "0.67087007", "0.6703969", "0.6701551", "0.6677789", "0.6676064", "0.6673976", "0.6673801", "0.6668401", "0.66657835", "0.6663962", "0.6661203", "0.66607887", "0.6659466", "0.6658878", "0.6652137", "0.6649935", "0.6646322", "0.6643059", "0.6636382", "0.6630498", "0.6627698", "0.6627464", "0.6627205", "0.662692", "0.6624514", "0.6619912", "0.66151494", "0.6615132", "0.6614679", "0.66090673", "0.6606994", "0.6601857" ]
0.0
-1
1. Create a simple function that can reverse the contents of a sentence, word, phrase.
function reverse(string) { let splitString = string.split(''); let reverseArray = splitString.reverse(); let joinArray = reverseArray.join(''); console.log(joinArray); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reverse(phrase){\n \"use strict\";\n\n return phrase.split('').reverse().join('');\n}", "function reverse(phrase){\n \"use strict\";\n\n return phrase.split('').reverse().join('');\n }", "function reverse(phrase){\n var newPhrase = '';\n for (i= phrase.length-1; i >= 0; i--) {\n newPhrase += phrase[i];\n }\n return newPhrase;\n}", "function reverse(phrase){\n var newPhrase = \"\";\n\tfor (count=(phrase.length-1); count>=0; count--){\n\t\tnewPhrase = newPhrase + phrase[count];\n\t}\n\treturn newPhrase;\n}", "function answer(sentence) {\n // Write your code here\n let arrayOfReverseWord = sentence\n .split(' ')\n .map((word) => word.split('').reverse().join(''));\n return arrayOfReverseWord.join(' ');\n}", "function reverseWord(string){\n\n}", "function reverseSentence (sent) {\n return sent.split(' ').reverse().join(' ');\n}", "function reverseInPlace(str){\n ///split by space, reverse words, join back together with a space, split reversed words again, reverse words back to their original position, rejoin to make strings\n return str.split(' ').reverse().join(' ').split('').reverse().join('')\n}", "function reverse(input) {}", "function invertir_text(texto) { \n return texto.split('').reverse().join('')\n}", "function reverse(str) {\n \n}", "function reverse(str){\n // YOUR CODE HERE\n}", "function reverseInPlace(str) {}", "function flipWords(backwardCase){\n\n let sentence = \"\";\n let separate = backwardCase.split(\"\");\n \n for (let i = separate.length - 1; i >= 0; i--){\n if (separate[i].length >= 1){\n sentence += separate[i].split(\"\").reverse(\"\").join(\"\");\n }\n\n else {\n sentence += \"\" + separate[i];\n }\n }\n return sentence;\n }", "function reverse(str) {\n \n}", "function wordReverse(stringofwords){\n\n var str = stringofwords;\n\nvar splitted1 = (str.split(\" \").reverse().join(\" \"));\n\n return (splitted1);\n\n}", "function reverseWords_V2(str){\n return str.split(' ').reverse().join(' ');\n}", "function rvr(words)\n{\nreturn words.split(\"\").reverse().join(\"\");\n}", "function reverseWordsInPlace(str){\nreturn str.split(' ').reverse('').join(' ').split('').reverse('').join('');\n}", "function reverser(sentence){\n return sentence.split(' ').map(word => word.split('').reverse()).join(' ').replace(/,/g,'')\n}", "function reverse(sen) {\nreturn sen.split(\"\").reverse().join(\"\");\n}", "function reverseSentence(string) {\n var inputSentence = process.argv[2] // NOTE: Sentence argument must be in quotes. \n inputSentenceArray = inputSentence.split(\" \");\n console.log(inputSentenceArray);\n reversedSentenceArray = inputSentenceArray.reverse();\n console.log(reversedSentenceArray);\n reversedSentenceResult = reversedSentenceArray.join(\" \");\n return console.log(reversedSentenceResult);\n }", "function reverseSentence(string) {\n var inputSentence = process.argv[2] // NOTE: Sentence argument must be in quotes. \n inputSentenceArray = inputSentence.split(\" \");\n console.log(inputSentenceArray);\n reversedSentenceArray = inputSentenceArray.reverse();\n console.log(reversedSentenceArray);\n reversedSentenceResult = reversedSentenceArray.join(\" \");\n return console.log(reversedSentenceResult);\n }", "function reverseSentence(string) {\n var inputSentence = process.argv[2] // NOTE: Sentence argument must be in quotes. \n inputSentenceArray = inputSentence.split(\" \");\n console.log(inputSentenceArray);\n reversedSentenceArray = inputSentenceArray.reverse();\n console.log(reversedSentenceArray);\n reversedSentenceResult = reversedSentenceArray.join(\" \");\n return console.log(reversedSentenceResult);\n }", "function reverseWord(sentence) {\n return sentence\n .split(\" \")\n .map(function (word) {\n return word.split(\"\").reverse().join(\"\");\n })\n .join(\" \");\n}", "function reverseString(whoseThat){ //function reverserString\nlet array = whoseThat.split('') //creating an array of whoseThat (splits the word rockstar into separate letters)\nreturn array.reverse('').join ('') //the reverse reverses the letters of rockstar and join joins the letters back together to create the word 'ratskcor'\n}", "function inverti (wordToReverse) {\r\n var parolaInvertita = '';\r\n for (var i = wordToReverse.length - 1; i >= 0; i--) {\r\n parolaInvertita += wordToReverse[i];\r\n }\r\n return parolaInvertita;\r\n}", "function reverseSentence(string) {\n return console.log(string.split(' ').reverse().join(''));\n}", "function reverse (word) {\n return word.split('').reverse().join('')\n}", "function reverse(hello){\n \"use strict\";\n\n var myReverse = \"hello\";\n myReverse.split(\"\").reverse().join(\"\");\n return myReverse;\n}", "function flipWord(word) {\n\n //creates an empty string\n let revWord = \"\";\n\n //for every letter in the word, create a word with the letters in reverse\n for (let index = word.length - 1; index >= 0; index--) {\n let letter = word[index];\n\n revWord += letter;\n }\n\n return revWord;\n}", "function reverse(word) {\n var splitReverse = word.split(\"\");\n var wordReverse = splitReverse.reverse();\n result = wordReverse.join('');\n console.log(result);\n\n\n}", "function spe_Reverse(sent,letter){\n let words = sent.toLowerCase().split(' ');\n for(let i = 0; i<words.length; i++){\n if(words[i][0] == letter){\n words[i] = words[i].split('').reverse('').join('');\n }\n }\n return words.join(' ');\n}", "function reverseWord(word) {\n return word.split(\"\").reverse().join(\"\");\n}", "function reversal(str) {\n\n// create variables to name split, reverse and join\n let splitString = str.split(\"\");\n let reverseArr = splitString.reverse();\n let joinArr = reverseArr.join(\"\");\n\n document.getElementById(\"output\").innerHTML = str.split(\"\").reverse().join(\"\");\n\n}", "function reverseWords(s) {\n //to array\n s = s.split(' ');\n\n //return flipped array as a string\n return flip(s);\n\n //recursive flip-flop\n function flip(arr) {\n return arr.length == 1 ? arr[0] : arr[arr.length -1] + ' ' + flip(arr.slice(0,arr.length-1));\n }\n}", "function reverseWord(word) {\n return word.split('').reverse().join('');\n}", "function reverseFunc(word){\n let reversedWord = '';\n for( let i = word.length - 1 ; i >= 0 ; i--)\n {\n reversedWord += word[i];\n }\n\n return reversedWord\n}", "function reverseWords(x){\n return x.toString().split(\" \").reverse().join(\" \");\n }", "reverse() {}", "function reverse(word_to_flip) {\r\n\tvar flipped_word = '';\r\n\tfor (var i = word_to_flip.length - 1; i >= 0; i --)\r\n\t\tflipped_word += word_to_flip[i];\r\n\t\treturn flipped_word;\r\n}", "function reverse(word) {\r\n var drow = \"\"\r\n for (var i = word.length - 1; i >= 0; i--) {\r\n drow += word[i]\r\n }\r\n return drow\r\n}", "function reverseWord(word) {\n if (word === undefined) throw new Error(\"word is required\");\n return word.split('').reverse().join('')\n}", "function reverseString(phrase) {\n let splitStr = phrase.split('');\n let reversed = [];\n for(let i = splitStr.length; i >= 0; i--) {\n reversed.push(splitStr[i]);\n }\n return reversed.join('');\n}", "function reverseString() {\n \n let sentence = prompt(\"Enter your sentence: \");\n let arr = sentence.split('');\n arr = arr.reverse();\n arr = arr.join('');\n console.log(arr);\n}", "function reverseWords2(str) {\n return str.split(' ').reverse().join(' ');\n}", "function reverseWords(str) {\nreturn str\n.split('')\n.reverse()\n.join('')\n.split(' ')\n.reverse()\n.join(' ');\n\n}", "function reverseString(txt) {\n return txt.split('').reverse().join('');\n\t}", "function wordReverse (str) {\n str.split(\" \");\n var a = str.split(\" \");\n a.reverse();\n //now i need to loop through the array to create a string\n var b = \"\";\n for (var index in a) {\n b = b + a[index] + \" \";\n }\n return b;\n}", "function reversal(string) {\n var rev = document.getElementById(\"reverse\");\n rev.innerHTML = string.split('').reverse().join('');\n}", "function reverse(str) {\n return str.split('').reduce((rev, char) => char + rev, '');\n // show การใช้ arry ให้ interviewer อึ้งไปเลย\n // reduce รับค่า 2 ค่า คือ function และ ค่าตั้งต้นของตัวแปรตังหนึ่ง\n // โดยมันจะเอา ตัวแปรตัวนั้นไปใส่เป็น argument แรก ของ function ดังกล่าว\n // แล้ว result ที่ return จาก function ดังกล่าวก็จะเป็นตัวแปลตั้งต้นในรอบถัดๆไปแทน\n // ส่วน argrument อื่น ของ function นั้นก็ตาม array ปกติ\n}", "function reverse(s){\r\n return s.split(\"\").reverse().join(\"\");\r\n}", "function wordReverse(string) {\n var split = string.split(\" \");\n return split.reverse();\n}", "function reverseWords(str){\n return str.split(' ').reverse().join(' ');\n}", "function reverseWords(str){\n return str.split(' ').reverse().join(' ');\n}", "function reversedString(string){\n \n console.log('Entered Word: ', string);\n\n var splitString = string.split(\" \")\n \n var reverseArray = splitString.reverse(); \n \n var joinArray = reverseArray.join(\" \"); \n \n document.querySelector('#display-string').innerText = joinArray;\n}", "function rev6() {\n var str = document.querySelector('#box6 p').textContent;\n str = str.split(\"\").reverse().join(\"\");\n document.querySelector('#box6 p').textContent = str; \n}", "function reverse(s){\n return s.split('').reverse().join('');\n}", "function reverse(s){\n return s.split(\"\").reverse().join(\"\");\n}", "function reverse(string){\n return string.split(\"\").reverse().join(\"\");\n}", "function reverse(word) {\n var word_array = word.split('');\n var total_index = word_array.length - 1;\n var reverse_array = [];\n\n for (var i = total_index; i > -1; i-=1) {\n reverse_array.push(word_array[i]);\n }\n\n return reverse_array.join('');\n}", "function reverseword(word) {\r\n\r\n //Trasformo la parola inserita da stringa ad array\r\n var arrayWord = userWord.split(\"\");\r\n console.log(arrayWord);\r\n\r\n //Creo un ciclo for attraverso il quale pusho in un array le lettere della parola con ordine contrario a quello iniziale.\r\n var reverseArray = [];\r\n for (var i = arrayWord.length - 1 ; i >= 0; i--) {\r\n reverseArray.push(arrayWord[i]);\r\n }\r\n console.log(reverseArray);\r\n\r\n //Uso join per trasformare l'array con le lettere invertite in una stringa.\r\n var invertedWord = reverseArray.join(\"\");\r\n console.log(invertedWord);\r\n\r\n return invertedWord;\r\n }", "function reverse(s) {\n \"use strict\";\n return (s).split(\"\").reverse().join(\"\");\n\n //...\n}", "function reverseWords(str){\n var newstring = str.split(\" \")\n return newstring.reverse().join(\" \")\n // return str; // reverse those words\n \n }", "function reverseEachWord(str) {\n // YOUR CODE HERE\n \n str = str.split(\"\").reverse().join(\"\");\n return str;\n // reverseStr = \"\";\n // for (i = 0; i <= str.length - 1; i++) {\n // reverseStr += \" \";\n // let world = str[i].reverse();\n // reverseStr += str[i].split(\"\").reverse() + \" \";\n // for (j = world.length - 1; j >= 0; j--) {\n // // console.log('world ',world[j]);\n // reverseStr = reverseStr + world[j];\n // }\n // }\n // return reverseStr;\n}", "function reverseWord(word) {\n var reverseWordResult = '';\n for (var i = word.length - 1; i >= 0; i--) {\n reverseWordResult += word[i];\n }\n return reverseWordResult;\n}", "function reverseWords(str){\n let sentence=''\n for(let i=0;i<str.length;i++){\n sentence = sentence + str[(str.length-1)-i]\n }\n return sentence\n}", "function reverse(word) {\n let reversed = \"\";\n let i = 0;\n\n while (i < word.length) {\n let char = word[i];\n reversed = char + reversed\n i++\n };\n return reversed\n }", "function reversedSentence(words) {\n let str = '';\n words.reverse();\n for(let i of words){\n str += i + ' ';\n }\n return $('<li>').text('Reversed string: ' + str).appendTo('#outputs');\n}", "function reverseWords(str){\n let reversed = str.split(' ').reverse().join(' ');\n return reversed\n}", "function reverseWords(str) {\n\n // Create an array of words in a sentence\n let wordsArr = str.split(' ');\n\n // Create an empty array of for inverted words\n let reversedWordsArr = [];\n\n // Using a loop in each element of the array containing the word\n // mix the letters from the sentence in the reverse order \n wordsArr.forEach(word => {\n\n // Variable for the current inverted word\n let reversedWord = '';\n\n // The cycle moves the letters\n for (let i = word.length - 1; i >= 0; i--) {\n reversedWord += word[i];\n };\n\n // Add inverted words to the array\n reversedWordsArr.push(reversedWord);\n });\n\n // Return result as a string\n return reversedWordsArr.join(' ');\n}", "function reverseString(stringofwords){\n\n var str = stringofwords;\n\nvar splitted1 = (str.split(\"\").reverse().join(\"\"));\n\n console.log (splitted1);\n\n}", "function reverseWords(str) {\n\t// Go for it\n\tif (typeof str !== \"string\"){\n\t\tthrow new TypeError(\"You did not enter a string\")\n\t} else {\n\n\t\tlet words = str.split(\" \")\n\t\tlet string = []\n\n\t\tfor (let i = 0; i < words.length; i++){\n\t\t\tstring.push(words[i].split(\"\").reverse().join(\"\"))\n\t\t}\n\n\t\tlet reversed = string.join(\" \")\n\t\tconsole.log(reversed)\n\t\treturn reversed\n\t}\n\n }", "function reverse(x){\n return x.split('').reverse().join('')\n}", "function reverse(str){\r\n return str.split(\"\").reverse().join(\"\");\r\n}", "function reverseMethod(string) {\r\n return [...string].reverse().join('');\r\n}", "function reverseWord(str) {\n return str.split(\"\").reverse().join(\"\");\n}", "function reverseStringIterative(word){\n\tlet answer = \"\";\n\tfor(let i = word.length - 1; i >= 0; i--){\n\t\tanswer += word[i];\n\t}\n\treturn answer;\n}", "function Reverse(word) {\n\tvar o = '';\n\tfor (var i = word.length -1; i >= 0; i--)\n\t\to += word[i];\n\tconsole.log(o);\n}", "function reverse2(str) {\n return str.split('').reverse().join('')\n}", "function reverseWord(word){\n let newString = \"\";\n for (let i = word.length-1; i >=0; i--) {\n newString += word[i];\n }\n return newString;\n}", "function reverse(word) {\n\tgreeting = []\n\n\tvar wordLength = word.length\n\tfor(var i = 0; i <= wordLength; i++)\n\tgreeting.push(word.charAt(wordLength - i));\n\treturn greeting.join('')\n}", "function reverse(s) {\n \"use strict\";\n return s.split('').reverse().join('');\n}", "function f(str) {\n\n let splitStr = str.split(\"\");\n splitStr.reverse();\n return splitStr.join(\"\")\n\n\n}", "function reverse(inputr) {\n return inputr.split(\"\").reverse().join(\"\");\n}", "function reverseWords(string) {\n //split string into each word\n var newstring = string.split(' '); \n console.log(newstring);\n //create variable to store reversed words\n var reversedWords = [];\n //loop through each word\n for(var i = 0; i < newstring.length; i++){\n //add reversed word to reversedWords variable\n reversedWords.push(reverse(newstring[i]));\n }\n //return reversed words.join()\n return reversedWords.join(' ');\n}", "function reverseWords(str) {\n return str.split(\" \").reverse();\n}", "function reverseInPlace(str) {\n return str\n .split(\" \")\n .reverse()\n .join(\" \")\n .split(\"\")\n .reverse()\n .join(\"\");\n}", "function solution_1 (s) {\r\n return s.reverse();\r\n}", "function reverseString(){\n var a = \"This Is Rekha\";\n var b = a.split(\" \");\n var c = [];\n for (var i = 0; i < b.length; i++) {\n c +=\n \" \" +\n b[i]\n .toString()\n .split(\"\")\n .reverse()\n .join(\"\");\n }\n console.log(`${c.trim()}`);\n var ee = c.trim().split(\" \");\n var h = \"\";\n var bb;\n for (let f of ee) {\n var k =\n f\n .toString()\n .charAt(0)\n .toUpperCase() +\n f\n .toString()\n .slice(1)\n .toLowerCase();\n h += \" \" + k;\n }\n console.log(`final string is : ${h.trim()}`);\n\n}", "function reverse(n)\n{\n n = n + \"\";\n return n.split(\"\").reverse().join(\"\");\n}", "function reverseWords(str) {\r\n\r\n var stringArray = str.split('');\r\n console.log(stringArray);\r\n var newStringArray = stringArray.reverse();\r\n console.log(newStringArray);\r\n var revString = newStringArray.join(\"\");\r\n\r\n return revString;\r\n}", "function reverse(str){\n return str.split(\"\").reverse().join(\"\");\n}", "function reverse(string){\n \"use strict\";\n return string.split(\"\").reverse().join(\"\")\n}", "function reverseString(event2) {\n let userInput2 = event2.target.value;\n let answer2 = userInput2;\n \n // Codes\n let newString = '';\n for (let i = answer2.length -1; i >=0; i--){\n newString += answer2[i];\n }\n document.querySelector('#reverseResult').innerText = newString;\n}", "function reverse(word) {\r\n\tvar reversedWord = []\r\n\tfor (var index = word.length - 1; index > -1; index--) {\r\n\t\treversedWord.push(word[index])\r\n\t}\r\n\tconsole.log(reversedWord.join(\"\",reversedWord))\r\n}", "function reverseWord(front, rear) {\n\n var length = rear - front;\n\n if (length < 2) {\n return;\n }\n \n for(let i = 0; i<length/2; i++) {\n let temp = message[front + i];\n //console.log(temp); \n message[front + i] = message[front+length-1-i];\n message[front+length-1-i] = temp;\n }\n }", "function simpleReverse(str) {\n var reversed = \"\";\n //var solution=\"\";\n //var length=str.length;\n //for(var i=1; i<=length; i++){\n //solution+=str[length-1];\n //return solution;\n }", "function reverseWords(string){\n\treturn string.split(\" \").reverse().join(\" \")\n}", "function reverseWords(s){\n const words = s.split(' ')\n for(let i=0; i<words.length/2; i++){\n const temp = words[i]\n words[i] = words[words.length-i-1]\n words[words.length-i-1] = temp\n }\n return words.join(' ')\n}", "function reverseString(str) {\n\n}" ]
[ "0.77850044", "0.7782319", "0.73398787", "0.7311283", "0.72222805", "0.7190132", "0.7182453", "0.71159583", "0.7037326", "0.70348555", "0.7025179", "0.7022026", "0.7004029", "0.6989658", "0.695644", "0.69525635", "0.6944668", "0.6938717", "0.6934415", "0.692512", "0.69035023", "0.68995273", "0.68995273", "0.68995273", "0.6892298", "0.6891863", "0.6881665", "0.6873642", "0.68498856", "0.68436605", "0.68224907", "0.68141073", "0.6770402", "0.67504483", "0.6748937", "0.67288256", "0.67264307", "0.67248875", "0.67173237", "0.6689397", "0.6672593", "0.6655561", "0.6647514", "0.66091746", "0.65948504", "0.6594134", "0.65554416", "0.6555364", "0.65475506", "0.6543597", "0.653871", "0.6523407", "0.65122813", "0.6511354", "0.6511354", "0.6491343", "0.6478322", "0.6472296", "0.6471509", "0.6471315", "0.6470801", "0.64679635", "0.6460086", "0.645955", "0.6456334", "0.6453022", "0.644211", "0.64389855", "0.64314884", "0.64156216", "0.63860005", "0.6384388", "0.6376631", "0.6375711", "0.6375445", "0.63679117", "0.6360994", "0.6358727", "0.6355662", "0.6348325", "0.63457006", "0.63415647", "0.6339281", "0.6334802", "0.6333917", "0.63338786", "0.63319147", "0.6329728", "0.6327452", "0.6327003", "0.6324492", "0.63235176", "0.63140506", "0.62743294", "0.6272913", "0.62699056", "0.62693596", "0.62688124", "0.62649834", "0.6263988", "0.62550205" ]
0.0
-1
2. Create a function that will accept a date or year and calculate if it falls on a Leap Year.
function leapYear(year) { //leap year --> divisible by 4 but not 100 or is divisible by 400 console.log((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function detectleapyear(year){\n if (year % 4 !== 0) {\n return false;\n } else if (year % 100 !== 0) {\n return true;\n } else if (year % 400 !== 0) {\n return false;\n } else {\n return true;\n }\n }", "function checkLeapYear(year){\n //(year % 4 == 0) && (( year % 100 != 0) || (year % 400 == 0)) ? true : false;\n if ((year % 4 == 0) && (( year % 100 != 0) || (year % 400 == 0))) {\n return true;\n }else {\n return false;\n }\n\n}", "function is_leap_year(year){\n\n if(!(year % 400)) return true\n if(!(year % 100)) return false\n if(!(year % 4)) return true\n return false\n}", "function CheckLeap(yy)\n{\nif ((yy % 100 != 0 && yy % 4 == 0) || (yy % 400 == 0)) { return 29; }\nelse { return 28; }\n}", "function checkLeapYear(year) {\n\n //three conditions to find out the leap year\n if ((0 == year % 4) && (0 != year % 100) || (0 == year % 400)) {\n console.log(year + ' is a leap year');\n } else {\n console.log(year + ' is not a leap year');\n }\n}", "leapyear1(year) {\n if (year % 4 == 0 && year % 100 !== 0 || year % 400 == 0) {\n console.log(year + \" is a leap year\");\n return true\n }\n else {\n console.log(year + \" is not a leap year\");\n return false\n }\n }", "function isLeapYear(year){\n year = +year;\n let isLeapYear = (year % 400 == 0 ) || (year % 4 == 0 && year % 100 != 0);\n console.log(isLeapYear ? \"yes\" : \"no\"); \n}", "function isLeapYear(year){\n // return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0\n //divible by 4 it is\n //divisble by 100 it isnt\n //divisible by 400 it is\n if(year % 4 === 0 && year % 100 !== 0 || year % 400 === 0)\n {\n return true\n }\n return false\n\n}", "function leapYear(year) {\nif ((year/4) != Math.floor(year/4)) return false;\nif ((year/100) != Math.floor(year/100)) return true;\nif ((year/400) != Math.floor(year/400)) return false;\nreturn true;\n}", "function isLeap() {\n var year = document.getElementById('numYear').value;\n\n return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);\n}", "findLeapYear(year)\n{\n if(year>999 && year<10000)\n {\n if(year%4 == 0 && (year%400 == 0 || year%100!= 0))\n {\n console.log(year+\" is a Leap year.\")\n }\n else\n {\n console.log(year+\" is not a Leap year.\")\n }\n }\n else\n {\n console.log(\"Please enter valid 4 digit year format.\");\n \n }\n}", "function calculateIfLeapYear(year) {\n\t\t//Must be divisible by 4 to be a leap year\n\t\tif(year == FIRST_LEAP_YEAR) {\n\t\t\treturn true;\t\t\t\n\t\t} else if (year % 4 == 0) {\n\t\t\t//May not be a leap year if it's divisible by 100\n\t\t\tif(year % 100 == 0) {\n\t\t\t\t//Unless it's divisible by 400 as well\n\t\t\t\tif(year % 400 == 0) {\n\t\t\t\t\treturn true;\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function isLeapYear(year){\n if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) \n return true;\n return false;\n}", "function IsItLeapYear(input){\n \n // console.log(\"is it leap year t/f?\" + IsItLeapYear());\n if ((input % 400) == 0){\n return true;\n }\n else if ((input % 100) == 0){\n return false;\n }\n else if ((input % 4) == 0){\n return true;\n }\n else return false;\n}", "isLeapYear() {\n return this.dateObject.year % 4 === 0;\n }", "function isLeapYear(year){\n if(year%4 == 0)\n {\n if( year%100 == 0) /* Checking for a century year */\n {\n if ( year%400 == 0)\n return true;\n else\n return false;\n }\n else\n return true;\n }\n else\n return false;\n}", "function isLeapYear(year) { return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0); }", "function LeapYear(year){\n var status = false;\n if(year % 400 === 0){\n status = true;\n }\n if(year % 4 === 0 && year % 100 != 0){\n status = true;\n }\n// } else {status = false;}\n if(status == true){\n console.log(year, \" is a leap year\");\n } else (console.log(year, \" is not a leap year\"))\n}", "function leapYear(year){\n if(year % 4 == 0){\n if(year % 400 == 0){\n return true;\n }else if(year % 100 == 0){\n return false;\n }else{\n return true;\n }\n }else{\n return false\n }\n}", "isLeapYear(year) {\n if (year % 4 !== 0) {\n return false;\n }\n\n if (year % 100 === 0 && year % 400 !== 0) {\n return false;\n }\n\n return true;\n }", "function isLeapYear(year){\n /* Takes a single argument, year. Calculates whether or not\n the year is a Leap Year. Returns either true or false */\n\n if (year % 400 === 0){ return true; }\n if (year % 100 === 0){ return false; }\n if (year % 4 === 0){ return true; }\n else { return false; }\n}", "function leapYear(year)\n{\n //...divisible by four but not by 100 - leap year\n if(year % 4 == 0 && year % 100 !== 0)\n {\n console.log('Leap Year');\n }\n //...divisible by 400 - leap year\n else if(year % 400 == 0)\n {\n console.log('Leap Year');\n }\n else\n {\n console.log('Not a Leap Year');\n }\n}", "function leap(y){\n if(y % 4 == 0 && y % 100 != 0 || y\n \n % 400 == 0){\n alert(\"it is leap year\");\n } else {\n alert(\"not a leap year\");\n }\n}", "function getLeapYear(year) {\n if ((year % 4 == 0) && (year % 100 != 0) || (year % 400 == 0)) {\n return true;\n } else {\n return false;\n }\n}", "function isLeapYear(year) {\nif ((year % 4 === 0 && year % 100 !== 0) || (year % 100 === 0 && year % 400 === 0)) {\n return true; \n } else {\n return false;\n }\n}", "function leapYear(year){\n if (year % 400 === 0) {\n console.log(\"Yes!\");\n } else if (year % 100 === 0){\n console.log(\"No!\");\n } else if (year % 4 === 0){\n console.log(\"Yes!\")\n }\n}", "function leapYear(year)\r\n{\r\n if(year % 4 == 0)\r\n {\r\n if(year % 100 == 0)\r\n {\r\n if (year % 400 == 0)\r\n {\r\n console.log(\"It is a leap year!\") \r\n }\r\n else\r\n {\r\n console.log(\"It is a not a leap year\")\r\n }\r\n }\r\n else\r\n {\r\n console.log(\"It is a leap year!\") \r\n }\r\n }\r\n}", "function checkLeapYear2(year) {\n return new Date(year, 1, 29).getDate() === 29;\n}", "function isLeapYear() {\n var year = Number(prompt(\"Year ? \"));\n\n var leapYear = year % 100 === 0 ? year % 400 === 0 : year % 4 === 0;\n return leapYear;\n}", "function isItLeapYear() {\n // gauti dabartinius metus\n let now = new Date();\n\n let year = now.getFullYear();\n year = 2016;\n // ar metai dalinasi is 4 lygiai\n if (year % 4 !== 0) {\n console.log(\"not a leap year\");\n return;\n }\n\n // ar metai dalinasi is 100 ir is 400\n if (year % 100 === 0 && year % 400 === 0) {\n console.log(\"leap year\");\n } else {\n console.log(\"not a leap year\");\n }\n}", "function isLeapYear(year) {\n if (year % 4 != 0) {\n return false;\n } else if (year % 100 != 0) {\n return true;\n } else if (year % 400 != 0) {\n return false;\n } else {\n return true;\n }\n}", "function isLeapYear(year){\r\n let res = ( !(year%400) || (year%100) && !(year%4) );\r\n // condition simplified using precedence\r\n if(res){\r\n cl(`Year ${year} is a leap year.`);\r\n }else{\r\n cl(`Year ${year} is not a leap year.`);\r\n }\r\n}", "function leapYear(year) {\n if ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)) {\n document.write(\"its a leap year\");\n }\n else {\n document.write(\"its not a leap year\");\n }\n\n}", "function leapyearV2(year) {\n\treturn year % 100 === 0 ? year % 400 === 0 : year % 4 === 0;\n}", "function isLeapYear(year) {\n if (year % 400 === 0) {\n return true;\n } else if(year % 4 === 0 && !(year % 100 === 0)) {\n return true;\n } else {\n return false;\n }\n}", "function leapYear(year) {\n return (year % 4 == 0 && year % 100 != 0) || year % 400 == 0;\n}", "function leapYear(year) {\n return (year % 4 === 0 && year % 100 !== 0) || (year % 100 === 0 && year % 400 === 0) ? year : false\n}", "function isLeapYear(year) {\n const d = new Date(year, 1, 29);\n return d.getDate() === 29;\n}", "function isLeapYear(year) {\n if (!(year % 4)) {\n if (year % 100) {\n return true;\n }\n if (!(year % 400)) {\n return true;\n }\n }\n return false;\n}", "function isLeapYear(year) {\r\n return ((year % 4) === 0 && ((year % 100) !== 0 || (year % 400) === 0));\r\n}", "function LeapYear(year)\n{\n\n if((year%4 && year%100 && year%400)===0)\n {\n document.write(\"Its a Leap year\");\n }\n else\n {\n document.write(\"\\n It's not a Leap Year\");\n }\n}", "function leapYear(){\n\tvar year = Math.floor((Math.random() * 118) + 1900); /// Set a random year from 1900-2018\n\n\tconsole.log(\"Year = \" +year);\n\n\tif (((year % 4 == 0) && (year % 100 !=0)) || (year % 400 == 0 )) { /// Leap year is either divisible by 4, but NOT 100 -- OR any year divisible by 400 is a leap year\n\tconsole.log(\"Yes! It is a Leap Year!\");\n\t} \n\n\telse {\n\tconsole.log(\"No. It is not a Leap Year.\");\n\t}\n\n}", "function isLeap(year) {\n\n /**************Don't change the code above****************/\n var yearResult = \"\";\n if (year % 4 !== 0) {\n yearResult = \"Not leap year.\"; // if a year is not divisible by 4 then it is not a leap year\n } else if (year % 100 !== 0) {\n yearResult = \"Leap year.\"; // else if a year is not divisible by 100 then it is a leap year\n } else if (year % 400 !== 0) {\n yearResult = \"Not leap year.\"; // else if a year is not divisible by 400 then it is not a leap year\n } else {\n yearResult = \"Leap year.\"; // else it is a leap year\n }\n\n return yearResult;\n\n}", "function isLeapYear(year) {\n if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n return true;\n } else {\n return false;\n }\n}", "function isLeapYear(year) {\n if (year % 400 === 0) return true;\n if (year % 100 === 0) return false;\n return year % 4 === 0;\n }", "function isLeapYear(year) {\n // leap year must be divide mod with 4 === 0\n if (year % 4 === 0) {\n //leap year must be divide mod with 100 !== 0\n if (year % 100 === 0) {\n // but if that year can mod with 400 === 0 It is leap year\n if (year % 400 === 0) {\n return true;\n }\n return false;\n }\n return true;\n }\n // it not leap year\n else {\n return false;\n }\n}", "function leapFinder(year) {\n if ((year % 4 === 0) && (year % 100 !== 0) || (year % 400 === 0)) {\n year = 'Leap year'; \n } else {\n year = 'Not a leap year'; \n }\n\n return year; \n}", "function leapyear(year) {\n if(year % 100 == 0) {\n if(year % 400 == 0) {\n alert(\"yes, this is a leap year\");\n }\n else {\n alert(\"nah\");\n }\n }\n else if(year % 4 == 0) {\n alert(\"yes, this is a leap year\");\n }\n else {\n alert(\"nah\");\n }\n}", "function isLeapYear(year) {\n\t return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;\n\t}", "function isIslamicLeapYear(hYear) {\n return (14 + 11 * hYear) % 30 < 11;\n}", "function isLeapYear(year, purpose) {\n\n //if a year is divisible by 4, then it is potentially a leap year, if it is not divisible by 100 unless it is also divisible by 400 it is a leap year\n if (year % 4 == 0 && (year % 100 != 0 || (year % 100 == 0 && year % 400 == 0))) {\n\n if (purpose == 'yearDayCount') {\n return 366;\n }\n else if (purpose == 'bool') {\n return true;\n }\n }\n else {\n if (purpose == 'yearDayCount') {\n return 365;\n }\n else if (purpose == 'bool') {\n return false;\n }\n }\n}", "function leap_islamic(year)\n {\n return (((year * 11) + 14) % 30) < 11;\n }", "function isIslamicLeapYear(hYear) {\n return (14 + 11 * hYear) % 30 < 11;\n}", "leapYear(year) {\n if (year > 999 && year < 10000) {\n if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0)\n console.log(year + \" is a leap year\");\n else\n console.log(year + \" is not a leap year\");\n\n }\n else\n console.log(\"Please enter a 4 digit year\");\n }", "function isYear(year){\n if(a%100==0 && a%400==0){\n return 'leap year';\n }else if(a%100!=0 && a%4==0){\n return 'leap year';\n }else{\n return 'not leap year';\n }\n}", "function leapYear(year) {\n\tif (year%400 === 0) {\n\t\treturn true;\n\t} else if (year%100 === 0) {\n\t\treturn false;\n\t} else if (year%4 === 0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function isLeapYear(n) {\n let leap = false;\n\n if (n % 4 === 0) leap = true;\n if (n % 100 === 0 && n % 400) leap = true;\n\n return leap;\n}", "function CheckDate(theYear, startYear, feet) {\n if (theYear > startYear)\n return true;\n else return false;\n}", "function isLeapYear(year) {\r\n return (year%4 == 0 && year%100 != 0) || (year%400 == 0);\r\n }", "function isLeapYear(year) {\n\treturn ((year % 4 === 0) && (year % 100 !== 0)) || (year % 400 === 0);\n}", "function leap (num) {\r\n\r\nif (num % 4 === 0) {\r\n console.log(\"That's a leap year\");\r\n}\r\nelse {\r\n console.log(\"That's not a leap year\");\r\n}\r\n}", "function isLeap(year) {\n\tvar isEvenlyDivisibleBy4 = year%4;\n\tvar isEvenlyDivisibleBy100 = year%100;\n\tvar isEvenlyDivisibleBy400 = year%400;\n\tif((isEvenlyDivisibleBy4 == 0) && (isEvenlyDivisibleBy100 != 0)) {\n\t\treturn (\"This is a Leap Year! A leap year has 366 days, with an extra day in February\");\n\t\t}\n\telse if((isEvenlyDivisibleBy4 == 0) && (isEvenlyDivisibleBy100 == 0) && (isEvenlyDivisibleBy400 == 0)){\n\t\treturn (\"This is a Leap Year! A leap year has 366 days, with an extra day in February\");\n\t\t}\n\telse {\n\t\treturn (\"This is NOT a Leap Year. A normal year has 365 days.\");\n\t\t}\n}", "function leapYear(year) {\n if(year % 400 === 0 || (year % 4 === 0 && year % 100 !== 0)) {\n return true;\n }\n\n return false;\n}", "function checkOverEighteenFn(year, month, day) {\n // Write your code here\n let d = new Date();\n year = d.getFullYear() - year\n if(year >= 18){\n return true\n }\n \n return false\n}", "function leapYear(year) {\n if ((year % 4 === 0 && year % 100 !== 0) || (year % 400 === 0)) {\n return true;\n }\n return false;\n}", "function checkLeapYear(){\n if(dateInfo.currentYear%4==0){\n monthInfo[1][1] = 29;\n }\n else{\n monthInfo[1][1] = 28;\n }\n}", "function leapYear(year) {\n return ((year % 4 === 0) && ((year % 100 !== 0) || (year % 400 === 0)));\n }", "function isLeapYear(i) {\n return (!(i % 100 == 0 && !i % 400 == 0) && i % 4 == 0)\n }", "function isLeap(year) {\n if (year % 4 === 0 || year % 400 === 0) {\n return (\"Leap year.\");\n } else if (year % 100 === 0) {\n return (\"Not leap year.\");\n } else if (year % 400 === 0) {\n return (\"Leap Year.\");\n } else {\n return (\"Not leap year.\");\n }\n}", "function isLeapYear3(year) {\n if (year % 4 === 0) {\n return false;\n } else if (year % 100 === 0) {\n return true;\n } else {\n return year % 400 === 0;\n }\n}", "function leapyear(year) {\n if(year%100===0 && year%400===0 || year%4===0){\n return \"Its leap year\"\n }\n else{\n return \"its not a leap year\"\n }\n }", "function leapYear(year){\nalert(year);\nvar result; \n if (year%400 == 0){\n result = true;\n }\n else if(year%100 == 0){\n result = false;\n }\n else if(year%4 == 0){\n result= true;\n }\n else{\n result= false;\n }\n alert(result? \"It is a leap year\" : \"It is not a leap year\");\n}", "function __LeapGregorian(year)\n{\n return ((year % 4) == 0) &&\n (!(((year % 100) == 0) && ((year % 400) != 0)));\n}", "function leapYear()\n{\n\tif( year % 4 == 0);\n\t{\n\t\tif( year % 100 == 0)\n\t\t{\n\t\t\tconsole.log(“not leap year”);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tconsole.log(“leap year”);\n\t\t}\n\t}\n\telse if ( year % 400 == 0)\n\t{\n\t\tconsole.log(“leap year”)\n\t}\n\telse \n\t{\t\n\t\tconsole.log(“not leap year”)\n\t}\n}", "function leapYear(year) {\r\n if (year % 400 === 0) {return year + ' is a leap year.'}\r\n else if (year % 100 === 0 && year % 400 !== 0) {return year + ' is not a leap year.'}\r\n else if (year % 4 === 0) {return year + ' is a leap year.'}\r\n else {return year + ' is not a leap year.'}\r\n}", "function leapYear(year) {\n var n = year % 4;\n if (n == 0) {\n alert(year + \" is leap year\");\n }\n else {\n alert(year + \" is not leap year\");\n }\n}", "function isLeapYear(year){\n if(year%4 == 0){\n return (year+\" was/is/will be a leap year.\")\n }\n else{\n return (year+\" was/is/will not be a leap year.\")\n };\n }", "function isLeapJalaaliYear (jy) {\n return jalCalLeap(jy) === 0\n }", "function isLeapYear(year) {\n\t\t// If the year is evenly divisible by 4, then continue.\n\t\tif (year % 4 == 0) {\n\t\t\t// If the year is not evenly divisible by 400 but is evenly\n\t\t\t// divisible by 100, then return false.\n\t\t\tif ((year % 400 != 0) && (year % 100 == 0)) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t// Otherwise, return true.\n\t\t\telse {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\t// Otherwise, return false.\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function leapYear(year) {\n if (year % 4 === 0) {\n if (year % 100 === 0) {\n if (year % 400 === 0) {\n return \"leap year\";\n } else {\n return \"not leap year\";\n }\n } else {\n return \"Leap Year\";\n }\n } else {\n return \"Not Leap Year\";\n }\n}", "function isLeapYear(number) {\n var year = number;\n var response = \"\";\n var yearIsInteger = Number.isInteger(year / 4);\n\n if (yearIsInteger) {\n response = \"Yes, is a leap year\";\n } else {\n response = \"No, is not a leap year\";\n }\n\n return response;\n}", "function isLeap2 (year) {\n if (year % 4 > 0) {\n return ('Not leap year.')\n }\n if (year % 100 > 0) {\n return ('Leap year.')\n }\n if (year % 400 === 0) {\n return ('Leap year.')\n } else {\n return ('Not leap year.')\n }\n}", "function leap_persiana(year)\n {\n return (persiana_to_jd(year + 1, 1, 1) -\n\t persiana_to_jd(year, 1, 1)) > 365;\n }", "function isLeapSolarHijriYear(hy) {\n return solarHijriCal(hy).leap == true\n}", "function isLeapYear(number) {\n\tlet year = number,\n\t\tonePlace,\n\t\ttensPlace,\n\t\tyearArry = [],\n\t\toutput = `The year ${year} is a leap!`;\n\tfor (let i = 0; i < year.toString().length; i++) {\n\t\tyearArry.push(year.toString()[i]);\n\t}\n\tonePlace = yearArry.pop();\n\ttensPlace = yearArry.pop();\n\t// \t*todo A2. If the year can be evenly divided by 100, it is NOT a leap year, unless;\n\tif (year % 100 === 0) {\n\t\t// *todo A3. The year is also evenly divisible by 400: Then it is a leap year.\n\t\tif (parseInt(onePlace) === 0 && parseInt(tensPlace) === 0) {\n\t\t\tif (Number.isInteger(year / 400)) return output;\n\t\t}\n\t\t// *todo A1. The year is evenly divisible by 4;\n\t\tif (Number.isInteger(year / 4)) return output;\n\t}\n\treturn `The year ${year} is NOT a leap!`;\n}", "function leapyear(b_yr,c_yr){\n var leap_count =0;\n for(b_yr ; b_yr<=c_yr; b_yr++ ){\n if((b_yr%400 == 0)||(b_yr%100 != 0)&& (b_yr%4 == 0)){\n leap_count+=1;\n }\n }\n return leap_count;\n \n}", "function leap_gregorian(year){\r\n return ((year % 4) == 0) &&\r\n (!(((year % 100) == 0) && ((year % 400) != 0)));\r\n}", "function IsLeapYear(lunisolarYear)\r\n {\r\n return (LEAP_YEARS_AND_MONTHS[lunisolarYear] != undefined);\r\n }", "function nextYear()\n\t\t\t{\n\t\t\t\tif( gMonth<=2)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse if(gMonth == 3 && gDay < leap)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}", "function isGregorianLeapYear(gDate) {\n const year = gDate.getFullYear();\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n}", "function isGregorianLeapYear(gDate) {\n var year = gDate.getFullYear();\n return year % 4 === 0 && year % 100 !== 0 || year % 400 === 0;\n}", "function leap_gregorian(year) {\n\n return ((year % 4) == 0) &&\n (!(((year % 100) == 0) && ((year % 400) != 0)));\n\n}", "function checkDate() {\r\n var date = document.getElementById(\"date\").value;\r\n newDate = new Date(date);\r\n var year = newDate.getFullYear();\r\n\r\n if(year == 2020)\r\n {\r\n return false;\r\n }else\r\n {\r\n return true;\r\n }\r\n}", "function hebrew_leap(year)\n {\n return mod(((year * 7) + 1), 19) < 7;\n }", "function leapYear() {\n var year = +prompt(\"Enter Year\")\n if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0) {\n alert(year + \"is leap year\")\n }\n else {\n alert(year + \"is not a leap year\")\n }\n}", "function leap_persian(year){\r\n return ((((((year - ((year > 0) ? 474 : 473)) % 2820) + 474) + 38) * 682) % 2816) < 682;\r\n}", "function test() {\n // let leap = 0;\n let days = 0;\n\n for (let year = 1; year < 3000; year++) {\n const isLeap = isLeapYear(year);\n const daysInYear = 365 + Number(isLeap);\n // leap += Number(isLeap);\n\n for (let day = 1; day < daysInYear; day++) {\n if (isLeap && day < 60) {\n if (leapDaysInYear(year) - 1 !== leapDaysInDays(days + day)) {\n console.log(`${year}: ${leapDaysInYear(year) - 1} ${leapDaysInDays(days + day)} || ${day}`);\n }\n } else {\n if (leapDaysInYear(year) !== leapDaysInDays(days + day)) {\n console.log(`${year}: ${leapDaysInYear(year)} ${leapDaysInDays(days + day)} || ${day}`);\n }\n }\n\n // if (leapDaysInYear(year) !== leapDaysInDays(days + day)) {\n // console.log(`${year}: ${leapDaysInYear(year)} ${leapDaysInDays(days + day)} || ${day}`);\n // }\n }\n\n days += daysInYear;\n }\n}", "function leap_gregorian(year) {\n return ((year % 4) == 0) &&\n (!(((year % 100) == 0) && ((year % 400) != 0)));\n}", "function leap_gregorian(year) {\n return ((year % 4) == 0) &&\n (!(((year % 100) == 0) && ((year % 400) != 0)));\n}", "function __LeapPersian(year)\n{\n return ((((((year - ((year > 0) ? 474 : 473)) % 2820) + 474) + 38) * 682) % 2816) < 682;\n}" ]
[ "0.8105666", "0.8043165", "0.80352247", "0.79319185", "0.79062885", "0.78988314", "0.78467315", "0.78442097", "0.7812159", "0.78047854", "0.7772833", "0.7762213", "0.7752126", "0.7731435", "0.7725717", "0.7717177", "0.7712448", "0.77115804", "0.7685194", "0.7665907", "0.7665", "0.7635433", "0.7634488", "0.7629287", "0.7596502", "0.7588417", "0.75568646", "0.7535736", "0.7529064", "0.75255734", "0.75201917", "0.7499707", "0.7491952", "0.74878633", "0.7485904", "0.74815387", "0.74811393", "0.7475818", "0.7470973", "0.74608433", "0.7449447", "0.74274886", "0.7424142", "0.74042356", "0.7389272", "0.7388212", "0.73877144", "0.7386168", "0.73641866", "0.7352567", "0.7346879", "0.73428214", "0.7333629", "0.7324156", "0.7304052", "0.72969264", "0.7293067", "0.7290623", "0.7279845", "0.72745913", "0.72680414", "0.7266638", "0.7256438", "0.7253545", "0.723696", "0.7229926", "0.7229767", "0.72233444", "0.7217276", "0.720443", "0.7200187", "0.7199281", "0.7178681", "0.7157696", "0.7153751", "0.7095596", "0.70897067", "0.7067851", "0.706026", "0.69925725", "0.6973562", "0.69341487", "0.68450034", "0.68232024", "0.6769035", "0.67518926", "0.6741132", "0.673324", "0.6695732", "0.6642266", "0.66373944", "0.66329825", "0.66265595", "0.65948737", "0.6576163", "0.65249753", "0.6493871", "0.6481189", "0.6481189", "0.6476599" ]
0.7546553
27
3. Create a function that can perform a word count, given a block of text. Punctuations or special characters are not to be included.
function countWords(text) { let punctuationRemove = text.replace(/[\.,-\/#!$%\^&\*;:{}=\-_`~()@\+\?><\[\]\+]/g, ''); let splitText = punctuationRemove.split(' '); console.log(splitText); let count = splitText.length; console.log(count); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWordCounts(text) {\n\n}", "function wordcount(text) {\n text = text.replace(/<\\/?(?!\\!)[^>]*>/gi, '');\n // Replace underscores (which are classed as word characters) with spaces.\n text = text.replace(/_/gi, \" \");\n // Remove any characters that shouldn't be treated as word boundaries.\n text = text.replace(/[\\'\"’-]/gi, \"\");\n // Remove dots and commas from within numbers only.\n text = text.replace(/([0-9])[.,]([0-9])/gi, '$1$2');\n\n return text.split(/\\w\\b/gi).length - 1;\n }", "function wordCounter(text) {\r\n const summary = text.split(\" \");\r\n let wordCount = 0;\r\n for (let i = 0; i < summary.length; i++) {\r\n if (text[i] !== \" \") {\r\n wordCount++;\r\n }\r\n }\r\n return wordCount;\r\n\r\n}", "function wordsCounter(text){\n\n if(text === ''){\n return 0;\n }else if(!text.includes(' ')){\n return 1;\n }else if(text.includes(' ')){\n return spaceCount(text) + 1;\n }\n}", "function countWords(text){\n //characters with spaces\n characters.innerText=text.length;\n \n displayMessage(text);\n\n text=text.split(' ');\n let wordCount=0;\n\n for(let i=0;i<text.length;i++){\n if(text[i]!=' ' && isWord(text[i])){\n wordCount++;\n }\n }\n \n words.innerText=wordCount;\n calculateReadingTime(wordCount);\n}", "function countWords(text) {\n return tokenize.words()(text).length;\n}", "function countNumOfWords(str) {\n\n}", "function countWords(keyword){\n return (keyword.replace(/(^\\s*)|(\\s*$)/gi,\"\").replace(/[ ]{2,}/gi,\" \").replace(/\\n /,\"\\n\").split(' ').length);\n}", "function wordCount(){\n var wom = $(\"#essay\").html().replace( /[^a-z0-9\\s]/g, \"\" ).split( /\\s+/ ).length;\n $(\"#demo11\").html(wom + \" word count\")\n}", "function countWords(text) {\n return text.split(' ').length;\n}", "function wordcount() {\n var matches = writing_data().match(/\\w\\w+/g);\n if(!matches) return 0;\n return matches.length;\n}", "function countWords(txt) {\n let words = getWords(txt);\n return words.length;\n}", "function count(text) {\n\tvar wc = 0;\n\n\ttestWords.lastIndex = 0;\n\twhile (testWords.test(text)) wc++;\n\treturn wc;\n}", "function wordMatchCount(tweet, target_tier) {\n //put # here and get rid of createKeywordTier ?\n var normalized_text = tweet.text.toLowerCase().replace(/[\\.,-\\/!$#%\\^&\\*;:{}=\\-_`~()]/g,\"\");\n var words = normalized_text.split(' ');\n var count = 0; \n\n for(var i=0; i < words.length; i++) {\n if(target_tier[words[i]]) {\n //console.log(words[i]);\n count++;\n }\n }\n return count;\n}", "function countWords(txt) {\n // write your code here\n let count=0;\n let arr=txt.split('');\n for(let g=0;g<arr.length;g++){\n if(arr[g] == ' ')\n count=count+1;\n }\nreturn count+1;\n }", "function wordCount(data) {\n var pattern = /[a-zA-Z0-9_\\u00A0-\\u02AF\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n var m = data.match(pattern);\n var count = 0;\n if (m === null) return count;\n for (var i = 0; i < m.length; i++) {\n if (m[i].charCodeAt(0) >= 0x4E00) {\n count += m[i].length;\n } else {\n count += 1;\n }\n }\n return count;\n}", "function wordCount(data) {\n var pattern = /[a-zA-Z0-9_\\u00A0-\\u02AF\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n var m = data.match(pattern);\n var count = 0;\n if (m === null) return count;\n for (var i = 0; i < m.length; i++) {\n if (m[i].charCodeAt(0) >= 0x4E00) {\n count += m[i].length;\n } else {\n count += 1;\n }\n }\n return count;\n}", "function wordCount(data) {\n\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\tvar m = data.match(pattern);\n\tvar count = 0;\n\tif(m === null) return count;\n\tfor(var i = 0; i < m.length; i++) {\n\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\tcount += m[i].length;\n\t\t} else {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}", "function wordCount(data) {\n\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\tvar m = data.match(pattern);\n\tvar count = 0;\n\tif(m === null) return count;\n\tfor(var i = 0; i < m.length; i++) {\n\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\tcount += m[i].length;\n\t\t} else {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}", "function wordCount(data) {\n\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\tvar m = data.match(pattern);\n\tvar count = 0;\n\tif(m === null) return count;\n\tfor(var i = 0; i < m.length; i++) {\n\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\tcount += m[i].length;\n\t\t} else {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}", "function wordCount(data) {\n\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\tvar m = data.match(pattern);\n\tvar count = 0;\n\tif(m === null) return count;\n\tfor(var i = 0; i < m.length; i++) {\n\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\tcount += m[i].length;\n\t\t} else {\n\t\t\tcount += 1;\n\t\t}\n\t}\n\treturn count;\n}", "function wordCount(data) {\n\t\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\t\tvar m = data.match(pattern);\n\t\tvar count = 0;\n\t\tif(m === null) return count;\n\t\tfor(var i = 0; i < m.length; i++) {\n\t\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\t\tcount += m[i].length;\n\t\t\t} else {\n\t\t\t\tcount += 1;\n\t\t\t}\n\t\t}\n\t\treturn count;\n\t}", "function wordCount(data) {\n var pattern = /[a-zA-Z0-9_\\u0392-\\u03c9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n var m = data.match(pattern);\n var count = 0;\n if( m === null ) return count;\n for (var i = 0; i < m.length; i++) {\n if (m[i].charCodeAt(0) >= 0x4E00) {\n count += m[i].length;\n } else {\n count += 1;\n }\n }\n return count;\n}", "function wordCount(data) {\n\t\t\tvar pattern = /[a-zA-Z0-9_\\u0392-\\u03c9\\u0410-\\u04F9]+|[\\u4E00-\\u9FFF\\u3400-\\u4dbf\\uf900-\\ufaff\\u3040-\\u309f\\uac00-\\ud7af]+/g;\n\t\t\tvar m = data.match(pattern);\n\t\t\tvar count = 0;\n\t\t\tif(m === null) return count;\n\t\t\tfor(var i = 0; i < m.length; i++) {\n\t\t\t\tif(m[i].charCodeAt(0) >= 0x4E00) {\n\t\t\t\t\tcount += m[i].length;\n\t\t\t\t} else {\n\t\t\t\t\tcount += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn count;\n\t\t}", "function wordCount() {\n\n var example = document.getElementById(\"target\").textContent;\n //Splits into array\n tokens = example.split(/\\W+/);\n //Cycles through array and counts words\n for (var i = 0; i < tokens.length; i++) {\n var word = tokens[i];\n // It's a new word!\n if (concordance[word] === undefined) {\n concordance[word] = 1;\n // We've seen this word before!\n } else {\n concordance[word]++;\n }\n }\n return concordance;\n }", "function wordCount() {\n\n var example = document.getElementById(\"target\").textContent;\n //Splits into array\n tokens = example.split(/\\W+/);\n //Cycles through array and counts words\n for (var i = 0; i < tokens.length; i++) {\n var word = tokens[i];\n // It's a new word!\n if (concordance[word] === undefined) {\n concordance[word] = 1;\n // We've seen this word before!\n } else {\n concordance[word]++;\n }\n }\n return concordance;\n }", "function countCensoredWords(sentence, words){\n if (typeof sentence === 'string' && typeof words === 'object'){\n const results = {}\n for (const key of words){\n results[key] = 0\n }\n results.total = 0\n sentence.toLowerCase().replace(/[^a-z\\s]/g, '').split(' ').map(item => {\n words.map(word => {\n if (item === word){\n results[word]++\n results.total++\n }\n })\n })\n return results\n } else {\n console.log('Please provide a string as the first parameter and a array as the second parameter')\n }\n}", "function wordcount(word){\n\t//console.log(word)\n\tletterarray = word.split(\"\");\n\tnumletters = letterarray.length;\n\tevalexpression = 'prioritydic';\n\tfor(y = 0; y < numletters+1; y++){\n\t\tif(y == numletters){\n\t\t\tevalexpression = evalexpression + \".nn\"\n\t\t}\n\t\telse{\n\t\t\tevalexpression = evalexpression + '.' + letterarray[y];\n\t\t}\n\t}\n\tcount = eval(evalexpression)\n\treturn count\n}", "function wordcount(word){\n\t//console.log(word)\n\tletterarray = word.split(\"\");\n\tnumletters = letterarray.length;\n\tevalexpression = 'prioritydic';\n\tfor(y = 0; y < numletters+1; y++){\n\t\tif(y == numletters){\n\t\t\tevalexpression = evalexpression + \".nn\"\n\t\t}\n\t\telse{\n\t\t\tevalexpression = evalexpression + '.' + letterarray[y];\n\t\t}\n\t}\n\tcount = eval(evalexpression)\n\treturn count\n}", "countWords(str) {\n //exclude start and end white-space\n str = str.replace(/(^\\s*)|(\\s*$)/gi,\"\");\n //convert 2 or more spaces to 1 \n str = str.replace(/[ ]{2,}/gi,\" \");\n // exclude newline with a start spacing \n str = str.replace(/\\n /,\"\\n\");\n\n return str.split(' ').length;\n }", "function wordCount(str){\nreturn str.split(\" \").length;\n}", "function countWords(str) {\n // your code here\n var x = {};\n if (str !== \"\") {\n var arr = str.split(\" \");\n for (var i = 0; i < arr.length; i++) {\n if (typeof x[arr[i]] != \"undefined\") {\n x[arr[i]] += 1;\n } else {\n x[arr[i]] = 1;\n }\n }\n } else {\n return x = {};\n }\n return x;\n }", "function counting(word) {\n var newWord = word.replace(/[A-Za-z0-9]/g, '');\n // var noNums = newWord.replace(/[0-9]/g, '');\n var arr = newWord.split(\"\");\n return arr.length;\n}", "function wordCountEnginePt2(document) {\n // your code goes here\n const frequencyCnt = {};\n document\n .toLowerCase()\n .split(' ')\n .forEach((word, index) => {\n word = word.replace(/[^a-z]/gi, '');\n if (word) {\n if (frequencyCnt[word]) {\n frequencyCnt[word] = {\n count: frequencyCnt[word].count + 1,\n index: Math.min(index, frequencyCnt[word].index),\n };\n } else {\n frequencyCnt[word] = { count: 1, index };\n }\n }\n });\n\n // [[word, {index, count}]]\n const returnArr = Object.keys(frequencyCnt).map(key => [\n key,\n frequencyCnt[key],\n ]);\n returnArr.sort(([_a, a], [_b, b]) => {\n if (b.count === a.count) {\n return a.index - b.index;\n } else {\n return b.count - a.count;\n }\n });\n\n return returnArr\n .map(innerArr => innerArr)\n .map(([key, { count }]) => [key, `${count}`]);\n}", "function countWords() {\n let page = document.getElementsByClassName(\"kix-zoomdocumentplugin-outer\")[0];\n if (page == null) {\n return (\"Element does not exist on the document.\")\n }\n const pageText = page.innerText;\n const words = pageText.split(\" \");\n \n return words.length; \n}", "function countWords(s){\n s = s.replace(/(^\\s*)|(\\s*$)/gi,\"\");//exclude start and end white-space\n s = s.replace(/\\n/g,\" \"); // exclude newline with a start spacing\n s = s.replace(/[ ]{2,}/gi,\" \");//2 or more space to 1\n if( s==\"\" || s == \" \") return 0\n return s.split(' ').length; \n}", "function getWordCount(text, word) {\n text = text.toLowerCase();\n word = word.toLowerCase();\n var answer = 0;\n var index = text.indexOf(word);\n\n while (index > -1) {\n answer++;\n index = text.indexOf(word, index + 1);\n }\n\n return answer;\n}", "function wordCount(str) \n{ \n\treturn str.split(\" \").length;\n}", "function WordCount(str) {\n\n\n return str.split(' ').length;\n\n}", "function countWords(s) {\n s = s.replace(/(^\\s*)|(\\s*$)/gi, \"\");//exclude start and end white-space\n s = s.replace(/[ ]{2,}/gi, \" \");//2 or more space to 1\n s = s.replace(/\\n /, \"\\n\"); // exclude newline with a start spacing\n return s.split(' ').length;\n}", "function WordCount(str) { \n return str.split(' ').length;\n }", "function wordscount(str){\n\treturn str.split(/\\s+/).length;\n}", "function Words(w) {\n\tvar arr = w.split(\" \");\n\treturn arr.length;\n}", "function countWords(str) {\n str = str.replace(/(^\\s*)|(\\s*$)/gi, \"\");\n str = str.replace(/[ ]{2,}/gi, \" \");\n str = str.replace(/\\n /, \"\\n\");\n return str.split(' ').length;\n }", "function wordCount(testChar){\n // Read in the user specified file.\n fs.readFile(process.argv[2], 'utf8', function (err, data){\n // If an error occurs, display its message.\n if(err){\n console.log(err.message);\n }\n // If the file read was successful, process the text and display the\n // results.\n else{\n var wordCounts = processText(data, testChar);\n displayWordCount(wordCounts);\n }\n });\n}", "function count_words(str) {\n let matches = str.match(/[\\w\\d]+/gi);\n return matches ? matches.length : 0;\n}", "function WordCount(str){\n return str.split(\" \").length;\n}", "function countWord(word) {\n if (typeof word !== 'string'){\n return 'error input bukan string';\n } else if (word === \"\") {\n return '';\n } else {\n let count = 1\n for (let j = 0; j < word.length; j++) {\n if (word[j] === ' ' && word[j+1] !== ' ') {\n count++\n }\n }\n if (word === '') return '' \n else return count\n }\n}", "function countWords() {\n //get display location into variable.\n var ul = document.getElementById(\"display\", \"stats\");\n\n //remove any unordered list in DOM.\n while (ul.firstChild) ul.removeChild(ul.firstChild);\n\n //turn user input to UpperCase since all gigVoice keys are upper case. For easy matching for now.\n //will need to find a fix for apostrophe characters in a word.\n var w = document.getElementById(\"searchInput\").value.toUpperCase();\n\n //remove end spacing\n w = w.replace(/(^\\s*)|(\\s*$)/gi, \"\");\n\n //gather 2 or more spacing to 1\n w = w.replace(/[ ]{2,}/gi, \" \");\n\n //exclude new line with start spacing\n w = w.replace(/\\n /, \"\\n\");\n\n //split string\n w = w.split(' ')\n return voiceCheck(w);\n\n }", "function wordCountEngine(doc) {\n const map = new Map();\n const wordList = doc.split(' ');\n let largestCount = 0;\n\n// for i from 0 to wordList.length-1:\n// # convert each token to lowercase\n// word = wordList[i].toLowerCase()\n for (let i = 0; i < wordList.length; i++) {\n const word = wordList[i].toLowerCase();\n const charArray = [];\n for (let char of word) {\n if (char >= 'a' && char <= 'z') {\n charArray.push(char);\n }\n \n }\n const cleanWord = charArray.join('');\n let count = 0;\n if (map.has(cleanWord)) {\n count = map.get(cleanWord);\n count++;\n } else {\n count = 1;\n }\n if (count > largestCount) {\n largestCount = count\n }\n map.set(cleanWord,count);\n }\n // const result = [];\n // for (let key of map) {\n // key[1] = key[1].toString()\n // result.push(key);\n \n // }\n // // result.sort((a,b) => b[1] - a[1])\n // return result;\n const counterList = new Array(largestCount + 1);\n for (word of map.keys()) {\n counter = map.get(word);\n wordCounterList = counterList[counter]\n console.log(counterList)\n if (wordCounterList == null) {\n wordCounterList = [];\n }\n wordCounterList.push(word);\n counterList[counter] = wordCounterList;\n }\n// # init the word counter list of lists.\n// # Since, in the worst case scenario, the\n// # number of lists is going to be as\n// # big as the maximum occurrence count,\n// # we need counterList's size to be the\n// # same to be able to store these lists.\n// # Creating counterList will allow us to\n// # “bucket-sort” the list by word occurrences\n// counterList = new Array(largestCount+1)\n// for j from 0 to largestCount:\n// counterList[j] = null\n\n// # add all words to a list indexed by the\n// # corresponding occurrence number.\n// for word in wordMap.keys():\n// counter = wordMap[word]\n// wordCounterList = counterList[counter]\n\n// if (wordCounterList == null):\n// wordCounterList = []\n\n// wordCounterList.push(word)\n// counterList[counter] = wordCounterList\n\n// # iterate through the list in reverse order\n// # and add only non-null values to result\n// result = []\n// for l from counterList.length-1 to 0:\n// wordCounterList = counterList[l]\n// if (wordCounterList == null):\n// continue\n\n// stringifiedOccurrenceVal = toString(l)\n// for m from 0 to wordCounterList.length-1:\n// result.push([wordCounterList[m], stringifiedOccurrenceVal])\n\n// return result\n\n}", "function countWords(str) {\n return str.split(\" \").length;\n}", "function count_words(file_contents, callback) {\n\tvar words = file_contents.split(/[\\s,]+/);\n\tcallback(words.length);\n}", "function getBodyWordCount(){\n\n var elem = $(\".scribe-body-editor__textarea\").clone();\n var notes = elem.find(\"gu-note\");\n notes.remove();\n var innerText = elem[0].innerText;\n\n var words = $.trim(innerText).split(/[.!?\\s]+/).filter(function (string) {\n return string != \"\\u200B\";\n })\n\n if (!words.length) {\n return 0;\n }\n return words.length;\n}", "function countSentences(text) {\n return tokenizeEnglish.sentences()(text).length;\n}", "function countWords(string){\n const wordArray = string.trim().split(' ')\n return wordArray.filter(word => word !== \"\").length\n }", "function WordCount(str) {\n //split string into array\n var arr = str.split(\" \");\n\n //return array length\n return arr.length;\n\n}", "function processWords(words, pattern) {\n var count = 0;\n var numOfBlocks = [];\n for (var i = 0; i < pattern.length; i++) {\n if (pattern.charAt(i) == ' ') {\n } else {\n count += letterHash[pattern.charAt(i)];\n numOfBlocks.push(letterHash[pattern.charAt(i)]);\n }\n }\n var wordsList = splitUp(words, numOfBlocks, count);\n return wordsList;\n}", "function countWords(textArea) {\n\tvar elClass = textArea.attr('class');\n\tvar minWords = 0;\n\tvar maxWords = 25;\n\tvar countControl = elClass.substring((elClass.indexOf('['))+1, elClass.lastIndexOf(']')).split(',');\n\n\t\tif(countControl.length > 1) {\n\t\t\tminWords = countControl[0];\n\t\t\tmaxWords = countControl[1];\n\t\t} else {\n\t\t\tmaxWords = countControl[0];\n\t\t}\n\t\t\tif ($('.wordCount').length == '0') { // verifies that wordCount element doesn't already exist to prevent multiple additions \t\t\n\t\t\t\ttextArea.after('<div class=\"wordCount\"><strong>0</strong> Words</div>');\n\t\t\t}\n\t\t\tvar numWords = jQuery.trim(textArea.val()).split(' ').length;\n\t\t\t\t\n\t\t\tif(minWords > 0) {\n\t\t\t\ttextArea.siblings('.wordCount').addClass('wordError');\n\t\t\t\treturn false;\n\t\t\t}\t\n\t\t\tif(textArea.val() === '') {\n\t\t\t\t\tnumWords = 0;\n\t\t\t\t}\n\t\t\t\ttextArea.siblings('.wordCount').children('strong').text(numWords);\n\t\t\t\t\n\t\t\t\tif(numWords < minWords || (numWords > maxWords && maxWords != 0)) {\n\t\t\t\t\ttextArea.siblings('.wordCount').addClass('wordError');\n\t\t\t\t\treturn false;\n\t\t\t\t} else {\n\t\t\t\t\ttextArea.siblings('.wordCount').removeClass('wordError');\n\t\t\t}\t\t\t\n\t\t\treturn true;\t\t\t\n}", "function WordCount(str) {\n\n return str.split(\" \").length;\n}", "function countWords(str) {\n\treturn str.split(/\\s/).filter(val => val).length;\n}", "function searchWord(word, text) {\n let count = 0;\n text.split(\" \").forEach((element) => {\n if (element.toLowerCase() === word) {\n count += 1;\n }\n });\n\n return count;\n}", "function countWords(paragraph, word1, word2 ) {\n // console.log(paragraph.split(' '))\n let countWord1 = 0, countWord2 = 0;\n paragraph.split(' ').filter(element => {\n if(element === word1) {\n countWord1++;\n }\n if(element === word2) {\n countWord2++;\n }\n });\n console.log(`word 1 passed = ${word1} count repeated ${countWord1}, word 2 passed = ${word2} count repeated ${countWord2}`)\n}", "function findWordsInText(term, text) {\n let count = 0;\n\n let lcTerm = term.toLowerCase();\n let lcText = text.toLowerCase().split(' ');\n\n for (let i = 0; i < lcText.length; i += 1) {\n if (lcText[i] === lcTerm) {\n count += 1;\n }\n }\n\n return count;\n}", "function countWords() {\r\n var words = document.getElementById(\"quoteInput\").value;\r\n var Count = 0;\r\n\r\n var split = words.split(' ');\r\n \r\n for(var i= 0; i < split.length; i++) {\r\n if (split[i] != \"\"){\r\n Count += 1;\r\n }\r\n }\r\n document.getElementById(\"show\").innerHTML = Count;\r\n console.log(\"hello world\");\r\n}", "function getAnadiplosisCount() {\r\n text = workarea.textContent;\r\n search_string = \"[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\\\s[a-zA-Zа-яА-ЯёЁ]+\";\r\n middle_words = text.match(/[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\s[a-zA-Zа-яА-ЯёЁ]+/g);\r\n new_phrases = [];\r\n result = [];\r\n if(middle_words != null) {\r\n for (i=0; i < middle_words.length; i++) {\r\n phrase = middle_words[i];\r\n phrase = phrase.toLowerCase();\r\n near_space = phrase.match(/[.?!;]{1,3}\\s/)[0];\r\n phrase = phrase.split(near_space);\r\n if(phrase[0] == phrase[1]) {\r\n new_phrases.push(middle_words[i]);\r\n }\r\n }\r\n result = new_phrases;\r\n\r\n tmp = [];\r\n for(key in result) {\r\n if(tmp.indexOf(result[key]) == -1) {\r\n tmp.push(result[key]);\r\n }\r\n }\r\n result = tmp;\r\n count = 0;\r\n\r\n search_string = \"([a-zA-Zа-яА-ЯёЁ]+\\\\s){0}\" + search_string + \"(\\\\s[a-zA-Zа-яА-ЯёЁ]+){0}\";\r\n while(new_phrases.length != 0) {\r\n\r\n middle_words = [];\r\n count++;\r\n search_reg = new RegExp(\"\\\\{\"+(count-1)+\"\\\\}\", 'g');\r\n search_string = search_string.replace(search_reg, \"{\"+count+\"}\");\r\n middle_words = text.match(new RegExp(search_string,\"g\"));\r\n new_phrases = [];\r\n if(middle_words != null) {\r\n for (i=0; i < middle_words.length; i++) {\r\n phrase = middle_words[i];\r\n phrase = phrase.toLowerCase();\r\n near_space = phrase.match(/[^a-zA-Zа-яА-ЯёЁ]{1,3}\\s/)[0];\r\n phrase = phrase.split(near_space);\r\n temp = middle_words[i].split(near_space);\r\n for(j=0; j<phrase.length-1; j++) {\r\n if(phrase[j] == phrase[j+1]) {\r\n new_phrases.push(temp[j] + near_space + temp[j+1]);\r\n } \r\n }\r\n }\r\n\r\n for(key in new_phrases) {\r\n result.push(new_phrases[key]);\r\n }\r\n }\r\n\r\n }\r\n tmp = [];\r\n for(key in result) {\r\n if(tmp.indexOf(result[key]) == -1) {\r\n tmp.push(result[key]);\r\n }\r\n }\r\n result = tmp;\r\n }\r\n return result.length;\r\n}", "countWords(sentence) {\n \tvar sentenceWords = sentence.split(\" \");\n \treturn sentenceWords.length;\n }", "function countWords(input){\n var str = input.split(\" \");\n console.log(str.length);\n }", "function words(str) {\n\n}", "function Tut_CountWordsInHTML(strHTML)\n{\n\t//Not valid string?\n\tif (String_IsNullOrWhiteSpace(strHTML))\n\t\treturn 0;\n\n\t//create a fake div\n\tvar div = document.createElement(\"div\");\n\t//set the text in this div\n\tdiv.innerHTML = strHTML; // SAFE BY SANITIZATION\n\t// Get text\n\tvar text = div.textContent || div.innerText || div.innerHTML || \"\"; // SAFE\n\t//now count the words\n\tvar words = text.match(__NEMESIS_REGEX_COUNT_WORDS);\n\t//return the count\n\treturn words ? words.length : 0;\n}", "countBigWords(input) {\n // Split the input\n let arr = input.split(\" \");\n // Start counter from 0\n let count = 0;\n //if array contains more than 6 lettes word, add 1 otherwise neglect word and keep moving further\n //until whole string input is completed\n arr.forEach(word =>{\n if (word.length > 6){\n count++;\n }\n \n });\n\n // return the count of all words with more than 6 letters\n return count;\n }", "function splitTextByCharCount(text, maxChars, fullWords, rtl) {\n // Maybe the text fits?\n if (text.length <= maxChars) {\n return [text];\n }\n // Init result\n var res = [];\n // Split by words or by charts\n if (fullWords) {\n // Split by words first\n // Split by spacing\n var currentIndex = -1;\n var tmpText = text.replace(/([,;:!?\\\\\\/\\.]+[\\s]+|[\\s])/g, _Strings__WEBPACK_IMPORTED_MODULE_5__[\"PLACEHOLDER\"] + \"$1\" + _Strings__WEBPACK_IMPORTED_MODULE_5__[\"PLACEHOLDER\"]);\n var words = tmpText.split(_Strings__WEBPACK_IMPORTED_MODULE_5__[\"PLACEHOLDER\"]);\n // Process each word\n for (var i = 0; i < words.length; i++) {\n // Get word and symbol count\n var word = words[i];\n var wordLength = word.length;\n // Ignore empty words\n if (wordLength === 0) {\n continue;\n }\n // Check word length\n //if ((wordLength > maxChars) && fullWords !== true) {\n if (wordLength > maxChars) {\n // A single word is longer than allowed symbol count\n // Break it up\n if (rtl) {\n word = reverseString(word);\n }\n var parts = word.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\n // TODO is this correct ?\n if (parts) {\n if (rtl) {\n for (var x = 0; x < parts.length; x++) {\n parts[x] = reverseString(parts[x]);\n }\n //parts.reverse();\n }\n res = res.concat(parts);\n }\n }\n else {\n // Init current line\n if (currentIndex === -1) {\n res.push(\"\");\n currentIndex = 0;\n }\n // Check if we need to break into another line\n if (((res[currentIndex].length + wordLength + 1) > maxChars) && res[currentIndex] !== \"\") {\n res.push(\"\");\n currentIndex++;\n }\n // Add word\n res[currentIndex] += word;\n }\n // Update index\n currentIndex = res.length - 1;\n }\n }\n else {\n // Splitting by anywhere (living la vida facil)\n var parts = text.match(new RegExp(\".{1,\" + maxChars + \"}\", \"g\"));\n if (parts) {\n if (rtl) {\n for (var x = 0; x < parts.length; x++) {\n parts[x] = reverseString(parts[x]);\n }\n }\n res = parts;\n }\n }\n // Do we have only one word that does not fit?\n // Since fullWords is set and we can't split the word, we end up with empty\n // set.\n if (res.length == 1 && fullWords && (res[0].length > maxChars)) {\n res = [];\n }\n return res;\n}", "function wordCount(str) {\n\tvar results = str.split(\" \");\n\tconsole.log((results.length));\n\n}", "function show_num_words() {\n\n var list = document.getElementsByClassName(\"list-unstyled\");\n if (showword_status) {\n for (let i = 0; i < list.length; i++) {\n list[i].getElementsByTagName(\"span\")[0].innerHTML = \"\";\n }\n showword_status = !showword_status;\n return;\n }\n\n var num = 0;\n for (let i = 0; i < list.length; i++) {\n let para = list[i].getElementsByTagName(\"p\")[0].innerText;\n let len = para.split(\" \").length;\n list[i].getElementsByTagName(\"span\")[0].innerHTML = \"<span class='font-weight-bold'>{\" + len + \" words}</span>\";\n }\n showword_status = !showword_status;\n}", "function duplicateCount(text) {\n // ...\n}", "function countWords() {\n reset();\n\n let text = document.getElementById(\"text\").value.toLowerCase();\n\n if (text === \"\") {\n // Show an alert if text field is empty\n alert(\"Text field is empty.\");\n } else {\n // Split by white space\n wordsArr = text.split(\" \");\n // Remove punctuation\n wordsArr.forEach((val, index, arr) => {\n arr[index] = val.replace(/[.!?,;:]/g, \"\");\n });\n // Capitalize first letters\n wordsArr.forEach((val, index, arr) => {\n arr[index] = val.charAt(0).toUpperCase() + val.slice(1);\n });\n // Create unique array\n wordsArr.forEach(w => {\n if (!uniqueArr.includes(w)) {\n uniqueArr.push(w);\n }\n });\n // Find occurences\n for (let i = 0; i < uniqueArr.length; i++) {\n let obj = {};\n let word = uniqueArr[i];\n let freq = 0;\n for (let j = 0; j < wordsArr.length; j++) {\n if (uniqueArr[i] === wordsArr[j]) {\n freq++;\n }\n }\n\n obj.key = word;\n obj.value = freq;\n freqArr.push(obj);\n }\n // Sort the array by descending order\n freqArr.sort(function(a, b) {\n return b.value - a.value;\n });\n\n // Print the result\n print();\n }\n}", "function charFreq(string) {\n //...\n}", "function charFreq(string) {\n //...\n}", "function charFreq(string){\n //...\n}", "function charFreq(string){\n //...\n}", "function countLetter(word) {\n const sContainer = selectElement(\".secret-word\");\n for (let i = 0; i < word.length; i++) {\n if (word[i] == \" \") {\n sContainer.textContent += \" \";\n }\n else {\n sContainer.textContent += \"_\";\n }\n }\n}", "function countChars(txt) {\n return txt.length;\n}", "function countWords(stringOfWords) {\n //checking if string is empty \n if (stringOfWords === '') {\n //returning empty object\n return {};\n }\n //result object\n var createdObj = {}\n //spliting the input string into an array of words adding a space\n var words = stringOfWords.split(' ');\n //iterating through array of words using for loop\n for (var i = 0; i < words.length; i++) {\n //creating an alias for the current word in the array\n var currentWord = words[i];\n //checking if the current word is in result object\n if (createdObj[currentWord] === undefined){\n //if the current word is not in result object, gives it a value of 1\n createdObj[currentWord] = 1;\n }else {\n //incrementing the value of current word by 1\n createdObj[currentWord]++;\n }\n }\n // returning the resulted object\n return createdObj;\n}", "function WordCount(str) {\n\n // code goes here \n arr1 = str.split(\" \");\n\n // alert(arr1.length);\n return arr1.length;\n\n\n}", "function longWordCount(string) {\n var words = string.split(\" \");\n var count = 0;\n\n for (var i = 0; i < words.length; i++) {\n if (words[i].length > 7) {count += 1}\n }\n return count;\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function charactersOccurencesCount() {\n\n}", "function getWordCounts(inputString){\n if(inputString !== \"\"){\n var words = inputString.split(' ');\n words.forEach(function(w) {\n if (!wordDict[w]) {\n wordDict[w] = 0;\n }\n wordDict[w] += 1;\n });\n if(showStats===1){\n dispatch(newDictionary(wordDict));\n }\n return wordDict;\n }\n \n}", "function countWords(stringValue) {\n\n let wordsCount = stringValue.split(' ');\n return wordsCount.length;\n\n}", "function _wordSizes(str) {\n const newStr = str.toLowerCase().split(\"\").filter(el => \"abcdefghijklmnopqrtstuvwxyz0123456789 \".includes(el));\n console.log(newStr.join(\"\"));\n return _letterCounter(newStr.join(\"\"));\n}", "function updateCounts() {\n text = document.getElementById('textBox').value;\n var charCount = text.length + 1;\n var wordCount = text.split(' ').length;\n\n document.getElementById('charCount').innerHTML = charCount;\n document.getElementById('wordCount').innerHTML = wordCount;\n}", "function misspelledWords (inputText) {\n misspelledWordsCount = 0;\n let inputTextArray = inputText.split(\" \");\n for (let i = 0; i < inputTextArray.length - 1; i++) {\n if (inputTextArray[i] != originTextArray[i]) {\n misspelledWordsCount++;\n }\n }\n MISSPELLEDWORDCOUNT.innerHTML = addLeadingZeros(misspelledWordsCount);\n}", "function clickEventWord() {\n //take value from text area\n var wordValue = textValue();\n var wordCount;\n //create array using split to separate words by spaces\n // var arr = value.split(\" \");\n if (wordValue === \"\") {\n wordCount = 0;\n } else {\n var arr = wordValue.trim().replace(/ +/g, \" \").split(/[\\s\\r\\n:\\/\\\\]/gi);\n wordCount = arr.length;\n }\n return wordCount;\n}", "function entCounter(text){var c,v;c=text.length;v=0;if(c>0){for(var i=0;i<c;i++){if (text[i]=='\\n'){v++;}if(i==(c-1)){return v;};}}else{return 0;}}", "function counter(word, n) {\n var count = 0;\n for (var i = 0; i < word.length; i++) {\n if (word[i] === n) {\n count++;\n }\n }\n return count;\n}", "function countChars(text, regexp) {\n const characters = tokenize.characters()(text);\n if (regexp)\n return characters.reduce((count, c) => count + regexp.test(c.value), 0);\n else\n return characters.length;\n}", "function charactersOccurencesCount() {\n \n}", "function charactersOccurencesCount() {\n \n}" ]
[ "0.7897133", "0.75909203", "0.7514788", "0.748212", "0.73726386", "0.73344356", "0.7242633", "0.7146962", "0.7118191", "0.70546764", "0.6928537", "0.6917344", "0.6874407", "0.6750008", "0.67400545", "0.6727978", "0.6727978", "0.67111254", "0.67111254", "0.67111254", "0.67062855", "0.669287", "0.66771", "0.6659308", "0.6636715", "0.6636715", "0.6588148", "0.6575985", "0.6575985", "0.6565728", "0.6561797", "0.6541965", "0.6532011", "0.6494715", "0.6490029", "0.64844894", "0.6480717", "0.6475504", "0.64656913", "0.6430073", "0.6418405", "0.6413312", "0.64011914", "0.6382769", "0.63760746", "0.63554764", "0.635095", "0.6349204", "0.6328031", "0.631843", "0.63061184", "0.6281343", "0.6247778", "0.62453806", "0.6240079", "0.62285554", "0.6223507", "0.62127376", "0.6193973", "0.61851525", "0.6177679", "0.6160196", "0.6150794", "0.6136324", "0.61334765", "0.61275417", "0.6110776", "0.61012536", "0.60942173", "0.6079086", "0.60751057", "0.6073325", "0.6058563", "0.6055615", "0.6043736", "0.59963626", "0.59963626", "0.5984705", "0.5984705", "0.59691334", "0.5943076", "0.59425956", "0.5912336", "0.59119", "0.5907786", "0.5907786", "0.5907786", "0.5907786", "0.5907786", "0.5896756", "0.588993", "0.58770955", "0.58691865", "0.586744", "0.58663166", "0.5864011", "0.5858141", "0.5845929", "0.5845426", "0.5845426" ]
0.6925955
11
4. Create a function that checks a string or sentence and returns true if that parameter is a palindrome, (the string is the same forward as it is backward).
function palindrome(string) { let splitString = string.split(''); let reverseArray = splitString.reverse(); let joinArray = reverseArray.join(''); if (string == joinArray) { console.log(true); } else { console.log(false); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPalindrome(str) {\n\n}", "function palindromeCheck(sentence){\n if (typeof sentence === 'string'){\n const reverseSentence = sentence.split('').reverse().join('').toLowerCase().replace(/[^a-z]/g, '')\n const noSpacesString = sentence.toLowerCase().replace(/[^a-z]/g, '')\n if (noSpacesString === reverseSentence){\n return true\n } else {\n return false\n }\n } else {\n console.log('Please provide strings only as parameters')\n }\n}", "function checkForPalindrome(word) {\r\n if (word === reverseString(word)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function palindrome(string) {\n\n}", "function isPalindrome_V2(str){\n if(str.split('').reverse().join('')==str){\n return true;\n }\n return false;\n \n}", "function palindrome(str) {\n return true;\n}", "function isPalindrome(phrase){\r\n return true;\r\n}", "function isPalindrome(string) {\n\n function reverse() {\n return string.split('').reverse().join('')\n }\n\n return string === reverse();\n}", "function palindrome(str) {\r\n // Good luck!\r\n return true;\r\n}", "function palindrome(str) {}", "function isPalindrome(str){\n//base case\nif (str.length === 1) return true;\nif (str.length === 2) return str[0] === str[1] //boolean\n\nif (str[0] === str.slice(-1)) return isPalindrome(str.slice(1, -1)) //.slice(-1) is the end of the word \n\nreturn false \n\n}", "function palindrome(string) {\n return string.toLowerCase() === reverse(string.toLowerCase());\n}", "function palindrome(str){\r\n return reverseString(str) === str;\r\n}", "function palindrome(string) {\n let lower = string.toLowerCase();\n return lower === reverse(lower);\n}", "function isPalindrome(s) {\n var pal = s.split('').reverse().join('');\n return s == pal;\n}", "function palindrome(string) {\n let processedContent = string.toLowerCase();\n return processedContent === reverse(processedContent);\n}", "function palindromeChecker(text) {\n const reversedText = text.toLowerCase().split(\"\").reverse().join(\"\")\n return text === reversedText\n}", "function palindrome(str) {\n \n // pre-process\n str = str.toLowerCase();\n \n // find unwanted characters and replace\n const re = /[^a-z\\d]+/g;\n\tstr = str.replace(re, '');\n\t\n // for reversing a string\n function reverseString(txt) {\n return txt.split('').reverse().join('');\n\t}\n\n\t// A question of symmetry:\n // find length & middle, split and reverse one piece\n // then check for equality\n \n\t// even if odd length string, this will give us enough to\n\t// check two halves are palindromic\n\tconst half = Math.floor(str.length / 2);\n\t\n\tconst flipped = reverseString(str.substring(str.length - half));\n\t\n\treturn str.substring(0, half) === flipped;\n \n}", "function isPalindrome(someStr) {\r\n \r\n thePalin = someStr.split('').reverse().join('');\r\n if (thePalin == someStr)\r\n return true;\r\n else\r\n return false;\r\n \r\n}", "function palindrome(word){\n \n}", "function palindrome(str) {\n return str.toLowerCase().split('').reverse().join('') === str.toLowerCase();\n}", "function palindrome(string) {\n let processedContent = string.toLowerCase();\n return processedContent() === reverse(this.processedContent());\n}", "function palindrome(str) {\n // Compare if original string is equal with reversed string\n return str === reverse(str)\n}", "function isPalendrome(word) {\n // palendrom is same forward and backwards\n // take in word as is\n // create new word that is the reverse\n // compare and return\n let reverseWord = word.split(\"\").reverse().join(\"\");\n //console.log('Word', word)\n //console.log('Reverse', reverseWord);\n return reverseWord === word ? true : false;\n}", "function palindrome(str) {\n if (str === str.split(\"\").reverse().join(\"\")) {\n return true;\n } else {\n return false;\n }\n}", "function isPalindrome(str) {\n // const revString = str\n // .split(\"\") // turn a string into an array\n // .reverse() // reverse, duh\n // .join(\"\"); // method returns the array as a string.\n // return revString === str;\n}", "function checkIsPalindrome(inputString) {\n // Your code here\n let reverseWord = inputString.toString().split('').reverse().join('');\n if (inputString === reverseWord) {\n return 'Yes';\n } \n return 'No'\n}", "function palindrome2(str) {\n str = str.match(/[A-Za-z0-9]/gi).join(\"\").toLowerCase();\n var polindromo = str.split('').reverse().join('');\n return polindromo === str;\n}", "function isPalindrome(str) {\n return str.split('').reverse().join('') === str\n}", "function palindrome(string){\n var newWord='';\n for (var i=string.length-1; i>=0; i--){\n newWord+=string[i];\n \n }\n if (newWord===string){\n return string +' is a palindrome'\n \n } else{\n return string +' is not a palindrome'\n }\n \n }", "function isPalindrome(x) {\n return x.toLowerCase() === x.toLowerCase().split('').slice().reverse().join('') ? true : false;\n}", "function isPalindrome(str){\n const revString = str.split('').reverse().join(''); \n return revString === str; // will give true or false\n \n}", "function isPalindrome(str)\n{\n var reverse = reverseStr(str);\n if(str === reverse)\n {\n return true;\n }\n return false;\n\n}", "function palindrome(str) {\n const rev = str.split('').reverse().join('');\n return str === rev;\n}", "function palinChecker(string){\n\tvar backword = string.split('').reverse().join('');\n\tconsole.log(backword);\n\tif (backword == string){\n\t\tconsole.log(\"You have a palindrome.\");\n\t\treturn true;\n\t}\n\telse{\n\t\tconsole.log(\"Not a palindrome.\");\n\t\treturn false;\n\t}\n}", "function isPalindrome(string) {\n var reversedString = string.split('').reverse().join('');\n return reversedString === string;\n}", "function isPalindrome(str) {\r\n if(str === reverseString(str))\r\n return true;\r\n return false;\r\n}", "function isPalindrome(string){\n return string === string.split('').reverse().join(''); //I DID IT BY MYSELF!!\n}", "function isPalindrome(string) {\n let reverseString = string.split(\"\").reverse().join(\"\");\n return reverseString === string;\n}", "function checkIsPalindrome(inputString) {\n\n if (typeof inputString !== \"string\") {\n return \"no\";\n }\n\n // checking palindromes is kind of weird.\n // take the length of the string.\n // grab string [0] and string [n]; compare for sameness\n // iterate until floor(n/2), I guess\n // as long as the bit is true, it's a palindrome?\n\n let wordArr = inputString.split('');\n for (let i = 0; i < wordArr.length / 2; i++) {\n if (wordArr[i] !== wordArr[wordArr.length - i - 1]) {\n return \"no\";\n }\n }\n return \"yes\";\n\n}", "function isPalindrome(text){\n if (text === undefined){\n return;\n }\n /* Store original formatted string using regex to strip all symbols and whitespace */\n var originalString = text.toLowerCase().replace(/[^\\w]|_/g, \"\");\n\n /* Store formatted reversed string */\n var reversedString = text.toLowerCase().replace(/[^\\w]|_/g, \"\").split(\"\").reverse().join(\"\");\n\n /* If the two strings are equal to each other, it is a palindrome */\n if (originalString == reversedString){\n return 'is-palindrome';\n } else{\n return 'not-palindrome';\n }\n}", "function palindrome(s){\n\n //Reverse the String \n //Push to array , reverse and parse to string\n //Return true if revString and str is equals\n\n const revString = str.split('').reverse().join('');\n\n return revString === str;\n\n}", "function isPalindrome(str) {\r\n if (str === reverseString(str)) {\r\n return true;\r\n }\r\n return false;\r\n}", "function isPalindrome(str) {\r\n return str === str.split('').reverse().join('');\r\n}", "function isPalindrome(stringValue) {\n\n if (reverseText(stringValue) === stringValue)\n return true;\n else\n return false;\n\n}", "function isPalindrome (inputStr) {\n\treturn inputStr.split('').reverse().join('') === inputStr ? true : false; \n}", "function isPalindrome(str){\n return (str === str.split('').reverse().join('')); \n}", "function isPalindrome(s) {\n var str = s.replace(/[^a-zA-Z0-9]/g, '').toLowerCase()\n var half = Math.floor(str.length / 2)\n var lastIndex = str.length - 1\n for (var i = 0; i < half; i++) {\n if (str[i] !== str[lastIndex - i]) {\n return false\n }\n }\n\n return true\n}", "function palindrome(str) \n{\n\n str = str.toLowerCase();\n\nlet strlength = str.length; \n \nfor (let i = 0; i < strlength/2; i++) \n{\nif (str[i] !== str[strlength - 1 - i]) \n{ \n return `${str} is not a palindrome`;\n}\n\n}\nreturn `${str} is a palindrome`;\n}", "function isPalindrome(str) {\n return str == str.split('').reverse().join('');\n}", "function isPalindrome(x) {\n let rev=x.toLowerCase().split('').reverse().join('');\n return x.toLowerCase()===rev? true:false;\n}", "function isPalindrome(name) {\n let word = name.split(\"\").reverse.().join(\"\");\n if (word === name) {\n return true:\n }\n else {\n return false;\n }\n}", "function isPalindrome(str) {\r\n\r\n //Compare if the str getting passed is equal to the reversed of the string\r\n //If it matches then return true\r\n //else false\r\n if(str === reverseString(str)){\r\n console.log(\"True\");\r\n return true;\r\n }\r\n else{\r\n console.log(\"false\");\r\n return false;\r\n }\r\n}", "function palindrome(string) {\n // reverse string\n const reversed = string\n .split(\"\")\n .reverse()\n .join(\"\");\n return string === reversed;\n}", "function isPalindrome(text){\n function helper(str){\n return str.length <= 1 ? str : helper(str.slice(1)) + str[0];\n }\n\n return text === helper(text);\n}", "function isPalindrome(str) {\n const revString = str.split('').reverse().join('');\n return str === revString;\n}", "function isPalindrome(str) {\n return str.split('').reverse().join('').toLocaleLowerCase() === str.toLocaleLowerCase();\n}", "function isPalindrome(word) {\n const reverse = word\n .split(\"\")\n .reverse()\n .join(\"\");\n return word === reverse;\n}", "function palindrome(str)\n{\n// split string into array\n var arr = str.split(\"\");\n// reverse array\n arr = arr.reverse();\n//\n var str2 = arr.join(\"\");\n\n\n// if second string equals the first string return true\n if(str2 == str){\n return true;\n }\n // if they are not equal return false\n return false;\n\n}", "function isPalindrome(str){\r\n // add whatever parameters you deem necessary - good luck!\r\n \r\n function reverse(str){\r\n //console.log(\"STR: \"+str);\r\n if(str === ''){ \r\n return '';\r\n }\r\n \r\n return str.charAt(str.length-1)+reverse(str.substr(0,str.length-1));\r\n }\r\n \r\n return str === reverse(str) ? true : false;\r\n \r\n }", "function palindrome(string,callback)\n{ \nresult=string.split(\"\").reverse().join(\"\");\n if(result==string)\n result=\"palindrome\";\n else\n result=\"not a palindrome\";\n callback(); \n }", "function isPalindrome2(string){\n string = string.toLowerCase(); //case insensitive\n var charactersArr = string.split('');\n var validCharacters = 'abcdefghijklmnopqrstuvwxyz'.split('');\n\n var lettersArr = [];\n charactersArr.forEach(function(char){ // for each character\n if (validCharacters.indexOf(char) > -1) lettersArr.push(char); //get rid of the character if it's not in the list of eligible chars\n });\n\n return lettersArr.join('') === lettersArr.reverse().join(''); // return result of comparing the word with the reverse version of it\n}", "function palindrome(str) {\n\t// Array.prototype.every -- is used to do a boolean check on every element within an array\n\t// arr.every((val) => val > 5);\n\t// If any function returns false, then the overall expression returns false as well\n\treturn str.split('').every((char,i) => {\n\t\treturn char === str[str.length -i -1]; // mirrored element\n\t});\n}", "function isPalindrome1(string) {\n const compareString = \n string.split('')\n .reverse()\n .join('')\n if(string === compareString) return true;\n else return false\n}", "function isPalindrome(s) {\n s = s.replace(/( |[^a-zA-Z0-9])/g, '').toLowerCase()\n var i = 0\n var j = s.length - 1\n\n while (i < j){\n if (s[i] === s[j]) {\n i++\n j--\n } else {\n return false\n }\n }\n\n return true\n}", "function palindrome(string){\n let len = string.length;\n let str = string.toLowerCase();\n for(let i = 0; i < str.length/2; i ++){\n if(str[i] != str[len - i - 1]){\n return false;\n }\n }\n return true;\n}", "function palindromeCheck(str) {\n if (str.length === 1) { // if the length of a word is only 1 character, \n return false; // take it out because a palindrome cannot be created. \n }\n\n str = str.toLowerCase(); // make lower case to make sure algo accounts for all characters in string\n\n let reverseStr = ''; // instantiate blank palindrome holder; \n\n for (let i = str.length - 1; i >= 0; i--) { // loop through string backwards and see what comes out as a palindrome. \n reverseStr += str[i]; // count the number of times a palindrome was able to be found and with what words in string. \n }\n\n return reverseStr === str; // return all palindromes that are the same as the existing words in the string.\n}", "function isPalindrome(str){\n // add whatever parameters you deem necessary - good luck!\n if (str.length === 1) return true;\n \n return str[0] === str[str.length - 1] && isPalindrome(str.slice(1, str.length - 1));\n}", "function Palindrome(str) {\n return str.split(' ').join('') === str.split('').reverse().join('').replace(/ /g,''); \n}", "function palindrome(str) {\n const string = str.toLowerCase().replace(/[^0-9a-z]/gi, '').trim(),\n reversed = string.split('').reverse().join('');\n\n if (reversed === string) {\n return true;\n }\n\n return false;\n}", "function isPalindrome(s) {\n\tvar str = s.replace(/\\W/g,\"\").toLowerCase();\n\treturn str == str.split(\"\").reverse().join(\"\")\n}", "function palindrome(input) {\n let cleanedInput = input.split(\" \").join(\"\");\n let reversedCleanedInput = cleanedInput.split(\"\").reverse().join(\"\")\n if (cleanedInput == reversedCleanedInput) {\n return true\n } else {\n return false\n }\n}", "function isPalindrome(str){\n var str2 = str.toLowerCase().split(\"\").join(\"\").replace(/ /g, '');\n var str3 = str.toLowerCase().split(\"\").reverse().join(\"\").replace(/ /g, '');\n if (str3 === str2) {\n console.log(\"Yay, it's a Palindrome!\")\n }else {\n console.log(\"Sorry, it's not a Palindrome...\")\n }\n}", "function palindrome (string) {\r\n var regExp = /[\\W_]/g; //This is a regular expression. The expreesion in the var regExp is symbol for non alphanumerics and hyphen.\r\n var newString = string.toLowerCase().replace(regExp, ''); //The input parameter is set to lower case and all non alphanumerics are replaced with an empty string\r\n var reversedString = newString.split('').reverse().join(''); // The new string is split into an array, reversed and joined back into a string\r\n if (reversedString === newString) { //if the reversed and new string are equal, the code below runs accordingly\r\n return true;\r\n } \r\n else {\r\n return false \r\n } \r\n}", "function Palindrome(str) {\n\n return str.replace(/[\\s]/g, \"\").toLowerCase() == str.replace(/[\\s]/g, \"\").toLowerCase().split(\"\").reverse().join(\"\");\n}", "function isPalindrome(str){\n let revStr = reversedStr(str)\n if(revStr.toLowerCase() === str.toLowerCase()){\n console.log(`${str} is a palindrome!`)\n } else { \n console.log(`${str} is not a palindrome!`)\n }\n}", "function isPalidrome(str){\n let reverseStrArray = str.split('').reverse();\n let reverseStr = reverseStrArray.join(''); \n \n if (str === reverseStr){\n return true;\n }\n \n return false;\n }", "function isPalindrome(str) {\n\n/////////////////////////////////////////////////////////\n // const strArr = str.split('');\n\n // strArr.reverse();\n \n // const reverseWord = strArr.join('');\n\n // if(str === reverseWord) {\n // console.log(\"It's a Palindrome.\");\n // }else{\n // console.log(\"It's not a Plaindrom.\");\n // }\n\n///////////////////////////////////////////////////////////\n // let revString = '';\n\n // for(let i = str.length - 1 ; i >= 0 ; i--){\n // revString += str[i] ;\n // }\n\n // if(str.lower === revString.lower) {\n // console.log(\"It's a Palindrome.\");\n // }else{\n // console.log(\"It's not a Plaindrom.\");\n // }\n \n//////////////////////////////////////////////////////////\n \n let revString = '';\n\n for(let i = 0 ; i <=str.length - 1 ; i++) {\n revString = str[i] + revString;\n }\n console.log(revString);\n if(str === revString) {\n console.log(\"It's a Palindrome.\");\n }else{\n console.log(\"It's not a Plaindrome.\");\n }\n \n///////////////////////////////////////////////////////////\n\n \n}", "function isPalindrome(str) {\n return (\n str ===\n str\n .split(\"\")\n .reverse()\n .join(\"\")\n );\n}", "function isPalindrome(str) {\n const copy = str.split('').reverse().join('');\n return copy === str;\n}", "function palindrome(str) {\n var filteredString = str.toLowerCase().replace(/[^A-Za-z0-9]/g,'');\n var reverseString = filteredString.split('').reverse().join('');\n \n if (filteredString === reverseString) {\n return true;\n }\n return false;\n}", "function palindrome(string){\n let len = string.length;\n for(let i = 0; i < string.length; i++){\n if(string[i] != string[len - i - 1]){\n return false;\n }\n }\n return true;\n}", "function isPalindrome(str) {\n //remove spaces, turn same case\n let newStr = str.toString().toLowerCase().replace(/\\s+/g, '');\n console.log(newStr);\n //reverse strings\n let revers = newStr.split(\"\").reverse().join('');\n console.log(revers);\n console.log(newStr + \"=\" + revers + \"?\");\n if (newStr === revers) {\n return `'${[str]}' is a palindrome :)`;\n }\n return `'${[str]}' is not a palindrome!`;\n\n}", "function isPalindrome(str){\n var newStr = [];\n newStr = str.split('').reverse().join('');\n if (newStr == str){\n console.log(\"Is Palindrome\") \n } else if(newStr !== str) {\n console.log(\"Not a Palindrome\")\n }\n }", "function isPalindrome(word) {\n if(word.length <= 1) return true;\n return Boolean(Number(\n word[0] == word[word.length-1]) * isPalindrome(word.slice(1, word.length-1)\n ))\n}", "function palindrome(str) {\n if (!str[1]) {\n console.log(\"This is a palindrome\");\n }\n else if (str[0] === str[str.length-1]) {\n str = str.slice(1, str.length-1);\n return palindrome(str);\n }\n else {\n console.log(\"this is def not a palindrome\");\n }\n}", "function isPalindrome(str) {\n let revStr;\n function reverse(str) {\n if (str === \"\") {\n return str;\n }\n return reverse(str.substring(1)) + str.charAt(0);\n }\n revStr = reverse(str);\n if (revStr === str) {\n return true;\n } else {\n return false;\n }\n}", "function palindrome2(text) {\n var str = String(text) //Convert to string\n var str = text.replace(/\\s+/g, ''); //Use regex to remove spaces\n var str = str.toLowerCase(); //Convert to lowercase\n// console.log(\"this is str: \",str)\n var rev = str.split('').reverse().join(''); //reverse the letters\n// console.log(\"this is rev: \",rev) \n if ( rev === str ) {console.log(\"true\");} //Check for palindrome\n else {console.log(\"false\")}\n }", "function isPalindromic(string) {\n var i;\n var stringMinusSpaces = '';\n for (i = 0; i < string.length; i++) {\n if (string[i] !== ' ') {\n stringMinusSpaces += string[i];\n }\n }\n var stringInReverse = '';\n for (i = stringMinusSpaces.length - 1; i >= 0; i = i - 1) {\n stringInReverse += stringMinusSpaces[i];\n }\n if (stringInReverse === stringMinusSpaces) {\n return true;\n } else {\n return false;\n }\n}", "function palindrome(word) {\n for (i=0; i<word.length/2; i++) {\n if (word.charAt(i) != word.charAt(word.length - i - 1)) {\n return false;\n }\n } return true;\n}", "function palindromeCheck(str) {\n // base case -> if empty string or length of 1, it is a palindrome\n if (str.length <= 1) return true;\n \n let firstIdx = 0\n let lastIdx = str.length - 1;\n // if first and last letters don't match, not a palindrome\n if (str[firstIdx].toLowerCase() !== str[lastIdx].toLowerCase()) {\n return false;\n }\n // make recursive call on string that has its first and last letters sliced off\n else return palindromeCheck(str.slice(1,-1))\n}", "function palindrome(string) {\n // build an output string\n let str = string\n .replace(/[^a-zA-z]/g, '')\n .split('')\n .map((ch) => ch.toLowerCase())\n .join('');\n\n if (str.length === 1 || str === '') return true;\n\n if (str[0] !== str[str.length - 1]) {\n return false;\n }\n\n return palindrome(str.slice(1, -1));\n}", "function palindrome(string){\n return string === string.split(\"\").reverse().join(\"\");\n}", "function isPalindrome(str){ \n if(str.length <= 1) {\n return true;\n } else {\n if (str[0] === str[str.length - 1]) {\n return isPalindrome(str.substring(1, str.length - 1))\n } else {\n return false;\n }\n }\n}", "function isPalindrome(str) {\n str = str.replace(/\\W/g, '').toLowerCase();\n return (str == str.split('').reverse().join(''));\n}", "function isPalindrome(x) {\r\n // your code here\r\n x = x.toLowerCase();\r\n x = x.replace(/\\W/g, \"\");\r\n return (\r\n x ===\r\n x\r\n .split(\"\")\r\n .reverse()\r\n .join(\"\")\r\n );\r\n}", "function isPalindrome(str) {\n\n //str = str.toString().replace(/[^a-z0-9]/gi, '').toLowerCase()\n str = str.replace(/[^a-z0-9]/gi, '').toLowerCase()\n\n let x = 0\n let y = str.length - 1\n\n if (str[x] != str[y]) {\n return false\n }\n x += 1\n y -= 1\n\n return true\n}", "function palindrome(str) {\n //assign a front and a back pointer\n let front = 0\n let back = str.length - 1\n \n //back and front pointers won't always meet in the middle, so use (back > front)\n while (back > front) {\n //increments front pointer if current character doesn't meet criteria\n if ( str[front].match(/[\\W_]/) ) {\n front++\n continue\n }\n //decrements back pointer if current character doesn't meet criteria\n if ( str[back].match(/[\\W_]/) ) {\n back--\n continue\n }\n //finally does the comparison on the current character\n if ( str[front].toLowerCase() !== str[back].toLowerCase() ) return false\n front++\n back--\n }\n \n //if the whole string has been compared without returning false, it's a palindrome!\n return true\n \n }", "function checkPalindrome(word) {\n let isPalindrome;\n let reverseWord = reverse(word);\n\n if(word === reverseWord) {\n isPalindrome = true;\n } else {\n isPalindrome = false;\n }\n\n return isPalindrome;\n}", "function palChecker(pallendromeCandidate) {\n//split the string into an array, reverse the array, and then merge the elements back into one. The quote marks in join keeps from separating the array with commas\n var pallendromeCandidateOpposite = pallendromeCandidate.split().reverse().join(\"\");\n console.log(pallendromeCandidateOpposite);\n\n//looking at the word forwards and backwards, and with teh same case, determine if both are the same\n if(pallendromeCandidate.toUpperCase() === pallendromeCandidateOpposite.toUpperCase()){\n \treturn true;\n } else {\n \treturn false;\n }\n}", "function palindrome(str) {\n var result = str.split('').reverse().join('');\n console.log(result)\n var checker = str;\nif(str == result){\n return true;\n}\nelse {\n return false;\n}\n}" ]
[ "0.85693794", "0.85097224", "0.84500337", "0.8435969", "0.84339464", "0.8399982", "0.8393444", "0.83907735", "0.8363172", "0.8344747", "0.8327029", "0.83268255", "0.8324368", "0.82945514", "0.8291161", "0.82678", "0.8252127", "0.82511175", "0.8219813", "0.82078207", "0.8186412", "0.81770754", "0.817171", "0.8169328", "0.8163088", "0.8159424", "0.81536067", "0.81453335", "0.8145096", "0.813785", "0.81337714", "0.8133442", "0.81322753", "0.812136", "0.8100913", "0.8094834", "0.8093706", "0.80915666", "0.80721635", "0.8069788", "0.8067333", "0.80659425", "0.80519676", "0.8048599", "0.80459446", "0.80446345", "0.8032681", "0.80323946", "0.8016964", "0.8015015", "0.80132586", "0.801033", "0.8009331", "0.80081874", "0.8006173", "0.80029774", "0.7996335", "0.7994752", "0.79943573", "0.7987648", "0.79861915", "0.79752266", "0.7974607", "0.79713655", "0.7970372", "0.79464227", "0.79382026", "0.7929197", "0.79275656", "0.7926223", "0.7925216", "0.79234976", "0.792094", "0.7919349", "0.7915613", "0.79145515", "0.79000777", "0.7900012", "0.7892316", "0.7880249", "0.78734833", "0.78640944", "0.7862675", "0.78583366", "0.7849633", "0.7848319", "0.7847627", "0.7843291", "0.7841721", "0.7833994", "0.7829385", "0.7819645", "0.7815673", "0.7813294", "0.7811065", "0.7807332", "0.78039473", "0.7802856", "0.7800884", "0.7796882", "0.7796034" ]
0.0
-1
6. create a table and paint alternative colors:
function getTableCells(elem) { let cells = [] let table = document.getElementById(elem); for (let r = 0; r < table.rows.length; r++) { for (let c = 0; c < table.rows[r].cells.length; c++) { cells.push(table.rows[r].cells[c]); } } alternateColors(cells); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initTable() {\r\nvar color = [\r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green\r\n \r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green\r\n \r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green\r\n \r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green\r\n \r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green \r\n \r\n '#FFFF00', // Bright yellow\r\n '#00FF00', // Bright green\r\n '#00FFFF', // Bright cyan\r\n '#FF00FF', // Bright pink\r\n '#FF0000', // Bright red\r\n '#AA00FF', // Bright purple\r\n '#FFAA00', // Bright orange\r\n '#00FFAA', // Bright blue-green\r\n\r\n '#FFFF55', // Light yellow\r\n '#55FF55', // Light green\r\n '#55FFFF', // Light cyan\r\n '#FF55FF', // Light pink\r\n '#FF5555', // Light red\r\n '#AA55FF', // Light purple\r\n '#FFAA55', // Light orange\r\n '#55FFAA', // Light blue-green\r\n]\r\n var symbols = [\r\n { slogan: \"speedDemon.js.\",\r\n icon: \"dashboard\"\r\n },\r\n { slogan: \"Perpetually lost.\",\r\n icon: \"map-marker\"\r\n },\r\n { slogan: \"Rebel without a cause.\",\r\n icon: \"rebel\"\r\n },\r\n { slogan: \"Powered by ESP8266.\",\r\n icon: \"microchip\"\r\n },\r\n { slogan: \"Was it supposed to do that?!\",\r\n icon: \"exclamation-triangle\"\r\n },\r\n { slogan: \"Headed toward the finish line.\",\r\n icon: \"flag-checkered\"\r\n },\r\n { slogan: \"Hang in there, baby.\",\r\n icon: \"heartbeat\"\r\n },\r\n { slogan: \"Really, really, really fast.\",\r\n icon: \"fast-forward\"\r\n },\r\n { slogan: \"Basically priceless.\",\r\n icon: \"diamond\"\r\n },\r\n { slogan: \"Fast as lightning!\",\r\n icon: \"bolt\"\r\n },\r\n { slogan: \"Eye on the prize.\",\r\n icon: \"eye\"\r\n },\r\n { slogan: \"????????\",\r\n icon: \"question-circle\"\r\n },\r\n { slogan: \"Pow-pow-power wheels!\",\r\n icon: \"power-off\"\r\n },\r\n { slogan: \"Uniquely unique.\",\r\n icon: \"snowflake-o\"\r\n },\r\n { slogan: \"Toot, toot! Ahh beep, beep!\",\r\n icon: \"bus\"\r\n },\r\n { slogan: \"A bit of a fixer-upper.\",\r\n icon: \"wrench\"\r\n },\r\n { slogan: \"IoT? Oh my!\",\r\n icon: \"wifi\"\r\n },\r\n { slogan: \"It's not a bug, it's a feature.\",\r\n icon: \"bug\"\r\n },\r\n { slogan: \"Um, no.\",\r\n icon: \"ban\"\r\n },\r\n { slogan: \"It's aliiive!\",\r\n icon: \"cogs\"\r\n },\r\n { slogan: \"Send help.\",\r\n icon: \"life-buoy\"\r\n },\r\n { slogan: \"A bot powered by magic. (And Javascript.)\",\r\n icon: \"magic\"\r\n },\r\n { slogan: \"LUV2CODE\",\r\n icon: \"heart\"\r\n },\r\n { slogan: \"It's not broken. It's... experimental.\",\r\n icon: \"flask\"\r\n },\r\n { slogan: \"Oh, dear.\",\r\n icon: \"frown-o\"\r\n },\r\n { slogan: \"Going places.\",\r\n icon: \"line-chart\"\r\n },\r\n { slogan: \"On fire! (Metaphorically, right?)\",\r\n icon: \"fire-extinguisher\"\r\n },\r\n { slogan: \"speedDemon.js.\",\r\n icon: \"dashboard\"\r\n },\r\n { slogan: \"Perpetually lost.\",\r\n icon: \"map-marker\"\r\n },\r\n { slogan: \"Rebel without a cause.\",\r\n icon: \"rebel\"\r\n },\r\n { slogan: \"Powered by ESP8266.\",\r\n icon: \"microchip\"\r\n },\r\n { slogan: \"Was it supposed to do that?!\",\r\n icon: \"exclamation-triangle\"\r\n },\r\n { slogan: \"Headed toward the finish line.\",\r\n icon: \"flag-checkered\"\r\n },\r\n { slogan: \"Hang in there, baby.\",\r\n icon: \"heartbeat\"\r\n },\r\n { slogan: \"Really, really, really fast.\",\r\n icon: \"fast-forward\"\r\n },\r\n { slogan: \"Basically priceless.\",\r\n icon: \"diamond\"\r\n },\r\n { slogan: \"Fast as lightning!\",\r\n icon: \"bolt\"\r\n },\r\n { slogan: \"Eye on the prize.\",\r\n icon: \"eye\"\r\n },\r\n { slogan: \"????????\",\r\n icon: \"question-circle\"\r\n },\r\n { slogan: \"Pow-pow-power wheels!\",\r\n icon: \"power-off\"\r\n },\r\n { slogan: \"Uniquely unique.\",\r\n icon: \"snowflake-o\"\r\n },\r\n { slogan: \"Toot, toot! Ahh beep, beep!\",\r\n icon: \"bus\"\r\n },\r\n { slogan: \"A bit of a fixer-upper.\",\r\n icon: \"wrench\"\r\n },\r\n { slogan: \"IoT? Oh my!\",\r\n icon: \"wifi\"\r\n },\r\n { slogan: \"It's not a bug, it's a feature.\",\r\n icon: \"bug\"\r\n },\r\n { slogan: \"Um, no.\",\r\n icon: \"ban\"\r\n },\r\n { slogan: \"It's aliiive!\",\r\n icon: \"cogs\"\r\n },\r\n { slogan: \"Send help.\",\r\n icon: \"life-buoy\"\r\n },\r\n { slogan: \"A bot powered by magic. (And Javascript.)\",\r\n icon: \"magic\"\r\n },\r\n { slogan: \"LUV2CODE\",\r\n icon: \"heart\"\r\n },\r\n { slogan: \"It's not broken. It's... experimental.\",\r\n icon: \"flask\"\r\n },\r\n { slogan: \"Oh, dear.\",\r\n icon: \"frown-o\"\r\n },\r\n { slogan: \"Going places.\",\r\n icon: \"line-chart\"\r\n },\r\n { slogan: \"On fire! (Metaphorically, right?)\",\r\n icon: \"fire-extinguisher\"\r\n },\r\n { slogan: \"speedDemon.js.\",\r\n icon: \"dashboard\"\r\n },\r\n { slogan: \"Perpetually lost.\",\r\n icon: \"map-marker\"\r\n },\r\n { slogan: \"Rebel without a cause.\",\r\n icon: \"rebel\"\r\n },\r\n { slogan: \"Powered by ESP8266.\",\r\n icon: \"microchip\"\r\n },\r\n { slogan: \"Was it supposed to do that?!\",\r\n icon: \"exclamation-triangle\"\r\n },\r\n { slogan: \"Headed toward the finish line.\",\r\n icon: \"flag-checkered\"\r\n },\r\n { slogan: \"Hang in there, baby.\",\r\n icon: \"heartbeat\"\r\n },\r\n { slogan: \"Really, really, really fast.\",\r\n icon: \"fast-forward\"\r\n },\r\n { slogan: \"Basically priceless.\",\r\n icon: \"diamond\"\r\n },\r\n { slogan: \"Fast as lightning!\",\r\n icon: \"bolt\"\r\n },\r\n { slogan: \"Eye on the prize.\",\r\n icon: \"eye\"\r\n },\r\n { slogan: \"????????\",\r\n icon: \"question-circle\"\r\n },\r\n { slogan: \"Pow-pow-power wheels!\",\r\n icon: \"power-off\"\r\n },\r\n { slogan: \"Uniquely unique.\",\r\n icon: \"snowflake-o\"\r\n },\r\n { slogan: \"Toot, toot! Ahh beep, beep!\",\r\n icon: \"bus\"\r\n },\r\n { slogan: \"A bit of a fixer-upper.\",\r\n icon: \"wrench\"\r\n },\r\n { slogan: \"IoT? Oh my!\",\r\n icon: \"wifi\"\r\n },\r\n { slogan: \"It's not a bug, it's a feature.\",\r\n icon: \"bug\"\r\n },\r\n { slogan: \"Um, no.\",\r\n icon: \"ban\"\r\n },\r\n { slogan: \"It's aliiive!\",\r\n icon: \"cogs\"\r\n },\r\n { slogan: \"Send help.\",\r\n icon: \"life-buoy\"\r\n },\r\n { slogan: \"A bot powered by magic. (And Javascript.)\",\r\n icon: \"magic\"\r\n },\r\n { slogan: \"LUV2CODE\",\r\n icon: \"heart\"\r\n },\r\n { slogan: \"It's not broken. It's... experimental.\",\r\n icon: \"flask\"\r\n },\r\n { slogan: \"Oh, dear.\",\r\n icon: \"frown-o\"\r\n },\r\n { slogan: \"Going places.\",\r\n icon: \"line-chart\"\r\n },\r\n { slogan: \"On fire! (Metaphorically, right?)\",\r\n icon: \"fire-extinguisher\"\r\n },\r\n { slogan: \"speedDemon.js.\",\r\n icon: \"dashboard\"\r\n },\r\n { slogan: \"Perpetually lost.\",\r\n icon: \"map-marker\"\r\n },\r\n { slogan: \"Rebel without a cause.\",\r\n icon: \"rebel\"\r\n },\r\n { slogan: \"Powered by ESP8266.\",\r\n icon: \"microchip\"\r\n },\r\n { slogan: \"Was it supposed to do that?!\",\r\n icon: \"exclamation-triangle\"\r\n },\r\n { slogan: \"Headed toward the finish line.\",\r\n icon: \"flag-checkered\"\r\n },\r\n { slogan: \"Hang in there, baby.\",\r\n icon: \"heartbeat\"\r\n },\r\n { slogan: \"Really, really, really fast.\",\r\n icon: \"fast-forward\"\r\n },\r\n { slogan: \"Basically priceless.\",\r\n icon: \"diamond\"\r\n },\r\n { slogan: \"Fast as lightning!\",\r\n icon: \"bolt\"\r\n },\r\n { slogan: \"Eye on the prize.\",\r\n icon: \"eye\"\r\n },\r\n { slogan: \"????????\",\r\n icon: \"question-circle\"\r\n },\r\n { slogan: \"Pow-pow-power wheels!\",\r\n icon: \"power-off\"\r\n },\r\n { slogan: \"Uniquely unique.\",\r\n icon: \"snowflake-o\"\r\n },\r\n { slogan: \"Toot, toot! Ahh beep, beep!\",\r\n icon: \"bus\"\r\n },\r\n { slogan: \"A bit of a fixer-upper.\",\r\n icon: \"wrench\"\r\n },\r\n { slogan: \"IoT? Oh my!\",\r\n icon: \"wifi\"\r\n },\r\n { slogan: \"It's not a bug, it's a feature.\",\r\n icon: \"bug\"\r\n },\r\n { slogan: \"Um, no.\",\r\n icon: \"ban\"\r\n },\r\n { slogan: \"It's aliiive!\",\r\n icon: \"cogs\"\r\n },\r\n { slogan: \"Send help.\",\r\n icon: \"life-buoy\"\r\n },\r\n { slogan: \"A bot powered by magic. (And Javascript.)\",\r\n icon: \"magic\"\r\n },\r\n { slogan: \"LUV2CODE\",\r\n icon: \"heart\"\r\n },\r\n { slogan: \"It's not broken. It's... experimental.\",\r\n icon: \"flask\"\r\n },\r\n { slogan: \"Oh, dear.\",\r\n icon: \"frown-o\"\r\n },\r\n { slogan: \"Going places.\",\r\n icon: \"line-chart\"\r\n },\r\n { slogan: \"On fire! (Metaphorically, right?)\",\r\n icon: \"fire-extinguisher\"\r\n }\r\n]\r\n botDirectory = [];\r\n var initQuery = new azure.TableQuery().select(['PartitionKey', 'RowKey', 'command', 'distance'])\r\n //.where('PartitionKey gt ?', lastUpdate);\r\n tableService.queryEntities('outTable', initQuery, null, function (error, result, response) {\r\n if (!error) {\r\n\r\n // For each row of table, check to see if bot is listed in bot directory\r\n for (i = 0; i < result.entries.length; i++) {\r\n\r\n function checkExist(botname) { return botname.botName == result.entries[i].RowKey._; }\r\n\r\n var botIndex = botDirectory.findIndex(checkExist);\r\n\r\n // If bot is already in bot directory, update content\r\n if (botIndex >= 0) {\r\n botDirectory[botIndex].currentCommand = \"\" + botDirectory[botIndex].currentCommand + \".\" + result.entries[i].command._ + \"\";\r\n botDirectory[botIndex].totalDistance = botDirectory[botIndex].totalDistance + parseInt(result.entries[i].distance._);\r\n }\r\n\r\n // If bot is not in bot directory, add an entry for it\r\n else {\r\n botDirectory.push(\r\n {\r\n botName: result.entries[i].RowKey._,\r\n botID: \"bot\" + result.entries[i].PartitionKey._,\r\n currentCommand: result.entries[i].command._,\r\n totalDistance: parseInt(result.entries[i].distance._),\r\n botColor: color[0],\r\n slogan: symbols[0].slogan,\r\n symbol: symbols[0].icon\r\n }\r\n );\r\n color.push(color.shift());\r\n symbols.push(symbols.shift());\r\n }\r\n }\r\n lastUpdate = result.entries[result.entries.length - 1].PartitionKey._;\r\n socket.emit('initData', botDirectory);\r\n console.log('Initial entries sent up to ' + lastUpdate);\r\n console.log(botDirectory);\r\n }\r\n });\r\n }", "function drawTable(blue) {\r\n // open table (one of six cube panels)\r\n s += '<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>';\r\n // loop through all non-dithered color descripters as red hex\r\n for (var i = 0; i < 6; ++i) {\r\n drawRow(hex[i], blue)\r\n }\r\n // close current table\r\n s += '</TABLE>';\r\n}", "function colorTable(color) {\n let tbody = document.querySelector('tbody'),\n c1 = jColor(color),\n c2 = jColor(color);\n tbody.innerHTML = '';\n for (let i = 0; i < 21; i++) {\n var tr = document.createElement('tr');\n var td = document.createElement('td');\n td.style.backgroundColor = c1.getLighter(i).toHEX\n td.classList.add('changeColor');\n tr.appendChild(td);\n var td = document.createElement('td');\n td.textContent = c1.toHEX\n tr.appendChild(td);\n var td = document.createElement('td');\n td.textContent = c1.toRGB\n tr.appendChild(td);\n var td = document.createElement('td');\n td.textContent = 5 * i + ' %'\n tr.appendChild(td);\n var td = document.createElement('td');\n td.textContent = c2.getDarker(i).toRGB\n tr.appendChild(td);\n var td = document.createElement('td');\n td.textContent = c2.toHEX\n tr.appendChild(td);\n var td = document.createElement('td');\n td.style.backgroundColor = c2.toHEX\n td.classList.add('changeColor');\n tr.appendChild(td);\n tbody.appendChild(tr);\n }\n colorTableClick()\n}", "function drawRow(red, blue) {\r\n // open table row\r\n s += '<TR>';\r\n\r\n // loop through all non-dithered color descripters as green hex\r\n for (var i = 0; i < 6; ++i) {\r\n drawCell(red, hex[i], blue)\r\n }\r\n // close current table row\r\n s += '</TR>';\r\n}", "function setUp() {\n\t// make a table of colors\n\tvar table = document.createElement(\"table\");\n\tfor(var i = 0; i < colors.length; i+=3) {\n\t\tvar row = document.createElement(\"tr\");\n\t\t\n\t\tfor(var j = 0; j < 3; j++) {\n\t\t\tvar data = document.createElement(\"td\");\t\t\n\t\t\tdata.style.backgroundColor = colors[i + j];\t\n\t\t\t//add a click event\n\t\t\tdata.onclick = function() {\n\t\t\t\tdocument.getElementById(\"phrase\").style.color = this.style.backgroundColor;\n\t\t\t}\n\n\t\t\trow.appendChild(data);\n\t\t}\t\t\n\t\ttable.appendChild(row);\n\t}\n\tdocument.getElementById(\"color-selector\").appendChild(table);\t\n}", "renderTable () {\n const { squareWidth, squareHeight, colorOne, colorTwo, x, y } = this.config;\n\n this.canvas.width = squareWidth * x;\n this.canvas.height = squareHeight * y;\n \n for(let r = 0; r < x; r++) {\n for(let c = 0; c < y; c++) {\n\n this.context.fillStyle = colorOne;\n \n const evenEven = (r % 2 == 0 && c % 2 == 0);\n const oddOdd = (r % 2 == 1 && c % 2 == 1);\n\n // Se a posicao for par, pinta apenas os quadrados pares\n // Se a posicao for impar, pinta apenas os quadrados impares.\n if (evenEven || oddOdd) {\n this.context.fillStyle = colorTwo; \n }\n\n this.context.fillRect(r * squareWidth, c * squareHeight, squareWidth, squareHeight);\n }\n }\n }", "function podswietlTablice(t)\r\n{\r\n for(i = 0; i < 9; i++) {\r\n $('#td'+t[i]).css('background-color', '#48ca3b');\r\n }\r\n}", "function drawCube() {\r\n // open table\r\n s += '<TABLE CELLPADDING=0 CELLSPACING=0 style=\"border:1px #888888 solid\"><TR>';\r\n // loop through all non-dithered color descripters as blue hex\r\n for (var i = 0; i < 2; ++i) {\r\n // open table cell with white background color\r\n s += '<TD BGCOLOR=\"#FFFFFF\">';\r\n // call function to create cube panel with hex[i] blue hex\r\n drawTable(hex[i])\r\n // close current table cell\r\n s += '</TD>';\r\n }\r\n s += '</TR><TR>';\r\n for (var i = 2; i < 4; ++i) {\r\n // open table cell with white background color\r\n s += '<TD BGCOLOR=\"#FFFFFF\">';\r\n // call function to create cube panel with hex[i] blue hex\r\n drawTable(hex[i])\r\n // close current table cell\r\n s += '</TD>';\r\n }\r\n // close table row and table\r\n s += '</TR></TABLE>';\r\n return s;\r\n}", "function create_color_selection_table() {\n $.each(available_filetypes, function(i) {\n var tr = $('<tr>');\n\n var td_filetype = $('<td>').html(available_filetypes[i]);\n var td_bold = $('<td>').html(create_bold_checkbox(available_filetypes[i]));\n var td_foreground = $('<td>').html(create_color_selection(available_filetypes[i]+'-foreground'));\n var td_background = $('<td>').html(create_color_selection(available_filetypes[i]+'-background'));\n\n $('table#colorselectiontable').append(tr.append(td_filetype, td_bold, td_foreground, td_background));\n });\n }", "function drawTable(num) {\n\tbackground(255);\n\tvar row = 0;\n\tvar col = 0; \n\tvar yheight = height / (num + 1);\n\tvar xwidth = width / (num + 1);\n\tvar x = xwidth / 2;\n\tvar y = yheight / 2;\n\t\n\twhile(col <= num) {\n\t\twhile(row <= num) {\n\t\t\tvar message;\n\t\t\tfill(200,50,50);\n\t\t\tif (row == 0 && col == 0) {\n\t\t\t\tmessage = \"\";\n\t\t\t} else if (row != 0 && col == 0) {\n\t\t\t\tmessage = row;\n\t\t\t} else if (row == 0 && col != 0) {\n\t\t\t\tmessage = col;\n\t\t\t} else {\n\t\t\t\tfill(0);\n\t\t\t\tmessage = row * col;\n\t\t\t}\n\t\t\ttext(message, x, y);\n\t\t\trow = row + 1;\n\t\t\ty = y + yheight;\n\t\t}\n\t\tx = x + xwidth;\n\t\tcol = col + 1;\n\t\trow = 0;\n\t\ty = yheight / 2;\n\n\t}\n}", "function makeGrid(height, width) {//takes the width and height input from the user\r\n $('tr').remove(); //remove previous table if any\r\n for(var i =1; i<=width;i++){\r\n $('#pixelCanvas').append('<tr id = table' + i + '></tr>');//the tableid plus table data\r\n for (var j =1; j <=height; j++){\r\n $('#table' + i).append('<td></td');\r\n }\r\n\r\n }\r\n\r\n //getting more interesting with adding color\r\n $('td').click(function addColor(){\r\n color = $('#colorPicker').val();\r\n\r\n if ($(this).attr('style')){\r\n $(this).removeAttr('style')\r\n } else {\r\n $(this).attr('style', 'background-color:' + color);\r\n }\r\n })\r\n\r\n}", "function cTable(title, baseColor, action, cArray) {\n var tiny = tinycolor(baseColor);\n var aList;\n var rowLimit = 10;\n var x;\n switch (action) {\n case (\"triadryb\"):\n aList = rybcolor.rybtriad(tiny);\n aList = aList.map(function(rgb) {\n return [rgb, \"\"];\n //return [ rgb, tinycolor.hexNames[ rgb.toHex()] ];\n });\n // convert array to md colors and send it to mdarray handler...\n cTable(title + \" MD\", baseColor, \"mdarray\", matchMd(aList));\n break;\n case (\"triad\"):\n aList = tiny.triad();\n aList = aList.map(function(rgb) {\n return [rgb, \"\"];\n //return [ rgb, tinycolor.hexNames[ rgb.toHex()] ];\n });\n // convert array to md colors and send it to mdarray handler...\n cTable(title + \" MD\", baseColor, \"mdarray\", matchMd(aList));\n break;\n case (\"tetradryb\"):\n aList = rybcolor.rybtetrad(tiny);\n aList = aList.map(function(rgb) {\n return [rgb, \"\"];\n //return [ rgb, tinycolor.hexNames[ rgb.toHex()] ];\n });\n // convert array to md colors and send it to mdarray handler...\n cTable(title + \" MD\", baseColor, \"mdarray\", matchMd(aList));\n break;\n case (\"tetrad\"):\n aList = tiny.tetrad();\n aList = aList.map(function(rgb) {\n return [rgb, \"\"];\n //return [ rgb, tinycolor.hexNames[ rgb.toHex()] ];\n });\n // convert array to md colors and send it to mdarray handler...\n cTable(title + \" MD\", baseColor, \"mdarray\", matchMd(aList));\n break;\n case (\"monochromatic\"):\n aList = tiny.monochromatic();\n aList = aList.map(function(rgb) {\n return [rgb, \"\"];\n //return [ rgb, tinycolor.hexNames[ rgb.toHex()] ];\n });\n // convert array to md colors and send it to mdarray handler...\n cTable(title + \" MD\", baseColor, \"mdarray\", matchMd(aList));\n break;\n case (\"analogous\"):\n aList = tiny.analogous();\n aList = aList.map(function(rgb) {\n return [rgb, \"\"];\n //return [ rgb, tinycolor.hexNames[ rgb.toHex()] ];\n });\n // convert array to md colors and send it to mdarray handler...\n cTable(title + \" MD\", baseColor, \"mdarray\", matchMd(aList));\n break;\n case (\"complementryb\"):\n aList = [];\n aList.push(tiny);\n // tiny.complement only returns one color ... not array...\n aList.push(rybcolor.rybcomplement(tiny));\n aList = aList.map(function(rgb) {\n return [rgb, \"\"];\n //return [ rgb, tinycolor.hexNames[ rgb.toHex()] ];\n });\n x = matchMd(aList);\n $(\"#pBack\").css(\"background-color\", x[1][0].toHexString());\n $(\"#pBack\").attr(\"title\", x[1][1] + \" (\" + x[1][0] + \")\");\n $(\"#pBack\").css(\"color\", findReadable(x[1][0]));\n\n var c1 = findReadable(x[0][0]); // text color main\n var c2 = x[0][0]; // main color\n var c3 = x[1][0]; // complement color\n $(\"#patt2\").css({\n \"background\": \"radial-gradient(circle at 50% 59%, \" + c1 + \" 3%, \" + c2 + \" 4%, \" + c2 + \" 11%, rgba(54,78,39,0) 12%, rgba(54,78,39,0)) 25px 0,\"\n + \"radial-gradient(circle at 50% 41%, \" + c2 + \" 3%, \" + c1 + \" 4%, \" + c1 + \" 11%, rgba(210,202,171,0) 12%, rgba(210,202,171,0)) 25px 0,\"\n + \"radial-gradient(circle at 50% 59%, \" + c1 + \" 3%, \" + c2 + \" 4%, \" + c2 + \" 11%, rgba(54,78,39,0) 12%, rgba(54,78,39,0)) 0 25px,\"\n + \"radial-gradient(circle at 50% 41%, \" + c2 + \" 3%, \" + c1 + \" 4%, \" + c1 + \" 11%, rgba(210,202,171,0) 12%, rgba(210,202,171,0)) 0 25px,\"\n + \"radial-gradient(circle at 100% 50%, \" + c1 + \" 16%, rgba(210,202,171,0) 17%),\"\n + \"radial-gradient(circle at 0% 50%, \" + c2 + \" 16%, rgba(54,78,39,0) 17%),\"\n + \"radial-gradient(circle at 100% 50%, \" + c1 + \" 16%, rgba(210,202,171,0) 17%) 25px 25px,\"\n + \"radial-gradient(circle at 0% 50%, \" + c2 + \" 16%, rgba(54,78,39,0) 17%) 25px 25px\",\n \"background-color\": c3.toHexString(),\n \"background-size\": \"50px 50px\",\n \"text-align\": \"right\",\n \"height\": \"50px\",\n \"width\": \"100%\"\n });\n $(\"#patt2 span\").css({\n \"background-color\": c3.toHexString(),\n \"color\": findReadable(c3), // text color complement\n });\n \n cTable(title + \" MD\", baseColor, \"mdarray\", x);\n break;\n case (\"complement\"):\n // tinycolor complement only returns 2nd color not an array...\n aList = [];\n aList.push(tiny);\n // tiny.complement only returns one color ... not array...\n aList.push(tiny.complement());\n aList = aList.map(function(rgb) {\n return [rgb, \"\"];\n //return [ rgb, tinycolor.hexNames[ rgb.toHex()] ];\n });\n // convert array to md colors and send it to mdarray handler...\n //console.log(\"aList: \", aList);\n x = matchMd(aList);\n //console.log(\"x: \", x);\n $(\"#navcolor\").css(\"background-color\", x[0][0].toHexString());\n $(\"#navcolor\").attr(\"title\", x[0][1] + \" (\" + x[0][0] + \")\");\n $(\"#logo-container\").css(\"color\", findReadable(x[0][0]));\n\n $(\"#helpnav\").empty();\n $(\"#helpnav\").append(\"<li>Top Nav: \" + x[0][1] + \" (\" + x[0][0] + \")</li>\");\n $(\"#helpside\").empty();\n $(\"#helpside\").append(\"<li>Top Nav: \" + x[0][1] + \" (\" + x[0][0] + \")</li>\");\n\n $(\"#footcolor\").css(\"background-color\", x[1][0].toHexString());\n $(\"#footcolor\").attr(\"title\", x[1][1] + \" (\" + x[1][0] + \")\");\n $(\".fText\").css(\"color\", findReadable(x[1][0]));\n\n //$(\"#pBack\").css(\"background-color\", x[1][0].toHexString());\n //$(\"#pBack\").attr(\"title\", x[1][1] + \" (\" + x[1][0] + \")\");\n //$(\"#pBack\").css(\"color\", findReadable( x[1][0] ));\n\n /*$(\"#patt\").css({\n \"background\": \"linear-gradient(45deg, \" + x[1][0] + \" 50%, \" + x[0][0] + \" 50%\",\n \"background-size\": \"10px 10px\",\n \"width\": \"100%\",\n \"height\": \"10px\"\n });*/\n \n var c1 = findReadable(x[0][0]); // text color main\n var c2 = x[0][0]; // main color\n var c3 = x[1][0]; // complement color\n $(\"#patt\").css({\n \"background\": \"radial-gradient(circle at 50% 59%, \" + c1 + \" 3%, \" + c2 + \" 4%, \" + c2 + \" 11%, rgba(54,78,39,0) 12%, rgba(54,78,39,0)) 25px 0,\"\n + \"radial-gradient(circle at 50% 41%, \" + c2 + \" 3%, \" + c1 + \" 4%, \" + c1 + \" 11%, rgba(210,202,171,0) 12%, rgba(210,202,171,0)) 25px 0,\"\n + \"radial-gradient(circle at 50% 59%, \" + c1 + \" 3%, \" + c2 + \" 4%, \" + c2 + \" 11%, rgba(54,78,39,0) 12%, rgba(54,78,39,0)) 0 25px,\"\n + \"radial-gradient(circle at 50% 41%, \" + c2 + \" 3%, \" + c1 + \" 4%, \" + c1 + \" 11%, rgba(210,202,171,0) 12%, rgba(210,202,171,0)) 0 25px,\"\n + \"radial-gradient(circle at 100% 50%, \" + c1 + \" 16%, rgba(210,202,171,0) 17%),\"\n + \"radial-gradient(circle at 0% 50%, \" + c2 + \" 16%, rgba(54,78,39,0) 17%),\"\n + \"radial-gradient(circle at 100% 50%, \" + c1 + \" 16%, rgba(210,202,171,0) 17%) 25px 25px,\"\n + \"radial-gradient(circle at 0% 50%, \" + c2 + \" 16%, rgba(54,78,39,0) 17%) 25px 25px\",\n \"background-color\": c3.toHexString(),\n \"background-size\": \"50px 50px\",\n \"text-align\": \"right\",\n \"height\": \"50px\",\n \"width\": \"100%\"\n });\n $(\"#patt span\").css({\n \"background-color\": c3.toHexString(),\n \"color\": findReadable(c3), // text color complement\n });\n \n $(\"#helpnav\").append(\"<li>Footer: \" + x[1][1] + \" (\" + x[1][0] + \")</li>\");\n $(\"#helpside\").append(\"<li>Footer: \" + x[1][1] + \" (\" + x[1][0] + \")</li>\");\n\n cTable(title + \" MD\", baseColor, \"mdarray\", x);\n break;\n case (\"splitcomplementryb\"):\n aList = rybcolor.rybsplitcomplement(tiny);\n aList = aList.map(function(rgb) {\n return [rgb, \"\"];\n //return [ rgb, tinycolor.hexNames[ rgb.toHex()] ];\n });\n // convert array to md colors and send it to mdarray handler...\n cTable(title + \" MD\", baseColor, \"mdarray\", matchMd(aList));\n break;\n case (\"splitcomplement\"):\n aList = tiny.splitcomplement();\n aList = aList.map(function(rgb) {\n return [rgb, \"\"];\n //return [ rgb, tinycolor.hexNames[ rgb.toHex()] ];\n });\n // convert array to md colors and send it to mdarray handler...\n cTable(title + \" MD\", baseColor, \"mdarray\", matchMd(aList));\n break;\n case (\"mdarray\"):\n // recursion to correct-length rows...\n if (cArray.length > rowLimit) {\n // tmpList receives remaining items over sets of rowLimit..\n var r = (cArray.length % rowLimit);\n r = r == 0 ? rowLimit : r;\n var tmpList = cArray.slice(cArray.length - r);\n // tempList2 receives elements before those removed above rowLimit...\n var tmpList2 = cArray.slice(0, cArray.length - r);\n cTable(title, baseColor, \"mdarray\", tmpList2);\n aList = jQuery.map(tmpList, function(n, i) {\n return [\n [tinycolor(n[0]), n[1]]\n ];\n });\n //aList = tmpList.map(tinycolor);\n }\n else {\n aList = jQuery.map(cArray, function(n, i) {\n return [\n [tinycolor(n[0]), n[1]]\n ];\n });\n //aList = cArray.map(tinycolor);\n }\n break;\n default:\n break;\n }\n var i, s;\n s = \"<table class=\\\"z-depth-1\\\"><thead></thead><tbody><tr><td>\" + title + \"</td>\";\n for (i = 0; i < aList.length; i++) {\n x = findReadable(aList[i][0].toHexString());\n s += \"<td title=\\\"\" + aList[i][1] + \"\\\" bgcolor=\" + aList[i][0].toHexString() + \" style=\\\"color:\" + x + \";\\\" data-rgb=\\\"\" + aList[i][0].toHexString() + \"\\\">\" + x + \"</td>\";\n }\n s += \"</tr><tr><td></td>\";\n for (i = 0; i < aList.length; i++) {\n s += \"<td>\" + aList[i][0].toHexString() + \"</td>\";\n }\n s += \"</tr></tbody></table>\";\n $(\"div.cTable\").append(s);\n }", "function tableColors() {\n\t$(\"tr:even\").css(\"background-color\", \"#dddddd\");\n\t$(\"tr:odd\").css(\"background-color\", \"#ffffff\");\n\t$(\"table.portada tr\").css(\"background-color\", \"#ffffff\");\n\t\n\t$(\"tr:even\").mouseover(function() {\n\t\t$(this).css(\"background-color\", \"yellow\");\n\t});\n\t\n\t$(\"tr:even\").mouseout(function() {\n\t\t$(this).css(\"background-color\", \"#dddddd\");\n\t});\n\t\n\t$(\"tr:odd\").mouseover(function() {\n\t\t$(this).css(\"background-color\", \"yellow\");\n\t});\n\t\n\t$(\"tr:odd\").mouseout(function() {\n\t\t$(this).css(\"background-color\", \"#ffffff\");\n\t});\n}", "function create_color_picker() {\n var tablediv = document.getElementById('color-picker');\n var table = document.createElement(\"table\");\n table.className = \"color-picker-table\";\n tablediv.appendChild(table);\n var tr;\n var count = 0;\n var step = 63; // red, green, and blue have 256 values.\n // three for loops step through these values, so for step=63 we have 5*5*5=125 color cells\n for (var r=0; r < 256; r += step) {\n for (var g=0; g < 256; g += step) {\n for (var b = 0; b < 256; b += step) {\n if (count++ % 24 === 0) { // new row after 24 color cells\n tr = document.createElement(\"tr\");\n table.appendChild(tr);\n }\n var td = document.createElement(\"td\");\n td.className = \"picker-pixel\";\n td.style.backgroundColor = \"rgb(\"+r+\",\"+g+\",\"+b+\")\";\n td.addEventListener(\"click\", choosecolor); // the callback function will look a the background color\n tr.appendChild(td);\n }\n }\n }\n}", "function drawTable() {\n var stat = getState(cm);\n _replaceSelection(cm, stat.table, insertTexts.table);\n}", "function drawmyTable(x, y) {\n var ground = document.getElementById(\"canvas\");\n var p = \"<table border=1 cellspacing=0 cellpadding=0>\";\n for (var i = 0; i < x; i++) {//for every row\n p += \"<tr>\"; \n for (var j = 0; j < y; j++) {//for every column\n p += \"<td onMouseOver='drawLine(this);'></td>\"; //loop through a row and add 50 cells each row represents a column while utlizing functions // changes colors \n }\n p += \"</tr>\";\n }\n p += \"</table>\";\n ground.innerHTML = p;\n \n rows=ground.children[0].children[0].children\n //console.log(rows.length);//rows of table \n \n for(let i=0; i<rows.length; i++){\n \n for(let j=0; j<rows[i].children.length; j++){\n //console.log(rows[i].children[j]);\n }\n \n }\n \n }", "function formatTable() {\n var rows = document.getElementsByTagName(\"tr\");\n for (var i = 0; i < rows.length; i++) {\n rows[i].style.background = \"#9FE098\";\n }\n}", "function makeGrid() {\n\n let h = height.value;\n let w = width.value;\n\n // Clear table\n for (let i = table.rows.length; i > 0 ; i--) {\n table.deleteRow(i - 1);\n }\n\n for (let y = 0; y < h; y++) {\n const newTr = document.createElement('tr');\n table.appendChild(newTr);\n for (let x = 0; x < w; x++) {\n const newTd = document.createElement('td');\n table.lastChild.appendChild(newTd);\n }\n }\n\n let cell = table.querySelectorAll('td');\n\n for (let i = 0; i < cell.length; i++) {\n cell.item(i).addEventListener('click', function () {\n this.style.backgroundColor = color.value;\n });\n }\n}", "function colourtable(type){\n\t\tvar table = new Array(256);\n\t\tfor(var i = 0; i < table.length ; i++){\n\t\t\ttable[i] = colour(i,type);\n\t\t}\n\t\treturn table;\n\t}", "function buildFilterPalette() {\n var\n $row,\n $palette = $('#filter-color-table').children('tbody'),\n rows = options.filterColors.length,\n cols = 0;\n \n if (rows > 0) {\n cols = options.filterColors[0].length;\n $('#filter-color-table').children('tfoot').find('td')\n .attr('colspan', cols);\n }\n for (var i = 0; i < rows; ++i) {\n $row = $(document.createElement('tr'));\n for (var j = 0; j < cols; ++j) {\n $row.append(\n $(document.createElement('td')).append(\n $(document.createElement('span')).attr('class', 'colorsample')\n .css('background-color', options.filterColors[i][j])\n .click(selectFilterColor)\n )\n );\n }\n $palette.append($row);\n }\n }", "function create_table() {\n\n var tablediv=document.getElementById('icon-table'); // place inside #icon-table div\n var table = document.createElement(\"table\"); // make a new table element\n table.className = \"icon-table\";\n tablediv.appendChild(table); // place it inside the div\n for (var i = 0; i < 16; i++) { // 16 rows\n var tr = document.createElement(\"tr\");\n table.appendChild(tr);\n for (var j = 0; j < 16; j++) { // 16 cells in each row\n var td = document.createElement(\"td\");\n td.className = \"icon-pixel\";\n td.id=\"pixel-\"+ i + \"-\" + j; // systematic ids for the cells pixel-<row>-<cell>\n td.style.backgroundColor = \"rgb(255,255,255)\"; // no dash - css attribute name becomes camelCase\n td.addEventListener(\"mouseover\", setpixel);\n td.addEventListener(\"click\", setpixel); // same event listener for all cells\n tr.appendChild(td);\n }\n }\n}", "function createTable(rows, cols, data) {\n var tbl = document.createElement('table');\n var tbdy = document.createElement('tbody');\n var k = 0;\n for (var i = 0; i < rows; i++) {\n var tr = document.createElement('tr');\n if (i % 2 === 0) {\n tr.style.background = \"lightgray\";\n } else {\n tr.style.background = \"white\";\n }\n for (var j = 0; j < cols; j++) {\n var td = document.createElement('td');\n var text = document.createTextNode(data[k++]);\n td.appendChild(text);\n tr.appendChild(td);\n }\n tbdy.appendChild(tr);\n }\n tbl.appendChild(tbdy);\n return tbl;\n}", "function generateTable(){\n\tvar header = table.createTHead();\n\n\t\n\tvar row = header.insertRow(0);\n\tfor(var ii = 0; ii <= xEnd - xStart + 1; ii++){ //Fills row\n\t\tvar cell=row.insertCell(ii);\n\t\tif(ii ===0){\n\t\t\t$(cell).addClass(\"multiplier\");\n\t\t\tcell.innerHTML = \" x \";\n\t\t}else{\n\t\t\t$(cell).addClass(\"baseXValue\");\n\t\t\tcell.innerHTML = (xStart + ii - 1);\n\t\t}\n\t}\n\t\n\n\tfor(var i = 1; i <= yEnd - yStart + 1; i++){ //determines row\n\t\tvar row = header.insertRow(i);\n\t\t\n\t\t\n\t\t\tfor(var ii = 0; ii <= xEnd - xStart + 1; ii++){ //Fills row\n\t\t\t\tvar cell=row.insertCell(ii);\t\n\t\t\t\tif(ii === 0){\n\t\t\t\t\t$(cell).addClass(\"baseYValue\");\n\t\t\t\t\tcell.innerHTML = (yStart+ i - 1);\n\t\t\t\t}else{\n\t\t\t\t\tcell.innerHTML = (xStart + ii - 1) * (yStart+ i - 1);\n\t\t\t\t}\n\t\t\t}\n\t}\n\t\n}", "function generateTable(type, colour) {\r\n\r\n\t// store names and objects\r\n\tvar names = [];\r\n\tvar objs = [];\r\n\r\n\t// loop through each field in \r\n\tfor (var field in type) {\r\n\r\n\t\tif (type.hasOwnProperty(field)) {\r\n\r\n\t\t\tif (!Ext.isFunction(type[field])) {\r\n\r\n\t\t\t\t// check it's not already been added\r\n\t\t\t\t// Camel and Lower case version are generated so this ignores duplicates for convenience\r\n\t\t\t\tif (names.indexOf(field.toLowerCase()) < 0) {\r\n\r\n\t\t\t\t\t// add to objects which we will add to the html table\r\n\t\t\t\t\tobjs.push({\r\n\t\t\t\t\t\tname: field,\r\n\t\t\t\t\t\tis: type[field]\r\n\t\t\t\t\t});\r\n\r\n\t\t\t\t\t// add lowercase name to the list of names so we can ignore it if it appears again\r\n\t\t\t\t\tnames.push(field.toLowerCase());\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t}\r\n\r\n\t// sort objects by name\r\n\tobjs.sort(function(a,b) {\r\n\t\treturn a.name < b.name ? -1 : a.name > b.name ? 1 : 0;\r\n\t});\r\n\r\n\t// generate html table\r\n\tvar html = '<table>';\r\n\tfor (var i=0,ilen=objs.length; i<ilen; i++) {\r\n\t\tvar obj = objs[i];\r\n\t\t// green if true, red if not\r\n\t\tvar stripe = i%2 === 0 ? '#ddd' : '#eee';\r\n\t\tvar isBg = colour || obj.is ? '#90EE90' : '#F08080';\r\n\t\thtml += '<tr style=\"background-color:' + stripe + ';\"><th>' + obj.name + '</th><td style=\"text-align:center;background-color:' + isBg + ';\">' + obj.is + '</td></tr>';\r\n\t}\r\n\thtml += '</table>';\r\n\r\n\treturn html;\r\n}", "function saveTable(){\n //Creates the table elements when the user decides to save the color.\n var node1 = document.createTextNode(\"\");\n var node2 = document.createTextNode(colorString);\n var table = document.getElementById(\"colorTable\");\n var row = document.createElement(\"tr\");\n var col1 = document.createElement(\"td\");\n var col2 = document.createElement(\"td\");\n\n col1.style.backgroundColor = colorString;\n col1.appendChild(node1);\n row.appendChild(col1);\n\n col2.appendChild(node2);\n row.appendChild(col2);\n table.appendChild(row);\n}", "function headerGraphic() {\n clear();\n\n var table = new Table;({\n chars: { 'top': '═' , 'top-mid': '╤' , 'top-left': '╔' , 'top-right': '╗'\n , 'bottom': '═' , 'bottom-mid': '╧' , 'bottom-left': '╚' , 'bottom-right': '╝'\n , 'left': '║' , 'left-mid': '║' , 'mid': ' ' , 'mid-mid': ''\n , 'right': '║' , 'right-mid': '║' , 'middle': '' }\n });\n\n let firstWord = colors.brightMagenta.bold(\n figlet.textSync('Employee', { horizontalLayout: 'fitted' , font: 'Standard' })\n );\n\n let secondWord = colors.brightMagenta.bold(\n figlet.textSync('Tracker', { horizontalLayout: 'fitted' , font: 'Standard' })\n );\n\n table.push(\n [firstWord]\n , [secondWord]\n );\n \n let finalTable = table.toString();\n \n console.log(finalTable);\n \n}", "function drawTable(rows) {\n///max row height is saved to heights variable \n var heights = rowHeights(rows);\n///max width of colwidth saved to widths variable \n var widths = colWidths(rows);\n //function drawLine that takes blocks and linenumber as arguments \n \t //extracts lines that should appear next to each other from an array of blocks and joins them with a space \n \t // to create a one-character gap between the table’s columns.\n \tfunction drawLine(blocks, lineNo) {\n \t//first converts the cell objects in the row to blocks \n \t//blocks are arrays of strings representing the content of the cells, split by line \n \t\treturn blocks.map(function(block) {\n \t\t\treturn block[lineNo];\n ///strings joined together with a space \n \t\t}).join(\" \");\n \t}\n \t//draw row function that accepts row and row number \n \tfunction drawRow(row, rowNum) {\n //The second call to map in drawRow builds up this output line by line by mapping over the lines in the \n \t//leftmost block and, for each of those, collecting a line that spans the full width of the table.\n \t\t//maps through row with each cell and colum number \n \t\tvar blocks = row.map(function(cell, colNum) {\n \t\t//draw(width, height) returns an array of length height, which contains a series of strings that are each width characters wide. This represents the content of the cell.\n \t\t\treturn cell.draw(widths[colNum], heights[rowNum]);\n \t\t});\n \t//blocks is an array. map over each block array element \n \treturn blocks[0].map(function(_, lineNo) {\n \treturn drawLine(blocks, lineNo);\n \t}).join(\"\\n\");\n }\n //joining rows together with a new line \n return rows.map(drawRow).join(\"\\n\");\n}", "function makeGrid(){\n\n table.innerHTML =''; //czyszczenie tabeli\n\n const fragment = document.createDocumentFragment(); // DocumentFragment wrapper\n\n for(let h = 0; h < gridHeight.value; h++){\n let tr = document.createElement('tr');\n fragment.appendChild(tr);\n for(let w = 0; w < gridWitdh.value; w++){\n let td = document.createElement('td');\n tr.appendChild(td);\n }\n }\n table.appendChild(fragment);\n colorSet();\n colorClick();\n colorRemove();\n}", "function drawCell(red, green, blue) {\r\n // open cell with specified hexadecimal triplet background color\r\n var color = '#' + red + green + blue;\r\n if (color == \"#000066\") color = \"#000000\";\r\n s += '<TD BGCOLOR=\"' + color + '\" style=\"height:12px;width:12px;\" >';\r\n // print transparent image (use any height and width)\r\n s += '<IMG ' + ((document.all) ? \"\" : \"src='place.gif'\") + ' HEIGHT=12 WIDTH=12>';\r\n // close table cell\r\n s += '</TD>';\r\n}", "function genColorTable(elementID)\n{\n\tvar color = new Array();\n\tcolor[0] = 0;\n\tcolor[1] = 0;\n\tcolor[2] = 0;\n\tvar selector = 2;\n\t\n\tcolorPicker='<table id=\"ColorPicker\">';\n\tfor(var i = 0; i < 6; i++)\n\t{;\n\t\tfor(var a = 0; a < 2; a++)\n\t\t{\n\t\t\tcolorPicker+='<tr id=\"ColorPickerTr\">';\n\t\t\tfor(var x = 0; x < 3; x++)\n\t\t\t{\n\t\t\t\tfor(var z = 0; z < 6; z++)\n\t\t\t\t{\n\t\t\t\t\tcolorPicker+= '<td id=\"ColorPickerTd\" bgColor=\"#' + decimalToHex(color[0],2) + decimalToHex(color[1],2) + decimalToHex(color[2],2) + '\" onClick=\"colourNum(this.bgColor)\"></td>'; \n\t\t\t\t\tcolor[2] += 51;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tcolor[2] = 0;\n\t\t\t\tcolor[0] += 51;\n\t\t\t}\n\t\t\tcolorPicker+='</tr>';\n\t\t}\n\t\tcolor[0] = 0;\n\t\tcolor[1] +=51;\n\t}\n\tcolorPicker+='</table>';\n\tdocument.getElementById(elementID).innerHTML = colorPicker;\n}", "function drawHatTable(tbody) {\r\n\tvar tr, td;\r\n\ttbody = document.getElementById(tbody);\r\n\t// remove existing rows, if any\r\n\tclearTable(tbody);\r\n\tvar oddEven = \"tableRowEven\";\r\n\tfor ( var i = 0; i < hatDetails.length; i++) {\r\n\t\ttr = tbody.insertRow(tbody.rows.length);\r\n\t\ttr.className = oddEven;\r\n\t\t// loop through data source\r\n\t\tfor ( var j = 0; j < hatDetails[i].length - 1; j++) {\r\n\t\t\ttd = tr.insertCell(tr.cells.length);\r\n\t\t\ttd.className = \"hatCol\";\r\n\t\t\tif (!hatDetails[i][j]) {\r\n\t\t\t\thatDetails[i][j] = \"\";\r\n\t\t\t}\r\n\t\t\tif (j == 0) {\r\n\t\t\t\tif (hatDetails[i][12] != null) {\r\n\t\t\t\t\ttd.id = hatDetails[i][j];\r\n\t\t\t\t\ttd.innerHTML = \"<a href='' id=\" + td.id + \">\" + hatDetails[i][j] + \"</a>\";\r\n\t\t\t\t\t$(\"#\" + td.id).click(function(event) {\r\n\t\t\t\t\t\tfindHatDetails(this.id, hatDetails);\r\n\t\t\t\t\t\tevent.preventDefault();\r\n\t\t\t\t\t});\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttd.innerHTML = hatDetails[i][j];\r\n\t\t\t\t}\r\n\t\t\t} else if (j == 5) {\r\n\t\t\t\tif (hatDetails[i][j] == \"G\") {\r\n\t\t\t\t\ttd.className = \"greenStatus\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttd.className = \"redStatus\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\ttd.innerHTML = hatDetails[i][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (oddEven = \"tableRowEven\") {\r\n\t\t\toddEven = \"tableRowOdd\";\r\n\t\t} else {\r\n\t\t\toddEven = \"tableRowEven\";\r\n\t\t}\r\n\t}\r\n}", "function alternatingTableCellColor() {\n\t\t$('.containerX.display-item:odd').css('background-color','rgb(100, 200, 255, 0.25)');\n\t\t$('.containerX.display-item:even').css('background-color','rgb(150, 250, 200, 0.25)');\n\t\t$('.container.categoryX:odd').css('background-color','rgb(100, 200, 255, 0.25)');\n\t\t$('.container.categoryX:even').css('background-color','rgb(150, 250, 200, 0.25)');\n\t}", "function updateColors() {\n\tfor (var i=0; i<allTissues.length; i++){\n\t\tchangeFillColor(allTissues[i].tissue, allTissues[i].color);\n\t\t//console.log(allTissues[i].tissue+\" \"+allTissues[i].value+\" \"+allTissues[i].color);\n\t}\n\tif(searchByTable){\n\t\tgenerateSelectionTable();\n\t}\n}", "function create_color_table()\n\t{\n\t\tcolor_table = new Uint32Array(256);\n\t\tcolor_table_canvas = [];\t\t\t\t// String array\n\t\t\n\t\tfor (var i = 0; i < 256; i++)\n\t\t{\n\t\t\tcolor_table[i] = make_color(i);\n\t\t\tcolor_table_canvas[i] = make_canvas_color(i);\n\t\t}\n\t}", "function makeGrid() {\r\n // Your code goes here!\r\n var height,width,table;\r\n\r\n //the value of height and width\r\n var height=$(\"#input_height\").val();\r\n var width=$(\"#input_width\").val();\r\n\r\n var table=$(\"#pixel_canvas\");\r\n\r\n\r\n //to create new table, we must delete the prev\r\n table.children().remove();\r\n\r\n //to create rows and columns\r\n for (var i=0; i<height ;++i) \r\n {\r\n table.append(\"<tr></tr>\");\r\n for (var j=0; j<width ;++j) \r\n {\r\n table.children().last().append(\"<td></td>\");\r\n }\r\n }\r\n\r\n //make event listener when we click on any cell, color it\r\n table.on(\"click\",\"td\",function() {\r\n var color=$(\"input[type='color']\").val();\r\n $(this).attr(\"bgcolor\",color);\r\n });\r\n}", "function makeGrid(x, y) {\n\t//removing whatever tr that has been created...\n\t$('tr').remove();\n\t//using nexted for loop to create a new tr and td and loop over tr to create new td.\n\tfor(let i = 1; i <= x; i++){\n\t\t$(\"#pixelCanvas\").append('<tr id=table'+i+'> </tr>');\n\t\tfor(let k = 1; k <= y; k++){\n\t\t\t$(\"#table\" + i).append(\"<td></td>\");\n\t\t}\n\t}\n\t//creating an eventlistener .click to set a color when ever we click inside the td..\n\t$(\"td\").click(function addColor(){\n\t//selecting color value and saving it inside var color.\n\tcolor = document.getElementById(\"colorPicker\").value;\n\t//using conditional sratement to add and remove color whenever we click inside td\n\tif($(this).attr(\"style\")){\n\t\t$(this).removeAttr(\"style\");\t\n\t} else{\n\t\t$(this).css(\"background-color\", color);\n\t}\n});\n\n}", "function colourCell( obj )\r\n\t{\r\n\t\tobj.origColor=obj.style.backgroundColor;\r\n\t\tobj.style.backgroundColor = '#E2EBF3';\r\n\t\tobj.style.cursor = \"pointer\";\r\n\t\tobj.style.border = \"solid 1px #A9B7C6\";\r\n\t}", "function color(co){\n tabla.style.color = co\n for(item of borde){\n item.style.borderColor = co\n }\n}", "function addEvents(){\n\t//made change here, when mouse hovers table, it changes the colors of the table\n\t$('table').mouseover(function(){\n\t\t//let a new variable named color\n\t\tvar color = \"rgb(\";\n\t\t//a for loop looping over between 0 and 255 colors\n\t\tfor (var i=0; i<3; i++){\n\t\t\t//random generating numbers from in between 0 and 255\n\t\t\tvar random = Math.round(Math.random() * 255);\n\t\t\t//made change here, add the valor to the variable color\n\t\t\tcolor += random;\n\t\t\t//seperate the color for each value\n\t\t\tif (i<2){\n\t\t\t\tcolor += \",\";\n\t\t\t\t//ending after the last color with a ')'\n\t\t\t} else {\n\t\t\t\tcolor += \")\";\n\t\t};\n\t//made change here, changing the color of the text\n\t};\n\n\t\t$(this).css('color', color);\n\t});\n//Adding a function which users can clic the table and pop up with a message\n\tfunction clickme(){\n\t\t//pop up with a message when the table is clicked\n\t\talert('Hey, you clicked me!');\n\t};\n\t//adding the click element to the table\n\t$('table').on('click', clickme);\n}", "function paint() {\n\t$('.cell').hover(function() {\n\t\t$(this).css('background-color', 'hsl(0, 0%, 90%)');\n});\n}", "updateColorTable(){\n let self = this;\n let keys = Object.keys(this._colors);\n let values = Object.values(this._colors);\n /* these are the DOM elements in each row of the table */\n let rowComponents = [\n { 'type': 'div', 'attr':[['class', 'flex-cell display']] },\n { 'type': 'div', 'attr':[['class', 'flex-cell label']] },\n { 'type': 'span', 'attr':[['class', 'flex-cell small-close']] },\n ];\n super.initTableRows('#color-table', 'color', keys, rowComponents);\n /* update the color backgroud of the display are of each row */\n d3.select('#color-table').selectAll('.display')\n .data(values)\n .style('background-color', d => d )\n ;\n /* set the labels for each row */\n d3.select('#color-table').selectAll('.label')\n .data(keys)\n .text(d => d)\n ;\n /* update the small close span element */\n d3.select('#color-table').selectAll('.small-close')\n .data(keys)\n .attr('data-key', d => d)\n .html('&times;')\n .on('click', function(d){\n if( this.dataset.key === 'Default' ) return;\n delete( self._colors[this.dataset.key] );\n self.assignColors();\n self.updateColorTable();\n self.plot();\n })\n ;\n }", "function drawTable(){\n for (employee of allEmployees){\n newRow(employee);\n }\n}", "function displayChessboard() {\n var rows = [];\n for (var i = 0; i < 5; i++) {\n var row = [];\n for (var j = 0; j < 5; j++) {\n if ((j + i) % 2 == 0) row.push(new TextCell('##'));\n else row.push(new TextCell(' '));\n }\n rows.push(row);\n }\n console.log(drawTable(rows));\n}", "function zebraRows(d, i) {\n if (i % 2 == 0) { return \"lightgray\"; }\n else { return \"white\"; }\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 generateTable(arr) {\n //const word for object indexing\n // Head handling\n var keys = arr.map(function(obj) {\n return Object.keys(obj);\n });\n var head = _.uniq(_.flatten(keys, 0));\n\n var table = new Table({\n head: ['(index)'.green].concat(head.map(function(str) {\n return str.cyan;\n })),\n chars: {\n 'top': '═' , 'top-mid': '╤' , 'top-left': '╔' , 'top-right': '╗',\n 'bottom': '═' , 'bottom-mid': '╧' , 'bottom-left': '╚' , 'bottom-right': '╝',\n 'left': '║' , 'left-mid': '╟' , 'mid': '─' , 'mid-mid': '┼',\n 'right': '║' , 'right-mid': '╢' , 'middle': '│'\n }\n });\n\n // Body handling\n arr.forEach(function(obj, i) {\n var body = [i].concat(head.map(function(key) {\n return _.isObject(obj[key])\n ? truncate(JSON.stringify(obj[key]), 10, '...')\n : _.isUndefined(obj[key]) ? ' ' : String(obj[key]);\n }));\n table.push(body);\n });\n\n // Print it\n console.log(table.toString());\n}", "function drawTable(gameName)\n{\n drawBG();\n \n ctx.fillStyle = colors[Game.tableColor];\n ctx.beginPath();\n ctx.rect(0, 0, DEFAULT_CANVAS_SIZE, DEFAULT_CANVAS_SIZE - 150);\n ctx.fill();\n\n ctx.beginPath();\n ctx.rect(0, DEFAULT_CANVAS_SIZE - 150, DEFAULT_CANVAS_SIZE, 150);\n ctx.strokeStyle = 'white';\n ctx.stroke();\n\n ctx.beginPath();\n ctx.moveTo(DEFAULT_CANVAS_SIZE / 4 * 3, DEFAULT_CANVAS_SIZE - 150);\n ctx.lineTo(DEFAULT_CANVAS_SIZE / 4 * 3, DEFAULT_CANVAS_SIZE);\n ctx.stroke();\n\n ctx.fillStyle = 'white';\n ctx.font = \"20px Arial\";\n ctx.fillText(gameName, DEFAULT_CANVAS_SIZE / 8 * 7, DEFAULT_CANVAS_SIZE - 125);\n\n ctx.fillStyle = 'white';\n ctx.font = \"15px Arial\";\n ctx.fillText(\"BANK\", DEFAULT_CANVAS_SIZE / 8 * 7, DEFAULT_CANVAS_SIZE - 100);\n ctx.fillText(Game.bank, DEFAULT_CANVAS_SIZE / 8 * 7, DEFAULT_CANVAS_SIZE - 75, DEFAULT_CANVAS_SIZE / 4);\n}", "function ttable(tableid, divid) {\n // Store the table ID\n this.tableid = tableid;\n\n // Store the Inner Div ID\n this.divid = divid;\n\n // Table Custom Styling\n this.style = new Object();\n this.style.table = new String;\n this.style.table = 'table-default';\n this.style.tablehead = new String;\n this.style.tablehead = 'head-default';\n this.style.tablebody = new String;\n this.style.tablebody = 'body-default';\n this.style.tablecaption = new String;\n this.style.tablecaption = 'caption-default';\n\n // Custom Hover Class\n this.style.bodyhover = new Boolean;\n this.style.bodyhover = true;\n this.style.headhover = new Boolean;\n this.style.headhover = true;\n this.style.tablehead_hover = new String;\n this.style.tablehead_hover = 'hoverhead-default';\n this.style.tableheadtd_hover = new String;\n this.style.tableheadtd_hover = 'hoverheadtd-default';\n this.style.tablebody_hover = new String;\n this.style.tablebody_hover = 'hoverbody-default';\n\n // Highlighting Custom Styling\n this.highlight = new Object();\n this.highlight.enabled = new Boolean;\n this.highlight.enabled = true;\n this.highlight.style = new String;\n this.highlight.style = 'highlight-default';\n this.highlight.onlclick = new Boolean;\n this.highlight.onclick = false;\n this.highlight.onclick_style = new String;\n this.highlight.onclick_style = 'clicklight-default';\n\n // Stripped Rows Parameters\n this.style.stripped = new Boolean;\n this.style.stripped = true;\n this.style.odd_row = new String;\n this.style.odd_row = 'odd-default';\n\n // Numeration Parameters\n this.style.num = new Boolean;\n this.style.num = true;\n this.style.num_class = new String;\n this.style.num_class = 'num-default';\n\n // Sorting Paramters\n this.sorting = new Object();\n this.sorting.enabled = new Boolean;\n this.sorting.enabled = true;\n this.sorting.sortall = new Boolean;\n this.sorting.sortall = false;\n this.sorting.resetnum = new Boolean;\n this.sorting.resetnum = true;\n this.sorting.sortedstyle = new String;\n this.sorting.sortedstyle = 'sorted-default';\n this.sorting.clickablestyle = new String;\n this.sorting.clickablestyle = 'clickable-default';\n this.sorting.onclickstyle = new String;\n this.sorting.onclickstyle = 'onclick-default';\n this.sorting.sortascstyle = new String;\n this.sorting.sortascstyle = 'sortasc-default';\n this.sorting.sortdescstyle = new String;\n this.sorting.sortdescstyle = 'sortdesc-default';\n\n // Pagination Paramaters\n this.pagination = new Object();\n this.pagination.enabled = new Boolean;\n this.pagination.enabled = false;\n this.pagination.rowperpage = new Number;\n this.pagination.rowperpage = 10;\n\n // Editable Parameters\n this.edit = new Object();\n this.edit.enabled = new Boolean;\n this.edit.enabled = false;\n\n // Conversion Parameters\n this.csv = new Object();\n this.csv.separator = new String;\n this.csv.separator = ',';\n\n // Search Input\n this.search = new Object();\n this.search.enabled = new Boolean;\n this.search.enabled = false;\n this.search.inputID = new String;\n this.search.inputID = \"filter\";\n this.search.casesensitive = new Boolean;\n // True = Case Sensitive\n this.search.casesensitive = false;\n\n // Table Information\n this.info = new Object();\n}", "function colorTable(txt){\r\n var table = document.getElementById(txt);\r\n var loop = 0;\r\n for (; loop < table.rows.length; loop++) {\r\n var row = table.rows[loop];\r\n if (loop % 2 == 0) {\r\n row.className = 'odd';\r\n } else {\r\n row.className = 'even';\r\n }\r\n }\r\n}", "function draw_table(){\n\n\t// create variable for table bar\n table = d3.select(\"#table\")\n .append(\"table\")\n .attr(\"class\", \"table table-hover table-bordered table-lg\")\n\n // create variable for table heads\n table.append('thead')\n .attr(\"class\", \"thead-inverse\")\n\n table.append('tbody');\n\n // create table heads\n d3.select(\"thead\").append(\"tr\")\n .selectAll('th')\n .data(variables_table).enter()\n .append('th')\n .text(function (column) { return column; });\n\n}", "function compruebaTablero(filaycolor1, filaycolor2, filaycolor3, filaycolor4, filaycolor5, filaycolor6) {\r\n\r\n console.log(filaycolor1);\r\n console.log(filaycolor2);\r\n console.log(filaycolor3);\r\n console.log(filaycolor4);\r\n console.log(filaycolor5);\r\n console.log(filaycolor6);\r\n \r\n\r\n}", "function init() {\r\n $('tr:even').css(\"background-color\", \"gray\");\r\n}", "function CreateElement() {\r\n let table = document.createElement('table');\r\n\r\n let tbody = document.createElement('tbody');\r\n\r\n\r\n for (let indexTr = 0; indexTr < 8; indexTr++) {\r\n var tr = document.createElement('tr');\r\n\r\n for (let indexTd = 0; indexTd < 8; indexTd++) {\r\n var td = document.createElement('td');\r\n\r\n td.style.position = 'relative';\r\n\r\n var span; var icon;\r\n\r\n var darkColor = 'rgb(177, 185, 184)';\r\n var lightColor = 'rgb(148, 151, 151)';\r\n //add digit color\r\n if (indexTd % 2 == 0) {\r\n if (indexTr % 2 == 0) {\r\n td.style.backgroundColor = darkColor;\r\n td.setAttribute('data-backgroundColor', darkColor);\r\n }\r\n else {\r\n td.style.backgroundColor = lightColor;\r\n td.setAttribute('data-backgroundColor', lightColor);\r\n }\r\n }\r\n else {\r\n if (indexTr % 2 != 0) {\r\n td.style.backgroundColor = darkColor;\r\n td.setAttribute('data-backgroundColor', darkColor);\r\n }\r\n else {\r\n td.style.backgroundColor = lightColor;\r\n td.setAttribute('data-backgroundColor', lightColor);\r\n }\r\n }\r\n\r\n //add figure\r\n if (indexTr == 0 || indexTr == 7) {\r\n\r\n icon = document.createElement('i');\r\n\r\n //add king figure\r\n if ((indexTd == 3 && indexTr == 0) || (indexTd == 4 && indexTr == 7)) {\r\n icon.className = 'fas fa-chess-king';\r\n td.setAttribute('data-name', whiteKing.name);\r\n }\r\n //add \r\n if ((indexTd == 4 && indexTr == 0) || (indexTd == 3 && indexTr == 7)) {\r\n icon.className = 'fas fa-crown';\r\n td.setAttribute('data-name', whiteVizier.name);\r\n }\r\n if (indexTd == 2 || indexTd == 5) {\r\n icon.className = 'fas fa-chess-bishop';\r\n td.setAttribute('data-name', whiteBishop.name);\r\n }\r\n if (indexTd == 1 || indexTd == 6) {\r\n icon.className = 'fas fa-chess-knight';\r\n td.setAttribute('data-name', whiteKnight.name);\r\n }\r\n if (indexTd == 0 || indexTd == 7) {\r\n icon.className = 'fas fa-chess-rook';\r\n td.setAttribute('data-name', whiteRook.name);\r\n }\r\n\r\n \r\n\r\n icon.style.fontSize = '60px';\r\n\r\n td.appendChild(icon);\r\n }\r\n\r\n if (indexTr == 1 || indexTr == 6) {\r\n icon = document.createElement('i');\r\n icon.className = 'fas fa-chess-pawn';\r\n icon.style.fontSize = '60px';\r\n td.appendChild(icon);\r\n td.setAttribute('data-name', whitePawn.name);\r\n }\r\n if (indexTr == 6 || indexTr == 7)\r\n icon.style.color = '#fff';\r\n\r\n if (indexTr == 0 || indexTr == 1)\r\n td.setAttribute('data-color', 'black');\r\n if (indexTr == 6 || indexTr == 7)\r\n td.setAttribute('data-color', 'white');\r\n\r\n if (indexTd == 0) {\r\n span = document.createElement('span');\r\n span.style.position = 'absolute';\r\n span.style.top = '3px';\r\n span.style.left = '3px';\r\n span.innerText = indexTr + 1;\r\n span.style.color = 'rgb(233, 240, 240)';\r\n span.style.fontSize = '1.2rem';\r\n td.appendChild(span);\r\n }\r\n if (indexTr == 7) {\r\n span = document.createElement('span');\r\n span.style.position = 'absolute';\r\n span.style.bottom = '3px';\r\n span.style.right = '3px';\r\n span.innerText = alphabet[indexTd];\r\n span.style.color = 'rgb(233, 240, 240)';\r\n span.style.fontSize = '1.2rem';\r\n td.appendChild(span);\r\n }\r\n\r\n td.style.textAlign = 'center';\r\n td.style.width = '90px';\r\n td.style.height = '90px';\r\n td.setAttribute('id', indexTr + 1 + alphabet[indexTd]);\r\n td.style.cursor = 'pointer';\r\n td.style.position = 'relative';\r\n\r\n tr.appendChild(td);\r\n }\r\n tbody.appendChild(tr);\r\n }\r\n\r\n table.appendChild(tbody);\r\n\r\n mainContent.appendChild(table);\r\n}", "function makeGrid(input1, input2) {\n // make the table\n var table = document.getElementById('pixelCanvas');\n //to remove the table if the user decied to make another table\n table.innerHTML = \"\";\n // the loop here for row in table t\n for (var i = 0; i < input1; i++) {\n var row = document.createElement('tr');\n\n // the inner loopp for the cell and when user click in one of cell changed the color\n for (var j = 0; j < input2; j++) {\n var cell = document.createElement('td');\n row.appendChild(cell);\n cell.addEventListener('click', function(e) {\n var color = document.getElementById('colorPicker').value;\n e.target.style.backgroundColor = color;\n })\n }\n table.appendChild(row);\n }\n}", "function drawTable(rows) {\n var i, j;\n for (row of rows) {\n var tr = document.createElement('tr');\n i = rows.indexOf(row);\n j = 0;\n for (item of row) {\n var td = document.createElement('td');\n var span_valor = document.createElement('span');\n span_valor.setAttribute('class', 'invisible');\n span_valor.textContent = item;\n td.appendChild(span_valor);\n td.addEventListener('click', clicou);\n td.addEventListener('mousedown', longclicou);\n td.setAttribute('id', `${i},${j}`);\n j++;\n tr.appendChild(td);\n }\n table.appendChild(tr);\n }\n}", "function renderFire() {\n\n let table = document.getElementById('table')\n let tableHtml = ''\n let pixelIndex = 0\n\n for (let x = 1; x <= fireHeight; x++) {\n tableHtml += '<tr>'\n\n for (let y = 1; y <= fireWidth; y++) {\n\n updatePixelFireIntensity(pixelIndex)\n\n let color = fireColorsPalette[pixelFireIntensity[pixelIndex]]\n\n tableHtml += '<td class=\"pixel\" style=\"background-color: rgb(' + color.r + ', ' + color.g + ', ' + color.b + ')\"></td>'\n pixelIndex++\n }\n\n tableHtml += '</tr>'\n }\n\n table.innerHTML = tableHtml\n}", "function drawTable(editor) {\n\t\tvar cm = editor.codemirror;\n\t\tvar stat = getState(cm);\n\t\tvar options = editor.options;\n\t\t_replaceSelection(cm, stat.table, options.insertTexts.table);\n\t}", "drawBackground(){\t\n\t\tvar table = this.createScreenElement(\"table\", \"background\");\t\t//using table for background. will be removed by canvas afer testing\n\t\ttable.style.width = this.level.width * this.scale + \"px\";\n\t\tthis.level.grid.forEach(function(row){\t\t\t\n\t\t\tvar rowElement = table.appendChild(this.createScreenElement(\"tr\"));\n\t\t\trowElement.style.height = this.scale + \"px\";\n\t\t\trow.forEach(function(type){\n\t\t\t\trowElement.appendChild(this.createScreenElement(\"td\", type));\n\t\t\t}.bind(this));\n\t\t}.bind(this));\n\t\treturn table;\n\t}", "function tab (stroke, stb){\n let table = document.createElement(\"table\");\n document.body.append(table)\n for(let i = 0; i < stroke; i++){\n let tr = document.createElement(\"tr\");\n tr.classList.add('box')\n for(let i = 0; i < stb; i++){\n let td = document.createElement(\"td\");\n tr.append(td)\n td.classList.add('box')\n }\n table.append(tr)\n }\n \n}", "function createTABLE(h,v){\n var mytable = '';\n \n //setting rows and column length to 5\n var row = 5;\n var col = 5;\n \n //creating each row\n for(var i = 0; i < row; i++){\n mytable += '<tr>';\n //creating each column\n for(var j = 0; j < col; j++){\n if( i === 0 && j !== 0){ //the first row of the table\n //displays the horizontal numbers in each cells\n mytable += '<th style=\"background-color:lightsteelblue; text-align: center ; height: 50px; width:50px;\">' + h[j-1] + '</th>';\n }else if(j === 0 && i !== 0){ //the first column of the table\n //displays the vertical numbers in each cells\n mytable += '<th style=\"background-color:thistle; text-align: center ; height: 50px; width:50px;\"\">' + v[i-1] + '</th>';\n }else if(j !== 0 && i !== 0){ //the rest of the table\n //displays the multiplication of the row and column value\n mytable += '<td style=\"background-color:lightcoral; text-align: center ; height: 50px; width:50px;\"\">' + mult(h[j-1], v[i-1]) + '</td>';\n }else{ //first cell of the table\n mytable += '<th style=\"background-color:beige; text-align: center ; height: 50px; width:50px;\"\">X</th>';\n }\n }\n mytable += '<tr>';\n }\n //displays the table\n //document.write('<table id=\"mytab\" border=\"3px\" >' + table + '</table>');\n \n document.getElementById(\"mytable\").innerHTML = '<table id=\"mytab\" border=\"3px solid black\" > ' + mytable + ' </table>';\n return false;\n}", "function drawBlocks(number) {\n console.log(\"The case number is \" + number);\n switch (number) {\n case \"1\":\n //When the mouse is over the square\n $('td').hover(function(){\n //color the cell with the standard color\n $(this).addClass('hoverTD');\n });\n break;\n\n case \"2\":\n //When the mouse is over the square\n $('td').hover(function(){\n //assign a random number to each color\n var r = Math.floor((Math.random() * 255) + 0);\n var g = Math.floor((Math.random() * 255) + 0);\n var b = Math.floor((Math.random() * 255) + 0);\n\n //color the td with this random color\n $(this).css('background-color', 'rgb(' + r + ','\n + g + ','\n + b +')');\n });\n break;\n\n case \"3\":\n //When the mouse is over the square\n $('td').hover(function(){\n\n var opac = $(this).attr('opac');\n\n if (typeof opac !== typeof undefined && opac !== false) {\n $(this).css('opacity', opac);\n opac = parseFloat(opac)+0.1;\n $(this).attr('opac',opac);\n } else {\n $(this).attr('opac',0.1);\n $(this).css('opacity', 0.1);\n }\n });\n\n break;\n\n default:\n alert(\"Whoops, something went wrong.\")\n }\n}", "function customTableFromArray(tbl, map) {\r\n var rows = map.length;\r\n var rowCount = 0\r\n var columns = map[0].length;\r\n var cell;\r\n\r\n\r\n for(var r=rows - 1;r>=0;r--) { \r\n var x=document.getElementById(tbl).insertRow(rowCount);\r\n for(var c=0;c<parseInt(columns,10);c++) {\r\n cell = map[r][c];\r\n \r\n var y= x.insertCell(c); \r\n $(y).attr(\"data-row\", (rows - rowCount - 1));\r\n $(y).attr(\"data-col\", c);\r\n $(y).attr(\"data-djsteps\", cell.djSteps);\r\n //$(y).text(cell.djSteps);\r\n\r\n if(cell.onPath) {$(y).attr(\"class\", \"onpath\");}\r\n\r\n //\r\n if(cell.borderTop) {y.style.borderTop = \"1px solid black\";};\r\n if(cell.borderRight) {y.style.borderRight = \"1px solid black\";};\r\n if(cell.borderBottom) {y.style.borderBottom = \"1px solid black\";};\r\n if(cell.borderLeft) {y.style.borderLeft = \"1px solid black\";};\r\n\r\n if(cell.entrance) {\r\n $(y).attr(\"id\", \"entrance\");\r\n }else if(cell.exit) {\r\n $(y).attr(\"id\", \"exit\");\r\n };\r\n \r\n //debugger;\r\n };\r\n rowCount += 1;\r\n };\r\n}", "function Table(i, j, n) {\n this.i = i;\n this.j = j;\n this.n = n;\n this.edges = [];\n this.searched = false;\n this.parent = null;\n\n this.f = 0;\n this.g = 0;\n this.h = 0;\n\n this.weight = 1;\n\n this.show = () => {\n let x = i * w;\n let y = j * w;\n\n // draw a cell with table and it's number\n stroke(250);\n fill('#e4e4e4');\n rect(x, y, w, w);\n image(tableImg, x + 8, y + 14, img.width / 1.3, img.height / 1.3);\n }\n\n this.addEdges = arr => {\n /* tables don't have edges */\n }\n }", "function displayTable() {\n var query = connection.query(\"SELECT * FROM products\", function(err, res) {\n \n var table = new Table([\n\n head=['id','product_name','department_name','price','stock_quantity']\n ,\n\n colWidths=[6,21,25,17]\n \n ]);\n table.push(['id','product name','department name','price','stock quantity']);\n for (var i = 0; i < res.length; i++) {\n table.push(\n \n [res[i].id ,res[i].product_name,res[i].department_name,res[i].price ,res[i].stock_quantity]\n \n );\n }\n console.log(colors.bgWhite(colors.red((table.toString())))); \n });\n}", "function createGrid(height, width) {\n bodyTable.innerHTML = \"\";\n for (let h = 0; h < height; h++) { \n var row = document.createElement(\"tr\");\n for (let w = 0; w < width; w++) {\n var column = document.createElement(\"td\");\n row.appendChild(column); \n }\n bodyTable.appendChild(row); \n }\n pixelCanvas.appendChild(bodyTable); \n event.preventDefault();\n bodyTable.addEventListener('click', addColor) \n}", "function drawTable(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\t_replaceSelection(cm, stat.table, options.insertTexts.table);\n}", "function drawTable(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\t_replaceSelection(cm, stat.table, options.insertTexts.table);\n}", "function drawTable(editor) {\n\tvar cm = editor.codemirror;\n\tvar stat = getState(cm);\n\tvar options = editor.options;\n\t_replaceSelection(cm, stat.table, options.insertTexts.table);\n}", "function make_table(table_data, table_headings, skip_indexes){\n var table_data_rows = table_data.rows.map( function(row) {\n var new_row = [];\n row.c.forEach(function (data, index) {\n if(skip_indexes.indexOf(index) === -1){\n new_row.push(data);\n }\n row['c'] = new_row;\n });\n return row;\n });\n var filtered_table_data = {cols: table_headings, rows: table_data_rows};\n var headings = []\n ,view = [];\n table_headings.forEach( function(heading,index) {\n headings.push({label: heading.label, index: index});\n view.push(index);\n });\n var table_div = 'table-div-1';\n var table_holder = 'holder-' + table_div;\n $('#open-nc-widget').append('<div id=\"' + table_holder + '\" class=\"dd-graphs\"></div>');\n $('#' + table_holder).append('<div id=\"' + table_div + '\" class=\"dd-graph-div\"></div>');\n $('#' + table_holder).prepend('<button class=\"btn btn-default graph-option\" data-which=\"' + table_div + '\">Customize</button>');\n graph_configs[table_div] = {'data': filtered_table_data, 'options': table_options, 'graph_type': 'Table', 'headings': headings,'view':view}; \n show_graph(graph_configs[table_div],table_div);\n }", "function drawTable(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\t_replaceSelection(cm, stat.table, options.insertTexts.table);\n\t\t}", "function makeGrid(height, width) {\n\n\tfor(var x = 0; x < height; x++){\n\t\tlet row = table.insertRow(x); \n\t\tfor(var y = 0; y < width; y++){\n\t\t\tlet cell = row.insertCell(y);\n\t\t\tcell.addEventListener('click', function(event){\n\t\t\t\tevent.preventDefault();\n\t\t\t\tcell.style.background = penColor.value; \n\t\t\t})\n\t\t}\n\t}\n\n\n}", "function makeGrid(r,c) {\n $('tr').remove();\n\n for (let i = 1; i<=r; i++){\n $('#pixelCanvas').append('<tr></tr>');\n for(let j = 1; j<=c; j++) {\n $('tr').filter(':last').append('<td></td>');\t\n }\n }\naddColor();\n \n}", "function makeGrid(height, width) {\n\tfor(i = 0; i < height; i++){\n\t\t$(\"#pixelCanvas\").append($(\"<tr></tr>\"));\n\t\tfor(j = 0; j < width; j++){\n\t\t\t$(\"tr\").last().append($(\"<td></td>\"));\n\t\t}\t\n\t}\n\n\t$(\"td\").on('click', function(event){\n\t\tconst painting = $('#colorPicker').val(); // Select color input\n\t\t$(event.target).css('background-color', painting); //painting the background of td with color picked by user\n\t});\n\n}", "function drawTable(){ \n \n //table\n pushMatrix();\n mat4.translate(modelview,modelview,[200,-70,-200]);\n mat4.scale(modelview,modelview,[20,25,20]);\n currentColor = [.5098,.3215, .0039,1];\n table.render();\n popMatrix();\n\n //skull\n pushMatrix();\n mat4.translate(modelview,modelview,[210,-25,-210]);\n mat4.scale(modelview,modelview,[7,7,7]);\n mat4.rotateY(modelview,modelview,(-40)/180*Math.PI);\n mat4.rotateX(modelview,modelview,(-15)/180*Math.PI);\n currentColor = [0.8901, 0.8549,0.7882,1];\n gl.uniform3f( u_material.specularColor, .8862,.3450,.1333 );\n gl.uniform1f( u_material.specularExponent, 20 );\n gl.uniform3f( u_material.emissiveColor,0.08901, 0.08549,0.07882); \n skull.render();\n gl.uniform3f( u_material.emissiveColor,0, 0,0); \n popMatrix();\n\n //candle with holder\n drawCandle(u_lights[7], [172,-2,-198]);\n pushMatrix();\n mat4.translate(modelview,modelview,[172,-15,-200]);\n mat4.scale(modelview,modelview,[2,2,2]);\n currentColor = [.8039,.5843, .4588,1];\n candleholder.render();\n popMatrix();\n}", "function drawPlayground() {\n\n //Get the table as root\n var root = $('#board');\n\n //Clear the board\n root.empty();\n\n //Create html grid content\n var grid = '';\n\n for(var i = 0; i < fieldSize; i++) {\n\n //Append a row\n grid += '<div style=\"line-height: 1px;\">';\n\n for(var j = 0; j < fieldSize; j++) {\n\n //Append a new cell to the last row, the size of a single cell is set in the ground css class in the style.css\n grid += '<div class=\"ground\"></div>';\n\n }\n\n //Close the row div\n grid += '</div>'\n\n }\n\n //Add the grid to the board\n root.html(grid);\n\n\n}", "function makeGrid(height, width) {\n var table = document.getElementById('pixelCanvas');\n table.innerHTML=\"\";\n for (var i = 0; i<height; i++){\n var row = table.insertRow();\n for (var j = 0; j<width; j++){\n var cell = row.insertCell();\n cell.addEventListener('click', function(event){\n event.target.style.backgroundColor = color.value;})\n }\n }\n}", "function drawTable(game) {\n\n var tableHeaders = \"<tr>\";\n var firstAndSecondScores = \"<tr>\";\n var finalScores = \"<tr>\";\n var rowEnder = '</tr>';\n var table = \"\";\n var runningTotal = null;\n game.frames.forEach(function(frame, index){\n runningTotal += frame.getFinalFrameScore();\n if (!(frame instanceof TenthFrame)) {\n tableHeaders += '<th scope=\"col\" colspan=\"2\">' + (index + 1) +'</th>';\n firstAndSecondScores += '<td scope=\"row\">' + deNullify(frame.getFirstScore()) + '</td>' +\n '<td scope=\"row\">' + xOrSlash(frame) + '</td>';\n finalScores += '<td colspan=\"2\">' + prepareRunningTotal(runningTotal, frame) + '</td>';\n } else {\n tableHeaders += '<th scope=\"col\" colspan=\"3\">' + (index + 1) +'</th>';\n firstAndSecondScores += '<td scope=\"row\">' + deNullify(frame.getFirstScore()) + '</td>' +\n '<td scope=\"row\">' + deNullify(frame.getSecondScore()) + '</td>' +\n '<td scope=\"row\">' + deNullify( frame.getBonusScore()) + '</td>';\n finalScores += '<td colspan=\"3\">' + prepareRunningTotal(runningTotal, frame) + '</td>';\n }\n });\n\n table = tableHeaders + rowEnder + firstAndSecondScores + rowEnder + finalScores + rowEnder;\n return table;\n}", "function makeGrid(height, width) {\n \n// Your code goes here!\n// Create rows and columns\n \n for (let rows = 0; rows < height; rows++) {\n let row = table.insertRow(rows);\n for (var columns = 0; columns < width; columns++) {\n let cell = row.insertCell(columns);\n \n// Allow user to color each, individual cell\n \n cell.addEventListener('click', (e) => { \n let color = document.getElementById('colorPicker');\n cell.style.backgroundColor = color.value;\n });\n }\n }\n}", "function create_table ()\n{\n moves = -1;\n finished = false;\n var game_table_element = get_by_id (\"game-table-tbody\");\n for (var row = 0; row < n_rows; row++) {\n var tr = create_node (\"tr\", game_table_element);\n for (var col = 0; col < n_cols; col++) {\n var td = create_node (\"td\", tr);\n var colour = random_colour ();\n td.className = \"piece \" + colour;\n game_table[row][col].colour = colour;\n start_table[row][col] = colour;\n game_table[row][col].element = td;\n game_table[row][col].flooded = false;\n }\n }\n /* Mark the first element of the table as flooded. */\n game_table[0][0].flooded = true;\n /* Initialize the adjacent elements with the same colour to be flooded\n from the outset. */\n flood (game_table[0][0].colour, true);\n append_text (get_by_id(\"max-moves\"), max_moves);\n}", "function drawTable()\n{\n \n textSize(12);\n let rectfill = [255]\n let textfill = [51, 48, 45]\n let m_text = null\n let mul = parseInt(240/no_of_nodes);\n let mulX = parseFloat(340/no_of_nodes);\n noStroke()\n fill(255)\n textSize(16);\n text('Next Table',415,150)\n text('Cost Table',415,505)\n\n textSize(12);\n \n for (var i = 0; i < no_of_nodes;i++)\n {\n for (var j = 0; j < no_of_nodes;j++)\n { \n push();\n translate(330,165);\n stroke([66, 58, 112]);\n\n let x = (j) * mulX + 1;\n let y = (i) * mul + 1;\n let textX = (.5 + j) * mulX;\n let textY = (.5 + i) * mul;\n fill(rectfill);\n rect(x,y,mulX,mul);\n\n fill(textfill);\n if (next[i][j] == Infinity)\n {\n m_text = 'Inf';\n } else \n {\n m_text = next[i][j];\n }\n stroke(0);\n text(m_text,textX,textY);\n pop();\n push();\n translate(330,520);\n stroke([66, 58, 112]);\n\n fill(rectfill);\n rect(x,y,mulX,mul);\n stroke(0);\n fill(textfill);\n if (dp[i][j] == Infinity)\n {\n m_text = 'Inf';\n } else \n {\n m_text = dp[i][j];\n }\n text(m_text,textX,textY);\n pop();\n }\n }\n \n\n\n\n}", "function makeGrid(height, width) {\n // create rows\n for (let i = 0; i < height; i++) {\n let row = document.createElement('tr');\n table_element.appendChild(row);\n // create columns\n for (let j = 0; j < width; j++) {\n let column = document.createElement('td');\n row.appendChild(column);\n // add event to cell\n column.addEventListener('mousedown', function () {\n let color = color_value.value;\n this.style.backgroundColor = color;\n });\n }\n }\n}", "function generateTable(table, table_data) {\n\t\tvar options = table_data.options || {};\n\t\tvar data = table_data.data;\n\t\t\n\t\tfor(var row = 0; row < data.length; row++) {\n\t\t\tvar rowcontainer = table\n\t\t\tif(row == 0 && options.columnheader) { //@todo: make columnheader is the count of column headers?\n\t\t\t\trowcontainer = rowcontainer.append(\"thead\")\t\t\t\t\n\t\t\t} else if ((row == (data.length - 1)) && options.columnfooter) {\n\t\t\t\trowcontainer = rowcontainer.append(\"tfoot\")\t\t\t\t\n\t\t\t}\n\t\t\trowcontainer = rowcontainer.append(\"tr\")\n\t\t\t\n\t\t\tfor(var col = 0; col < data[row].length; col++) {\n\t\t\t\tvar colcontainer = rowcontainer.append('td');\n\t\t\t\tif(col == 0 && options.rowheader) {\n\t\t\t\t\tcolcontainer.classed(\"rowheader\", true)\t\t\t\t\n\t\t\t\t} else if ((col == (data[row].length - 1)) && options.rowfooter) {\n\t\t\t\t\tcolcontainer.classed(\"rowfooter\", true)\t\t\t\t\n\t\t\t\t}\n\t\t\t\tcolcontainer.text(data[row][col]);\n\t\t\t}\t\t\t\n\t\t}\n\t}", "function prepareTableCell(mon, ty, da) {\n var ddd = document.createElement(\"B\");\n var uuuu = document.createElement(\"U\")\n var nodee = document.createElement(\"p\");\n var noder = document.createElement(\"p\");\n var nodet = document.createElement(\"p\");\n var nodey = document.createElement(\"p\");\n var ea = document.createElement(\"p\");\n var node = document.createElement(\"br\");\n var nodehr = document.createElement(\"hr\");\n var textnode = document.createTextNode(\"\");\n var textnodehr = document.createTextNode(\"\");\n var easy = document.createElement(\"a\");\n var easy1 = document.createElement(\"a\");\n var easy2 = document.createElement(\"a\");\n var easy3 = document.createElement(\"a\");\n var easy4 = document.createElement(\"hr\");\n var buu = document.createElement(\"button\");\n\n\n nodee.appendChild(easy);\n noder.appendChild(easy1);\n nodet.appendChild(easy2);\n nodey.appendChild(easy3);\n var textnode1 = mon + \"$\";\n var textnode2 = \"Money:\" + mon + \"$\";\n var textnode3 = \"Type:\" + ty;\n var textnode4 = \"Date:\" + da;\n\n easy.append(textnode1);\n easy1.append(textnode2);\n easy2.append(textnode3);\n easy3.append(textnode4);\n nodehr.append(textnodehr);\n\n document.getElementById(\"output1\").appendChild(ddd);\n document.getElementById(\"output1\").appendChild(noder);\n document.getElementById(\"output1\").appendChild(nodet);\n document.getElementById(\"output1\").appendChild(nodey);\n document.getElementById(\"output1\").appendChild(easy4);\n\n}", "function learnColors()\n{\n //Clear the UI\n document.body.innerHTML=\"\";\n\n //Create the Back Button\n color_screen_button=createButton(\"Back\",\"color_screen_button\");\n color_screen_button.onclick=startLearningModule;\n document.body.appendChild(color_screen_button);\n\n //Create the Header using Complex UI in ui.js\n var color_screen_header_section=createComplexDiv(\"\",\"color_screen_div\",\"Colours\",\"color_screen_header\",\"images/colors_icon.jpg\",\"620px\",\"320px\",\"learning_module_image\",\"The Following symbols of specific colours are being used within the Game. It's Good time to get Familiar with them!!!!!!\",\"color_screen_paragraph\");\n document.body.appendChild(color_screen_header_section);\n\n //Create the table strucuture from one defined in ui.js\n var color_screen_table=reusableTable(\"\",\"screen_table\",\"color_screen_table\",\"color_screen_tr_head\",\"Symbol\",\"color_screen_th_symbol\",\"Meaning\",\"color_screen_th_meaning\");\n document.body.appendChild(color_screen_table);\n\n //Fetch the Required table for appending\n var table=document.querySelector('.color_screen_table');\n\n\n //Creation of td (red coloured ball) and its appending\n color_screen_tr_red=createtr(\"color_screen_tr_red\");\n color_screen_td_red_symbol=createtd(\"\",\"color_screen_td_red_symbol\");\n //Red colored ball creation\n var red=creatediv(\"\",\"red\");\n color_screen_td_red_symbol.appendChild(red);\n color_screen_td_red_meaning=createtd(\"This is RED colour Ball\",\"color_screen_td_red_meaning\");\n color_screen_tr_red.appendChild(color_screen_td_red_symbol);\n color_screen_tr_red.appendChild(color_screen_td_red_meaning);\n table.appendChild(color_screen_tr_red);\n\n //Creation of td (green coloured ball) and its appending\n color_screen_tr_green=createtr(\"color_screen_tr_green\");\n color_screen_td_green_symbol=createtd(\"\",\"color_screen_td_green_symbol\");\n var green=creatediv(\"\",\"green\");\n color_screen_td_green_symbol.appendChild(green);\n color_screen_td_green_meaning=createtd(\"This is GREEN colour Ball\",\"color_screen_td_green_meaning\");\n color_screen_tr_green.appendChild(color_screen_td_green_symbol);\n color_screen_tr_green.appendChild(color_screen_td_green_meaning);\n table.appendChild(color_screen_tr_green);\n\n //Creation of td (blue coloured ball) and its appending\n color_screen_tr_blue=createtr(\"color_screen_tr_blue\");\n color_screen_td_blue_symbol=createtd(\"\",\"color_screen_td_blue_symbol\");\n var blue=creatediv(\"\",\"blue\");\n color_screen_td_blue_symbol.appendChild(blue);\n color_screen_td_blue_meaning=createtd(\"This is BLUE colour Ball\",\"color_screen_td_blue_meaning\");\n color_screen_tr_blue.appendChild(color_screen_td_blue_symbol);\n color_screen_tr_blue.appendChild(color_screen_td_blue_meaning);\n table.appendChild(color_screen_tr_blue);\n\n //Creation of td (yellow coloured ball) and its appending\n color_screen_tr_yellow=createtr(\"color_screen_tr_yellow\");\n color_screen_td_yellow_symbol=createtd(\"\",\"color_screen_td_yellow_symbol\");\n var yellow=creatediv(\"\",\"yellow\");\n color_screen_td_yellow_symbol.appendChild(yellow);\n color_screen_td_yellow_meaning=createtd(\"This is YELLOW colour Ball\",\"color_screen_td_yellow_meaning\");\n color_screen_tr_yellow.appendChild(color_screen_td_yellow_symbol);\n color_screen_tr_yellow.appendChild(color_screen_td_yellow_meaning);\n table.appendChild(color_screen_tr_yellow);\n\n //Creation of td (pink coloured ball) and its appending\n color_screen_tr_pink=createtr(\"color_screen_tr_pink\");\n color_screen_td_pink_symbol=createtd(\"\",\"color_screen_td_pink_symbol\");\n var pink=creatediv(\"\",\"pink\");\n color_screen_td_pink_symbol.appendChild(pink);\n color_screen_td_pink_meaning=createtd(\"This is PINK colour Ball\",\"color_screen_td_pink_meaning\");\n color_screen_tr_pink.appendChild(color_screen_td_pink_symbol);\n color_screen_tr_pink.appendChild(color_screen_td_pink_meaning);\n table.appendChild(color_screen_tr_pink);\n\n}", "function AxisTableRenderer(parent){this.parent=parent;}", "function generateTable() {\n var data = [];\n\n for (var i = 0; i < 30; i++) {\n var row = [];\n row.push(commands[Math.round(Math.random() * (commands.length - 1))]);\n row.push(Math.round(Math.random() * 5));\n row.push(Math.round(Math.random() * 100));\n\n data.push(row);\n }\n\n table.setData({ headers: [\"Process\", \"Cpu (%)\", \"Memory\"], data: data });\n}", "function createtable(listofveg){\n\t// listofveg is the div for the table container\n\tvar tablecontainer = document.getElementById(listofveg );\n\t\n\t// ARRAY FOR HEADER.\n \n arrHead = ['Veg name', 'number of sqft', 'spacing per sqft', 'number of seeds per sqft', 'total seedlings']; \n\t\n\t\n\tvar body = document.body,\n tbl = document.createElement('table');\n\ttbl.setAttribute(\"id\" , \"listtable\");\n //tbl.style.width = '350px';\n //tbl.style.border = '1px solid white';\n\t\n\tvar tr = tbl.insertRow(-1);\n\n for (var h = 0; h < arrHead.length; h++) {\n var th = document.createElement('th'); // TABLE HEADER.\n th.innerHTML = arrHead[h];\n tr.appendChild(th);\n }\n \n for(var i = 0; i < 0; i++){\n tr = tbl.insertRow();\n\t\ttr.setAttribute(\"id\",\"row\" + i);\n for(var j = 0; j < 5; j++){\n //if(i == 2 && j == 1){\n // break;\n //} else {\n var td = tr.insertCell();\n\t\t\t\ttd.setAttribute(\"id\" , \"r\" + i + \"c\" + j);\n td.appendChild(document.createTextNode(''));\n td.style.border = '1px solid white';\n //if(i == 1 && j == 1){\n // td.setAttribute('rowSpan', '3');\n //}\n //}\n }\n }\n tablecontainer.appendChild(tbl);\n}", "function drawHorizontalLines(table, offsets, mode, colIdx) {\r\n for (var i = offsets[0]; i < table.rows.length - offsets[1]; i++) {\r\n switch (mode) {\r\n case 1: // Saisons trennen\r\n var value1 = parseInt(table.rows[i].cells[colIdx].textContent);\r\n var value2 = parseInt(table.rows[i + 1].cells[colIdx].textContent);\r\n if (value1 != value2) {\r\n for (var j = offsets[2]; j < table.rows[i].cells.length - offsets[3]; j++) {\r\n table.rows[i].cells[j].style.borderBottom = borderString;\r\n }\r\n }\r\n break;\r\n case 2: // Abrechnungsperioden trennen (Saison 1)\r\n var value = parseInt(table.rows[i].cells[colIdx].textContent);\r\n if (value % 7 == 0) {\r\n for (var j = offsets[2]; j < table.rows[i].cells.length - offsets[3]; j++) {\r\n table.rows[i].cells[j].style.borderBottom = borderString;\r\n }\r\n }\r\n break;\r\n case 3: // Abrechnungsperioden trennen (Saisons > 1)\r\n var value = parseInt(table.rows[i].cells[colIdx].textContent);\r\n if (value % 6 == 0) {\r\n for (var j = offsets[2]; j < table.rows[i].cells.length - offsets[3]; j++) {\r\n table.rows[i].cells[j].style.borderBottom = borderString;\r\n }\r\n }\r\n break;\r\n }\r\n }\r\n}", "function drawTable(editor) {\n var cm = editor.codemirror;\n var stat = getState(cm);\n var options = editor.options;\n _replaceSelection(cm, stat.table, options.insertTexts.table);\n}", "function createMemoryDisplay() {\n var table = document.getElementById(\"memoryTable\");\n\n // remove all current entries in the table\n while(table.hasChildNodes()) {\n table.removeChild(table.lastChild);\n }\n\n // go through and generate each row and cell\n for(var i = 0; i < 96; i++) {\n // calculate the hex value for this row\n var hexString = (i*8).toString(16);\n \n var row = table.insertRow(i);\n\n for(var j = 0; j < 9; j++) {\n var cell = row.insertCell(j);\n \n // if we are in the first column, pad the number and display it in bold\n if(j === 0) {\n cell.style.fontWeight = \"bold\";\n var pad = \"000\";\n hexString = pad.substring(0, pad.length - hexString.length) + hexString;\n cell.innerHTML = \"$\" + hexString;\n }\n else {\n cell.innerHTML = \"00\";\n }\n }\n }\n}", "function makeGrid() {\n //remove previous table if exists\n $('#gridTable').remove();\n const height = document.getElementById('input_height').value;\n const width = document.getElementById('input_width').value;\n\n\n // create table\n const table = document.createElement('table');\n table.id = \"gridTable\";\n\n // add rows and columns to the table\n for (let i = 0; i < height; ++i) {\n const row = table.insertRow(i);\n for (let j = 0; j < width; ++j) {\n const cell = row.insertCell(j);\n\n // add event listener to each cell such that\n // it is fillied with selected color when clicked\n cell.addEventListener('click', (e) => {\n changeColor(e);\n });\n }\n }\n\n // append the table to the canvas\n document.getElementById('pixel_canvas').append(table);\n}", "function makeGrid(n,m) {\n\n\tfor(let i=1; i<=n; i++) {\n\t\t//create a row\n\t\t$('#pixelCanvas').append('<tr id=table' + i + '></tr>');\n\n\t\tfor(let j=1; j<=m; j++) {\n\t\t\t//add a td or cell to row\n\t\t\t$('#table' + i).append('<td></td>');\n\t\t}\n\t}\n\n\t//add color to cell when clicked\n\t$('td').click(function addColor() {\n\t\tlet color = $('#colorPicker').val();\n\n\t\tif($(this).attr('style')) {\n\t\t\t$(this).removeAttr('style')\n\t\t} else {\n\t\t\t$(this).attr('style', 'background-color:' + color);\n\n\t\t}\n\t})\n}", "function generateMatrix() {\r\n\tvar tableDef = \"\";\r\n\t\r\n\t//Calculate the centre row and cell - (number Rows + 1) / 2\r\n\tvar centreCell = (Number(chosenSize) + 1) / 2;\r\n\tvar cellColor = \"\";\r\n\t\r\n\t//Outer loop for the Rows in the table\r\n\tfor (rowCounter = 1; rowCounter <= chosenSize; rowCounter++)\r\n\t{\r\n\t\t//Cells in even row numbers and even column numbers will be yellow\r\n\t\tvar isEvenRow = false;\r\n\t\tif (rowCounter % 2 == 0) {\r\n\t\t\tisEvenRow = true;\r\n\t\t}\r\n\t\t\r\n\t\t//Create a new table row for each loop\r\n\t\ttableDef += \"<tr>\";\r\n\t\t\r\n\t\t//Inner loop for the columns in each row\r\n\t\tfor (columnCounter = 1; columnCounter <= chosenSize; columnCounter++)\r\n\t\t{\r\n\t\t\tvar isEvenColumn = false;\r\n\t\t\tif (columnCounter % 2 == 0) {\r\n\t\t\t\tisEvenColumn = true;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Set the color\r\n\t\t\tif (rowCounter == centreCell && columnCounter == centreCell) {\r\n\t\t\t\tcellColor = \"Red\";\r\n\t\t\t} else if(Boolean(isEvenRow) && Boolean(isEvenColumn)) {\r\n\t\t\t\tcellColor = \"Yellow\";\r\n\t\t\t} else {\r\n\t\t\t\tcellColor = \"Green\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Create each cell in the table\r\n\t\t\ttableDef += \"<td><span class='circle\" + cellColor + \"'></span>\";\r\n\t\t}\r\n\t\r\n\t\t//End the table row\r\n\t\ttableDef += \"</tr>\";\r\n\r\n\t}\r\n\t\r\n\t//Output the matrix\r\n\tdocument.getElementById(\"matrix\").innerHTML = tableDef;\r\n}", "function makeGrid() {\n\n let height = document.getElementById('inputHeight').value;\n let width = document.getElementById('inputWidth').value;\n let table = document.getElementById('pixelCanvas');\n\n console.log(height, width)\n// clear table\ntable.innerHTML = '';\ncolor.value = '#000000'\n for (var i=0; i<height; i++)\n {\n var tr=document.createElement('tr');\n for (var j=0; j<width; j++)\n {\n // create column; table data\n var td = document.createElement('td');\n\n // td.onclick = function() {\n // this.style.backgroundColor = color.value;\n // }\n td.addEventListener('click', function() {\n this.style.backgroundColor = color.value;\n }, false);\n\n tr.appendChild(td);\n }\n table.appendChild(tr);\n }\n\n\n}", "function paint_cell(x, y, num)\n\t{\t\n\t\tvar gc_colors = [\"#1BCFC3\", \"#1BCFC3\" , \"#1BCFC3\"];\n\t\tctx.fillStyle = gc_colors[num % 3];\n\t\tctx.fillRect(x*cell_w, y*cell_w, cell_w, cell_w);\n\t\tctx.strokeStyle = gc_colors[num % 3];\n\t\tctx.strokeRect(x*cell_w, y*cell_w, cell_w, cell_w);\n\t}", "function makeGrid() {\n // Select size input\n const height = document.getElementById('inputHeight').value;\n const width = document.getElementById('inputWidth').value;\n // select table\n const table = document.getElementById('pixelCanvas');\n //remove old table then create new one .\n table.innerHTML = \"\";\n // create inner loops to draw row and column .\n for (var i = 0; i < height; i++) {\n // create a new row .\n var tableRow = document.createElement(\"tr\");\n for (var j = 0; j < width; j++) {\n // create new column in each rows.\n var tableCell = document.createElement(\"td\");\n tableRow.appendChild(tableCell);\n }// End inner for loop .\n // add row and cell in each round .\n var cell = table.appendChild(tableRow);\n // add listenr to each cell.\n cell.addEventListener('click', function (e) {\n // Select color input\n var color = document.getElementById('colorPicker').value;\n e.target.style.backgroundColor = color;\n });\n }; // end main loop.\n}", "function renderTable() {\n clearTable();\n showTable();\n}", "function createTable(){\n var body = document.getElementsByTagName('span')[0];\n // var body = document.getElementById('table')[0];\n var tab = document.createElement('table');\n \n var table = document.getElementsByTagName('table')[0];\n\n for (var row=0; row<params.progress.length; row++){\n var tr = document.createElement('tr');\n for (var col=0; col<params.progress[row].length; col++) {\n var td = document.createElement('td');\n var tn = document.createTextNode(params.progress[row][col]);\n td.appendChild(tn);\n tr.appendChild(td);\n };\n tab.appendChild(tr);\n };\n\n table.parentNode.removeChild(table);//czyszczenie pierwszego wpisu w tablicy\n\n body.appendChild(tab);\n}", "function init_2(){\n d3.select('table')\n .selectAll('td')\n .each(function(e) {\n if (this.innerText === \"42\")\n this.style.backgroundColor = \"red\";\n }\n );\n}", "function maketable_allof(icaos, type, how) {\n\t\ticaos = icaos.filter(d=>icaodb[d][type] == how);\n\t\td3.select(\"#colorbar\")\n\t\t\t.transition()\n\t\t\t.duration(300)\n\t\t\t.styleTween(\"background-color\", function(d){\n\t\t\t\t return d3.interpolateLab(d3.select(this)\n\t\t\t\t \t\t\t\t\t\t\t .style(\"background-color\"),\n\t\t\t\t \t\t\t\t\t\t\tfiltercss[type].fillcol);\n\t\t\t})\n\t\tmaketable_icaos(icaos);\n\t}", "function createTable(){\n\t// Get value of the Min Column\n //cMin = document.getElementById(\"minCol\").value;\n var cMin = parseInt($('input[name=minCol]').val());\n // Get value of the Max Column\n\t//cMax = document.getElementById(\"maxCol\").value;\n var cMax = parseInt($('input[name=maxCol]').val());\n\t// Get value of the Min Row\n\t//rMin = document.getElementById(\"minRow\").value;\n var rMin = parseInt($('input[name=minRow]').val());\n\t// Get value of the Max Row\n\t//rMax = document.getElementById(\"maxRow\").value;\n var rMax = parseInt($('input[name=maxRow]').val());\n\n\t// Check to see if the numbers are read correctly.\n console.log(\"minCol: \", cMin, \"maxCol: \", cMax),\n console.log(\"minRow: \", rMin, \"maxRow: \", rMax);\n\t\n\tvar tableOutput = \"\"; //define the tableOutput\n\tvar checkColor = 0; // using this variable to check the color of each cell\n\ttableOutput += \"<table id='myTable'>\"; // opening tag for table\n\t\t\n\t// create table from column to row with the input provided by user\n\t// this \"for loop\" is creating rows \n\tfor(var row = 0; row <= (rMax - rMin + 1); row++){\n\t\ttableOutput += \"<tr>\"; // opening tag for table\n\t\t// this \"for loop\" is creating columns\n\t\tfor(var col = 0; col <= (cMax - cMin + 1); col++){\n\t\t\t// all the if and else statements are taking care of the coloring cell\n\t\t\tif(row == 0){\n\t\t\t\ttableOutput += \"<td class='header'>\" + ((col == 0)? \"\" : ( col + cMin - 1)) + \"</td>\";\n\t\t\t}\n\t\t\telse if( col == 0 ){\n\t\t\t\ttableOutput += \"<td class='header'>\" + (row + rMin - 1) + \"</td>\";\n\t\t\t}\n\t\t\telse{\n\t\t\t\ttableOutput += ((Number(checkColor) % 2 == 0) ? \"<td class='child-blink'>\" : \"<td class='color'>\") + ((row + rMin - 1) * (col + cMin - 1)) + \"</td>\"; \n\t\t\t\tcheckColor++; // increment the checkColor\n\t\t\t}\n\t\t}\n\t\trow % 2 == 0 ? checkColor = 0 : checkColor = 1;\n\t\ttableOutput += \"</tr>\"; // closing tag for the row\n\t}\n\ttableOutput += \"</table>\";// closing tag for the table\n $(\"#myTable\").html(tableOutput);// Outputing the table\n\t// this is making sure that after the box is Drew\n\t// the submit button is enable\n\t$(\"#submit\").prop(\"disabled\", false);\n return false;\n}" ]
[ "0.79159707", "0.79053813", "0.74255663", "0.7110601", "0.69467086", "0.67430735", "0.6679923", "0.66681814", "0.6650535", "0.6645183", "0.6643966", "0.66277987", "0.6620158", "0.65676934", "0.6532415", "0.6520607", "0.65086704", "0.6494173", "0.6461298", "0.6430681", "0.6415909", "0.6413757", "0.640165", "0.6388937", "0.63808095", "0.6379112", "0.6373039", "0.6370027", "0.6360691", "0.6359675", "0.6357549", "0.6295757", "0.62942475", "0.62878454", "0.6268463", "0.6235174", "0.6234672", "0.6228225", "0.6202334", "0.6198623", "0.61984885", "0.61943585", "0.619324", "0.6184293", "0.61815065", "0.61807984", "0.6180273", "0.6168884", "0.61554104", "0.614895", "0.61351734", "0.6134949", "0.6126578", "0.61194086", "0.6111202", "0.61067027", "0.6099191", "0.609861", "0.6076957", "0.60704803", "0.60683906", "0.6065043", "0.60619444", "0.6060699", "0.6058724", "0.60545504", "0.60545504", "0.60545504", "0.605093", "0.60476816", "0.6047604", "0.6045977", "0.6042072", "0.6040931", "0.6039663", "0.60366803", "0.6032699", "0.6028444", "0.6021606", "0.60052586", "0.59997725", "0.59910554", "0.59849834", "0.5983121", "0.5980656", "0.5977867", "0.59686565", "0.5967756", "0.5967736", "0.59635586", "0.59626377", "0.595995", "0.5957056", "0.5943339", "0.5940392", "0.59381104", "0.5933504", "0.59321433", "0.59316576", "0.59312564", "0.5927095" ]
0.0
-1
7. Write a script that, on click of a button, can randomly select an image from a list and insert it inside the section tag in the html. eg.
function insertImage() { let img = document.createElement("img"); let section = document.getElementById("imageSection"); img.src = "https://source.unsplash.com/random"; img.style.height = "300px"; img.style.width = "auto"; section.appendChild(img); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function chooseFruit(){\n // access id and get the attr with attr();\n //to get random image in second parameter\n //we will create array above. fruits[0] is apple\n /*\n want number to be randomly chosen between 0-8\n use Math.random() which gives a number betwwen\n 0 and 1 and multiply by 8\n use Math.round to get whole number\n */\n $('#fruit1').attr('src','images/'+ fruits[Math.round(8*Math.random())] + '.png')\n // need to position fruit randomly horizontally\n //verticallly place it above fruit container\n // when it appears \n // also want left position( horizontal) to be random so use same Math methods\n // use the { }becuase setting 2 property\n\n\n \n }", "function displayImage() {\n let randomImage = images[Math.floor(Math.random() * images.length)];\n document.getElementById(\"img-place\").innerHTML = randomImage;\n}", "function chooseFruit(){\n $(\"#picture1\").attr(\"src\", \"images/\" + fruits[Math.round(6*Math.random())] + \".png\");\n}", "function chooseWeddingPicture() {\n \n var weddingPictures = [\"images/2018august(1).JPG\", \"images/2018august(2).JPG\", \"images/2018august(3).JPG\"];\n \n var randomNum = Math.floor(Math.random() * weddingPictures.length);\n \n document.querySelector(\"#mySpecialModal\").src = weddingPictures[randomNum];\n}", "function randomImage() {\n var path = 'assets/img/',\n imgs = ['service-details-1.jpg', 'service-details-2.jpg', 'service-details-3.jpg', 'service-details-4.jpg', 'services.jpg'],\n i = Math.floor(Math.random() * imgs.length);\n $('.myimage').append(\"<img src='\" + path + imgs[i] + \"'>\").hide().fadeIn(2000);\n}", "function chooseFruit() {\n var number = Math.round(Math.random()*8);\n \n //chosing fruits from array and random horizontal position\n $(\"#fruit1\").attr('src','images/'+fruits[number]+'.png');\n $(\"#fruit1\").css({'left': Math.round(Math.random()*800), 'top':-50});\n }", "function chooseFruit(){\n $(\"#fruit1\").attr('src' , 'images/' + fruits[Math.round(8*Math.random())] +'.png');\n}", "function displayImg() {\n\n var images = [\"PeterdeBipolarBearNeutraal.png\",\n \"PeterdeBipolarBearbeetjesad.png\",\n \"PeterdeBipolarBearmoe.png\",\n \"PeterdeBipolarBearboos.png\",\n \"PeterdeBipolarBearverwonderd.png\",\n \"PeterdeBipolarBearblij.png\",\n \"PeterdeBipolarBeardood.png\",\n \"PeterdeBipolarBearetend.png\",\n \"PeterdeBipolarBeargek.png\",\n \"PeterdeBipolarBearmisselijk.png\",\n \"PeterdeBipolarBearslapend.png\",\n \"PeterdeBipolarBearsmooth.png\",\n \"PeterdeBipolarBearvampierig.png\"\n ];\n\n var num = Math.floor(Math.random() * (images.length));\n document.canvas.src = \"BipolarAfbeeldingen/\" + images[num];\n}", "function chooseFruit(){\r\n $(\"#fruit1\").attr('src' , 'images/' + fruits[Math.round(8*Math.random())] +'.png'); \r\n}", "function imgRandom(location) {\n for (var i = 0; i < 1; i++) {\n var rand = imgArray[Math.floor(Math.random() * imgArray.length)];\n var image = new Image();\n image.src = basePath+rand;\n $(location).append(image);\n }\n}", "function getRandomImgs(){\n //randomize the images\n var randomIndex = getRandomMax(imageObjects.length);\n //make an array with 6 non matching images and compare to current random to keep repitition down\n while(matchImages.includes(randomIndex)){\n randomIndex = getRandomMax(imageObjects.length);\n }\n matchImages.push(randomIndex);\n if(matchImages.length > (voteOnNum*2)){\n matchImages.shift();\n }\n var randomImg = imageObjects[randomIndex];\n //display image on page\n var imageElement = document.createElement('img');\n imageElement.setAttribute('src',randomImg.filepath);\n imageElement.setAttribute('alt',randomImg.alt);\n imageElement.setAttribute('title', randomImg.title);\n imageparentElement.appendChild(imageElement);\n randomImg.looks++;\n}", "function chooseFruit() {\n $(\"#fruit1\").attr('src', 'images/' + fruits[Math.round(8*Math.random())] + '.png');\n }", "function displayImage() {\n var num = Math.floor(Math.random() * 3);\n var img = document.getElementById(\"background\");\n img.src = imagesArray[num];\n}", "function getRandomImage(){\n var randomIndex = getRandomNumber(productArray.length);\n\n while(uniqueImageArray.includes(randomIndex)){\n randomIndex = getRandomNumber(productArray.length);\n }\n\n // add the index to the end of the arraay\n uniqueImageArray.push(randomIndex);\n\n // remove the oldest index from the array - that would be the first index\n if(uniqueImageArray.length > 6){\n uniqueImageArray.shift();\n }\n var chosenImage = productArray[randomIndex];\n chosenImage.displayCount++;\n // create an img element\n var imageElement = document.createElement('img');\n //set the attirbutes of the image\n imageElement.setAttribute('src', chosenImage.filepath);\n imageElement.setAttribute('alt', chosenImage.alt);\n imageElement.setAttribute('name', chosenImage.title);\n //append to parent\n imageContainer.appendChild(imageElement);\n}", "function getRandomImage(){\n // get a random number from the helper function betweet 0 and one less than the length of the array\n var randomIndex = getRandomNumber(imageArray.length);\n while(uniqueImageArray.includes(randomIndex)){\n randomIndex = getRandomNumber(imageArray.length);\n }\n uniqueImageArray.push(randomIndex);\n if(uniqueImageArray > 6){\n uniqueImageArray.shift();\n }\n // use that random number as the index for our catArray\n var chosenImage = imageArray[randomIndex];\n chosenImage.shown++;\n buildElements(chosenImage);\n // create an img tag\n var imageElement = document.createElement('img');\n // give that img tag a src = the path of where my image is\n imageElement.setAttribute('src', chosenImage.filepath);\n // give the img tag an alt\n imageElement.setAttribute('alt', chosenImage.alt);\n // give the img tag a title\n imageElement.setAttribute('title', chosenImage.title);\n // append it to the parent\n parentElement.appendChild(imageElement);\n}", "function choosefruit() {\r\n\t$(\"#fruity\").attr('src', fruits[Math.round(11 * Math.random())] + '.png');\r\n}", "function chooseItem(item){\n \n if(item == 'sports'){\n \n //Randomly generating images to be dropped\n $(\"#items\").attr(\"src\",\"img/sports/\" + items_sports[Math.floor(Math.random() * 8)] + \".png\"); \n }else{\n \n //Randomly generating images to be dropped\n $(\"#items\").attr(\"src\",\"img/fruits/\" + items_fruits[Math.floor(Math.random() * 8)] + \".png\"); \n }\n}", "function displayImage() {\n const randomIndex = Math.floor(Math.random() * response.length);\n const imgSrc = response[randomIndex].links[0].href;\n const { title, description } = response[randomIndex].data[0];\n const imgHTML = `<img class=\"random-img\" src=\"${imgSrc}\" alt=\"${title}\">`;\n imageDescription.textContent = description;\n imageDescription.style.display = 'block';\n imageDiv.innerHTML = imgHTML;\n }", "function newInspiration() {\r\n var randomNumber = Math.floor(Math.random() * inspirations.length) /*Math.random is a decimal btw 0-1*/\r\n /*use value of randomNumber to get inspiration from inspiration array*/\r\n document.getElementById('inspirationDisplay').innerHTML = inspirations[randomNumber] /*document is DOM document object model which makes html interactive*/\r\n} /*innerHTML is the html of a dom element*/", "function imagesToHtml(){\n var leftPic = getRandomNum();\n oldItems.push(leftPic);\n var img = document.createElement('IMG');\n img.src = items[leftPic].filepath;\n document.body.appendChild(img);\n // img.onclick = function() {\n // console.log('ok')\n // }\n var centerPic = getRandomNum();\n while(centerPic === leftPic){\n centerPic = getRandomNum();\n }\n oldItems.push(centerPic);\n img = document.createElement('IMG');\n img.src = items[centerPic].filepath;\n document.body.appendChild(img);\n var rightPic = getRandomNum();\n while(rightPic === leftPic || rightPic === centerPic){\n rightPic = getRandomNum();\n }\n oldItems.push(rightPic);\n img = document.createElement('IMG');\n img.src = items[rightPic].filepath;\n document.body.appendChild(img);\n}", "function renderToPage(){\n var targetDisplayParent = document.getElementById('choices'); \n var newDisplayContent = findThreeUniq();\n \n for(var i = 0; i <= 2; i++){\n var newDisplayEl = document.createElement('img');\n var newLi = document.createElement('li');\n newDisplayEl.src = newDisplayContent[i].imageUrl;\n newDisplayEl.id = newDisplayContent[i].product;\n newLi.appendChild(newDisplayEl);\n newDisplayContent[i].views ++;\n targetDisplayParent.appendChild(newLi);\n \n } \n}", "function randomTPain(){\n var randIndex = Math.floor(Math.random() * 10);\n var text = \"<img src=\" + tPainArray[randIndex] + \"></img>\";\n document.getElementById(\"tpain\").innerHTML = text;\n}", "function randomateSurvPerks() {\n \n // Shuffles the array and returns it\n var Survshuffled = SurvImgSrc.sort(function () {\n return .5 - Math.random()\n });\n // Select the first 4 in the new array \n var Survselected = Survshuffled.slice(0, 4);\n\n // Puts the first 4 in slots made in html.\n document.getElementById(\"perkslotone\").innerHTML = Survselected[0];\n document.getElementById(\"perkslottwo\").innerHTML = Survselected[1];\n document.getElementById(\"perkslotthree\").innerHTML = Survselected[2];\n document.getElementById(\"perkslotfour\").innerHTML = Survselected[3];\n\n}", "function displayImages() {\n \n if (voteCount === 25){\n console.log('display results');\n showResults();\n \n return;\n\n }\n var image1 = Item.all [randomIntFromInterval(0,4)];\n image1.showCount++;\n var img1 = document.getElementById('item-1');\n img1.src = image1.src;\n img1.currentItem = image1;\n\n var image2 = Item.all [randomIntFromInterval(5,9)];\n image2.showCount++;\n var img2 = document.getElementById('item-2');\n img2.src = image2.src;\n img2.currentItem = image2;\n\n var image3 = Item.all [randomIntFromInterval(10,14)];\n image3.showCount++;\n var img3 = document.getElementById('item-3');\n img3.src = image3.src;\n img3.currentItem = image3;\n \n\n}", "function choosePic() {\n const randomNum = getRandomInt(0, 15)\n console.log(randomNum)\n document.getElementById(\"image\").src = rabbitsImages[randomNum];\n}", "function shuffle() {\n let banners = [\n [\"images/buyCoding.svg\"], [\"images/courses.svg\"], [\"images/electronics.svg\"], [\"images/mastermind.svg\"], [\"images/books.svg\"]];\n \n //every time the page loads it will use a random number to return a random index of the array\n let rand = Math.floor(Math.random() * 4);\n \n document.getElementById('ad-container').innerHTML = '<a href=\"./products.html\"><img src=\" ' + banners[rand] + '\" height=\"320\" width=\"350\" alt=\"300x250 Banner Ad\" /></a>';\n}", "function shuffleGallery() {\n if (chico[0] == undefined) {\n populateChico();\n }\n do {\n var randIndex = generateRandomIndex();\n } while (chico[randIndex] == current)\n current = chico[randIndex];\n //console.log(chico[randIndex]);\n document.getElementById('caption').innerHTML = current.description;\n document.getElementById('picture').src = current.picture;\n document.getElementById('source').innerHTML = \"Image courtesy of: \" + current.from;\n}", "function updateTargetImageContainer() {\n $targetImg = $targetImg;\n let number = getRandomNumber(imgNameList);\n imgNameList.splice(imgNameList.indexOf(number), 1);\n targetImage = `images/${number}.jpg`;;\n $targetImg.find('img').attr('src', targetImage);\n $targetImg.css('display', 'block');\n $('.text-2').css(\"display\", \"block\");\n}", "function displayImage(){\r\n\r\n \t//the first statement should generate a random number in the range 0 to 6 (the subscript values of the image file names in the imagesArray)\r\n \tvar num = Math.floor(Math.random() * 2); // 0...6\r\n \t//the second statement display the random image from the imagesArray array in the canvas image using the random number as the subscript value\r\n \tdocument.canvas.src = imagesArray[num];\r\n\r\n\t}", "function displayImage(){\n\t\tvar images = { 3:\"assets/images/gym.png\", 5:\"assets/images/kanto.jpg\", 6:\"assets/images/badge.png\", 7:\"assets/images/pikachu.png\", 8:\"assets/images/squirtle.png\"};\n\t\t$(\"#imagePlace\").html(\"<img src=\"+images[randomWord.length]+\" style=\\\"height:225px;\\\">\");\n\t}", "function placeImg() {\n var i = 0;\n var randomSrc = shuffle(srcList); \n $(\".img\").each(function() {\n $(this).attr(\"src\", randomSrc[i])\n i++\n })\n}", "function displayComputerMove (){\n let randomImage = document.getElementById(\"computer-choice\");\n randomImage.src=`images/${computerMove}.png`;\n}", "function domReady(){\n\n var imajRandom = getRandomItem(illu);\n\n initScreen();\n\n $(\"#imaj\").html(\"<img src=./images/\"+ imajRandom +\">\");\n $(\"#rep1\").click(clickRep1)\n $(\"#rep2\").click(clickRep2)\n $(\"#rep3\").click(clickRep3)\n $(\".qsuiv\").click(clickQSuiv)\n $(\".ecran2\").hide()\n // $(\".reponses\").css({\n // \"background-color\":getRandomColor()\n // })\n\n}", "function pickRandom(){\n var r1 = Math.floor((Math.random() * imagePathListLength));\n var r2 = Math.floor((Math.random() * imagePathListLength));\n var r3 = Math.floor((Math.random() * imagePathListLength));\n var r4 = Math.floor((Math.random() * imagePathListLength));\n\n img1bg.src = imagePaths[r1];\n img2bg.src = imagePaths[r2];\n img3bg.src = imagePaths[r3];\n img4bg.src = imagePaths[r4];\n}", "function userProfiles(){\n // Choose a random number for the image to use\n var imageNumber = randomIntegerInRange(1,AVAILABLE_IMAGES);\n // Create a string that points to the location of the image\n var imageSource = \"../images/profile\" + imageNumber + \".jpg\";\n // Build the image element\n var img = $('<img class=\"image\" src=\"' + imageSource + '\">');\n // Add the chosen image to corresponding div\n $('.random').append(img);\n }", "function addRandomImage(){\n\t\tvar bussySite=[];\n\t\tvar bussyImage=[];\n\t\tshow=1;\t\n\n\t\tfor (var i =0; bussyImage.length<8; i++){\n\t\t\t\t\t\n\t\t\tvar image = Math.floor(Math.random() * 8);\n\t\t\tvar pic=0;\n\t\t\t\t\t\t\n\t\t\tif (!bussyImage.includes(image)) {\t\t\t\t\n\t\t\t\tbussyImage.push(image);\n\n\n\t\t\t\twhile (pic<2){\n\t\t\t\t\tvar site = Math.floor(Math.random() * 16); \n\t\t\t\t\t//cardlist[1].innerHTML;\n\t\t\t\t\tif (!bussySite.includes(site)) {\n\t\t\t\t\t\tbussySite.push(site);\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\taddImage(site,image);\n\t\t\t\t\t\tpic++;\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\t\t\n\t}", "function image() {\r\n // Set variable as the div in order to check if the div is there\r\n var location = document.getElementById('imgSection');\r\n // If an image IS there\r\n if (document.getElementById('charImage')) {\r\n // Remove the current character image from the div\r\n location.removeChild(characterImage);\r\n }\r\n // Get a random character image\r\n randomHira = imgRandom(hiraArray);\r\n // Set new img element's src as the \"character\" image src\r\n characterImage.src = randomHira.src;\r\n // Append img to page\r\n location.appendChild(characterImage);\r\n // Clear the text entry box of the User's previous answer\r\n document.forms['form1'].reset();\r\n}", "function randomateKillPerks() {\n var Killshuffled = KillImgSrc.sort(function () {\n return .5 - Math.random()\n });\n var Killselected = Killshuffled.slice(0, 4);\n\n document.getElementById(\"perkslotone\").innerHTML = Killselected[0];\n document.getElementById(\"perkslottwo\").innerHTML = Killselected[1];\n document.getElementById(\"perkslotthree\").innerHTML = Killselected[2];\n document.getElementById(\"perkslotfour\").innerHTML = Killselected[3];\n}", "function showPokemon(randImg){\n let imagenPokemon = document.createElement('img')\n imagenPokemon.setAttribute('src',randImg)\n pokemonImg.appendChild(imagenPokemon);\n\n}", "function randomBrand(){\n var selection = Math.floor(Math.random() * brandName.length + 1);\n toGuess = brandName[selection].name;\n document.getElementById(\"imageGuess\").src = \"assets/images/\" + brandName[selection].image;\n document.getElementById(\"imageGuess\").style.visibility = 'visible';\n //console.log(toGuess);\n}", "function removeImage() { //Exists to remove the Image when the randomButton is clicked, to make place for a new image. Used in function changeHash(). See chapter 7. \n //<<<NOTE: Might put this with the creation of new image? Though that might be a step in the wrong direction considering it'll lessen the\n //reusability of the function.\n\n let selectImg = document.querySelector(\"img\"); //Selects the image-element.\n selectImg.parentNode.removeChild(selectImg); //Removes the image from the div.\n}", "function getRandomImage() {\n var images = [\"url('https://cdn.pixabay.com/photo/2015/03/26/09/47/sky-690293_960_720.jpg')\", \n \"url('https://images.unsplash.com/photo-1499346030926-9a72daac6c63?ixlib=rb-1.2.1&auto=format&fit=crop&w=750&q=80')\", \n \"url('https://cdn.pixabay.com/photo/2018/08/23/07/35/thunderstorm-3625405_960_720.jpg')\", \n \"url('https://cdn.pixabay.com/photo/2013/02/21/19/10/sea-84629_960_720.jpg')\", \n \"url('https://cdn.pixabay.com/photo/2016/10/18/21/22/california-1751455_960_720.jpg')\",\n \"url('https://cdn.pixabay.com/photo/2015/11/22/15/16/lightning-1056419_960_720.jpg')\",\n \"url('https://cdn.pixabay.com/photo/2018/04/12/18/13/sunset-3314275_960_720.jpg')\",\n \"url('https://cdn.pixabay.com/photo/2017/01/06/23/04/homberg-1959229_960_720.jpg')\",\n \"url('https://cdn.pixabay.com/photo/2017/12/29/18/47/nature-3048299_960_720.jpg')\",\n \"url('https://cdn.pixabay.com/photo/2016/03/04/19/36/beach-1236581_960_720.jpg')\",\n \"url('https://cdn.pixabay.com/photo/2018/05/30/00/24/thunderstorm-3440450_960_720.jpg')\",\n \"url('https://cdn.pixabay.com/photo/2016/10/25/14/03/clouds-1768967_960_720.jpg')\"];\n var image = images[Math.floor(Math.random()*images.length)];\n \n document.body.style.backgroundImage = image\n}", "function setMain(){\r\n var slides = document.getElementById(\"slides\");\r\n var mainImage = document.createElement(\"img\");\r\n var whichImage = Math.floor(Math.random()*6)\r\n mainImage.src= thumbImages[whichImage];\r\n slides.appendChild(mainImage);\r\n mainImage.className = \"mainImage\";\r\n}", "function renderImg() \n{\n leftIndex = randomImage();\n midIndex = randomImage();\n rightIndex = randomImage();\n\n randControl();\n while (leftIndex === rightIndex || leftIndex === midIndex) \n {\n leftIndex = randomImage();\n }\n while(rightIndex === midIndex)\n {\n rightIndex = randomImage();\n }\n randControl();\n usedImg.splice(0, usedImg.length);\n\n leftImg.setAttribute('src', products[leftIndex].productImg);\n midImg.setAttribute('src', products[midIndex].productImg);\n rightImg.setAttribute('src', products[rightIndex].productImg);\n products[leftIndex].views++;\n products[midIndex].views++;\n products[rightIndex].views++;\n\n usedImg.push(leftIndex);\n usedImg.push(midIndex);\n usedImg.push(rightIndex);\n}", "function randomAddressImage(){\n var folderPath = \"images/\";\n var fishes = [\"cuttlefish.jpg\", \"killerwhale.jpg\", \"mandarinfish.jpg\", \"lionfish.jpg\", \"piranha.jpg\", \"tigershark.jpg\"];\n var randomFish = fishes[Math.floor(Math.random() * fishes.length)];\n\n document.getElementById(\"addressImg\").src = folderPath + randomFish;\n} // end randomAddressImage", "function random_imglink(){\r\nvar myimages=new Array()\r\n//specify random images below. You can have as many as you wish\r\nmyimages[1]=\"http://67.media.tumblr.com/7c53a0454aa607ef4cec820972961e69/tumblr_o5fiynvcm41rlapeio1_540.gif\"\r\nmyimages[2]=\"http://bestanimations.com/Sci-Fi/StarWars/yoda-sat-wars-animated-gif-3.gif\"\r\nmyimages[3]=\"http://i.imgur.com/Fpkz2Va.gif\"\r\nmyimages[4]=\"https://media.giphy.com/media/vt4gALQsxCDmM/giphy.gif\"\r\nmyimages[5]=\"https://media.giphy.com/media/EXwLWGViGKevm/giphy.gif\"\r\nmyimages[6]=\"http://i4.photobucket.com/albums/y145/MoonlightStorm/gifs/gifleiashutup.gif\"\r\n\r\nvar ry=Math.floor(Math.random()*myimages.length)\r\nif (ry==0)\r\nry=1\r\ndocument.write('<img src=\"'+myimages[ry]+'\" border=0>')\r\n}", "function generateRandomIndex(imgIndexSelected) {\n var randIndex = Math.floor(Math.random() * products.length);\n while (previouslyDisplayedIndexs.includes(randIndex) || imgIndexSelected.includes(randIndex) ) {\n randIndex = Math.floor(Math.random() * products.length);\n }\n\n return randIndex;\n\n}", "function setupImageContainer() {\r\n container.innerHTML = '';\r\n for (var i = 0; i < 3; i++) {\r\n var currentPicture = getRandomUniqueImage();\r\n var img = document.createElement('img');\r\n img.alt = currentPicture.name;\r\n img.src = currentPicture.src;\r\n container.appendChild(img);\r\n }\r\n}", "function getTags() {\n // remove the old images\n imgContainer.innerHTML = \"\";\n // create new number for the page that we want to get images for\n let rundomNum = Math.floor(Math.random() * 100);\n // call etImages function with tag that user entred and the rundomNum that we have created\n getImages(document.querySelector(\"input\").value, rundomNum);\n // call displayTags to display new tags\n // displayTags();\n}", "function showRandomPictures(){\n \n //Generate 3 random numbers\n var random = Math.floor(Math.random() * allImages.length);\n var random2 = Math.floor(Math.random() * allImages.length);\n var random3 = Math.floor(Math.random() * allImages.length);\n \n //change to ensure no duplicates occur\n while (previousImage.includes(random) || previousImage.includes(random2) || previousImage.includes(random3) || random === random2 || random2 === random3 || random === random3){\n\n //regenerate random numbers\n random = Math.floor(Math.random() * allImages.length);\n random2 = Math.floor(Math.random() * allImages.length);\n random3 = Math.floor(Math.random() * allImages.length);\n }\n productPic.src = allImages[random].filepath;\n productPic.alt = allImages[random].name;\n productPic.title = allImages[random].name;\n\n productPic2.src = allImages[random2].filepath;\n productPic2.alt = allImages[random2].name;\n productPic2.title = allImages[random2].name;\n\n productPic3.src = allImages[random3].filepath;\n productPic3.alt = allImages[random3].name;\n productPic3.title = allImages[random3].name;\n\n allImages[random].views += 1;\n allImages[random2].views += 1;\n allImages[random3].views += 1;\n\n previousImage[0] = random;\n previousImage[1] = random2;\n previousImage[2] = random3;\n}", "function pictureThis() {\n document.write('<img src=\\'pics/Pic' + Math.floor(Math.random() * 5 ) + '.jfif\\'>')\n}", "function clickQSuiv(){\n\n $(\".ecran2\").hide() //--- PASSAGE à L'ÉCRAN 1\n $(\".ecran1\").show()\n\n initScreen(); // ----CHOISIS UNE PHRASE POUR LES REPONSES\n\n var imajRandom = getRandomItem(illu); // --- CHOISIS UNE IMAGE POUR LA QUESTION\n $(\"#imaj\").html(\"<img src=./images/\"+ imajRandom +\">\");\n // $(\".reponses\").css({\n // \"background-color\":getRandomColor()\n // })\n}", "function ChangeImage()\n{\n\tvar num = Math.floor(Math.random() * picList.length);\n\tvar Picture = {\n\t \timg: '<img class=\"pic\" src=\"https://picsum.photos/200?image=' + picList[num].id + '\">',\n\t \tauthor: picList[num].author,\n\t \tauthor_link:'<a href=\"' + picList[num].post_url + '\">'+\n\t \t\t\t\t'<img class=\"pic\" src=\"https://picsum.photos/200?image=' + picList[num].id + '\">' +\n\t \t\t\t\t'</a>'\n\t};\n\treturn Picture;\n}", "function makeRandomImage(){\n return Math.floor(Math.random() * allPics.length);\n}", "function setGemImages() {\n var gems = $(\"#gems\").children().children();\n console.log(gems);\n var selected = [];\n var rand = 0;\n\n for (i = 0; i < gems.length; i++) {\n rand = Math.floor(Math.random() * imgArray.length);\n\n //If image is not unique in set of 4, redo our random\n while(selected.indexOf(imgArray[rand]) != -1){\n rand = Math.floor(Math.random() * imgArray.length);\n }\n\n if(selected.indexOf(imgArray[rand]) === -1){\n selected.push(imgArray[rand]);\n console.log(\"supposed to push images\")\n $(gems[i]).attr(\"src\", \"assets/images/\" + selected[i]);\n }\n \n }\n }", "function changeImages() {\n\t//CSS position change\n\t$( this ).css( 'left', -500 );\n\n\t//Randomly select new image from array & store it in a variable (face,body,hand,feet)\n\tlet face = faces[ Math.floor( Math.random() * faces.length ) ];\n\tlet body = bodies[ Math.floor( Math.random() * bodies.length ) ];\n\tlet hand = hands[ Math.floor( Math.random() * hands.length ) ];\n\tlet feet = feets[ Math.floor( Math.random() * feets.length ) ];\n\n\t//Set the new image to the selected (this) body part\n\tif ( this.id === \"head\" ) {\n\t\t$head.attr( 'src', face );\n\t};\n\tif ( this.id === \"torso\" ) {\n\t\t$torso.attr( 'src', body );\n\t};\n\tif ( this.id === \"arms\" ) {\n\t\t$arms.attr( 'src', hand );\n\t};\n\tif ( this.id === \"legs\" ) {\n\t\t$legs.attr( 'src', feet )\n\t};\n\n\t//Lastly we call addImages function\n\tunlockImages();\n}", "function selectBeverages () {\n var img1Index = Math.floor(Math.random() * favBeverages.length);\n var img1Disp = document.createElement(\"img\");\n img1Disp.id = \"img1pic\";\n img1Disp.src = favBeverages[img1Index].folder;\n document.getElementById(\"img1\").appendChild(img1Disp);\n var img1Button = document.createElement(\"input\");\n img1Button.className = \"choiceButton\";\n img1Button.type = \"button\";\n img1Button.name = \"btn1\";\n img1Button.id = img1Index;\n img1Button.value = \"Vote for me!\";\n img1Button.addEventListener(\"click\", function () {\n countVote(this);\n clearSpans();\n }); /*addEventListener closure. */\n document.getElementById(\"img1\").appendChild(img1Button);\n/*do:while loop to ensure second image is different from first image: */\n do {var img2Index = Math.floor(Math.random() * favBeverages.length)}\n while (img2Index == img1Index);\n var img2Disp = document.createElement(\"img\");\n img2Disp.id = \"img2pic\"\n img2Disp.src = favBeverages[img2Index].folder;\n document.getElementById(\"img2\").appendChild(img2Disp);\n var img2Button = document.createElement(\"input\");\n img2Button.className = \"choiceButton\";\n img2Button.type = \"button\";\n img2Button.name = \"btn2\";\n img2Button.id = img2Index;\n img2Button.value = \"Vote for me!\";\n img2Button.addEventListener(\"click\", function () {\n countVote(this);\n clearSpans();\n }); /*addEventListener closure. */\n document.getElementById(\"img2\").appendChild(img2Button);\n}", "function getRandomDog(){\n let i = getRandomInt(171);\n try{$('.sub__voting-image img').attr('src', MyVariables.breedOptions[i].url);\n $('.sub__voting-image img').attr('ImgId', MyVariables.breedOptions[i].reffImgId);\n $('.sub__voting-image img').attr('value',MyVariables.breedOptions[i].id);\n $('.sub__voting-image img').attr('name', MyVariables.breedOptions[i].name);}\n catch(e){\n console.error(e);\n getRandomDog();\n }\n }", "function handleClickOnAnyImage(event){\r\n if(event.target.tagName !== 'IMG'){\r\n return;\r\n }\r\n console.log('clicked on A image');\r\n //increment total clicks\r\n likeCounter++;\r\n //debugger;\r\n if(event.target.id === 'left-image'){\r\n leftImageThatIsOnThePage.clicks++;\r\n }\r\n if(event.target.id === 'middle-image'){\r\n middleImageThatIsOnThePage.clicks++;\r\n }\r\n if(event.target.id === 'right-image'){\r\n rightImageThatIsOnThePage.clicks++;\r\n }\r\n\r\n var tempPickedProducts = [];\r\n //TODO: refactor to be repeatable\r\n do {// we are selecting a previous product\r\n // pick a new 3 images\r\n var leftImageIndex = Math.floor(Math.random() * allImages.length);\r\n\r\n } while (\r\n previouslyPickedImages.includes(allImages[leftImageIndex])||\r\n tempPickedProducts.includes(allImages[leftImageIndex])\r\n\r\n );\r\n tempPickedProducts.push(allImages[leftImageIndex]);\r\n do {// we are selecting a previous image\r\n // pick a new 3 images,\r\n var middleImageIndex = Math.floor(Math.random() * allImages.length);\r\n\r\n } while (\r\n previouslyPickedImages.includes(allImages[middleImageIndex]) ||\r\n tempPickedProducts.includes(allImages[middleImageIndex])\r\n\r\n );\r\n tempPickedProducts.push(allImages[middleImageIndex]);\r\n\r\n do {\r\n\r\n var rightImageIndex = Math.floor(Math.random() * allImages.length);\r\n\r\n } while (\r\n\r\n previouslyPickedImages.includes(allImages[rightImageIndex])||\r\n tempPickedProducts.includes(allImages[rightImageIndex])\r\n\r\n );\r\n tempPickedProducts.push(allImages[rightImageIndex]);\r\n\r\n //selecting 3 random images\r\n //TODO: make sure you dont repeat\r\n\r\n\r\n leftImageThatIsOnThePage = allImages[leftImageIndex];\r\n middleImageThatIsOnThePage = allImages[middleImageIndex];\r\n rightImageThatIsOnThePage = allImages[rightImageIndex];\r\n\r\n // and put them on the page\r\n leftImage.src = leftImageThatIsOnThePage.imagesrc;\r\n middleImage.src = middleImageThatIsOnThePage.imagesrc;\r\n rightImage.src = rightImageThatIsOnThePage.imagesrc;\r\n\r\n\r\n // stop after 2 clicks\r\n if(likeCounter > 24){\r\n // stop listening for clicks on the left, center and right images\r\n allProductImagesContainerSectionEl.removeEventListener('click', handleClickOnAnyImage);\r\n // centerDiv.removeEventListener('click', handleClickOnCenterImage);\r\n // rightDiv.removeEventListener('click', handleClickOnRightImage);\r\n\r\n makeAProductChart();\r\n\r\n // Save the images data;\r\n console.log('saving images to local storage');\r\n var catalogImages = JSON.stringify(allImages);\r\n localStorage.setItem('allImages', catalogImages);\r\n }\r\n}", "function getRandomImage() {\n var jumbo = document.getElementById(\"jumbotron\");\n var randomItem = randomList[Math.floor(Math.random()*randomList.length)];\n jumbo.style.backgroundImage = \"url(../javapic/images/\" + randomItem +\")\";\n}", "function selectCorrectAnswer() {\n let imgLink = `${STORE[questionNum].answerImage}`\n $('.questionPage').html(\n `<div class=\"correct-answer\">\n <h3>You are correct!</h3>\n ${imgLink}\n <button type=\"button\" class=\"nextButton\">Next</button>\n </div>`\n );\n}", "function imgSet(numberOfPics){\n for(var i = 0;i < numberOfPics;i++){\n getRandomImgs();\n };\n}", "function randControl()\n{\n while(leftIndex === usedImg[0] || leftIndex === usedImg[1] || leftIndex === usedImg[2])\n {\n leftIndex = randomImage();\n }\n while(midIndex === usedImg[0] || midIndex === usedImg[1] || midIndex === usedImg[2])\n {\n midIndex = randomImage();\n }\n while(rightIndex === usedImg[0] || rightIndex === usedImg[1] || rightIndex === usedImg[2])\n {\n rightIndex = randomImage();\n }\n}", "function imageGenerator(){\n var pic1 = randomizer(allAlpacas.length);\n console.log(pic1);\n var pic2 = randomizer(allAlpacas.length);\n console.log(pic2);\n\n imageOneEl.src = allAlpacas[pic1].src;\n imageOneEl.title = allAlpacas[pic1].name;\n\n imageTwoEl.src = allAlpacas[pic2].src;\n imageTwoEl.title = allAlpacas[pic2].name;\n}", "function getRandomNum() {\n randomArray = [];\n for (var i = 0; i < 3; i++) {\n var randomImage = Math.floor(Math.random() * (availablePhotos.length));\n var imageChoice = availablePhotos[randomImage];\n if (typeof testArray == 'undefined') { // First itme through run\n createImageArray();\n } else if (imageChoice == testArray[0] || imageChoice == testArray[1] || imageChoice == testArray[2]) {\n i -= 1; //rerun if a duplicate from previous round\n continue;\n } else {\n createImageArray();\n };\n\n //get image form array; store in randomArray, splice from cloned imageArray\n function createImageArray() {\n var imgPick = imageChoice.fileSrc\n randomArray.push(imageChoice);\n availablePhotos.splice(randomImage, 1);\n };\n };\n availablePhotos = availablePhotos.concat(randomArray) //add images back into array\n testArray.splice(0, 3, randomArray[0], randomArray[1], randomArray[2]); //store images to check next round\n displayImage(randomArray);\n}", "function mousePressed(){\n var selection = random(choices)\n if (selection === \"Tails\"){\n image(tails,width/2-150,height/2,);\n }\n else if (selection === \"Heads\"){\n image(heads,width/2-150,height/2);\n }\n}", "function generateRandomImg() {\n let randomImg = Math.floor(Math.random() * numOfImages) +1//CREATES RANDOM RESPONSE BETWEEN 0-4 INCLUSIVE\n if (randomImg === 1) {\n imageArea.src = \"Images/Santa_Img.png\"\n revealedMsg.textContent = \"You get a visit from Santa!\"\n }\n else if (randomImg === 2) {\n imageArea.src = \"Images/Hot_Drink_Img.png\"\n revealedMsg.textContent = \"You get a hot cocoa!\"\n }\n else if (randomImg === 3) {\n imageArea.src = \"Images/Christmas_Tree_Img.png\"\n revealedMsg.textContent = \"You get your own Holiday Tree!\"\n }\n else if (randomImg === 4) {\n imageArea.src = \"Images/Snow_Games_Img.png\"\n revealedMsg.textContent = \"You get to play in the snow!\"\n } \n}", "function randomize() {\r\n \tvar images = $('.randomize');\r\n \tif(images) {\r\n \t\timages.hide();\r\n \t\tvar number = images.length;\r\n \t\tvar random = Math.floor((Math.random()*number));\r\n \t\t\timages.eq(random).show();\r\n \t\t}\r\n }", "function getImage(pickATheme, makeSubList){\n var imageLi = document.createElement('li'); \n \tmakeSubList.appendChild(imageLi);\n var newImg = document.createElement('img');\n var setSrc = newImg.setAttribute(\"src\", \"images/\" + pickATheme + \".png\");\n \timageLi.appendChild(newImg);\n }", "function randomLobbying() {\n let _largeSign = [ \"//static.pardus.at/img/std/disposition_plus.png\", \"//static.pardus.at/img/std/disposition_neutral.png\", \"//static.pardus.at/img/std/disposition_minus.png\"];\n document.querySelectorAll('th+td[colspan=\"2\"]').forEach( function (e) {\n e.children[0].src = _largeSign[Math.floor(Math.random()*3)]\n })\n }", "function comuterSelect() {\r\n var images = [\"rock\", \"paper\", \"scissors\"];\r\n var x;\r\n x=images[Math.floor(Math.random()*images.length)]; \r\n // console.log(\"computer selection\",x); \r\n //set attribute and value\r\n if(x===\"paper\"){$(\"#randimg\").attr(\"src\",\"images/paper-h.png\")}\r\n else if(x===\"rock\"){$(\"#randimg\").attr(\"src\",\"images/rock-h.png\")}\r\n else if(x===\"scissors\"){$(\"#randimg\").attr(\"src\",\"images/scissors.png\")}\r\n return x; \r\n}", "function clickImage() {\n\tlet clickedImage = Math.floor(Math.random() * 13) + 4;\n\tdocument.getElementsByTagName(\"img\")[clickedImage].click();\n\tsetTimeout(function() {\n\t\tdocument.getElementById(\"lose\").click();\n\t}, getRandomNum());\n}", "function shuffle() {\n\n //get the random result\n var imageResult = \"url(\" + images[Math.floor(Math.random() * images.length)] + \")\"\n var textResult = texts[Math.floor(Math.random() * texts.length)]\n\n //style result\n container.css(\"background-image\", imageResult);\n //input text\n text.text(textResult)\n}", "function selectTitleCandy() {\n console.log(\"Selecting Candy...\");\n var candy1 = CANDY_LIST[getRandomNumber(0, CANDY_LIST.length)];\n var candy2 = CANDY_LIST[getRandomNumber(0, CANDY_LIST.length)];\n\n\n\n while (candy1.slice(0, candy1.lastIndexOf(\"/\")) == candy2.slice(0, candy2.lastIndexOf(\"/\"))) {\n candy2 = CANDY_LIST[getRandomNumber(0, CANDY_LIST.length)];\n }\n\n $titleCandy[0].attr(\"src\", \"opponents/\" + candy1);\n $titleCandy[1].attr(\"src\", \"opponents/\" + candy2);\n}", "function randomImages(current, imagesArray) {\n var randomOne = randomNumber();\n var randomTwo = randomNumber();\n var randomThree = randomNumber();\n\n var comparison;\n if(randomOne === randomTwo || randomOne === randomThree || randomTwo === randomThree){\n comparison = true;\n }\n\n var matchOne = imagesArray.indexOf(randomOne);\n var matchTwo = imagesArray.indexOf(randomTwo);\n var matchThree = imagesArray.indexOf(randomThree);\n\n while(comparison || matchOne > -1 || matchTwo > -1 || matchThree > -1){\n randomOne = randomNumber();\n randomTwo = randomNumber();\n randomThree = randomNumber();\n\n matchOne = imagesArray.indexOf(randomOne);\n matchTwo = imagesArray.indexOf(randomTwo);\n matchThree = imagesArray.indexOf(randomThree);\n\n if(randomOne === randomTwo || randomOne === randomThree || randomTwo === randomThree){\n comparison = true;\n }else if(matchOne > -1 || matchTwo > -1 || matchThree > -1){\n comparison = true;\n }else {\n comparison = false;\n matchOne = -1;\n matchTwo = -1;\n matchThree = -1;\n }\n }\n ///Gets path of image and puts in src of image ids\n firstImageEl.src = images[randomOne].path;\n secondImageEl.src = images[randomTwo].path;\n thirdImageEl.src = images[randomThree].path;\n\n ///Update image shown\n images[randomOne].shown += 1;\n images[randomTwo].shown += 1;\n images[randomThree].shown += 1;\n}", "function show_image() { //TODO make show image never repeat (in same round, I got the same image 2x in a row)\n\n //clear the \"resultDiv\"\n document.getElementById(\"resultDiv\").innerHTML = \"\";\n\n allFilePaths = readCSVToArray(csvPath, '\\r');\n allVectorPaths = readCSVToArray(vectorPath, '\\r');\n\n var ranNum = Math.floor(Math.random() * allFilePaths.length);\n data = (allVectorPaths[ranNum]).split(\",\");\n currVect = data.slice(1, 6);\n emoteTypes.forEach((key, i) => currDic[key] = currVect[i]);\n currVect = Object.keys(currDic).map(function (key) {\n return [key, currDic[key]];\n });\n currVect.sort(function (first, second) {\n return second[1] - first[1];\n });\n\n var img = document.createElement(\"img\");\n img.src = \"../imgs/images/\" + data[0];\n img.id = \"picture\";\n img.height = \"600\";\n img.style = 'display: block; margin-left: auto; margin-right: auto;'\n\n console.log(allFilePaths[ranNum]);\n\n var foo = document.getElementById(\"resultDiv\");\n foo.appendChild(img);\n}", "function displayImage(){\n // Loop through the 3 random images\n for (let i = 0; i < imgElement.length; i++){\n // Creating imgTemp variable element to store the image element\n let imgTemp = imgElement[i]\n // Storing the random image source generated our randomNum function in a variable for further processing\n let randomImg = allImages[randomNum()]\n // Changed the if/else statement with switch\n switch (true){\n case (i === 0):\n firstImage = randomImg\n break\n case (i === 1):\n secondImage = randomImg\n break\n default:\n thirdImage = randomImg\n break\n }\n // Setting the image source attribute randomly using the randomImg variable defined above.\n imgTemp.src = randomImg.path\n // Setting image id attribute to track the number of clicks and display per image\n imgTemp.setAttribute('id,' randomImg.id)\n // Track how many times a particular has been shown\n randomImg.shown++\n // Adding click even listener to the image element on the page\n imgTemp.addEventListener('click', clickHandler)\n }\n}", "function addNr() {\n newImgDiv.forEach((e) => {\n const mixFotos = Math.floor(Math.random() * nrFotos.length);\n e.style.backgroundImage = `url(foto/${nrFotos[mixFotos]}.png)`;\n nrFotos.splice(mixFotos, 1);\n });\n}", "function initGallery() {\n let divGallery = document.getElementById(\"gallery\");\n for (let i = 1; i <= 7; i++) {\n divGallery.innerHTML += `<img onclick=\"selectAvatar(event)\" \n class=\"avatar\" \n data-path=\"img/avatar${i}.png\"\n src=\"img/avatar${i}.png\">`;\n }\n}", "function showRandomPicture() {\n return Math.floor(Math.random() * allPictureNames.length);\n}", "function randomImage(){\n var images = [\n '/public/images/home-hero-images/1.jpg',\n '/public/images/home-hero-images/2.jpg',\n '/public/images/home-hero-images/3.jpg',\n '/public/images/home-hero-images/4.jpg',\n '/public/images/home-hero-images/5.jpg',\n '/public/images/home-hero-images/6.jpg'];\n var size = images.length;\n var x = Math.floor(size * Math.random());\n console.log(x);\n var element = document.getElementsByClassName('hero-lcc-wrapper');\n console.log(element);\n if(element.length > 0)\n {\n element[0].style[\"background-image\"] = \"url(\"+ images[x] + \")\";\n }\n}", "function generateImages() {\n Array.from(document.querySelectorAll(\".main__image\"))\n .map((image,index)=> {\n document.querySelector(`.main__player${index+1}`).textContent = `Player ${index+1}`;\n image.setAttribute(\"src\",`./images/dice${Math.floor((Math.random() * 6) + 1)}.png`)\n });\n}", "function randomPicture() {\n var a = showRandomPicture();\n return allPicturesArray[a];\n}", "function randomMashroom() {\r\n var arr = [];\r\n let _combinationArr = combinationArr.shift(); // removing 00 element from array as mario will be place on it on load \r\n // creating array of random numbers from all combinations \r\n // array length will be the given number to form grid\r\n while (arr.length < gridWidth) {\r\n var r = combinationArr[Math.floor(Math.random() * combinationArr.length)];\r\n if (arr.indexOf(r) === -1) arr.push(r);\r\n }\r\n randomArr = arr;\r\n //if there is any number with single digit\r\n //adding 0 so iamge can be placed on grid \r\n for (let i of arr) {\r\n if (i.toString().length == 1) {\r\n i = \"0\" + i\r\n }\r\n //placing mashroom on random numbers\r\n var mashroomImg = document.createElement(\"img\");\r\n mashroomImg.src = \"https://i.postimg.cc/SKktCGCQ/mashroom.jpg\";\r\n mashroomImg.id = \"mashroom\" + i;\r\n mashroomImg.style.width = \"20px\";\r\n mashroomImg.style.height = \"20px\";\r\n let mushroomIm = document.getElementsByClassName(\"grid-item grid-item-\" + i);\r\n mushroomIm[0].appendChild(mashroomImg)\r\n }\r\n}", "function simulate_advertise_images() {\n display_advertise_images();\n}", "function startImage() {\n var first = selectedPictures[0];\n let picturePath = './images/' + first + '.png';\n document.getElementById('selectedImage').src = picturePath;\n document.getElementById('helperImage').src = picturePath;\n document.getElementById('modalImage').src = picturePath;\n}", "function showRandomPic(data) {\n galleryItem.css(\"background-image\", 'url(\"' + data.url + '\")');\n title.text(data.title).hide();\n date.text(data.date).hide();\n }", "function CardPicker() {\n var para = document.getElementById('CJ');\n var img = document.createElement('img');\n var path = randomOne(player_score, player_cards, \"texte2\");\n img.src = path;\n para.appendChild(img);\n if (player_score[0] > 21) {\n display_res(\"Vous avez perdu\");\n }\n}", "function ComputerChoice(){\n var randomNumber =Math.floor((Math.random() * 3) + 1);\n console.log(randomNumber);\n switch(randomNumber){\n case 1:\n document.getElementById('fx-box').remove();\n var image = document.createElement('img');\n var source = \"assets/images/rock.jpg\";\n image.setAttribute('id','image4');\n image.setAttribute('src',source);\n document.getElementById('computerChoice').appendChild(image);\n pcChoice = 'rock';\n break;\n case 2:\n document.getElementById('fx-box').remove();\n var image = document.createElement('img');\n var source = \"assets/images/paper.jpg\";\n image.setAttribute('id','image4');\n image.setAttribute('src',source);\n document.getElementById('computerChoice').appendChild(image);\n pcChoice = 'paper';\n break;\n case 3:\n document.getElementById('fx-box').remove();\n var image = document.createElement('img');\n var source = \"assets/images/scissors.jpg\";\n image.setAttribute('id','image4');\n image.setAttribute('src',source);\n document.getElementById('computerChoice').appendChild(image);\n pcChoice = 'scissors';\n break;\n }\n\n}", "function switchImage() {\n whichImage = Math.floor(Math.random() * 40) + 1;\n imageObj.src = whereImage + (whichImage+1) + \".jpg\";\n clear();\n drawScene();\n}", "function generateImages() {\n var currentPictures = [];\n for(var i = 0; i < picArrayContainer.length; i++) {\n var newIndex = randomIndex(picArray.length);\n while(currentPictures.includes(newIndex) || previousPictures.includes(newIndex)) {\n newIndex = randomIndex(picArray.length);\n }\n currentPictures.push(newIndex);\n\n picArrayContainer[i].src = picArray[newIndex].src;\n picArrayContainer[i].title = picArray[newIndex].title;\n picArrayContainer[i].alt = picArray[newIndex].alt;\n\n picArray[newIndex].viewed++;\n }\n previousPictures = currentPictures;\n}", "function randomBackground() {\n var selectBackground = document.getElementById('background-select');\n var backgroundOptions = selectBackground.getElementsByTagName('option');\n var randomSelection = Math.floor(Math.random() * (backgroundOptions.length - 1)) + 1;\n backgroundImage = backgroundOptions[randomSelection].value;\n backgroundImageChanged = true;\n }", "function initGallery(){\n console.trace('initGallery');\n let divGallery = document.getElementById('gallery');\n for ( let i = 1; i <= 7 ; i++){\n divGallery.innerHTML += `<img onclick=\"selectAvatar(event)\" \n class=\"avatar\" \n data-path=\"avatar${i}.png\"\n src=\"img/avatar${i}.png\">`;\n }\n}", "function selectedRestaurant(restaurant){\n // Reference DOM elements\n let restoDiv = document.getElementById('result-image')\n let restoName = document.getElementById('restaurant-name')\n\n let restoImg = document.createElement('img')\n let restoId = document.createElement('span')\n // Setting the values of the DOM elements\n //Setting restaurant name\n restoName.innerText = `This is the ONE you're looking for: ${restaurant.name}`\n // restaurant image\n restoImg.src = restaurant.restPath\n // restaurant ID\n restoId.innerText = restaurant.id\n\n // append the restaurant image\n restoDiv.appendChild(restoImg)\n // code to be replaced\n restoDiv.appendChild(restoId)\n }", "function displayDocsImages() {\n for (let i = 0; i < docsList.length; i++) {\n let itemImage = createCircleImages(i);\n let docs = document.getElementById(\"images\").insertAdjacentHTML(\"beforeend\", itemImage);\n }\n}", "function random_image_generator(randomimagearray) {\n\n let randomnumber = Math.floor(Math.random() * ((randomimagearray.length) * 2) / 2);\n let randomvalue = Math.floor((Math.random() * 9) + 1)\n\n var randimg = randomimagearray[randomnumber];\n\n var imgelement = document.createElement(\"img\");\n imgelement.setAttribute(\"src\", randimg);\n imgelement.setAttribute(\"height\", '100px');\n imgelement.setAttribute(\"width\", '100px');\n imgelement.setAttribute(\"value\", randomvalue);\n imgelement.setAttribute(\"id\", randimg);\n imgelement.setAttribute(\"style\", 'border-radius : 20%;border:1px solid green;margin-left:20px;box-shadow: 4px 3px 5px rgb(205, 5, 255);margins-top: 15px');\n\n allvalues.push(imgelement)\n\n document.getElementById('image').append(imgelement);\n\n }", "function fortuneImages() {\n\tvar num = randNum(imgs.length);\n\tvar img = imgs[num];\n\timgs.splice(num, 1);\n\treturn \"url('imgs/\" + img + \".png')\";\n}", "function createRandomImages() {\r\n var product1 = allProducts[randomImage()];\r\n var product2 = allProducts[randomImage()];\r\n while (product1 === product2) {\r\n product2 = allProducts[randomImage()];\r\n }\r\n var product3 = allProducts[randomImage()];\r\n while (product2 === product3 || product3 === product1) {\r\n product3 = allProducts[randomImage()];\r\n }\r\n randomProducts = [];\r\n randomProducts.push(product1);\r\n randomProducts.push(product2);\r\n randomProducts.push(product3);\r\n product1.views++;\r\n product2.views++;\r\n product3.views++;\r\n}", "function nuevaPartida(){\n var tamanoArreglo = nombres.length;\n \n if(tamanoArreglo >0){\n azar = random(0, tamanoArreglo);\n var imagen = 'fotos/' + personas[azar]\n $('#foto').attr('src', imagen);\n }else{\n alert('Ganaste!') \n }\n}", "function randomGalleryChange() {\n var galleryImages = [firstImage, secondImage, thirdImage, fourthImage, fifthImage, sixthImage, seventhImage];\n\n galleryImages.sort(sortFunc);\n\n gallery.appendChild(galleryImages[0]);\n gallery.appendChild(galleryImages[1]);\n gallery.appendChild(galleryImages[2]);\n gallery.appendChild(galleryImages[3]);\n gallery.appendChild(galleryImages[4]);\n gallery.appendChild(galleryImages[5]);\n gallery.appendChild(galleryImages[6]);\n\n gallery.style.transitionTimingFunction = \"ease\";\n}", "function renderRandomImages(x) {\n fabric.Image.fromURL(sources[getRandomInt(1, 12)], function(img) {\n var img1 = img.set({\n left: 100,\n top: x\n });\n group.push(img1);\n\n fabric.Image.fromURL(sources[getRandomInt(1, 12)], function(img) {\n var img2 = img.set({\n left: 240,\n top: x\n });\n group.push(img2);\n fabric.Image.fromURL(sources[getRandomInt(1, 12)], function(img) {\n var img3 = img.set({\n left: 380,\n top: x\n });\n group.push(img3);\n });\n });\n });\n}" ]
[ "0.6935787", "0.6859484", "0.67021376", "0.664194", "0.6633752", "0.66218", "0.6585556", "0.6583496", "0.65834415", "0.6540964", "0.6519542", "0.6516514", "0.65159434", "0.6489359", "0.6477023", "0.64638716", "0.6452845", "0.6432863", "0.6427705", "0.64170784", "0.6414186", "0.6407974", "0.63546354", "0.63441414", "0.63270396", "0.63214904", "0.6306983", "0.62761873", "0.6267147", "0.62583846", "0.6242768", "0.6241216", "0.62326145", "0.62318385", "0.6212476", "0.62122035", "0.6184726", "0.61805135", "0.61700517", "0.61682", "0.61388624", "0.6131938", "0.61317694", "0.61283624", "0.61155164", "0.6111191", "0.6110024", "0.6109739", "0.61025727", "0.60896635", "0.6085182", "0.607766", "0.6073726", "0.60717964", "0.6070869", "0.6063804", "0.6063429", "0.6061844", "0.60616404", "0.6057929", "0.6057142", "0.605414", "0.60487133", "0.6037916", "0.6037425", "0.6028528", "0.60283554", "0.60219795", "0.6014167", "0.60122055", "0.60115147", "0.6011338", "0.60099685", "0.60070086", "0.5998872", "0.5991912", "0.59905785", "0.5977933", "0.5971002", "0.59703755", "0.5963553", "0.59622073", "0.5960174", "0.5949205", "0.5948327", "0.5947987", "0.59458685", "0.5936121", "0.59343445", "0.5924623", "0.59213346", "0.5921077", "0.5919512", "0.59188855", "0.58983606", "0.58969396", "0.58885324", "0.5888051", "0.58858806", "0.5884456", "0.58822775" ]
0.0
-1
La function si occupa di rispondere al client.
function rispondi(result,cb){ if(result!="err"){ cb(result); } else{ cb("0"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getClientCalls() {\n\n }", "function ElstrServerRpcCallsAdmin (){}", "function executeClient() {\n\t\trequest('BrixApi.newPlayer', [], function(response) {\n\t\t\tplayer = new Player(response.value, 400, 400, randomColor());\n\t\t\tmap.addPlayer(player, function() {\n\t\t\t\tplayer.takeControl(map);\n\t\t\t});\n\t\n\t\t\t/*\n\t\t\tstreamRequest('BrixApi.getHitPoints', [], function(response) {\n\t\t\t\tplayer_hitpoints.set(response, 100);\n\t\t\t}, 150);\n\t\t\t*/\n\t\t\tsubscriptionRequest('BrixApi.getPlayers', [], function(response) {\n\t\t\t\tfor(var i in response.value) {\n\t\t\t\t\tvar found = false;\n\t\t\t\t\tfor(var j in playerManager.list) {\n\t\t\t\t\t\tif(response.value[i].state == 4) {\n\t\t\t\t\t\t\t// Player has disconnected\n\t\t\t\t\t\t\tplayerManager.get(playerManager.list[j].id).dom.fadeOut('slow', function() {\n\t\t\t\t\t\t\t\tplayerManager.get(playerManager.list[j].id).dom.remove();\n\t\t\t\t\t\t\t\tplayerManager.remove(playerManager.list[j].id);\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t} else \tif(response.value[i].id == playerManager.list[j].id) {\n\t\t\t\t\t\t\t// Player has data to change\n\t\t\t\t\t\t\tfound = true;\n\t\t\t\t\t\t\tif(response.value[i].id != player.id && playerManager.list[j].state > PLAYER_STATES.ETHEREAL) {\n\t\t\t\t\t\t\t\t// Player is not you\n\t\t\t\t\t\t\t\tplayerManager.list[j].dom.animate({\n\t\t\t\t\t\t\t\t\tleft: response.value[i].x,\n\t\t\t\t\t\t\t\t\ttop: response.value[i].y\n\t\t\t\t\t\t\t\t}, 150);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!found) {\n\t\t\t\t\t\tif(response.value[i].x == 0) {\n\t\t\t\t\t\t\tvar x = 400;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar x = response.value[i].x;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(response.value[i].y == 0) {\n\t\t\t\t\t\t\tvar y = 400;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tvar y = response.value[i].y;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar newPlayer = new Player(response.value[i].id, x, y, randomColor()); \n\t\t\t\t\t\tplayerManager.add(newPlayer);\n\t\t\t\t\t\tmap.addPlayer(newPlayer, function() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, 150);\n\t\t});\n\t}", "send() {}", "send() {}", "send() {}", "send() {}", "send() {}", "send() {}", "function escribiendo(){\n socket.emit(\"escribiendo\",{ escribiendo: true, id: usuarioChat.usuario.id });\n \n}", "function seleccionarAcuerdoBonificaciones(idAcuerdo)\n{\nvar idCliente = document.getElementById(\"idCliente\").value;\n\nvar requerimiento = new RequerimientoGet();\nrequerimiento.setURL(\"acuerdobonificaciones/seleccionaracuerdo/ajax/seleccionarAcuerdoBonificaciones.php\");\nrequerimiento.addParametro(\"idCliente\",idCliente);\nrequerimiento.addParametro(\"idAcuerdo\",idAcuerdo);\nrequerimiento.addListener(respuestaSeleccionarAcuerdoBonificaciones);\nrequerimiento.ejecutar();\n}", "ServerCallback() {\n\n }", "_sendData() {\n\n }", "function validerResa() {\n if (connect == 1) {\n\n }\n}", "function arrancaServidor (requiere,respuesta){\r\n\r\nrespuesta.writeHead('200',{'Content-Type':'text/html'}); // enviar una head al navegador web\r\n\t\t\t\t\t\t\t // 200 codigo de todo correcto 404 no encontrada\t\r\n\t\t\t\t\t\t\t \t// todo lo que va dentro de llaves es un objeto\r\n\t\t\t\t\t\t\t \t// te voy a enviar una pagina escrita en html... no una imagen o otra cosa\r\n\r\nrespuesta.write(\"<h1> el servidor functiona correctamente </h1>\");\r\nrespuesta.end();\r\n\r\n}", "function reDirect() {\n\t\t\tvar objKick = {\n\t\t\t\tuserName: U5312UX5,\n\t\t\t\tfilter: \"CekKick\",\n\t\t\t\tIp: ClientIP\n\t\t\t}\n\t\t\tvar pKickUser = Global.dynamicParam(\"KickUser\", objKick)\n\t\t\t$.ajax({\n\t\t\t\turl: wsUrl,\n\t\t\t\ttype: \"POST\",\n\t\t\t\tdataType: 'json',\n\t\t\t\tdata: pKickUser,\n\t\t\t\tsuccess: function (result) {\n\t\t\t\t\tvar resultData = Global.dynamicDeserialize(result)\n\n\t\t\t\t\t//\t\t\t\t\t\tconsole.log(\"StatusKick1>> : \"+resultData); \n\t\t\t\t\t//\t\t\t\t\t\tconsole.log(ClientIP)\n\t\t\t\t\tif (resultData[0].Result == \"1\") {\n\t\t\t\t\t\tclearInterval(reDire);\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tU5312UX5 = \"\";\n\t\t\t\t\t\tX_VarianUX5 = \"\";\n\t\t\t\t\t\twindow.localStorage.clear();\n\t\t\t\t\t\twindow.sessionStorage.clear();\n\t\t\t\t\t\tsap.m.URLHelper.redirect(\"index.html\");\n\t\t\t\t\t\tGlobal.GetClientIP();\n\t\t\t\t\t\twindow.open('', '_self').close()\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "createClient() {\n let thisObj = this;\n\n // Set up SlideClient and write disconnect handler.\n this.StreamClient = new SlideClient(this.state.server,\n () => { thisObj.processLogout() });\n\n // Action cannot be undone without refresh.\n this.setState({ clientSet: true });\n }", "function arrancaServidor(requiere, respuesta) {\n console.log(\"Alguien se ah conectado\");\n respuesta.writeHead(200,{\"Content-Type\":\"text/html\"}); // le digo que le enviare informacion de tipo html al servidor\n respuesta.write(\"<h1>El servidor funciona correctamente en el puerto 8888</h1>\");\n respuesta.end();\n}", "function rc(){}", "function Handler(res, client, clientCookie, Command) {\n\n // Send request to WinCC Unified RunTime \n // \n client.write(Command);\n\n console.log('Already send the ReadTag command. ' + (new Date()));\n console.log(\"CilentCookie: \" + clientCookie);\n\n const rl = readline.createInterface({\n input: client,\n crlfDelay: Infinity\n });\n\n // Listen for event \"line\"\n // \n rl.on('line', (line) => {\n\n // Convert the WinCC Unified Runtime response to JSON Format\n // Send to the Cilent\n // \n let obj = JSON.parse(line); \n res.send(obj);\n \n var endDateTime = GetCurrentTime();\n console.log(\"The result is sent to the client \" + endDateTime + \"\\r\\n\" + 'Listening on port 4000...' + \"\\r\\n\");\n\n res.end();\n });\n}", "function iniciar() {\n \n }", "function sendToServer_wantnext() {\r\n socket.emit('clientend', {\r\n 'room': ROOM_ID\r\n });\r\n}", "function prueba(res, req) {\n res.send(\"corriendo\");\n }", "interrogate() {\n var url = '/clients/' + this.clientId + '/actions/interrogate';\n\n this.grrApiService_.post(url).then(\n function success(response) {\n this.interrogateOperationId = response['data']['operation_id'];\n this.monitorInterrogateOperation_();\n }.bind(this),\n function failure(response) {\n this.stopMonitorInterrogateOperation_();\n }.bind(this));\n }", "function uwsgi_rpc(addr) {\n\tthis.serveraddr = addr;\n\tthis.client = new net.Socket();\n\tif (false == (this instanceof uwsgi_rpc)) {\n\t\treturn new uwsgi_rpc;\n\t\t}\n\t\t\n\tthis.client.on('data',function(data) {\n\t // console.log('DATA ' + client.remoteAddress + ': ' + data)\n\t\tif (data.length >= 0) {\n\t\t\tvar pktsize = data.readUInt16LE(0);\n\t\t\t// here we parse the uwsgi rpc response\n\t\t\tfor(var i=0;i<pktsize;i++) {\n\t\t\t\titem_len = data.readUInt16LE(4 + i);\n\t\t\t\tvar base = 4 + i + 2;\n\t\t\t\tvar item = data.toString('utf8', base, base + item_len);\n\t\t\t\targs.push(item);\n\t\t\t\ti += 1 + item_len;\n\t\t\t\t}\n\t\t\t// check if the functions is defined\n\t\t\tif (args.length == 0) return -1;\n\t\t\t}\n\t\tconsole.log(\"return args ---> %j\", args); \n\t\treturn(data);\n\t\t});\n\n\tthis.client.on('end',function() {\n\t\tconsole.log('end');\n\t\t// console.log(\"end args ---> %j\",args);\n\t\t// return(args.join(\"\").toString(\"utf8\"));\n\t\t});\n\n\tthis.client.on('connection',function() {\n\t\tconsole.log(\"connection\");\n\t\t});\n\n\tthis.client.on('close',function() {\n\t\tconsole.log(\"close\");\n\t\t});\n\n\t}", "function nlobjServerResponse() {\n}", "function connexionPanierControl(){\n\tconsole.log('tata');\n\tcliendGood();\n\tmdpControl();\n\temailControl();\n}", "function darDeBajaPromocion(id)\n{\nvar requerimiento = new RequerimientoGet();\nrequerimiento.setURL(\"verpromociones/ajax/darDeBajaPromocion.php\");\nrequerimiento.addParametro(\"id\",id);\nrequerimiento.addListener(respuestaDarDeBajaPromocion);\nrequerimiento.ejecutar();\n}", "function call(req, res) {\n // estatutos...\n}", "function obdelajPridruzitevKanalu(socket) {\n socket.on('pridruzitevZahteva', function(kanal) {\n socket.leave(trenutniKanal[socket.id]);\n pridruzitevKanalu(socket, kanal.novKanal);\n });\n}", "async function monitoreoTiempoReal(req = request, res = response) {\n//https://www.digitalocean.com/community/tutorials/how-to-launch-child-processes-in-node-js-es\n//Pagina para validar el comando fork para comunicacion bilateral\n //obtener los parametros de entrada \n // const {fechaInicio,fechaFin, numClientes, tiempoSeg, tamanioPaquete, URL } = req.body;\n const body = req.body;\n parametroModel = guardarParametros(body);\n // console.log(\"el id del los parametros ingrasados es\"+ parametroModel._id);\n latenciaModel = crearLatencia(parametroModel._id);\n\n //Ejecutar comando\n ejecutarMonitoreo(body,parametroModel._id );\n\n\n //ping(tamanioPaquete, URL);\n //https://www.npmjs.com/package/net-ping\n\n // res.json({\n // msg: \"get API\",\n // parametro\n // });\n // Documentacion\n // https://elabismodenull.wordpress.com/2017/03/28/el-manejo-de-streams-en-nodejs/\n // ########## SOCKET IO##########\n\n}", "function cargaPartida(){\n stompClient.send(\"/app/cargarPartida\", {}, JSON.stringify({idPartida:partidaId,jugador:nick}));\n}", "function responderSolicitudASolicitante(req,res){\n let id_solicitante = req.params.id;\n let solicitud= buscarSolicitud(id_solicitante); //verificamos si la aceptaron\n if(solicitudes[solicitud].estatus=='aceptada' && solicitudes[solicitud].operador != ''){\n console.log(`PRUEBA: si la aceptaron`);\n let id_operador=solicitudes[solicitud].operador;\n let lat = solicitudes[solicitud].latOperador;\n let lng = solicitudes[solicitud].lngOperador;\n let id_servicio = solicitudes[solicitud].id_servicio;\n let data = {};\n \n let sql = `Select * FROM usuarios WHERE id_usuario = ${ id_operador }`; \n consultaBd.consultaBd(sql,(result)=>{\n if(result){\n console.log(`PRUEBA: si la aceptaron 2`);\n data.nombreOperador = result[0].nombre + \" \" + result[0].ap + \" \" + result[0].am ;\n data.telefonoOperador = result[0].telefono;\n \n }\n })\n sql = `SELECT * FROM servicio WHERE id_servicio = ${id_servicio}`;\n consultaBd.consultaBd(sql,(result)=>{\n if(result){\n console.log(`PRUEBA: si la aceptaron 3`);\n data.servicio=result[0].descripcion;\n data.costoMax = result[0].costo_max;\n data.costoMin= result[0].costo_min;\n data.lat = lat;\n data.lng = lng;\n res.status(200).send({message:[{'flag':'true','cuerpo':[data]}]});\n }\n }) \n \n }else if(solicitudes[solicitud].estatus=='pendiente'){\n buscarOperadorPorFiltros(solicitudes[solicitud].id_solicitante); //si aun no la aceptan se busca al operador de nuevo\n res.status(200).send({message:[{'flag':'false','cuerpo':[{'nombre':'estatus pendiente'}]}]});\n //console.log(solicitudes[solicitud]);\n }else if(solicitudes[solicitud].estatus=='enEspera'){\n res.status(200).send({message:[{'flag':'false','cuerpo':[{'nombre':'Esperando respuesta de operador'}]}]});\n }else{\n res.status(200).send({message:[{'flag':'false','cuerpo':[{'nombre':'buscando operador'}]}]});\n }\n}", "requestRemoteData(handler) {\n }", "function operadorRechazoSolicitud(req,res){\n console.log('rechazo solicitud');\n let id_operador= req.params.id, id_solicitante = req.params.id_solicitante;\n let solicitud = buscarSolicitud(id_solicitante);\n solicitudes[solicitud].estatus='pendiente';\n arregloSolicitudRechazada.push({idSolicitante:id_solicitante,idOperador:id_operador});\n console.log(`El operador ${ arregloSolicitudRechazada[0].idSolicitante } rechazo la solicitud de ${ id_solicitante }`);\n res.status(200).send({message:['Mamon']});\n}", "function spostaButtonProduzione(i){\r\n \"use strict\";\r\n\tvar data = new Object();\r\n\tdata.destinationID = LOCATIONID + $(\"#dest_\"+i).find(\"option:selected\").text();\r\n\tdata.pawnID = arrCamion[i].pawnID;\r\n\tsocket.emit('moveTransportPawn', JSON.stringify(data), function(response) {\r\n\t\tvar sposta = JSON.parse(response);\r\n\t\tif(sposta.success){\r\n\t\t\tarrCamion[i].spostamenti--; //non credo vada più, ma è da vedere \r\n\t\t\t$(\"#nSpostamenti_\"+i).text(arrCamion[i].spostamenti); //aggiorna il numero degli spostamenti a video\r\n\t\t\tif(arrCamion[i].spostamenti === 0){\r\n\t\t\t\t$(\"#spostaButtonP_\"+i).prop(\"disabled\", true);\r\n\t\t\t}\r\n\t\t\tarrCamion[i].origine = sposta.newLocation;\r\n\t\t\t//parte visuale\r\n\t\t\t$(\"#orig_\"+i).text(arrCamion[i].origine);\r\n\t\t\t//chiamo l'aggiorna destinazioni\r\n\t\t\taggiornaListaDestinazioni(arrCamion, i);\r\n\t\t\tsetModalLog(sposta.logString);\r\n\t\t\tsalvaLog(sposta.logString);\r\n\t\t}else{\r\n\t\t\tsetModalLog(sposta.logString);\r\n\t\t\t//$(\"#spostaButtonP_\"+i).prop(\"disabled\", true);\r\n\t\t}\r\n\t\t\r\n\t});\r\n\r\n}", "function SendMessage()\r\n{\t\r\n //Note: You can send to a specific client by passing\r\n //the IP address as the second parameter.\r\n\tserv.SendText( count-- );\r\n\tif( count < 0 ) count = 10;\r\n}", "function clientCommunication(param) {\n vm.clientClick = param;\n vm.followingClick = 1;\n vm.allPostClick = 1;\n vm.eventClick = param;\n }", "function OnBtnServerSynch_Click( e )\r\n{\r\n OnBtnServerSynch() ;\r\n}", "function escreveConteudo(){}", "function gotMessageFromServer(message) {\n console.log(\"Got message\", message.data); \n var data = JSON.parse(message.data); \n \n switch(data.type) { \n case \"login\": \n handleLogin(data.success,data.allUsers); \n break;\n case \"joined\":\n catchAllAvailableUsers(data.allUsers);\n break;\n case \"statusChange\":\n refreshAllAvailableUsers(data.user_status);\n break;\n case \"snap\":\n console.log('got imgUrl')\n gotRemoteSnapImg(data.snapUrl);\n break;\n //when somebody wants to call us \n case \"offer\": \n console.log('inside offer')\n document.getElementById('callFrom').innerHTML = '來自 ' + name;\n handleOffer(data.offer, data.name);\n alert(\"Receive a call from \" + data.name);\n break; \n case \"answer\": \n console.log('inside answer')\n handleAnswer(data.answer); \n break; \n //when a remote peer sends an ice candidate to us \n case \"candidate\": \n console.log('inside handle candidate')\n handleCandidate(data.candidate); \n break;\n case \"decline\":\n window.clearTimeout(callTimeout);\n handleLeave();\n alert(\"No response from remote\");\n break;\n case \"timeout\":\n handleLeave();\n alert(\"You didn't resopnse a call from \" + data.name);\n break;\n case \"leave\": \n handleLeave();\n alert(\"Remote has disconnected !\");\n break;\n case \"close\":\n if(data.reqFrom == connectedUser) {\n handleLeave();\n alert(\"Remote has disconnected !\");\n }\n refreshAllAvailableUsers(data.user_status);\n break;\n\n default: \n break; \n } \n\n serverConnection.onerror = function (err) { \n console.log(\"Got error\", err); \n };\n\n}", "function funboton(valor) {\n\tvar data = {\n\t\tplayer: playerNumber,\n\t\tcolor: valor,\n\t}\n render(data);\n//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>//\n socket.emit(\"res-message\", data); // emite al servidor el nuevo valor\n}", "function clientCode(facade) {\n // ...\n console.log(facade.operation());\n // ...\n}", "restart(){\n this.channel.push(\"restart\")\n .receive(\"ok\", this.got_view.bind(this));\n }", "function main() {\n autoRelog = function(password){\n ServerSocket.on(\"connect\", function (){\n console.log(\"getting back in\");\n setTimeout(function(){\n ElementValue(\"InputPassword\",password)\n RelogSend()\n },2000)\n\n })\n }\n\n //---------------------------------------------------------------------------------------------------------------------------------------------\n console.log(\"auto login done\")\n }", "function on_select_client(serial) {\n clear_div();\n //hide_div();\n $('#life_police_flg').val(\"\");\n $('#documents_flg').val(\"\");\n $('#communication_flg').val(\"\");\n // $('#conversation_follow_flg').val(\"\");\n $('#kupa_gemel_flg').val(\"\");\n client_details(serial);\n }", "function habServDePermiso(idsistema,idpersona,idformulario,idservicio,nomserv,estado){\n var url = '../../ccontrol/control/control.php';\n var data = 'p1=habServDePermiso&p2='+idsistema+'&p3='+idpersona+'&p4='+idformulario+'&p5='+idservicio+'&p6='+estado;\n var habi = estado==1?'DESHABILITADO':'HABILITADO';\n var ask = confirm('El Servicio: '+nomserv+' va a ser '+habi+' \\xBFDesea Continuar?');\n if(ask){\n new Ajax.Request ( url,\n {method : 'get',\n parameters : data,\n onLoading : function(transport){est_cargador(1);},\n onComplete : function(transport){est_cargador(0);\n alert('Servicio: '+nomserv+' fue '+habi);\n actPermisoFormServ(idsistema,idformulario,idpersona);\n }\n }\n )\n }\n}", "_sendRestart() {\n this._throttledRequestHandler();\n clearTimeout(this._conn._idleTimeout);\n }", "process_rcon(discord, rcon, m, a) { return false; }", "function clientResponse(start){\n\tstart.addEventListener('click',(e)=>{\n\t\tsendInfo(e);\n\t});\n}", "function editClient() {\n\t\t\trefreshClientData(function () {\n\t\t\t\tvar cf_codigo = clientsGrid.selection.getSelected()[0].cf_codigo;\n\n\t\t\t\tclientRest.get(cf_codigo).then(function (client) {\n\t\t\t\t\trefreshGroupDropDown(client.cf_grupo);\n\n\t\t\t\t\tdijit.byId(\"edit_client_cf_codigo\").set(\"value\", client.cf_codigo);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_nome\").set(\"value\", client.pe_nome);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_tipo\").set(\"value\", client.pe_tipo);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_lograd\").set(\"value\", client.ed_lograd);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_numero\").set(\"value\", client.ed_numero);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_compl\").set(\"value\", client.ed_compl);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_bairro\").set(\"value\", client.ed_bairro);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_cidade\").set(\"value\", client.ed_cidade);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_estado\").set(\"value\", client.ed_estado);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_cep\").set(\"value\", client.ed_cep);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_mv_ibge\").set(\"value\", client.ed_mv_ibge);\n\t\t\t\t\tdijit.byId(\"edit_client_cf_contato\").set(\"value\", client.cf_contato);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_tel_loc\").set(\"value\", client.ed_tel_loc);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_tel_rec\").set(\"value\", client.ed_tel_rec);\n\t\t\t\t\tdijit.byId(\"edit_client_ed_tel_fin\").set(\"value\", client.ed_tel_fin);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_tel_cel\").set(\"value\", client.pe_tel_cel);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_radio\").set(\"value\", client.pe_radio);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_email\").set(\"value\", client.pe_email);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_cpf\").set(\"value\", client.pe_cpf);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_rg_num\").set(\"value\", client.pe_rg_num);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_rg_emi\").set(\"value\", client.pe_rg_emi);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_rg_dte\").set(\"value\", client.pe_rg_dte);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_psp_num\").set(\"value\", client.pe_psp_num);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_cnpj\").set(\"value\", client.pe_cnpj);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_ie\").set(\"value\", client.pe_ie);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_im\").set(\"value\", client.pe_im);\n\t\t\t\t\tdijit.byId(\"edit_client_pe_suframa\").set(\"value\", client.pe_suframa);\n\t\t\t\t\tdijit.byId(\"edit_client_cf_mreceb\").set(\"value\", client.cf_mreceb);\n\t\t\t\t\tdijit.byId(\"edit_client_cf_receb\").set(\"value\", client.cf_receb);\n\t\t\t\t\tdijit.byId(\"edit_client_cf_transp\").set(\"value\", client.cf_transp);\n\t\t\t\t\tdijit.byId(\"edit_client_ee_lograd\").set(\"value\", client.ee_lograd);\n\t\t\t\t\tdijit.byId(\"edit_client_ee_numero\").set(\"value\", client.ee_numero);\n\t\t\t\t\tdijit.byId(\"edit_client_ee_compl\").set(\"value\", client.ee_compl);\n\t\t\t\t\tdijit.byId(\"edit_client_ee_bairro\").set(\"value\", client.ee_bairro);\n\t\t\t\t\tdijit.byId(\"edit_client_ee_cidade\").set(\"value\", client.ee_cidade);\n\t\t\t\t\tdijit.byId(\"edit_client_ee_estado\").set(\"value\", client.ee_estado);\n\t\t\t\t\tdijit.byId(\"edit_client_ee_cep\").set(\"value\", client.ee_cep);\n\t\t\t\t\tdijit.byId(\"edit_client_ee_mv_ibge\").set(\"value\", client.ee_mv_ibge);\n\t\t\t\t\tdijit.byId(\"edit_client_ee_tel_loc\").set(\"value\", client.ee_tel_loc);\n\t\t\t\t\tdijit.byId(\"edit_client_ec_lograd\").set(\"value\", client.ec_lograd);\n\t\t\t\t\tdijit.byId(\"edit_client_ec_numero\").set(\"value\", client.ec_numero);\n\t\t\t\t\tdijit.byId(\"edit_client_ec_compl\").set(\"value\", client.ec_compl);\n\t\t\t\t\tdijit.byId(\"edit_client_ec_bairro\").set(\"value\", client.ec_bairro);\n\t\t\t\t\tdijit.byId(\"edit_client_ec_cidade\").set(\"value\", client.ec_cidade);\n\t\t\t\t\tdijit.byId(\"edit_client_ec_estado\").set(\"value\", client.ec_estado);\n\t\t\t\t\tdijit.byId(\"edit_client_ec_cep\").set(\"value\", client.ec_cep);\n\t\t\t\t\tdijit.byId(\"edit_client_ec_mv_ibge\").set(\"value\", client.ec_mv_ibge);\n\t\t\t\t\tdijit.byId(\"edit_client_ec_tel_loc\").set(\"value\", client.ec_tel_loc);\n\t\t\t\t\tdijit.byId(\"edit_client_cf_obs\").set(\"value\", client.cf_obs);\n\t\t\t\t\tdijit.byId(\"edit_client_cf_obscv\").set(\"value\", client.cf_obscv);\n\n\t\t\t\t\tdijit.byId(\"editClientDialog\").set(\"title\", \"Editar cliente\");\n\t\t\t\t\tdijit.byId(\"editClientDialog\").show();\n\t\t\t\t});\n\t\t\t});\n\t\t}", "function retiraSenha(servico,letra){\n showQuiosqueLoad();\n var strURL = '/printSenha/'+servico+'/'+letra;\n $.ajax({type: 'POST', url: strURL, data: $('#erpForm').serialize()\n }).done(function(r) {\n if(r == \"None\"){\n hideQuiosqueLoad();\n showMSG('warning', \"Serviço Indisponivel no momento\",\"#ModalQSmessage\",\"#ModalQSmessage_container\");\n }else{\n imprimir(r);\n location.reload();\n }\n }).fail(function(r) {});\n}", "handler_VRFY(command, callback) {\n this.send(252, 'Try to send something. No promises though');\n callback();\n }", "function handleClientLoad() \n{\n console.log(\"Libreria cargada exitosamente\");\n}", "function onloevha() {\n}", "async function displayClient() {\n\n try {\n let sql = { sql: \"CALL sp_displayClients\" }\n const sqlResult = await connection.query(sql);\n\n return res(200, \"client displayed\",sqlResult);\n\n } catch (err) {\n return res(404,err);\n }\n}", "recoverProductByProduces1(req, res) {\n // USER DATA\n let id = req.params.id;\n // CONNECTING TO THE DATABASE\n pool.connect()\n // ON SUCCESS => CONNECTED\n .then(client => {\n // UPDATE QUERY => UPDATE tbProdutoPorProdutor disponibilidade\n client.query(\"UPDATE tbProdutoPorProdutor SET disponibilidade = 'Indisponível' WHERE idProdutoPorProdutor = $1\", [id])\n // ON SUCCESS => RESPONSE OK 200\n .then(() => res.status(200).json({ title: 'Obrigado por atualizar seus produtos', message: 'Seus dados foram atualizados com sucesso.' }))\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => res.status(400).json({ message: err.message }))\n // DISCONNECTING TO THE DATABASE\n client.release();\n })\n // ON ERROR => RESPONSE BAD REQUEST 400\n .catch(err => res.status(400).json({ message: err.message }));\n }", "broadcast(sender, message) {\n let aaa = 0;\n for (let c of this.clients) {\n if (c.readyState === 1) {\n aaa++;\n c.send(message)\n //p(`aaa => ${aaa}`)\n //p(`message => ${message}`)\n }\n }\n }", "function testClient(payload, callback){\n client.request('pingRPC', payload, function(err, response) {\n if(err){\n return callback(err,err)\n }\n return callback(err,response)\n })\n}", "function myData() {\n retrun;\n}", "function inactivateStatCLIENTE(ID) {\n if (ID) {\n const sql = `UPDATE espacios SET ? WHERE ID = '${ID}'`\n const data = {\n CLIENTE: 0\n }\n connection.query(sql, data, error => {\n /*Trabajo de error*/\n if (error) {\n console.log('Hubo un error en la base de datos');\n return false;\n } else {\n return true;\n }\n });\n\n } else {\n res.json({\n value: false\n })\n }\n}", "sending () {\n }", "function vratiPodatke() {\n fetch(\"http://localhost:3000/vratiDelegata\")\n .then(response => {\n if (!response.ok)\n throw new Error(\"Greska u povezivanju! \" + response.statusText);\n else {\n return response.json();\n }\n })\n .then(data => crtajDelegata(data))\n .catch(error => console.log(\"Greska u radu sa bazom! \" + error.statusText));\n}", "function getDesktopByName(client) {\n var desktop = {\n idComputadora: 0, \n IP: client.sock.address().address,\n nombre: client.data.hostname,\n costoRenta: 0,\n enLinea: false\n }\n var url = apiURL + 'api/Desktop/getDesktopByName';\n $.ajax({\n url: url,\n type: \"POST\",\n data: JSON.stringify(desktop),\n contentType: \"application/json\",\n success: function (data, textStatus, jqXHR) {\n if (data) {\n let desktopInfo = data;\n setDesktopInfoToStorage(data);\n let d = { idComputadora: desktopInfo.idComputadora, enLinea: true };\n setDesktopStatus(d);\n // ipcRenderer.send('getSockets', desktopInfo);\n sendDesktopInfoFromSocket(desktopInfo);\n }\n },\n error: function (data, textStatus, jqXHR) { errorAjaxHandler(data, textStatus, jqXHR); }\n });\n}", "function SendControllMessageMainLogic(db, pvid, message, args, timeout_second,res) {\n SendControllMessageCheckPv(db, pvid, message, args, timeout_second,res, \n SendControllMessageWaitAcknowledge,\n SendControllMessageReturnModifyingMessage,\n SendControllMessageProcessControl,\n SendControllMessageProcessData\n )\n}", "_scheduleSendResponseMessage() {\n\n }", "function lrClient(){\n return (function(URL){\n let timer;\n\n function livereload(){\n if (!!window.EventSource) {\n var source = new EventSource(URL);\n\n function getData(e){\n return JSON.parse(e.data);\n }\n \n source.addEventListener('refresh', function(e) {\n location.reload();\n }, false)\n\n source.addEventListener('console', function(e) {\n console.log(getData(e).text);\n }, false)\n\n source.addEventListener('srverror', function(e) {\n let data = getData(e);\n showModal(data.header,data.text);\n }, false);\n \n source.addEventListener('open', function(e) {\n if(timer) location.reload();\n console.log('[Livereload] Ready')\n }, false)\n\n source.addEventListener('error', function(e) {\n\n if (e.eventPhase == EventSource.CLOSED) source.close();\n\n \n if (e.target.readyState == EventSource.CLOSED) {\n console.log(\"[Livereload] Disconnected! Retry in 5s...\");\n !timer && showModal('Disconnected!','Connection with server was lost.');\n timer = setTimeout(livereload,5000);\n }else if (e.target.readyState == EventSource.CONNECTING) {\n console.log(\"[Livereload] Connecting...\");\n }\n }, false);\n } else {\n console.error(\"[Livereload] Can't start Livereload! Your browser doesn't support SSE\")\n }\n }\n\n function showModal(header,text){\n const message = document.createElement('div');\n message.innerHTML = `\n <div class=\"lrmsg-bg\">\n <div class=\"lrmsg-modal\">\n <div class=\"lrmsg-close\" onclick=\"this.parentNode.parentNode.remove()\">×</div>\n <div class=\"lrmsg-header\">${header}</div>\n <div class=\"lrmsg-content\">${text}</div>\n </div>\n </div>\n <style>\n .lrmsg-bg{\n font-family: Verdana, Geneva, sans-serif;\n font-size: 16px;\n background: rgba(30, 30, 30, 0.6);\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1;\n }\n\n .lrmsg-modal{\n position: relative;\n max-width: 600px;\n max-height: 400px;\n margin: 40px auto; \n margin-top: 0px;\n background-color: #1e1e1e;\n border-top: 3px solid red;\n border-radius: 5px;\n opacity: 0;\n animation: slide 0.3s forwards;\n color: #cccccc;\n }\n\n .lrmsg-header{\n font-weight: bold;\n font-size: 18px;\n padding: 10px;\n }\n\n .lrmsg-close{\n float: right;\n font-weight: bold;\n color: #cccccc;\n font-size: 25px;\n margin: 3px 10px;\n cursor: pointer;\n }\n\n .lrmsg-close:hover{color:#9a9a9a}\n\n .lrmsg-content{\n padding: 10px;\n border-top: 1px solid #363636;\n }\n\n @keyframes slide {\n 100% { margin-top: 40px; opacity: 1;}\n }\n </style>\n `;\n\n document.body.append(message);\n }\n\n livereload();\n\n }).toString(); \n}", "constructor(servico, codigoRastreamento) {\n this.servico = servico;\n this.codigoRastreamento = codigoRastreamento;\n }", "function endRetrieval() {\n console.info(\"Fine recupero notizie.\");\n}", "function correccion(){\r\n\tir_a(ID_FORM, URL_CORRECCION);\r\n}", "async obliterateTicketHandler() {\n try {\n await this.ticketReader.obliterateTicketRemote(this.state.currentTicket.identifier, this.state.currentSecretIngredient);\n alert('Erfolgreich entwertet!');\n this.closeTicketViewHandler();\n } catch (error) {\n alert(error);\n }\n }", "clientOut({buffer/* , next, broadcast, fail */}) {\n return buffer;\n }", "function iniciar() {\n function arrancaServidor(requiere, respuesta) {\n console.log(\"Alguien de ha conectado al servidor\");\n respuesta.writeHead(200, { \"Content-TYpe\": \"text/html\" });\n respuesta.write(\"<h1>El servidor funciona correctamente</h1>\");\n respuesta.end();\n\n }\n /**La creacion del servidor tambien desde estar dentro de la funcion */\n servidor.createServer(arrancaServidor).listen(8080);\n}", "_onRecieveMessage() {\n this.client.on(\"data\", data => {\n console.log(data.toString());\n });\n }", "function clientLoadedv2(err, client) {\n \n \n \n console.log('client loaded');\n \n \n function stasisStartinbhandler(event, channel) {\n \n \n console.log('stasisStartinbhandler');\n //Check if inbound call from Trunk \n if (channel.dialplan.exten.length == 11) {\n \n console.log('Inbound Call');\n \n // console.log(util.format(channel.dialplan.exten));\n \n objuserinfo.inbinfo[channel.id] = [];\n \n \n \n //push into leave alone on hang up message array \n objuserinfo.inbinfo[channel.id].did = channel.dialplan.exten;\n \n objuserinfo.inbinfo[channel.id].currentagchan = '';\n objuserinfo.inbinfo[channel.id].chan_id = channel.id;\n objuserinfo.inbinfo[channel.id].channame = channel.name;\n objuserinfo.inbinfo[channel.id].att_wk = 0;\n objuserinfo.inbinfo[channel.id].contact_wk = 0;\n objuserinfo.inbinfo[channel.id].inbound_dt = moment().format();\n objuserinfo.inbinfo[channel.id].dispo_wk = 0;\n objuserinfo.inbinfo[channel.id].skill_wk = 0;\n objuserinfo.inbinfo[channel.id].skill_name = '';\n objuserinfo.inbinfo[channel.id].socketid = '';\n objuserinfo.inbinfo[channel.id].ani = channel.caller.number;\n objuserinfo.inbinfo[channel.id].bridge_id = '';\n objuserinfo.inbinfo[channel.id].online_user_wk = '';\n objuserinfo.inbinfo[channel.id].dispos = '';\n objuserinfo.inbinfo[channel.id].intro_audio = '';\n objuserinfo.inbinfo[channel.id].hold_audio = '';\n objuserinfo.inbinfo[channel.id].whisper_audio = '';\n objuserinfo.inbinfo[channel.id].callerinfo_acd = channel.caller;\n objuserinfo.inbinfo[channel.id].ready = 0;\n \n \n \n \n //console.log(objuserinfo.inbinfo[channel.id]);\n \n console.log('inbound to db');\n db.insertattrecinb(objuserinfo.inbinfo[channel.id], 'SCI').then(function (data) {\n \n console.log('inbound to db after insert');\n //after insert tag record in obj with current attempt_wk \n objuserinfo.inbinfo[channel.id].att_wk = data.att_wk;\n objuserinfo.inbinfo[channel.id].dispos = data.dispo_db_display;\n objuserinfo.inbinfo[channel.id].intro_audio = data.dnis_info[0].inb_intro_audio;\n objuserinfo.inbinfo[channel.id].hold_audio = data.dnis_info[0].inb_hold_audio;\n objuserinfo.inbinfo[channel.id].whisper_audio = data.dnis_info[0].ag_whisper;\n objuserinfo.inbinfo[channel.id].skill_wk = data.dnis_info[0].skill_wk;\n objuserinfo.inbinfo[channel.id].skill_name = data.dnis_info[0].skill_name;\n objuserinfo.inbinfo[channel.id].survey = data.srv_info_display;\n objuserinfo.inbinfo[channel.id].surveyqa = data.qst_display;\n \n \n \n console.log('data inbound');\n console.log(data);\n // console.log(objuserinfo.inbinfo[channel.id]);\n \n channel.answer(function (err) {\n \n var bridge = client.Bridge();\n \n bridge.create({ type: 'mixing' }).then(function (bridge) {\n \n \n \n objuserinfo.inbinfo[channel.id].bridge_id = bridge.id\n \n bridge.addChannel({ channel: channel.id }).then(function () { })\n .catch(function (err) { console.log('Add bridge inbound error') });\n \n \n console.log('$$$$ Play intor audio' + objuserinfo.inbinfo[channel.id].intro_audio);\n \n client.channels.play({ channelId: channel.id, media: objuserinfo.inbinfo[channel.id].intro_audio }).then(function (playback) {\n \n \n console.log('Play back starts');\n \n playback.on('PlaybackFinished', function (event, playback) {\n \n \n //get id to play music on hold \n console.log('play back music on hold to channel : ' + playback.target_uri.replace('channel:', ''));\n \n \n //play hold music \n client.channels.play({\n channelId: playback.target_uri.replace('channel:', ''),\n media: objuserinfo.inbinfo[channel.id].hold_audio,\n playbackId: playback.target_uri.replace('channel:', '')\n })\n .then(function (playback) {\n \n \n // make channel obj ready for call and stop play back \n \n objuserinfo.inbinfo[channel.id].ready = 1;\n \n })\n .catch(function (err) { console.log('channel not found to play hold'); });\n });\n \n }).catch(function (err) { console.log('Intro Hold play error') });\n \n\n\n }).catch(function (err) { console.log('Channel ans inbound error') });\n \n //send to agent here last inbound Randy \n \n });\n\n \n\n }\n \n \n \n //end here\n ).catch(function (err) { console.log('Stat start error'); console.log(err) });\n\n\n\n \n\n\n } else {\n \n console.log('Outbound Call');\n }\n \n \n }\n \n function stasisendinbhandler(event, channel) {\n \n \n //Check if inbound call from Trunk \n if (channel.dialplan.exten.length == 11) {\n \n console.log('Inbound Call end clean up');\n \n objuserinfo.inbinfo[channel.id].dispo_wk = -1;\n \n \n \n //dispo rec hang up inbound call\n db.updatedisporecinb(objuserinfo.inbinfo[channel.id]).then(function (data) {\n //get dial infomation for afte dispo\n console.log('Dispo to DB update confirmation to success');\n }).catch(function (err) {\n console.log('Update dispo error');\n });\n \n \n \n //with agent \n if (objuserinfo.inbinfo[channel.id].socketid != '') {\n \n \n io.to('/#' + objuserinfo.inbinfo[channel.id].socketid).emit('hanguponuser', objuserinfo.inbinfo[channel.id].socketid);\n \n client.bridges.removeChannel({ bridgeId: objuserinfo.inbinfo[channel.id].bridge_id , channel: objuserinfo.inbinfo[channel.id].currentagchan }).then(function () {\n \n \n client.bridges.destroy({ bridgeId: objuserinfo.inbinfo[channel.id].bridge_id }).then(function (bridge) {\n //remove from inbound array obj\n delete objuserinfo.inbinfo[channel.id]\n console.log(objuserinfo.inbinfo);\n\n }).catch(function (err) { });\n \n }).catch(function (err) { });\n \n //with out agent \n } else {\n \n client.bridges.destroy({ bridgeId: objuserinfo.inbinfo[channel.id].bridge_id }).then(function (bridge) {\n \n console.log('destroy bridge for none agent call');\n \n \n \n //remove from inbound array obj\n \n if (typeof objuserinfo.inbinfo[channel.id] !== 'undefined') {\n delete objuserinfo.inbinfo[channel.id]\n }\n //console.log(objuserinfo.inbinfo);\n\n }).catch(function (err) { });\n \n console.log('No agent on call');\n\n }\n \n }\n \n \n }\n \n //client.on('StasisStart', stasisStartinbhandler);\n \n client.on('StasisStart', inboundtesthandle);\n \n function inboundtesthandle(event, incoming_channel) {\n \n \n //inbound insert to DB\n \n inbinsert_obj(incoming_channel, function () {\n \n incoming_channel.answer().then(function (rtn_data) {\n \n var bridge = client.Bridge();\n \n incoming_channel.once('ChannelHangupRequest', function (event, channel) {\n \n console.log('Hangup Inbound Channel DB' + channel.id);\n //dispo rec hang up inbound call\n \n //with out agent \n \n if (typeof objuserinfo.inbinfo[channel.id] !== 'undefined') {\n \n if (objuserinfo.inbinfo[channel.id].socketid == '') {\n objuserinfo.inbinfo[channel.id].dispo_wk = -1;\n console.log('With Out Agent');\n \n db.updatedisporecinb(objuserinfo.inbinfo[channel.id]).then(function (data) {\n //get dial infomation for afte dispo\n console.log('Dispo to DB Inbound update confirmation to success With out Agent');\n \n \n //clean up obj inbound \n if (typeof objuserinfo.inbinfo[channel.id] !== 'undefined') {\n delete objuserinfo.inbinfo[channel.id]\n }\n \n console.log('After Obj Delete');\n \n \n \n //destroy inb hang up bridge \n bridge.destroy().then(function () { console.log('After Bridge destory Delete'); }).catch(function (err) { console.log('Brdige destroy Err'); });\n\n\n\n }).catch(function (err) {\n \n console.log('!Dispo to DB Inbound update confirmation to error!');\n console.log(err)\n \n \n \n //clean up obj inbound \n if (typeof objuserinfo.inbinfo[channel.id] !== 'undefined') {\n delete objuserinfo.inbinfo[channel.id]\n }\n \n \n console.log('After Obj Delete');\n //destroy inb hang up bridge \n bridge.destroy().then(function () { console.log('After Bridge destory Delete'); }).catch(function (err) { console.log('Brdige destroy Err'); });\n\n\n\n });\n } else {\n //with agent \n console.log('WITH! Agent');\n \n io.to('/#' + objuserinfo.inbinfo[channel.id].socketid).emit('hanguponuser', objuserinfo.inbinfo[channel.id].socketid);\n console.log('WITH! agent clean up');\n \n \n //clean up obj inbound \n if (typeof objuserinfo.inbinfo[channel.id] !== 'undefined') {\n delete objuserinfo.inbinfo[channel.id]\n }\n //destroy inb hang up bridge \n bridge.destroy().then(function () { }).catch(function (err) { console.log('Brdige destroy Err'); });\n \n };\n\n };\n \n });\n \n return bridge.create({ type: 'mixing' }).then(function (bridge) { return bridge }).catch(function (err) { console.log('create Bridge error'); });\n\n }).then(function (bridge) {\n \n objuserinfo.inbinfo[incoming_channel.id].bridge_id = bridge.id\n \n return bridge.addChannel({ channel: incoming_channel.id }).then(function () {\n \n return incoming_channel.play({ media: objuserinfo.inbinfo[incoming_channel.id].intro_audio }).then(function (playback) {\n return playback;\n }).catch(function (err) { console.log('please hold play Err'); });\n\n });\n }).then(function (playback) {\n \n \n playback.once('PlaybackFinished', function (event, playback) {\n \n \n incoming_channel.play({ media: objuserinfo.inbinfo[incoming_channel.id].hold_audio, playbackId: incoming_channel.id }).then(function (playback) {\n \n \n // make channel obj ready for call and stop play back \n objuserinfo.inbinfo[incoming_channel.id].ready = 1;\n \n console.log('Play Back : Hold on for one more day')\n }).catch(function (err) { console.log('hold on play error'); });\n \n });\n \n\n }).catch(function (err) { console.log('Main Inbound Error'); console.log(err); });\n \n \n \n });\n \n\n\n };\n //ENd Inbound test\n \n \n client.on('StasisStart', stasisStart);\n client.on('StasisEnd', stasisEnd);\n // client.on('StasisEnd', stasisendinbhandler);\n \n client.on('ChannelEnteredBridge', channelEnteredBridge);\n client.on('ChannelLeftBridge', channelLeftBridge);\n \n client.start('hello-world');\n\n}", "static receive() {}", "onAfterSend()\n {\n }", "enter(client) {\n super.enter(client);\n }", "function delete_entreprise(){\n\t// Recuperation de l'id de l'entreprise\n\tvar id_e = liste_coord_entrep.getCoupler().getLastInformation();\n\t\n\tif(id_e != -1) {\n\t\tvar xhr = new XMLHttpRequest();\n\t\txhr.open(\"DELETE\", \"/entreprises/\"+id_e, false);\n\t\txhr.send();\n\t\t\n\t\tsocket.emit(\"update\",{url: \"/entreprises\",func: getHandler(function(url){\n\t\t\tliste_entreprises.clear();\n\t\t\tvar ets = DatasBuffer.getRequest(\"/entreprises\");\n\t\t\tfor(var i=0;i<ets.length;i++)\n\t\t\t{\t\n\t\t\t\tvar cts = DatasBuffer.getRequest(\"/entreprises/\"+ets[i]._id+\"/contacts\");\n\t\t\t\t// Creation des items de la liste\n\t\t\t\tliste_entreprises.addItem('<p class=\"nom_entreprise\">'+ets[i].nom+'</p><p class=\"nb_entreprise\">'+cts.length+' '+(function(){return(cts.length>1?\"contacts\":\"contact\");})()+'</p>',ets[i]._id);\n\t\t\t}\n\t\t\tliste_entreprises.update();\n\t\t})});\n\n\t\tliste_coord_entrep.clear();\n\t\tliste_coord_entrep.update();\n\t\tliste_cts.clear();\n\t\tliste_cts.update();\n\t\tliste_infos_contacts.clear();\n\t\tliste_infos_contacts.update();\n\t\tliste_concern.clear();\n\t\tliste_concern.update();\n\t\tliste_com.clear();\n\t\tliste_com.update();\n\t\tGraphicalPopup.hidePopup(popup_sup_entreprise.getPopupIndex());\n\t}\n}", "function onBye(req, rem) {\n sipClient.send(sip.makeResponse(req, 200, 'OK'));\n}", "function carterasFunction(){\n console.log(\"SeleccionaCliente\");\n SeleccionaCliente();\n console.log(\"getipoCartera\");\n getipoCartera();\n console.log(\">>>>>>>>>\");\n}", "onMessage() {}", "onMessage() {}", "function r(e,t){if(e&&t)return\"sendrecv\";if(e&&!t)return\"sendonly\";if(!e&&t)return\"recvonly\";if(!e&&!t)return\"inactive\";throw new Error(\"If you see this error, your JavaScript engine has a major flaw\")}", "function recibir() {\r\n //bug0: MAL HACER UNA FUNCION DEL TIEMPOconsole.log(hora);\r\n //bug0: resuelto\r\n console.log(hourNow());\r\n /*\r\n ipcMain.on(\"exit-pedidos\", (e, args) => {\r\n console.log(args);\r\n ipcMain.removeListener(\"cedula\", async (e, args) => {\r\n\r\n });\r\n\r\n });\r\n */\r\n\r\n //Funcion para recibir el numero de cedula del textbox\r\n ipcMain.on(\"cedula\", async (e, args) => {\r\n console.log(args + \" numero de cedula ingresado\"); // Imprime por consolo el numero de cedula\r\n\r\n const hcl = hcgen(args); // Llamado a la funcion para generar o responder con un numero de historia clinica\r\n hcl.then((hClinica) => {\r\n console.log(hClinica + \" historia clinica\"); // Imprime la historia clinica\r\n hClinica = JSON.stringify(hClinica);\r\n e.reply(\"hClinica\", hClinica);\r\n });\r\n\r\n const ped = pedidogen(); // llamado a la funcion para generar un numero de pedido bug cuando cambie de fecha reiniciar el numero del contador\r\n ped.then((numPedido) => {\r\n console.log(numPedido + \" numero de pedido\"); // imprime el numero del pedido\r\n numPedido = JSON.stringify(numPedido);\r\n e.reply(\"numPedido\", numPedido);\r\n });\r\n\r\n provincias = provinces(); // funcion para consultar las provincias de Ecuador\r\n e.returnValue = JSON.stringify(provincias);\r\n });\r\n\r\n //consulta de cantones\r\n ipcMain.on(\"dropProvincia\", async (e, args) => {\r\n cantones = canton(args);\r\n e.returnValue = JSON.stringify(cantones);\r\n cantones = [];\r\n });\r\n\r\n //Consuta de parroquias\r\n ipcMain.on(\"dropCanton\", async (e, args) => {\r\n parroquias = parroquia(args);\r\n e.returnValue = JSON.stringify(parroquias);\r\n });\r\n\r\n //funcion para consultar los nombres de los doctors dependiendo del establecimiento\r\n ipcMain.on(\"dropMedicos\", async (e, args) => {\r\n console.log(args);\r\n medicos = [];\r\n let medicos_buscar = await Medicos.find(\r\n { institucion: args },\r\n \"nombre apellido\"\r\n ).exec();\r\n for (var key in medicos_buscar) {\r\n let nombreCompleto =\r\n medicos_buscar[key].nombre + \" \" + medicos_buscar[key].apellido;\r\n medicos.push(nombreCompleto);\r\n }\r\n e.returnValue = JSON.stringify(medicos);\r\n });\r\n\r\n //funcion para validar los datos del formulario y ademas guardar en la bd de paciente y pedidos\r\n ipcMain.on(\"datos\", async (e, args) => {\r\n let envia0 = true;\r\n let envia1 = true;\r\n let datosVacios = [args[0], args[1], args[2], args[3], args[4]];\r\n let datosNumeros = [args[0], args[4]];\r\n let genHc = args[1];\r\n let array = [];\r\n let array2 = [];\r\n array = genHc.split(\"-\");\r\n array2 = array[0].split('\"');\r\n\r\n //console.log(array2[1].replace(/['\"]+/g, \"\"));\r\n envia0 = validaciones.verificarVacio(datosVacios);\r\n envia1 = validaciones.verificarNumero(datosNumeros);\r\n\r\n // bug2: popup para preguntar si continuar en la pantalla de pedidos, entonces se debe resetear los campos\r\n // si no se desea continuar regresar al main menu\r\n if (envia0 == true && envia1 === true) {\r\n console.log(\"formulario correcto\");\r\n if (array[1] == 'actualice\"') {\r\n let actualizar = Hclinic.where({ _id: \"5fcd4685b3b8b747e6347f82\" });\r\n actualizar.updateOne({ $set: { h_clinica: array2[1] } }).exec();\r\n hClinica = array2[1];\r\n console.log(hClinica);\r\n } else {\r\n hClinica = args[1];\r\n console.log(hClinica);\r\n }\r\n\r\n const paciente = {\r\n fecha: new Date().toISOString().slice(0, 10),\r\n hora: hourNow(),\r\n h_clinica: hClinica,\r\n cedula: args[0],\r\n apellidos: args[4],\r\n nombres: args[3],\r\n f_nacimiento: args[6],\r\n };\r\n\r\n const pedidoBD = {\r\n fecha: new Date().toISOString().slice(0, 10),\r\n hora: hourNow(),\r\n h_clinica: hClinica,\r\n cedula: args[0],\r\n pedido: args[39].replace(/['\"]+/g, \"\"),\r\n nombre: args[3],\r\n apellido: args[4],\r\n edad: args[5],\r\n medico: args[40],\r\n establecimiento: args[2],\r\n telefono: args[16],\r\n email: args[17],\r\n telefonof: args[18],\r\n emailf: args[19],\r\n ubicacion: {\r\n pais: args[7],\r\n provincia: args[8],\r\n canton: args[9],\r\n parroquia: args[10],\r\n sector: args[11],\r\n },\r\n estudios: {\r\n instruccion: args[12],\r\n ocupacion: args[13],\r\n ins_jefefamilia: args[14],\r\n ocu_jefefamilia: args[15],\r\n },\r\n f_muestra: args[20],\r\n fecha_ult_mestruacion: args[21],\r\n metodo_planificacion: args[22],\r\n num_partos: args[23],\r\n num_cesareas: args[41],\r\n num_abortos: args[24],\r\n inicio_sexo: args[25],\r\n\r\n embarazada: args[26],\r\n lactancia: args[27],\r\n now_ninguno: args[42],\r\n\r\n destruccion_local: args[28],\r\n conizacon: args[29],\r\n histectomia: args[30],\r\n radioterapia: args[31],\r\n hormonoterapia: args[32],\r\n otros: args[33],\r\n some_ninguno: args[43],\r\n\r\n citologia: {\r\n Si: args[34],\r\n No: args[35],\r\n numero: args[36],\r\n anios: args[37],\r\n meses: args[38],\r\n },\r\n };\r\n let pacienteBuscar = await Patient.find({ cedula: args[0] }).exec();\r\n console.log(pacienteBuscar);\r\n let verificar = true;\r\n verificar = isEmpty(pacienteBuscar);\r\n console.log(verificar);\r\n if (verificar == true) {\r\n const newPatient = new Patient(paciente);\r\n const patientSaved = await newPatient.save();\r\n console.log(\"paciente nuevo\");\r\n } else {\r\n console.log(\"paciente ya existe\");\r\n }\r\n const newPedido = new Pedido(pedidoBD);\r\n const pedidoSaved = await newPedido.save();\r\n //const newPC = new Pedidocounter(pedidogenCounter);\r\n //const PCSaved = await newPC.save();\r\n let actualizarPC = Pedidocounter.where({\r\n _id: \"5f5802815a5736164e9858a0\",\r\n });\r\n actualizarPC\r\n .updateOne({ $set: { pedido_counter: args[39].replace(/['\"]+/g, \"\") } })\r\n .exec();\r\n //const pedidotSaved = await newPedido.save();\r\n //const newHclinica = new Hclinic(hclinica);\r\n //const hclinicaSaved = await newHclinica.save();\r\n //console.log(patientSaved);\r\n //console.log(pedidoSaved);\r\n //console.log(hclinicaSaved);\r\n } else {\r\n console.log(\"formulario incorrecto\");\r\n }\r\n });\r\n}", "function habServDePerfil(idsistema,idperfil,idformulario,idservicio,nomserv,estado){\n var url = '../../ccontrol/control/control.php';\n var data = 'p1=habServDePerfil&p2='+idsistema+'&p3='+idperfil+'&p4='+idformulario+'&p5='+idservicio+'&p6='+estado;\n var habi = estado==1?'DESHABILITADO':'HABILITADO';\n var ask = confirm('El Servicio: '+nomserv+' va a ser '+habi+' \\xBFDesea Continuar?');\n if(ask){\n new Ajax.Request ( url,\n {method : 'get',\n parameters : data,\n onLoading : function(transport){est_cargador(1);},\n onComplete : function(transport){est_cargador(0);\n alert('Servicio: '+nomserv+' fue '+habi);\n actPerfilFormularioServicio(idsistema,idperfil,idformulario);\n }\n }\n )\n }\n}", "function addCBtoUser(client){\n\tclient.sync_cursor=function(cursor){\n\t\tvar message={};\n\t\tmessage.Action=\"OnSyncCursor\";\n\t\tmessage.absPos={Row:cursor.getRow(), Col:cursor.getIndex()};\n\t\tmessage.Row=cursor.getRow();\n\t\tmessage.Col=cursor.getIndex();\n\t\tmessage.ID=\"LOCAL\";\n\t\tclient.send(JSON.stringify(message));\n\t};\n\n\tclient.reject=function(reason){\n\t\tvar message={};\n\t\tmessage.Action=\"OnConnectionRejected\";\n\t\tmessage.Reason=reason;\n\t\tclient.send(JSON.stringify(message));\n\t\tsetTimeout(function(){\n\t\t\tclient.close();\n\t\t},1000);\n\t};\n\n}", "function retry(){\r\n\t\tpartie = 0;\r\n\tstart();\r\n}", "function ecrire(){\nrl.question(welcomemessage, (answer) =>{\n\tif (answer == 'exit'){\n\t\tprocess.exit();\n\t}\n\telse if (answer== 'set'){\n\t\tset();\n\t}\n\telse if (answer == 'get'){\n\t\tget();\n\t}\n\telse if (answer == 'lastquery'){\n\t\tlastquery();\n\t}\n\n\telse if (answer == 'mysql') {\n\t\tsetEvent();\n\t}\n\telse if (answer== 'php'){\n\t\teventphp();\n\t}\n\telse {\n\t\tconsole.log(answer + ': command not found \\n' + listofcommand);\n\t\tsetTimeout(function(){ecrire()},120);\n\t}\n\t});\n}", "function envoiMessage(mess) {\r\n // On recupere le message\r\n var message = document.getElementById('message').value;\r\n\r\n // On appelle l'evenement se trouvant sur le serveur pour qu'il enregistre le message et qu'il l'envoie a tous les autres clients connectes (sauf nous)\r\n socket.emit('nouveauMessage', { 'pseudo' : pseudo, 'message' : message });\r\n\r\n // On affiche directement notre message dans notre page\r\n document.getElementById('tchat').innerHTML += '<div class=\"line\"><b>'+pseudo+'</b> : '+message+'</div>';\r\n\r\n // On vide le formulaire\r\n document.getElementById('message').value = '';\r\n\r\n // On retourne false pour pas que le formulaire n'actualise pas la page\r\n return false;\r\n}", "function buscarClienteOnClick(){\n if ( get('formulario.accion') != 'clienteSeleccionado' ) {\n // var oid;\n // var obj = new Object();\n var whnd = mostrarModalSICC('LPBusquedaRapidaCliente','',new Object());//[1] obj);\n if(whnd!=null){\n \n //[1] }else{\n /* posicion N°\n 0 : oid del cliente\n 1 : codigo del cliente\n 2 : Nombre1 del cliente\n 3 : Nombre2 del cliente\n 4 : apellido1 del cliente\n 5 : apellido2 del cliente */\n \n var oid = whnd[0];\n var cod = whnd[1];\n //[1] var nombre1 = whnd[2];\n //[1] var nombre2 = whnd[3];\n //[1] var apellido1 = whnd[4]; \n //[1] var apellido2 = whnd[5]; \n \n // asigno los valores a las variables y campos corresp.\n set(\"frmFormulario.hOidCliente\", oid);\n set(\"frmFormulario.txtCodigoCliente\", cod);\n \n } \n }\n }", "function sent() {\n console.info(\"Fine processo d'invio notizie\")\n}", "function jouer() {\r\n var btn = document.getElementById('jouer');\r\n sock.emit('jouer');\r\n btn.innerHTML = \"Changer d'affaire\";\r\n}", "pollproliphix() {\n this.log('entered pollproliphix')\n\n this.log('pollproliphix polleri before', this.polleri);\n\n this.log('pollproliphix this.thermostatset', this.thermostatset);\n this.log('pollproliphix this.testthermostat', this.thermostattested);\n this.log('pollproliphix this.thermostatconnected', this.thermostatconnected);\n\n\n this.torepeat = () => {\n this.polleri += 1;\n this.log('pollproliphix polleri before', this.polleri);\n\n this.log('pollproliphix this.thermostatset', this.thermostatset);\n this.log('pollproliphix this.testthermostat', this.thermostattested);\n this.log('pollproliphix this.thermostatconnected', this.thermostatconnected);\n\n\n if (this.thermostatset && this.thermostatconnected) {\n\n this.req(this.ip, this.port, this.thermostatGetCommand, this.thermostatmethod, this.thermostatusername, this.thermostatpassword);\n\n };\n this.log('pollproliphix polleri after ', this.polleri);\n\n\n };\n\n\n this.toset = setInterval(() => { this.torepeat() }, this.pollInterval);\n\n }", "function set_email_resp_inter()\n{\n RMPApplication.debug (\"begin set_email_resp_inter\");\n var my_pattern = {};\n var nom_societe = RMPApplication.get(\"nom_societe\");\n my_pattern.nom_societe = nom_societe;\n c_debug(debug.init, \"=> set_email_resp_inter: nom_societe = \", nom_societe);\n col_societes_inter_tpi.listCallback(my_pattern, {}, set_email_resp_inter_ok, set_email_resp_inter_ko);\n RMPApplication.debug (\"end set_email_resp_inter\");\n}", "static consultarCliente(id, callback) {\n //Armamos la consulta segn los parametros que necesitemos\n let query = 'SELECT * ';\n query += 'FROM '+table.name+' ';\n query += 'WHERE '+table.fields.id+'='+id+';'; \n //Verificamos la conexion\n if(sql){\n sql.query(query, (err, result) => {\n if(err){\n throw err;\n }else{ \n let cliente = Cliente.mapFactory(result[0]); \n console.log(cliente); \n callback(null,cliente);\n }\n })\n }else{\n throw \"Problema conectado con Mysql en consultarCliente\";\n } \n }", "function ws_oneditprepare() {\n $(\"#websocket-client-row\").hide();\n $(\"#node-input-mode\").change(function() {\n if ( $(\"#node-input-mode\").val() === 'client') {\n $(\"#websocket-server-row\").hide();\n $(\"#websocket-client-row\").show();\n }\n else {\n $(\"#websocket-server-row\").show();\n $(\"#websocket-client-row\").hide();\n }\n });\n \n if (this.client) {\n $(\"#node-input-mode\").val('client').change();\n }\n else {\n $(\"#node-input-mode\").val('server').change();\n }\n }", "function consola (){\r\n bienvenida_random();\r\n ayuda();\r\n}", "run({ accion, socket, Socket, leccionId, paraleloId, fechaInicioTomada, tiempoEstimado, usuarioId }) {\n // limpiarlos por si acaso el moderador envia dos veces la misma peticion\n const existeInterval = intervals.some(leccion => leccionId == leccion.leccionId)\n const existeTimeout = timeouts.some(leccion => leccionId == leccion.leccionId)\n socket.join(`${paraleloId}`) // cada vez que realiza una de las acciones de debe agregar al profesor al room del paralelo\n if (existeInterval)\n intervals = intervals.filter(inicial => { if (inicial.leccionId == leccionId) {clearInterval(inicial.interval)} return inicial.leccionId !=leccionId })\n if (existeTimeout) { // si comento esto, se crean 3?\n timeouts = timeouts.filter(inicial => { if (inicial.leccionId == leccionId) {clearTimeout(inicial.timeout)} return inicial.leccionId != leccionId })\n }\n if (accion === 'comenzar') {\n logger.info(`moderador-comenzar usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n } else if (accion === 'aumentarTiempo') {\n logger.info(`moderados-aumentarTiempo usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}`)\n } else if (accion === 'continuar') {\n logger.info(`moderador-continuar usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoPausado+TiempoRestante: ${tiempoEstimado}`)\n } else if (accion === 'reconectarModerador') {\n logger.info(`moderador-reconectarModerador usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoPausado+TiempoRestante: ${tiempoEstimado}`)\n }\n const CURRENT_TIME = moment(moment().tz('America/Guayaquil').format())\n const FECHA_INICIO = moment(fechaInicioTomada)\n const FECHA_FIN = FECHA_INICIO.add(tiempoEstimado, 's')\n intervalId = setInterval(() => {\n let fechaFinLeccion = FECHA_FIN.subtract(1, 's')\n let tiempoRestante = moment.duration(fechaFinLeccion.diff(CURRENT_TIME)).format('h:mm:ss')\n // console.log(tiempoRestante)\n Socket.in(`${paraleloId}`).emit(EMIT.TIEMPO_RESTANTE, tiempoRestante)\n if (!CURRENT_TIME.isBefore(fechaFinLeccion)) {\n intervals = intervals.filter(inicial => { if (inicial.leccionId == leccionId) {clearInterval(inicial.interval)} return inicial.leccionId !=leccionId })\n Socket.in(`${paraleloId}`).emit(EMIT.LECCION_TERMINADA)\n Socket.in(`${paraleloId}`).emit(EMIT.TIEMPO_RESTANTE, 0)\n logger.info(`moderador-leccion-termino usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n }\n }, 1000)\n intervalId.ref()\n\n const SEGUNDOS_FIN = parseInt(moment.duration(FECHA_FIN.clone().add(5, 's').diff(CURRENT_TIME), 'seconds').format('ss'), 10) // si no termina con setInterval, despues de 5 segundos terminara con setTimeout\n timeoutId = 1 // prueba\n // timeoutId = setTimeout(() => {\n // if (intervalExiste(intervals, leccionId)) {\n // intervals = intervals.filter(inicial => { if (inicial.leccionId == leccionId) {clearInterval(inicial.interval)} return inicial.leccionId !=leccionId })\n // Socket.in(`${paraleloId}`).emit(EMIT.LECCION_TERMINADA)\n // logger.info(`moderador-leccion-termino-setTimeout usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n // } else {\n // logger.info(`moderador-leccion-termino-setInterval usuarioId: ${usuarioId}, leccionId: ${leccionId}, paraleloId: ${paraleloId}, fechaInicioTomada: ${moment(fechaInicioTomada).format(\"DD-MM-YY_hh-mm-ss\")}, tiempoEstimado: ${tiempoEstimado}`)\n // }\n // timeouts = timeouts.filter(inicial => { if (inicial.leccionId == leccionId) {clearTimeout(inicial.timeouts)} return inicial.leccionId !=leccionId })\n // }, SEGUNDOS_FIN)\n intervals.push({ leccionId, interval: intervalId, usuarioId })\n timeouts.push({ leccionId, timeout: timeoutId, usuarioId })\n if (accion === 'comenzar') {\n Socket.in(`${paraleloId}`).emit(EMIT.EMPEZAR_LECCION) // este solo sirve cuando los estudiantes estan en \"ingresar-codigo\"\n }\n }", "sendBill() {}", "disconnected() {}" ]
[ "0.59425795", "0.5847604", "0.58139616", "0.5701569", "0.5701569", "0.5701569", "0.5701569", "0.5701569", "0.5701569", "0.56467503", "0.5638129", "0.56301713", "0.5621787", "0.5612145", "0.55654985", "0.552803", "0.55232894", "0.55148935", "0.5502826", "0.5502411", "0.54998595", "0.54965264", "0.5477436", "0.5476414", "0.5474723", "0.54663396", "0.5465495", "0.54405445", "0.5439231", "0.54292214", "0.5428744", "0.542833", "0.5427116", "0.54236495", "0.5410679", "0.53953564", "0.53895265", "0.5382342", "0.5381603", "0.53788817", "0.536711", "0.53589445", "0.5353202", "0.5345213", "0.534303", "0.5340406", "0.5339866", "0.53349835", "0.53224576", "0.53215784", "0.53207517", "0.53203046", "0.5315177", "0.5308502", "0.53018343", "0.53009874", "0.52958906", "0.52933186", "0.5285108", "0.5285049", "0.5283296", "0.52673405", "0.526625", "0.5265508", "0.5264997", "0.5263672", "0.52634", "0.52613825", "0.52573663", "0.5245107", "0.52446204", "0.52433485", "0.5238152", "0.5237269", "0.52366763", "0.5227177", "0.5224794", "0.52209616", "0.5218377", "0.52157086", "0.52143824", "0.52097607", "0.52097607", "0.5205283", "0.5198893", "0.5196725", "0.519528", "0.5194775", "0.51919997", "0.5188213", "0.5186521", "0.5185329", "0.5183387", "0.5180551", "0.5180289", "0.5177186", "0.5172638", "0.5168804", "0.51674545", "0.51599765", "0.51572764" ]
0.0
-1
get currentuser transactions and set to this.userTransactions property
getUserTransactions() { this.userTransactions = this.appConfig.transactions.filter((transaction) => { if (transaction.userId === this.loggedInUserDetails.id) { return true; } }); // filter current user transactions from this.appConfig.transactions array // console.log(this.userTransactions); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserTransactions(id) {\n return Api().get(`/transactions/user/${id}`);\n }", "function transact(){\n const tid = transactions.length;\n const transaction = {\n tid: tid,\n timestamp: new Date(),\n user: 0\n };\n\n transactions.push(transaction);\n return transaction;\n }", "setTransactions(transactions) {\n transactions = transactions ? transactions : this.getTransactions();\n localStorage.setItem('transactions', JSON.stringify(transactions));\n }", "getRecentTransactions() {\n const userId = this._userService.loggedInUserId;\n this.subscription.add(this._transactionService.getRecentTransactions(userId).subscribe((recentTransactions) => {\n this.recentTransactions = [];\n recentTransactions.sort((a, b) => {\n return b - a;\n });\n recentTransactions.forEach((amount) => {\n this.recentTransactions.push({\n amount,\n coinCount: this.computeChange(this.denominations, amount),\n });\n });\n }, (error) => {\n if (error.status === _model_error_enum__WEBPACK_IMPORTED_MODULE_2__[\"ErrorCodes\"].Unauthorized ||\n error.status === _model_error_enum__WEBPACK_IMPORTED_MODULE_2__[\"ErrorCodes\"].Forbidden) {\n this._userService.signOut();\n }\n else {\n this.recentTransactionFetchError =\n _model_error_enum__WEBPACK_IMPORTED_MODULE_2__[\"ErrorMessages\"].RecentTransactionFetchError;\n }\n }));\n }", "get transaction() {\n return this._transaction;\n }", "control(user) {\n return this.tx.every((tx) => {\n if (! user.isInvolvedIn(tx)) {\n return true;\n }\n return user.transactions().includes(tx);\n });\n }", "getCurrentUser() {\r\n return this.users[0];\r\n }", "function getTransactions() {\n\n $.ajax({\n contentType: \"application/json;charset=utf-8\",\n url: 'http://localhost:8080/getTransactions',\n type: 'get',\n dataType: 'json',\n data: { user_id: state.id },\n success: function (data) {\n\n setTransactions(data);\n },\n error: function (request, status, error) {\n console.log(request.responseText);\n }\n\n });\n }", "getTransactionContext() {\n return this.transactionContext;\n }", "get current() {\n return this._active_user.getValue();\n }", "getCurrentTransactionIndex() {\n return this.currentTransactionIndex;\n }", "get currentUser() {\r\n return new CurrentUser(this);\r\n }", "function loadTransactions() {\n transaction.getTransactions()\n .then(res =>{\n console.log(\"TEST\" + res.data);\n setTransactions(res.data)}\n \n )\n .catch(err => console.log(err));\n }", "set transaction(aValue) {\n this._transaction = aValue;\n }", "async UsePointsTransactionsInfo(ctx, userType, userId) {\n let transactions = await ctx.stub.getState(usePointsTransactionsKey);\n transactions = JSON.parse(transactions);\n let userTransactions = [];\n\n for (let transaction of transactions) {\n if (userType == \"member\") {\n if (transaction.member == userId) {\n userTransactions.push(transaction);\n }\n } else if (userType == \"partner\") {\n if (transaction.partner == userId) {\n userTransactions.push(transaction);\n }\n }\n }\n\n return JSON.stringify(userTransactions);\n }", "getCurrentUser() {\n var self = this;\n return self.user;\n }", "function user() {\n return currentUser;\n }", "getRecentTransactions(userId) {\n const transactionIndex = this.transactions.findIndex((transaction) => {\n return transaction.userId === userId;\n });\n if (transactionIndex !== -1) {\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"of\"])(this.transactions[transactionIndex].recentTransactions);\n }\n else {\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_2__[\"throwError\"])(new _angular_common_http__WEBPACK_IMPORTED_MODULE_0__[\"HttpErrorResponse\"]({ status: 404 }));\n }\n }", "function getAllUsers(transactions) {\r\n loggerMessages.logDebug('Getting all users\\' info');\r\n const users = calculateAccounts(transactions);\r\n \r\n loggerMessages.logDebug('Starting to print out users\\' info');\r\n users.forEach(function(value) {\r\n value.logAccount();\r\n });\r\n}", "function getCurrentUser()\n{ \n\treturn currentUser;\n}", "function setCurrentUser(user) {\n currentUser = user.data;\n currentUserAllData = user;\n\n return Fliplet.App.Storage.set(USERID_STORAGE_KEY, currentUser.flUserId).then(function() {\n return Fliplet.App.Storage.set(USERTOKEN_STORAGE_KEY, currentUser.flUserToken);\n });\n }", "get currentUser() {\n const activeUsers = this.users.filter(\n (user) => user.state === UserState.Active\n );\n\n if (activeUsers.length === 0) {\n return null;\n } else {\n // Current user is the top of the stack\n return activeUsers[0];\n }\n }", "get transactionId() {\n return this._transactionId;\n }", "function current() {\n return user;\n }", "get _currentUser() {\r\n return this.currentUser;\r\n }", "get _currentUser() {\r\n return this.currentUser;\r\n }", "fillOutUser () {\r\n\t\t\treturn new Promise((resolve, reject) => {\r\n\t\t\t\t$http({\r\n\t\t\t\t\turl: `https://api.coinbase.com/v2/accounts`,\r\n\t\t\t\t\tmethod: 'GET',\r\n\t\t\t\t\theaders: {\r\n\t\t\t\t\t\t\"Authorization\": `Bearer ${currentUser.AccessToken}`\r\n\t\t\t\t\t}\r\n\t\t\t\t})\r\n\t\t\t\t.then(\r\n\t\t\t\t\tresponse => {\r\n\t\t\t\t\t\tconsole.log(`fillOutUser GET response: `, response);\r\n\t\t\t\t\t\tgetPrimaryAccountInfo(response);\r\n\t\t\t\t\t\t// get transactions after account info\r\n\t\t\t\t\t\treturn getTransactions();\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror => {\r\n\t\t\t\t\t\tconsole.log(`fillOutUser GET error: `, error)\r\n\t\t\t\t\t\treject();\r\n\t\t\t\t\t}\r\n\t\t\t\t)\r\n\t\t\t\t.then(\r\n\t\t\t\t\ttransactionsResponse => {\r\n\t\t\t\t\t\tconsole.log(`transactions resolve`);\r\n\t\t\t\t\t\t// resolve outer promise in page controller\r\n\t\t\t\t\t\tresolve();\t\r\n\t\t\t\t\t},\r\n\t\t\t\t\terror => {\r\n\t\t\t\t\t\tconsole.log(`Transactions GET error: `, error);\r\n\t\t\t\t\t\treject();\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// get transactions resolve\r\n\t\t\t\t);\r\n\t\t\t});\r\n\t\t}", "function transaction() {\n // * CURRENT transaction\n if (AccountType === \"CURRENT\") {\n Accounts[AccountID].current += TransactionValue;\n\n // * SAVINGS transaction\n } else if (AccountType === \"SAVINGS\") {\n // (1) - if withdrawal is made from SAVINGS but the required sum does not exist, only the total available amount is transferred\n // i.e. SAVINGS does not drop below 0\n if (TransactionValue < 0 && Accounts[AccountID].savings < Math.abs(TransactionValue)) {\n Accounts[AccountID].savings -= Accounts[AccountID].savings;\n // (2) - regular SAVINGS transaction\n } else {\n Accounts[AccountID].savings += TransactionValue;\n }\n }\n }", "get allTransactionsAddresses() {\n return this._fetcher.allTransactionsAddresses;\n }", "get allTransactionsAddresses() {\n return this._fetcher.allTransactionsAddresses;\n }", "setAppliedUsers(users) {\n this.appliedUsers = users;\n console.log(this.appliedUsers);\n }", "getTransactions(){\n var params = {\n category: this.state.filter_option,\n page: this.state.page,\n itemsPerPage: TRANSACTIONS_PER_PAGE\n };\n\n var thisObj = this;\n $.getJSON(\"/api/transactions/\", params, function(data){\n thisObj.setState({\n transactions: data.results,\n pageCount: Math.ceil(data.num_pages),\n });\n });\n }", "function getCurrentUser() {\n \n return currentUser;\n }", "get tr() {\n return new Transaction(this);\n }", "get user() {\n return this._user;\n }", "get txId() { return this._txId }", "getUserChange(transaction) {\n const result = [];\n let value = roundedDecimal(transaction.paid - transaction.owed); // determine what is owed\n const override = this.setOverrides(value); // set any available override(s)\n\n // get user's change for transaction\n while (value > 0) {\n const denomination = this.getDenomination(value, override); // returns object\n const remainder = value - denomination.value; // Update Difference\n value = roundedDecimal(remainder);\n result.push(denomination.name); // Push user's change to array until we reach 0\n }\n // console.warn(\"Result: \", result);\n return result;\n }", "mergeUserDataWithCurrentState(stateChange) {\n return Object.assign(this.props.user, stateChange);\n }", "getTransactions (blockHash, txids, opts, cb) {\n this._request('getTransactions', blockHash, txids, opts, cb)\n }", "get() {\n return JSON.parse(localStorage.getItem(\"dev.finances:transactions\")) || [] // transformando de string para arrays ou devolve um array vazio\n }", "function Transactions() {\n _classCallCheck(this, Transactions);\n\n Transactions.initialize(this);\n }", "currentBalance() {\n const sumTransaction = (a, b) => a + getTransactionAmountWithSign(b);\n\n return slice((state) => state.transactions.reduce(sumTransaction, 0));\n }", "currentUser(state, user) {\n state.currentUser = user;\n }", "function applyTaxToItems(user){\n return user\n}", "function applyTaxToItems(user){\n return user\n}", "function applyTaxToItems(user){\n return user\n}", "setUser(user) {\n this.discountingUser = user;\n\n this.getCurrentDiscountForUser(user);\n }", "get users() {\n return this.mutateData.users;\n }", "async EarnPointsTransactionsInfo(ctx, userType, userId) {\n let transactions = await ctx.stub.getState(earnPointsTransactionsKey);\n transactions = JSON.parse(transactions);\n let userTransactions = [];\n\n for (let transaction of transactions) {\n if (userType == \"member\") {\n if (transaction.member == userId) {\n userTransactions.push(transaction);\n }\n } else if (userType == \"partner\") {\n if (transaction.partner == userId) {\n userTransactions.push(transaction);\n }\n }\n }\n\n return JSON.stringify(userTransactions);\n }", "function getAll(trans_username) {\n // return Transactions().select();\n return Transactions().where('trans_username', trans_username);\n}", "function getUsers() {\n\t\t\t\tusers.getUser().then(function(result) {\n\t\t\t\t\tvm.subscribers = result;\n\t\t\t\t\tconsole.log(vm.subscribers);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "getUser() {\n return this.store.user;\n }", "function getUserData() {\n\n return currUserData;\n }", "get user() { return this.user_; }", "get user() {\n return this._user;\n }", "get activeUser() {\n return CacheRequest.getActiveUser(this);\n }", "function currentUser(callback) {\n\tsendRequest({ request: 'current user' }, callback);\n}", "get() {\n //aqui vamos desfazer oque fizemos no set, ou seja, transformar a string em array como era antes.\n //quem faz isso acontecer é o \"parse\", e \"||\" = \"OU\", caso nao tenha a chave retornar um array vazio.\n return JSON.parse(localStorage.getItem(\"dev.finances:transactions\")) || [];\n }", "get paymentsIn() {\n return new Transactions(\n this.get('paymentAddressTransactions')\n .filter(payment => (payment.get('value') > 0))\n );\n }", "addNewUserTransaction(data) {\n return Api().post(`/transactions`, data);\n }", "getCurrentUser() {\n return JSON.parse(localStorage.getItem('user'));\n }", "_addTxOutItem(userKey, amount){\n\t\tthis.txOut.push({key: userKey, amount: amount});\n\t}", "function setActiveUser(user) {\n if (!user) {\n localStorageService.set('activeUser', null);\n } else {\n let activeUser = {\n userID: user.userID,\n username: user.username,\n token: user.token,\n userSources: user.userSources || {}\n };\n localStorageService.set('activeUser', activeUser);\n }\n }", "handleUserSelect(item) {\n let username = item.username;\n let user1 = item.userid;\n let user2 = cookie.load(\"user_id\");\n let type = item.FavourType;\n\n\n let responseData = [];\n this.setState({\n userloginName: username,\n allOWedTransaction: [],\n allOwesTransaction: []\n })\n if (type === \"Owes\") {\n\n let FavourQt = item.FavourQty;\n this.setState({\n SumOfOwes: FavourQt,\n SumOfOwed: 0\n });\n\n }\n else {\n let FavourQt = item.FavourQty;\n\n this.setState({\n SumOfOwed: FavourQt,\n SumOfOwes: 0\n });\n }\n\n // For login(user1) owes users2\n axios.get(`https://aip-v1.ts.r.appspot.com/api/favours/transaction?user_owes=${user2}&user_owed=${user1}`)\n .then(response => {\n if (response.status === 200) {\n responseData = response.data.transactions;\n\n this.setState({\n allOwesTransaction: responseData\n });\n }\n })\n .catch((e) => {\n console.log(e);\n })\n\n // For users2 owes login(user1) \n axios.get(`https://aip-v1.ts.r.appspot.com/api/favours/transaction?user_owes=${user1}&user_owed=${user2}`)\n .then(response => {\n if (response.status === 200) {\n responseData = response.data.transactions;\n\n this.setState({\n allOWedTransaction: responseData\n });\n\n }\n })\n .catch((e) => {\n console.log(e);\n })\n\n\n\n\n }", "function setCurrentUser(user) {\n \n currentUser.userId = user[0];\n currentUser.firstName = user[1];\n currentUser.lastName = user[2];\n currentUser.email = user[3];\n currentUser.password = user[4];\n }", "function buyItem(user){\n return Object.assign({}, user, { purchases: })\n}", "async setCurrentUser() {\n const response = await this.client.get('currentUser')\n this.currentUser = response.currentUser\n }", "function getUser() {\n return user;\n }", "populateTransactions(transactions) {\n const sortedTransactions = _.sortBy(transactions, [\n 'transactionDate',\n 'id'\n ]);\n this.state.transactions = sortedTransactions;\n store.wasm.populateInWasm(sortedTransactions, this.getCategories());\n this.recalculateBalances();\n }", "setCurrentUser (user, id) {\n resourceCache.addItem('users', user)\n }", "get allUsers() {\n // Returning a freezed copy of the list of users to prevent outside changes\n return Object.fromEntries(this.users.map((user) => [user.id, user]));\n }", "syncCurrentUser(user) {\n this.setState({ currentUser: user });\n console.log(\"current user\", this.state.currentUser);\n }", "function updateLocalStorage() {\r\n localStorage.setItem('transactions', JSON.stringify(transactions));\r\n}", "get user() {\n return this._model.data\n }", "__transId () {\n return this._transid\n }", "function getCurrentUser() {\n API.getCurrentUser()\n .then(res => {\n setCurrentUser(res.data);\n }\n )\n }", "getTransactions (params) {\r\n return Api().get('/transactions')\r\n }", "getAllUsers() {\r\n return this.users;\r\n }", "getCurrentUser({commit, getters, state}) {\n\t\t\tif(getters.isLoggedIn) {\n\t\t\t\tlet token = state.token;\n\t\t\t\treturn new Promise((resolve, reject) => {\n\t\t\t\t\taxios({method: 'GET', url: 'http://localhost:8000/api/user/current'})\n\t\t\t\t\t.then(resp => {\n\t\t\t\t\t\tlet user = resp.data.user\n\t\t\t\t\t\tcommit('auth_success', {token, user})\n\t\t\t\t\t\tresolve(resp)\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t} else {\n\t\t\t\tconsole.log('Not logged in so wont fetch user')\n\t\t\t}\n\t\t}", "createTransaction(transaction){\n this.pendingTransactions.push(transaction);\n }", "function getCurrentUserData(){\n\n ApiCalls.getCurrentUser()\n .then((res) => {\n //console.log(\"current\" ,res.data);\n setCurrentUser(res.data);\n }\n ) \n}", "getAllUserData () {\n return this.allUserData\n }", "transactionalProperties() {\n return (this._transactionalProperties\n || this.constructor.transactionalProperties());\n }", "function updateLocalStorage() {\n localStorage.setItem('transactions', JSON.stringify(transactions));\n}", "setUserKeeps({ commit }) {\n api.get('/api/vaulktkeeps/' + user.id)\n .then(res => {\n commit('setUserKeeps', res.data) // get all vaultkeeps from vaultkeeps []\n console.log(res)\n })\n .catch(err => {\n console.log(err)\n })\n }", "async function getTransactions() {\n try {\n const res = await axios.get('api/v1/transactions');\n\n dispatch({\n type: 'GET_TRANSACTIONS',\n payload: res.data.data\n });\n } catch(err) {\n dispatch({\n type: 'TRANSACTION_ERROR',\n payload: err.response.data.error\n });\n }\n }", "get paymentsIn() {\n return new Transactions(\n this.get('paymentAddressTransactions')\n .filter(payment => (payment.get('bigValue').gt(0)))\n );\n }", "getCurrentUserId() {\r\n return JSON.parse(localStorage.getItem(\"user\")).id;\r\n }", "function buyItem(user){\n return Object.assign({}, user, )\n}", "function createTransaction(type, value){\n //adicionar uma nova transação no array de transações de um usuário\n var valor = {type: type,value: value} \n user.transactions.push(valor)\n //console.log(valor)//{ type: 'credit', value: 10 }\n \n if(valor.type == \"credit\"){\n user.balance = user.balance + valor.value\n }else{\n user.balance = user.balance - valor.value\n }\n //console.log(user.balance)/// value inserido acima\n return user.balance\n}", "function pollForTransactions() {\n\t\t$log.info('About to request transactions');\n\t\tbaseTransactions.getList({filter:$scope.filterOptions.filterText}).then(function(transactions) {\n\t\t\t$log.info('Got transactions');\n\t\t\t$scope.transactions = transactions;\n\t\t\tbaseTransactions = transactions;\n\t\t\tif (!angular.isDefined(polling))\n\t\t\t{\n\t\t\t\tpolling = $interval(pollForTransactions, 1000);\n\t\t\t\t// Cancel interval on page changes\n\t\t\t\t$scope.$on('$destroy', function(){\n\t\t\t\t\tif (angular.isDefined(polling)) {\n\t\t\t\t\t\t$interval.cancel(polling);\n\t\t\t\t\t\tpolling = undefined;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "function buyItem(user){\n return Object.assign({}, user, { purchases: user.cart })\n}", "getTransactionsData() {\n const key = 'Transactions';\n const newObj = TransactionStore.get(key);\n const objArr = newObj || [];\n const arrToRet = [];\n const { publicKey } = this.props;\n for (const transaction of objArr) {\n if (\n (transaction.to &&\n transaction.from &&\n transaction.from === publicKey) ||\n transaction.to === publicKey\n ) {\n arrToRet.push(transaction);\n }\n }\n\n return arrToRet.reverse();\n }", "getPayingUsers() {\n const payingUsers = this._payingUsers.map(payer => payer._user);\n const paymentApprovals = this.paymentApprovals;\n const approvers = paymentApprovals.map(approval => approval._approver);\n\n return [...payingUsers, ...approvers];\n }", "async getUser () {\n\t\tthis.user = await this.data.users.getById(this.tokenInfo.userId);\n\t\tif (!this.user || this.user.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'user' });\n\t\t}\n\t}", "doTransaction() {\n if (this.currentList != undefined)\n this.currentList.items[this.itemIndex] = this.newItem;\n }", "restoreFromStorage() {\r\n this._settings = JSON.parse(localStorage.getItem('settings'));\r\n this._lastAssignedID = JSON.parse(localStorage.getItem('lastAssignedID'));\r\n this._accountList = [];\r\n const tempList = JSON.parse(localStorage.getItem('accountList'));\r\n\r\n tempList.forEach( account => {\r\n let tempaccount = this.createAccount(account._accountName);\r\n tempaccount.currency = account._currency;\r\n tempaccount.startingAmount = account._startingAmount;\r\n for (let i = 0; i < account._transactionList.length ; i++){\r\n tempaccount.addTransaction( new Transaction(\r\n account._transactionList[i]._id,\r\n account._transactionList[i]._name,\r\n account._transactionList[i]._date,\r\n account._transactionList[i]._amount,\r\n account._transactionList[i]._category,\r\n account._transactionList[i]._type\r\n ));\r\n }\r\n });\r\n }", "function getMyTransactions(req, res, next) {\n transactionService.getMyTransactions(req.params.id) // que pasar? req.params? id del wallet\n .then(wallets => res.json(wallets)) // alomejor hay q devolver otra cosa\n .catch(err => next(err));\n}", "async getTransactions(progressBar) {\n //get transaction list\n let wallet = await this.getWalletInfo();\n console.log(wallet.transactions);\n let transactions = [];\n if (progressBar) {\n progressBar.max = wallet.transactions.length;\n progressBar.value = 0;\n }\n //loop through list and get info about each transaction from api, very inefficient\n for (var i = 0; i < wallet.transactions.length; i++) {\n if (progressBar) {\n progressBar.value += 1;\n }\n console.log(i + \"/\" + wallet.transactions.length);\n let transactionInfo = await this.getTransactionInfo(\n wallet.transactions[i]\n );\n transactions.push(transactionInfo);\n }\n if (progressBar) {\n progressBar.remove();\n }\n return transactions;\n }", "function getTransactions() {\n let postBody = {\n authToken: getCookie(\"authToken\"),\n returnValueList: \"transactionList\"\n };\n\n $.ajax({\n type: \"GET\",\n url: \"proxy.php\",\n data: postBody,\n dataType: 'json',\n success: function (data) {\n\n let response = JSON.parse(data);\n\n if (response.jsonCode === 200) {\n writeTransactions(response);\n $loader.hide();\n $landingImage.hide();\n $transactionTable.show();\n $buttonGroup.show();\n } else {\n displayMessage(response);\n $loader.hide();\n $loginContent.show();\n }\n }\n });\n }" ]
[ "0.6856593", "0.6219605", "0.6203921", "0.61412543", "0.59827733", "0.5883101", "0.5790193", "0.56914294", "0.5688507", "0.56723285", "0.5647265", "0.56311315", "0.56117254", "0.5531228", "0.54710543", "0.54460144", "0.54356796", "0.5427972", "0.5424224", "0.541708", "0.5413004", "0.540268", "0.5383364", "0.5381825", "0.53771895", "0.53771895", "0.5364459", "0.53413767", "0.5333662", "0.5333662", "0.5317882", "0.5313262", "0.53055", "0.5298671", "0.52972794", "0.52960813", "0.5294613", "0.5286731", "0.52653944", "0.525704", "0.5254598", "0.5214864", "0.5211953", "0.52035624", "0.52035624", "0.52035624", "0.51877135", "0.51827586", "0.5159761", "0.51537883", "0.515103", "0.51379955", "0.5131967", "0.51261574", "0.51127106", "0.5105673", "0.50689536", "0.50668395", "0.5060273", "0.5058311", "0.5051971", "0.50510335", "0.50477", "0.50398", "0.5029778", "0.50274634", "0.50240195", "0.50159943", "0.50004065", "0.49989933", "0.49964064", "0.4990188", "0.49871773", "0.4970942", "0.4968065", "0.49626228", "0.49598613", "0.49563277", "0.49548033", "0.49464953", "0.49402228", "0.4935803", "0.49351496", "0.49318364", "0.49258175", "0.49211776", "0.49208346", "0.4919638", "0.49186683", "0.49175677", "0.491556", "0.4912589", "0.49045953", "0.49021295", "0.48974392", "0.488382", "0.4882966", "0.48823753", "0.48734823", "0.4873319" ]
0.7917257
0
Active Threads Over Time
function refreshActiveThreadsOverTime(fixTimestamps) { var infos = activeThreadsOverTimeInfos; prepareSeries(infos.data); if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotActiveThreadsOverTime"))) { infos.createGraph(); }else{ var choiceContainer = $("#choicesActiveThreadsOverTime"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotActiveThreadsOverTime", "#overviewActiveThreadsOverTime"); $('#footerActiveThreadsOverTime .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sendActiveThreadCountRes() {\n \n }", "function inc_busy()\n{\n background_jobs++;\n update_busy_indicator();\n}", "get threads() {\r\n return new Threads(this);\r\n }", "scheduler() {\n const {busyApps, appPriorities, ticks} = this;\n this.__apps.map((app, appId) => {\n return {\n appId, app,\n busy: busyApps[appId],\n priority: appPriorities[appId]\n };\n }).filter(({app, appId, busy, priority}) => {\n return app && !busy && priority >= 0 && ticks % priority === 0;\n }).forEach(({app, priority}) => {\n // Set the app busy, the app itself should \"unbusy\" itself,\n // when the idle call is done.\n // That happens in <HApplication._startIdle>\n // If the app is not busy, then make a idle call:\n app._startIdle();\n });\n if (this._updateZIndexOfChildrenBuffer.length !== 0) {\n this._flushUpdateZIndexOfChilden();\n }\n }", "initThreads() {\n let initThreads = [];\n initThreads.push(this.createThread(\"run\", \"init\"));\n return initThreads;\n }", "async function activeUserCheck() {\n var prevDateTime = Date.now() - activeTime;\n var localActiveUsers = 1;\n let sql = /*sql*/`SELECT DateTime,\n UserId\n FROM Activity\n ORDER BY _rowid_`;\n db.all(sql, [], (err, rows) => {\n if (err) {\n return;\n }\n rows.forEach(function (row) {\n if (row.DateTime >= prevDateTime) {\n localActiveUsers++;\n }\n });\n activeUsers = localActiveUsers;\n guild.channels.resolve(config.starboard).edit({ topic: `${Math.ceil(activeUsers * starDevider) + 1} hearts needed for heartboard` });\n guild.channels.resolve(config.logchannel).edit({ topic: `There are ${activeUsers} users active!` });\n });\n}", "function concurrent_time() {\n if (app_opt.simulate)\n return simulate(event_opt.simulate.min, event_opt.simulate.max);\n else\n return event_opt.simulate.tick;\n }", "statusCheck(){\n console.log(`\\nTaskQueue length is ${this.taskQueue.length} !!`);\n let index = 0; //taking index separately, cause Map.prototype.forEach doesn't provide index by itself\n this.workers.forEach((status)=>{\n console.log(`Worker ${index} is ${status}`);\n index++;\n });\n }", "get threads() { return check(threadsWasm); }", "static get THREAD_STEP_INTERVAL () {\n return 1000 / 60;\n }", "function trackTasks() {\n trackTasksFn(autoflow);\n }", "function WorkerPool() {\n\t this.active = {};\n\t}", "function CurrentThread() {\r\n}", "function Scheduler() {\n this.clock = 0\n this.upcoming_events = []\n this.running = true\n this.devices = {}\n}", "mainloop() {\n this.repetitions++;\n let now = new Date().getTime();\n let relativeOriginal = now - this.realstartts;\n let relative = relativeOriginal * this.config.timeFactor;\n for (let node of this.nodes) {\n node.check(relative);\n };\n if (this.repetitions % 1000 === 0) {\n console.log(\"Repetition:\", this.repetitions, \"Relative time:\", relative);\n };\n }", "function alive()\n{\n\tconsole.log(\"Loop\");\n\tswitch(state)\n\t{\n\t\tcase 0:\n\t\t\tconsole.log(\"Stopped\");\n\t\t\t//stop();\n\t\tbreak;\n\t\t\n\t\tcase 1:\n\t\t\tif (busy == 0)\n\t\t\t{\n\t\t\t\tconsole.log(\"Swimming\");\n\t\t\t\tswim();\n\t\t\t}\n\t\tbreak;\n\t\t\n\t\tcase 2:\n\t\t\t//NOT Implemented\n\t\t\tfollow();\n\t\tbreak;\n\t\t\n\t\tcase 3:\n\t\t\t//NOT Implemented\n\t\t\tavoid();\n\t\tbreak;\n\t\t\n\t\tcase 4:\n\t\t\t//NOT Implemented\n\t\t\tfeed();\n\t\tbreak;\n\t\t\n\t\tcase 5:\n\t\t\t//DoNothingCozManual!!!!\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\tstate = 1;\n\t}\n}", "function isRunning() {\n return running;\n }", "function createThreadLevelTimeStats(numThreads) {\n var tidToTime = {};\n for (var tid = 0; tid < numThreads; tid++) {\n tidToTime[tid] = new Time(0, 0);\n }\n\n return tidToTime;\n}", "function coreTimer()\n{\n\t// If the document.hidden property doesn't work, this timer doesn't function\n\tif(typeof(document.hidden) != \"undefined\")\n\t{\n\t\tif(document.hidden != true)\n\t\t{\n\t\t\tcoreTimeCount++;\n\t\t}\n\t}\n\t\n\t// If you're logged in, run the user's update handlers\n\tif(typeof(JSUser) == \"string\")\n\t{\n\t\t// Notifications Updater\n\t\tif(coreTimeCount >= timers.notifications.next)\n\t\t{\n\t\t\ttimers.notifications.next = coreTimeCount + timers.notifications.interval;\n\t\t\trunNotifications();\n\t\t}\n\t\t\n\t\t// Friend Updater\n\t\tif(coreTimeCount >= timers.friends.next)\n\t\t{\n\t\t\ttimers.friends.next = coreTimeCount + timers.friends.interval;\n\t\t\trunFriendList();\n\t\t}\n\t\t\n\t\t// User Chat Updater\n\t\tif(coreTimeCount >= timers.userchat.next)\n\t\t{\n\t\t\ttimers.userchat.next = coreTimeCount + timers.userchat.interval;\n\t\t\trunUserChat();\n\t\t}\n\t}\n\t\n\t// Chat Updater\n\tif(coreTimeCount >= timers.chat.next)\n\t{\n\t\ttimers.chat.next = coreTimeCount + timers.chat.interval;\n\t\trunChatUpdate();\n\t}\n}", "function checkTimers(){\n createTimerCallback(amatriadata.sleepTimes)\n console.log( Date(Date.now()) + 'Checking Timers')\n}", "function activate(){\n busy = queue[0]\n if(busy) fetch(busy.url,busy.options)\n .then(busy.onComplete,err=>false)\n .then(ok=>{\n if(ok || !busy.retry){\n queue = queue.filter(item=>item!==busy)\n activate()\n }\n else setTimeout(()=>activate(),1000)\n })\n }", "_jobOver() {\n this._nbJobsRunning--;\n if (this._nbJobsRunning == 0) {\n this.emit('all-done');\n this._holdStatsTimer();\n }\n this._nbJobsCompleted++;\n this._worker();\n }", "function numWorkers() { return workerIds().length }", "function Scheduler() {\n this.tasks = [];\n this.current_running = 0;\n this.enabled = false;\n this.running = {};\n}", "function intervalTasks() {\n calculateGreeting()\n displayTime()\n}", "static get concurrency() {\n return 1\n }", "static get concurrency() {\n return 1\n }", "poll () {\n console.log('Polling'.cyan);\n\n Promise\n .all([\n PS.get(),\n PS.getCPUTime()\n ])\n .then(\n results => {\n try {\n // free mem\n this.sockets.forEach(socket => socket.emit('free mem', os.freemem()));\n\n let [ processes, cpu ] = results;\n\n this.processes = processes;\n console.log(`Got ${processes.length} processes`.green);\n this.broadcast('ps', processes);\n\n let time = cpu.totalTime - this.cpu.totalTime;\n let idle = cpu.idleTime - this.cpu.idleTime;\n\n let load = ( ( time - idle ) / time );\n\n console.log('comparing', cpu, this.cpu, { load });\n\n this.cpu = cpu;\n\n this.cpu.load = load;\n\n console.log('load average', (os.loadavg()[0] / 8 * 100) + load);\n\n this.broadcast('cpu load', (os.loadavg()[0] / 8 * 100) + load);\n\n setTimeout(this.poll.bind(this), 2500);\n }\n catch ( error ) {\n this.emit('error', error);\n }\n },\n error => this.emit('error', error)\n );\n }", "get running() { return data.clock.running; }", "function touchLastRequested(){\n\tlastRequestedMs = new Date().getTime();\n\n\t// if it was not running, we run it\n\tif (!on){\n\t\ton = true;\n\t\tconsole.log(\"os-usage.js - starting top.fetch every \" + (delay/1000) + \"s\");\n\t\ttopFetch();\n\t}\n\n}", "function startBenchmark() {\n while(numberOfRunningInstances != 0){\n workOnTasks();\n setRunningProcessInstances();\n }\n}", "function starttime(){\n \twatch = setInterval(count, 1000)\n time = 10; \n }", "isActive() {\n const { task } = this.props;\n return task.started !== null;\n }", "_ticked() {\n this._tickedLink()\n this._tickedTermPoint()\n this._tickedNode()\n }", "run() {\n this.fillSportListAndTick();\n this.timerID = setInterval(() => {\n this.tick();\n console.log(\"ctr = \"+this.ctr);\n if (this.ctr < (ONE_DAY_IN_MS / LIVE_TICK_INTERVAL)) {\n this.ctr = this.ctr + 1;\n } else {\n this.ctr = 1;\n }\n }, LIVE_TICK_INTERVAL);\n }", "runWorkers () {\n }", "static get concurrency () {\r\n return 1\r\n }", "function TaskLoop() {\n\t\n}", "heartbeat () {\n }", "refresh(){\n this.workers = new Map();\n this.taskQueue = [];\n }", "activateHealthCheckUp() {\n setInterval(() => {\n if (this.master.masterActivated) {\n let totalWorkers = this.master.totWorker();\n let workersOnline = this.master.onlineWorkers();\n\n if (totalWorkers == workersOnline)\n console.log(`Cluster Health: ${chalk.green.bold.italic(this.health[1])}`);\n else if (workersOnline > 0) {\n console.log(`Cluster Health: ${chalk.yellow.bold.italic(this.health[0])}`);\n winston.warn('Cluster health: YELLOW')\n }\n else if (workersOnline == 0) {\n console.log(`Cluster Health: ${chalk.red.bold.italic(this.health[-1])}`);\n winston.error('Cluster health: RED');\n }\n let workerStats = this.master.workerStats()\n winston.info(`Engaged: ${workerStats.engaged} Idle: ${workerStats.idle}`);\n // Log the worker stats\n }\n }, 20000);\n }", "function Waiter() {}", "checkAlive(){\n if (this.lifeTime > 1000){\n this.alive = false;\n this.lifeTime = 0;\n }\n\n }", "function totalInboxThreads()\n{\n var threads = GmailApp.getInboxThreads();\n return threads\n\n}", "static get concurrency () {\n return 1\n }", "static get concurrency () {\n return 1\n }", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "started() {}", "async waitForActiveTaskToFinish() {\n await Promise.race(this.tasks());\n }", "keepAlive() {\n\t\tif (this._next) this._next.ttl = Math.min(this._next.ttl+1, BlackoutContext.STARTING_TTL-1);\n\t\tthis.ttl = Math.max(this.ttl, 2);\n\t}", "forkWorkers() {\n for (var i = 0; i < this.numWorkers; i++) {\n this.requestNewWorker()\n }\n }", "function resetActive(){\n clearTimeout(activityTimeout);\n activityTimeout = setTimeout(inActive, timeoutTime);\n}", "function regularActivityMonitor() {\n service.user.active = true;\n service.user.action = Date.now();\n\n publish(EVENT_ACTIVITY);\n\n if (service.user.warning) {\n service.user.warning = false;\n publish(EVENT_KEEPALIVE);\n }\n }", "function next() {\n\t\tactiveThreads--;\n\t\tif (tasks && tasks.length > 0) {\n\t\t\ttasks.shift()();\n\t\t}\n\t}", "function keepAliveUntilFinished() {\n setTimeout(keepAliveUntilFinished, 10000)\n}", "boot() {\n log.info('Ready called in uptime');\n setInterval(count, 60000);\n }", "function numWorkers() { return Object.keys(cluster.workers).length; }", "function countActiveJobs () {\r\n return state.jobs.reduce((count, job) => {\r\n if (job.state === 'active') {\r\n count++;\r\n }\r\n return count;\r\n }, 0);\r\n}", "runToComplete() {\n // Clock tick\n this.clock++;\n // Update the actual browser (Jobs Table, \"CPU\" section, \"Ready Queue\" section, \"Average\" section, and Gantt Chart)\n this.updater.update_table();\n this.updater.update_page();\n\n // Run all the CPUs on clock tick\n for (var i = 0; i < this.cpus.length; i++) {\n var cpu = this.cpus[i];\n switch (this.schedulerAlgo) {\n case \"FCFS\":\n cpu.runFCFS();\n break;\n case \"SJF\":\n cpu.runSJF();\n break;\n case \"SRTF\":\n cpu.runSRTF();\n break;\n case \"RR\":\n cpu.runRR();\n break;\n case \"PNP\":\n cpu.runPNP();\n break;\n case \"PP\":\n cpu.runPP();\n break;\n default:\n // Default is FCFS\n cpu.runFCFS();\n }\n }\n\n if (!this.ended) {\n this.runToComplete();\n }\n }", "getNumberOfProcesses() {\n\t return tslib_es6.__awaiter(this, void 0, void 0, function* () {\n\t const result = yield this.rawQuery({\n\t sqlQuery: 'select count(distinct(upid)) from thread;',\n\t });\n\t return +result.columns[0].longValues[0];\n\t });\n\t }", "function activate() {\n \n console.log('start the process each time');\n\n slyders = document.getElementsByClassName(\"slider\");\n\n console.log('did we get ' + slyders);\n\n for (let screens of slyders) {\n \n // check\n console.log(counts);\n\n // wait to do the thing between each slide\n // this might be messy with a zero first?\n // this doesnt hold up everything it just doesnt do this until\n let wait;\n wait = setTimeout(adder, (counts + 2000) + 2000);\n\n function adder() {\n // console.log(counts);\n screens.classList.add('here');\n }\n\n console.log('count em up ' + counts);\n counts++;\n }\n }", "function worker() {\n // deleting obsolete data\n executed = executed.filter(obj => obj.executedAt + 1000 > Date.now());\n\n // running available requests\n for (let q in queue) {\n // max 2 request in 1 sec. for one client\n if (queue.hasOwnProperty(q) && executed.filter(obj => obj.client === queue[q].client).length < 2) {\n // remember for control API restrictions\n executed.push({\n client: queue[q].client,\n executedAt: Date.now(),\n });\n // execute request\n queue[q].callback();\n // exclude repeated request\n queue[q] = null;\n }\n }\n\n // clear queue\n queue = queue.filter(obj => obj);\n setTimeout(worker, 300);\n}", "function heartbeat(){\n this.isAlive = true;\n}", "initiate(url){\n console.log(`\\nKicking off with base url ${url} \\n`);\n \n //create workers\n for(let i=0; i<maxConcurrent; i++){\n let worker = new Worker();\n this.workers.set(worker, IDLE);\n }\n\n //start distributing\n this.pushToTaskQueue([url]);\n this.distribute();\n }", "function computeActiveContexts() {\n var ctxs = [];\n for (var p in databag) {\n ctxs = ctxs.concat(Object.keys(databag[p]));\n }\n activeContexts = ctxs.reduce(function(a, b) {\n if (a.indexOf(b) === -1) {\n a.push(b);\n }\n return a;\n }, []);\n }", "doCallbackAndEnableBackgroundPinging() {\n this._beSatisfiedWith = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._counter = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._suitableNodeFound = true;\n this._pingInBackGround = true;\n }", "sendHeartbeats() {\n // Send heartbeats to idle workers if it's time\n if ((new Date()).getTime() >= this.heartbeatAt) {\n this.waiting.forEach((worker) => {\n this.sendToWorker(worker, MDP.W_HEARTBEAT, null, null);\n })\n this.heartbeatAt = (new Date()).getTime() + HEARTBEAT_INTERVAL;\n }\n }", "function checkActivity() {\n refreshListeners();\n console.log('checking activity. activity status is: ', activity);\n if (activity === false) {\n activity = true;\n setTimeout(function () {\n console.log('end of 5 min timer. setting activity to false to refresh timer');\n activity = false;\n checkActivity();\n }, 300000);\n console.log('activity set to: ', activity, '. timeout to check activity in 5 mins set.');\n }\n\n}", "isInactive() {\n return this.workStatus == 0;\n }", "runningTasks() {\n return this.tasks.filter((task) => task.lastStatus === 'RUNNING');\n }", "get is_idle() {\n\t\treturn this.req_queue.length == 0 && Object.keys(this.req_map).length == 0;\n\t}", "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 heartbeat () { this.isAlive = true }", "function eachActiveConnection(fn) {\n var actives = $('.active');\n var checkedIds = {};\n actives.each(function() {\n var peerId = $(this).attr('id');\n if (!checkedIds[peerId]) {\n var conns = peer.connections[peerId];\n for (var i = 0, ii = conns.length; i < ii; i += 1) {\n var conn = conns[i];\n fn(conn, $(this));\n }\n }\n checkedIds[peerId] = 1;\n });\n }", "enableBackgroundPinging() {\n this._beSatisfiedWith = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._counter = {\n instant: 0,\n low: 0,\n medium: 0\n };\n this._suitableNodeFound = false;\n this._pingInBackGround = true;\n }", "idle() {\n return (0, _waitFor.default)(() => this.length === 0, {\n timeout: 2 * 60 * 1000 // 2 minutes\n\n });\n }", "startCountUp() {\n this.intervalHandle = setInterval(this.tick, 1000);\n this.setState({\n startedDate:new Date(),\n });\n }", "function eachActiveConnection(fn) {\n var actives = $('.active');\n var checkedIds = {};\n actives.each(function() {\n var peerId = $(this).attr('id');\n\n if (!checkedIds[peerId]) {\n var conns = peer.connections[peerId];\n for (var i = 0, ii = conns.length; i < ii; i += 1) {\n var conn = conns[i];\n fn(conn, $(this));\n }\n }\n\n checkedIds[peerId] = 1;\n });\n }", "function mainLoop()\r\n{\r\n\tvar startTime = performance.now();\r\n}", "start() {\n if (this._timeout) return;\n if (this.interval < 0) this.interval = 5 * 60 * 1000;\n\n const self = this;\n function endless() {\n self.check().then(() => {\n if (self._timeout) self._timeout = setTimeout(endless, self.interval);\n });\n }\n this._timeout = setTimeout(endless, this.interval);\n }", "function slowloop() {\n // Build the minimap\n logs.minimap.set();\n readmap = getminimap();\n // Build the leaderboard\n readlb = getleaderboard();\n logs.minimap.mark();\n // Check sockets\n let time = util.time();\n clients.forEach(socket => {\n //if (socket.timeout.check(time)) socket.kick('Kicked for inactivity.');\n if (time - socket.statuslastHeartbeat > c.maxHeartbeatInterval) socket.kick('Lost heartbeat.'); \n });\n }", "is_running() {\n return this._state === 'RUNNING'\n }", "function getTickers(){\n tickers();\n // set interval\n setInterval(tickers, 60000);\n}", "async _run() {\n const jobsCount = TaskQueue.count(this.inMemoryOnly)\n const hasJobs = jobsCount > 0\n const wantedWorkers = Math.min(this._cpus, jobsCount)\n const availableWorkers = this._getAvailableWorkers(wantedWorkers)\n await this._dispatchJobs(availableWorkers)\n }", "function monitor(){\n\t\t\twakeWatch.unbind(wakeEvents, wake).bind(wakeEvents, wake);\n\t\t\tvar myCookie = e2.getCookie('lastActiveWindow');\n\t\t\tif (e2.now() - lastActive > e2.sleepAfter * 60000 ||\n\t\t\t\t(!e2.isChatterlight && myCookie && myCookie != windowId)) zzz('sleep');\n\t\t}", "start() {\n setInterval(() => {\n this.Services.forEach(function(entry)\n {\n entry.GetStatus();\n }); \n }, 10000);\n }", "get STATE_AWAIT() { return 5; }", "async started() {}", "async started() {}", "async started() {}", "async started() {}", "async started() {}", "function getAllActiveNodeInfo() {\n return new Promise(function(resolve, reject) {\n db.all('SELECT * FROM Node WHERE active = 1', function(err, rows) {\n if (err)\n return reject(err)\n resolve(rows)\n })\n })\n}" ]
[ "0.6576497", "0.59847337", "0.58223873", "0.5718862", "0.55958724", "0.5595724", "0.55418223", "0.55237967", "0.5521639", "0.5500782", "0.54795545", "0.54381746", "0.54291314", "0.5426496", "0.54111665", "0.5372322", "0.53668267", "0.5361897", "0.53617936", "0.5358493", "0.5353422", "0.5352365", "0.5343117", "0.5339196", "0.53260154", "0.532247", "0.532247", "0.52988964", "0.52844554", "0.52767396", "0.5261771", "0.52592134", "0.5241292", "0.52411735", "0.52352023", "0.5231648", "0.5227206", "0.52241", "0.5221137", "0.521394", "0.52062917", "0.51951015", "0.51921946", "0.51916546", "0.5174581", "0.5174581", "0.51706105", "0.51706105", "0.51706105", "0.51706105", "0.51706105", "0.51706105", "0.51706105", "0.51706105", "0.51706105", "0.51706105", "0.5164266", "0.5160382", "0.5153384", "0.5150846", "0.51506394", "0.5148908", "0.5144806", "0.51444435", "0.51405215", "0.51358694", "0.51321423", "0.5126213", "0.5120562", "0.511815", "0.5108512", "0.51043916", "0.5096691", "0.509129", "0.5089027", "0.50885254", "0.50884575", "0.5088259", "0.5085407", "0.5085012", "0.50822717", "0.508056", "0.50757587", "0.5074423", "0.50743437", "0.5066557", "0.5064043", "0.5062574", "0.5059622", "0.5052589", "0.50517935", "0.5047676", "0.50473344", "0.50383925", "0.5035442", "0.50317633", "0.50317633", "0.50317633", "0.50317633", "0.50317633", "0.5029374" ]
0.0
-1
Bytes throughput Over Time
function refreshBytesThroughputOverTime(fixTimestamps) { var infos = bytesThroughputOverTimeInfos; prepareSeries(infos.data); if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotBytesThroughputOverTime"))){ infos.createGraph(); }else{ var choiceContainer = $("#choicesBytesThroughputOverTime"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotBytesThroughputOverTime", "#overviewBytesThroughputOverTime"); $('#footerBytesThroughputOverTime .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _calculateDownloadTime(sizeInBytes) {\n return Math$floor(sizeInBytes / _throughput); \n }", "_measureSpeed() {\n\t\tif(!this._socket) return;\n\t\tif(!this._connected) {\n\t\t\tthis._upspeed = 0;\n\t\t\tthis._downspeed = 0;\n\t\t}\n\t\tconst dt = new Date();\n\t\tconst dtime = (dt - this._measuretime) / 1000;\n\t\tif(dtime < 0.11) return;\n\t\tconst bup = this._socket.bytesWritten - this._bytesOut;\n\t\tconst bdown = this._socket.bytesRead - this._bytesIn;\n\n\t\tthis._upspeed = ~~((this._upspeed + (bup / dtime)) / 2);\n\t\tthis._downspeed = ~~((this._downspeed + (bdown / dtime)) / 2);\n\t\tif(this._upspeed < 1) this._upspeed = 0;\n\t\tif(this._downspeed < 1) this._downspeed = 0;\n\t\tthis._bytesOut = this._socket.bytesWritten;\n\t\tthis._bytesIn = this._socket.bytesRead;\n\t\tthis._totalBytesOut += bup;\n\t\tthis._totalBytesIn += bdown;\n\t\tthis._measuretime = dt;\n\n\t\tif(this.opts.lognetstat) {\n\t\t\tconst o = {\n\t\t\t\tupspeed: this._upspeed,\n\t\t\t\tdownspeed: this._downspeed,\n\t\t\t\tout: this._bytesOut,\n\t\t\t\tin: this._bytesIn,\n\t\t\t}\n\t\t\tif(this._upspeed || this._downspeed) console.error(o)\n\t\t}\n\t}", "function kb(bytes) { return bytes / SIZE }", "function MeasureConnectionSpeed() {\n var startTime, endTime;\n var download = new Image();\n download.onload = function () {\n endTime = (new Date()).getTime();\n showResults();\n }\n \n download.onerror = function (err, msg) {\n ShowProgressMessage(\"Invalid image, or error downloading\");\n }\n \n startTime = (new Date()).getTime();\n var cacheBuster = \"?nnn=\" + startTime;\n download.src = imageURL + cacheBuster;\n \n function showResults() {\n var duration = (endTime - startTime) / 1000;\n var bitsLoaded = downloadSize * 8;\n var speedBps = (bitsLoaded / duration).toFixed(5);\n var speedbps = (downloadSize / duration).toFixed(5);\n var speedKbps = (speedBps / 1024).toFixed(5);\n var speedMbps = (speedKbps / 1024).toFixed(5);\n ShowProgressMessage([\n \"Your connection speed is:\", \n speedBps + \" bps\", \n speedbps+ \" Bps\", \n speedKbps + \" kbps\", \n speedMbps + \" Mbps\"\n ]);\n }\n getip();\n DBtest();\n}", "getReqPerTime() {\n let sum_time = 0.0\n let dif = 0.0\n for (let d = 0; d < this.state.data.length; d++) {\n dif = new Date(this.state.data[d].dt_end_log).getTime() - new Date(this.state.data[d].dt_Start_Log).getTime()\n sum_time += dif / 1000\n }\n \n return (sum_time / this.state.data.length)\n }", "function hit(newBytes) {\n totalHits++;\n hits++;\n\n totalBytes += newBytes;\n bytes += newBytes;\n\n var newCost = (COST_PER_HIT + COST_PER_BYTE * newBytes);\n\n totalCost += newCost;\n cost += newCost;\n}", "function totalBytes(results) {\n var result = 0;\n for(var j in results.pageStats) {\n if(j.match(/Bytes/g)) {\n result += Number(results.pageStats[j]); \n }\n }\n return result;\n}", "function cockroachSpeed(s) {\n const cmPerKm = s * 100000\n const secPerHr = 3600\n return Math.floor(cmPerKm / secPerHr)\n}", "function pipeThroughput(length) {\n if (length.equal(zero)) {\n // A length of zero represents a solid line of pumps.\n return RationalFromFloat(12000);\n } if (length.less(RationalFromFloat(198))) {\n const numerator = RationalFromFloat(50)\n .mul(length)\n .add(RationalFromFloat(150));\n const denominator = RationalFromFloat(3).mul(length).sub(one);\n return numerator.div(denominator).mul(RationalFromFloat(60));\n }\n return RationalFromFloat(60 * 4000).div(RationalFromFloat(39).add(length));\n}", "function LowLatencyThroughputModel() {\n var LLTM_MAX_MEASUREMENTS = 10; // factor (<1) is used to reduce the real needed download time when at very bleeding live edge\n\n var LLTM_SEMI_OPTIMISTIC_ESTIMATE_FACTOR = 0.8;\n var LLTM_OPTIMISTIC_ESTIMATE_FACTOR = 0.6;\n var LLTM_SLOW_SEGMENT_DOWNLOAD_TOLERANCE = 1.05;\n var LLTM_MAX_DELAY_MS = 250;\n var context = this.context;\n var instance;\n var logger;\n var measurements = {};\n\n function setup() {\n logger = Object(_core_Debug__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(context).getInstance().getLogger(instance);\n }\n /**\n * Linear regression with least squares method to get a trend function for buffer lavel at chunk receive timestamps\n * @param {*} chunkMeasurements\n * @returns linear trend function\n */\n\n\n function createBufferLevelTrendFunction(chunkMeasurements) {\n var result = {};\n var sumX = 0;\n var sumY = 0;\n var sumXY = 0;\n var sumXSq = 0;\n var N = chunkMeasurements.length;\n\n for (var i = 0; i < N; ++i) {\n sumX += chunkMeasurements[i].chunkDownloadTimeRelativeMS;\n sumY += chunkMeasurements[i].bufferLevel;\n sumXY += chunkMeasurements[i].chunkDownloadTimeRelativeMS * chunkMeasurements[i].bufferLevel;\n sumXSq += chunkMeasurements[i].chunkDownloadTimeRelativeMS * chunkMeasurements[i].chunkDownloadTimeRelativeMS;\n }\n\n result.m = (sumXY - sumX * sumY / N) / (sumXSq - sumX * sumX / N);\n result.b = sumY / N - result.m * sumX / N;\n return function (x) {\n return result.m * x + result.b;\n };\n }\n\n function isBufferSafeAndStable(lastMeasurements) {\n var isBufferSafeAndStable = true;\n var lastBitrate;\n var aveBufferLevelLastSegements = lastMeasurements.reduce(function (prev, curr) {\n return prev + curr.bufferLevelAtSegmentEnd;\n }, 0) / lastMeasurements.length;\n lastMeasurements.forEach(function (m) {\n // inner segment buffer stability\n if (Math.abs(m.bufferLevelAtSegmentEnd / m.bufferLevelAtSegmentStart) < 0.95) {\n isBufferSafeAndStable = false;\n } // inter segment buffer stability\n\n\n if (m.bufferLevelAtSegmentEnd / aveBufferLevelLastSegements < 0.8) {\n isBufferSafeAndStable = false;\n } // representation bitrate remained at least constant\n\n\n if (!lastBitrate) {\n lastBitrate = m.bitrate;\n } else if (lastBitrate > m.bitrate) {\n isBufferSafeAndStable = false;\n }\n });\n return isBufferSafeAndStable;\n }\n /**\n * Based on the MPD, timing and buffer information of the last recent segments and their chunks\n * the most stable download time (in milliseconds) is calculated.\n * @param {*} request HTTPLoader request object\n * @returns download time in milliseconds of last fetched segment\n */\n\n\n function getEstimatedDownloadDurationMS(request) {\n var lastMeasurement = measurements[request.mediaType].slice(-1).pop();\n var lastThreeMeasurements = measurements[request.mediaType].slice(-3); // calculate and remember the buffer level trend during the last fetched segment\n\n var lastChunkRelativeTimeMS = lastMeasurement.chunkMeasurements.slice(-1).pop().chunkDownloadTimeRelativeMS;\n lastMeasurement.bufferLevelAtSegmentStart = lastMeasurement.getEstimatedBufferLevel(lastChunkRelativeTimeMS / 2);\n lastMeasurement.bufferLevelAtSegmentEnd = lastMeasurement.getEstimatedBufferLevel(lastChunkRelativeTimeMS);\n var isBufferStable = isBufferSafeAndStable(lastThreeMeasurements);\n var selectedOptimisticFactor = isBufferStable ? LLTM_OPTIMISTIC_ESTIMATE_FACTOR : LLTM_SEMI_OPTIMISTIC_ESTIMATE_FACTOR; // fetch duration was longer than segment duration, but buffer was stable\n\n if (lastMeasurement.isBufferStable && lastMeasurement.segDurationMS * LLTM_SLOW_SEGMENT_DOWNLOAD_TOLERANCE < lastMeasurement.fetchDownloadDurationMS) {\n return lastMeasurement.fetchDownloadDurationMS;\n } // buffer is drying or fetch took too long\n\n\n if (!isBufferStable || lastMeasurement.segDurationMS < lastMeasurement.fetchDownloadDurationMS) {\n return lastMeasurement.fetchDownloadDurationMS * LLTM_SEMI_OPTIMISTIC_ESTIMATE_FACTOR;\n } // did we requested a fully available segment? -> most accurate throughput calculation\n // we use adjusted availability start time to decide\n // Note: this \"download mode\" usually happens at startup and if requests are delayed artificially\n\n\n if (lastMeasurement.adjustedAvailabilityStartTimeMS <= lastMeasurement.requestTimeMS + lastMeasurement.throughputCapacityDelayMS - lastMeasurement.segDurationMS) {\n return lastMeasurement.fetchDownloadDurationMS * LLTM_SEMI_OPTIMISTIC_ESTIMATE_FACTOR;\n } // get all chunks that have been downloaded before fetch reached bleeding live edge\n // the remaining chunks loaded at production rate we will approximated\n\n\n var chunkAvailablePeriod = lastMeasurement.requestTimeMS + lastMeasurement.throughputCapacityDelayMS - lastMeasurement.adjustedAvailabilityStartTimeMS;\n var chunkBytesBBLE = 0; // BBLE -> Before bleeding live edge\n\n var chunkDownloadtimeMSBBLE = 0;\n var chunkCount = 0;\n\n for (var index = 0; index < lastMeasurement.chunkMeasurements.length; index++) {\n var chunk = lastMeasurement.chunkMeasurements[index];\n\n if (chunkAvailablePeriod < chunkDownloadtimeMSBBLE + chunk.chunkDownloadDurationMS) {\n break;\n }\n\n chunkDownloadtimeMSBBLE += chunk.chunkDownloadDurationMS;\n chunkBytesBBLE += chunk.chunkBytes;\n chunkCount++;\n }\n\n if (chunkAvailablePeriod < 0) {\n logger.warn('request time was before adjusted availibitly start time');\n } // there have to be some chunks available (20% of max count)\n // otherwise we are at bleeding live edge and the few chunks are insufficient to estimate correctly\n\n\n if (chunkBytesBBLE && chunkDownloadtimeMSBBLE && chunkCount > lastMeasurement.chunkMeasurements.length * 0.2) {\n var downloadThroughput = chunkBytesBBLE / chunkDownloadtimeMSBBLE; // bytes per millesecond\n\n var estimatedDownloadtimeMS = lastMeasurement.segmentBytes / downloadThroughput; // if real download was shorter then report this incl. semi optimistical estimate factor\n\n if (lastMeasurement.fetchDownloadDurationMS < estimatedDownloadtimeMS) {\n return lastMeasurement.fetchDownloadDurationMS * selectedOptimisticFactor;\n }\n\n return estimatedDownloadtimeMS * selectedOptimisticFactor;\n } // when we are to tight at live edge and it's stable then\n // we start to optimistically estimate download time\n // in such a way that a switch to next rep will be possible\n // optimistical estimate: assume download was fast enough for next higher rendition\n\n\n var nextHigherBitrate = lastMeasurement.bitrate;\n lastMeasurement.bitrateList.some(function (b) {\n if (b.bandwidth > lastMeasurement.bitrate) {\n nextHigherBitrate = b.bandwidth;\n return true;\n }\n }); // already highest bitrate?\n\n if (nextHigherBitrate === lastMeasurement.bitrate) {\n return lastMeasurement.fetchDownloadDurationMS * selectedOptimisticFactor;\n }\n\n return selectedOptimisticFactor * lastMeasurement.segmentBytes * 8 * 1000 / nextHigherBitrate;\n }\n /**\n * Get calculated value for a safe artificial delay of the next request to allow to accumulate some chunks.\n * This allows better line throughput measurement.\n * @param {*} request\n * @param {*} currentBufferLevel current buffer level in milliseconds\n * @returns delay in milliseconds\n */\n\n\n function getThroughputCapacityDelayMS(request, currentBufferLevelMS) {\n var lastThreeMeasurements = measurements[request.mediaType] && measurements[request.mediaType].slice(-3);\n\n if (!lastThreeMeasurements || lastThreeMeasurements.length < 3) {\n return 0;\n } // in case not stable buffer, no artificially delay for the next request\n\n\n if (!isBufferSafeAndStable(lastThreeMeasurements)) {\n return 0;\n } // allowed artificial delay is the min of quater of buffer level in milliseconds and LLTM_MAX_DELAY_MS\n\n\n return currentBufferLevelMS / 4 > LLTM_MAX_DELAY_MS ? LLTM_MAX_DELAY_MS : currentBufferLevelMS / 4;\n }\n /**\n * Add some measurement data for bookkeeping and being able to derive decisions on estimated throughput.\n * @param {*} request HTTPLoader object to get MPD and media info from\n * @param {*} fetchDownloadDurationMS Duration how long the fetch actually took\n * @param {*} chunkMeasurements Array containing chunk timings and buffer levels\n * @param {*} requestTimeMS Timestamp at which the fetch was initiated\n * @param {*} throughputCapacityDelayMS An artificial delay that was used for this request\n */\n\n\n function addMeasurement(request, fetchDownloadDurationMS, chunkMeasurements, requestTimeMS, throughputCapacityDelayMS) {\n if (request && request.mediaType && !measurements[request.mediaType]) {\n measurements[request.mediaType] = [];\n }\n\n var bitrateEntry = request.mediaInfo.bitrateList.find(function (item) {\n return item.id === request.representationId;\n });\n measurements[request.mediaType].push({\n index: request.index,\n repId: request.representationId,\n mediaType: request.mediaType,\n requestTimeMS: requestTimeMS,\n adjustedAvailabilityStartTimeMS: request.availabilityStartTime.getTime(),\n segDurationMS: request.duration * 1000,\n chunksDurationMS: chunkMeasurements.reduce(function (prev, curr) {\n return prev + curr.chunkDownloadDurationMS;\n }, 0),\n segmentBytes: chunkMeasurements.reduce(function (prev, curr) {\n return prev + curr.chunkBytes;\n }, 0),\n bitrate: bitrateEntry && bitrateEntry.bandwidth,\n bitrateList: request.mediaInfo.bitrateList,\n chunkMeasurements: chunkMeasurements,\n fetchDownloadDurationMS: fetchDownloadDurationMS,\n throughputCapacityDelayMS: throughputCapacityDelayMS,\n getEstimatedBufferLevel: createBufferLevelTrendFunction(chunkMeasurements.slice(1)) // don't use first chunk's buffer level\n\n }); // maintain only a maximum amount of most recent measurements\n\n if (measurements[request.mediaType].length > LLTM_MAX_MEASUREMENTS) {\n measurements[request.mediaType].shift();\n }\n }\n\n instance = {\n setup: setup,\n addMeasurement: addMeasurement,\n getThroughputCapacityDelayMS: getThroughputCapacityDelayMS,\n getEstimatedDownloadDurationMS: getEstimatedDownloadDurationMS\n };\n setup();\n return instance;\n}", "function kb(bytes) {\n return bytes / SIZE;\n}", "async function checkPerformance() {\r\n var latestBlock = await web3.eth.getBlockNumber();\r\n var block = await web3.eth.getBlock(latestBlock, true);\r\n if (block.transactions != null) {\r\n var minedTxTime = new Date().getTime();\r\n block.transactions.forEach(async function (tx) {\r\n try{\r\n var input = web3.utils.hexToUtf8(tx.input).split(\" \")[0]\r\n var writtenTxTime = parseInt(input)/100 //divide by 100 to get rid of extra 0s\r\n var latency = minedTxTime - writtenTxTime;\r\n fs.appendFileSync('./data/performance.txt', (latency.toString() + \"\\n\"), (err) => { //synchronously writes to ./data/performance.txt\r\n if (err) {return console.log(err);}\r\n });\r\n } catch (error) {\r\n console.log(\"Tx input not correctly formatted\");\r\n }\r\n }) \r\n }\r\n}", "get throttleRate() {\n const { canary, binaryType, assert, referrer, expected } = this.opts;\n let throttleRate = 1;\n\n // Throttle errors from Stable.\n if (!canary && !['control', 'rc', 'nightly'].includes(binaryType)) {\n throttleRate /= 10;\n }\n\n // Throttle user errors.\n if (assert) {\n throttleRate /= 10;\n }\n\n // Throttle errors on origin pages; they may not be valid AMP docs.\n if (!CDN_REGEX.test(referrer)) {\n throttleRate /= 20;\n }\n\n if (expected) {\n throttleRate /= 10;\n }\n\n return throttleRate;\n }", "function cockroachSpeed(s) {\n //cm in 1 km / secs in 1 hr;\n return s * Math.floor((100000 / 3600));\n}", "async function doTest(url, writeStream) {\n const results = await runLighthouse(url);\n const rawData = results.lhr;\n const userTimings = rawData.audits['user-timings']['details'];\n\n const logs = results.artifacts['devtoolsLogs']['defaultPass'];\n const harResult = await chromeHarCapturer.fromLog(url, logs);\n const harEntries = harResult['log']['entries'];\n\n let totaltransfersize = 0;\n let transfersizes = [];\n let times = [];\n for (entry in harEntries) {\n let time = 0;\n const request = harEntries[entry];\n const response = request['response'];\n const transfersize = response['_transferSize'];\n\n const timings = request['timings'];\n\n // add up all the timing components to get the request time\n for (key in request['timings']) {\n // null values are -1, we do not want those\n if (timings[key] >= 0) {\n time += timings[key];\n }\n }\n\n times.push(time);\n totaltransfersize += transfersize;\n transfersizes.push(transfersize);\n }\n\n const metrics = [\n rawData.audits['first-contentful-paint'].numericValue,\n rawData.audits['first-meaningful-paint'].numericValue,\n rawData.audits['speed-index'].numericValue,\n rawData.audits['total-blocking-time'].numericValue,\n rawData.audits['estimated-input-latency'].numericValue,\n rawData.audits['time-to-first-byte'].numericValue,\n rawData.audits['first-cpu-idle'].numericValue,\n rawData.audits['interactive'].numericValue,\n rawData.audits['network-rtt'].numericValue,\n rawData.audits['network-requests'].numericValue,\n rawData.audits['dom-size'].numericValue,\n totaltransfersize,\n avg(transfersizes),\n median(transfersizes),\n percentile(90, transfersizes),\n percentile(95, transfersizes),\n percentile(99, transfersizes),\n avg(times),\n median(times),\n percentile(90, times),\n percentile(95, times),\n percentile(99, times),\n times.length,\n getLowestTimeToWidget(userTimings),\n getMedianTimeToWidget(userTimings),\n ];\n\n let line = metrics.join(',');\n line += '\\n';\n\n writeStream.write(line);\n}", "function _getMaxCushionSizeInMilliseconds() {\n var maxCushionSize = _maxBufferSizeMilliseconds * _maxCushionSizeInBufferPercentage/100 - _reservoirSizeMilliseconds - _outageProtectionMilliseconds;\n return maxCushionSize;\n }", "function Fib(stream) {\n var previous = 0, current = 1;\n for (var i = 0; i < stream.request.limit; i++) {\n stream.write({\n num: current\n });\n var temp = current;\n current += previous;\n previous = temp;\n }\n stream.end();\n}", "componentDidUpdate() {\n Perf.stop()\n Perf.printInclusive()\n Perf.printWasted()\n }", "function totalBytes(results) {\n var total = 0;\n var stats = results.pageStats;\n for (var item in stats) {\n if (item.indexOf(\"Bytes\") !== -1) {\n total = total + parseInt(stats[item],10);\n }\n }\n return total;\n}", "function Bsize(bytes, decimals=0) {\n for(var i=0, d=1; i < decimals; i++) { d *= 10; }\n if (bytes >= PB) return Math.round(d*bytes/PB)/d+' PB'\n else if (bytes >= TB) return Math.round(d*bytes/TB)/d+' TB'\n else if (bytes >= GB) return Math.round(d*bytes/GB)/d+' GB'\n else if (bytes >= MB) return Math.round(d*bytes/MB)/d+' MB'\n else if (bytes >= KB) return Math.round(d*bytes/KB)/d+' KB'\n else return bytes+' bytes';\n}", "metricProcessedBytes(props) {\n try {\n jsiiDeprecationWarnings.print(\"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer#metricProcessedBytes\", \"Use ``ApplicationLoadBalancer.metrics.processedBytes`` instead\");\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_MetricOptions(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.metricProcessedBytes);\n }\n throw error;\n }\n return this.metrics.processedBytes(props);\n }", "function recordSegmentDownloadRate() {\r\n\ttotalEndTime = performance.now();\r\n\tvar totalTime = totalEndTime - totalStartTime;\r\n\tdocument.getElementById(\"result\").events_textarea.value += \"TotalTime:\" + totalTime + \"\\n\";\r\n}", "async function getNetworkDownloadSpeed()\n{\n const baseUrl = \"https://pruebasbotanax.000webhostapp.com/videos/13-138039_4k-ultra-hd-dragon.jpg\";\n const fileSizeInBytes = 50000000;\n\n downloadSPeed = await testNetworkSpeed.checkDownloadSpeed(baseUrl, fileSizeInBytes);\n\n console.log(\"Velocidad de bajada: \", downloadSPeed[\"mbps\"] + \" Mbps\");\n}", "function sendStats() {\n push('stats', {\n hits: hits,\n totalHits: totalHits,\n bytes: bytes,\n totalBytes: totalBytes,\n cost: cost,\n totalCost: totalCost,\n period: STATS_PERIOD,\n uptime: +(new Date) - startTime\n });\n\n hits = 0;\n bytes = 0;\n cost = 0;\n}", "startCalcSpeed () {\n // calc rest time of backup\n this.lastTenData.length = 0\n this.startTime = new Date().getTime()\n let restTime = -1\n let lastRestTime = -1\n let beforeLastRestTime = -1\n clearInterval(this.timer)\n this.timer = setInterval(() => {\n const data = this.summary()\n this.lastTenData.unshift(data)\n\n // keep 10 data\n if (this.lastTenData.length > 10) this.lastTenData.length = 10\n\n const length = this.lastTenData.length\n // start calc restTime\n if (length > 1) {\n const deltaSize = this.lastTenData[0].transferSize - this.lastTenData[length - 1].transferSize\n const restTimeBySize = (data.size - data.completeSize) / deltaSize * (length - 1)\n\n const deltaCount = this.lastTenData[0].finishCount - this.lastTenData[length - 1].finishCount\n const restTimeByCount = (data.count - data.finishCount) / deltaCount * (length - 1)\n\n const usedTime = (new Date().getTime() - this.startTime) / 1000\n const restTimeByAllSize = (data.size - data.completeSize) * usedTime / data.transferSize\n const restTimeByAllCount = data.count * usedTime / data.finishCount - usedTime\n\n /* combine of restime by different method */\n restTime = Math.max(Math.min(restTimeBySize, restTimeByCount), Math.min(restTimeByAllSize, restTimeByAllCount))\n\n /* only use restTimeBySize */\n restTime = restTimeBySize\n // max restTime: 30 days\n restTime = Math.min(restTime, 2592000)\n /* average of the last 3 restTime */\n if (lastRestTime < 0 || beforeLastRestTime < 0) {\n lastRestTime = restTime\n beforeLastRestTime = restTime\n }\n restTime = (beforeLastRestTime + lastRestTime + restTime) / 3\n\n beforeLastRestTime = lastRestTime\n lastRestTime = restTime\n }\n\n const ltd = this.lastTenData\n const speed = ltd.length > 1 ? (ltd[0].transferSize - ltd[ltd.length - 1].transferSize) / ltd.length - 1 : 0\n\n const bProgress = data.count ? `${data.finishCount || 0}/${data.count}` : '--/--'\n\n const args = { speed, restTime: getLocaleRestTime(restTime), bProgress, ...data }\n webContents.getAllWebContents().forEach(contents => contents.send('BACKUP_MSG', args))\n }, 1000)\n }", "loadFactor() {\n return this.elements / this.capacity;\n }", "loadFactor() {\n return this.elements / this.capacity;\n }", "timeTaken(){\n var resultTime = this._endTime - this._startTime; \n var diff = Math.ceil(resultTime / 1000); \n this._timeTaken = diff;\n return diff ;\n }", "function sample_size() {\n return 5000\n}", "function totalBytes(results) {\n var total = 0;\n var pageStats = results.pageStats;\n for(var key in pageStats) {\n if(key.endsWith('Bytes')) {\n total += parseInt(pageStats[key], 10);\n }\n }\n return total;\n}", "function bytesUsedPerSecond(point, config) {\n if (!canCalculateRate(point, config)) {\n return null;\n }\n\n var seconds = (point.end - point.start) / 1000;\n if (seconds === 0) {\n return null;\n }\n\n var bytesUsed = point.max - point.min;\n return bytesUsed / seconds;\n }", "function _getMaxCushionSizeInMilliseconds(map) {\n var _bbconfig = config.bufferBased,\n reservoirSizeMilliseconds = map.reservoir,\n outageProtectionMilliseconds = map.outage,\n maxCushionSize = _bbconfig.maxBufferSizeMilliseconds * _bbconfig.maxCushionSizeInBufferPercentage/100 - reservoirSizeMilliseconds - outageProtectionMilliseconds;\n return maxCushionSize;\n}", "function msForBytesOfBitrate(bytes, bitrateKbps) {\n return Math.floor((bytes / (bitrateKbps * (1000 / 8)) * 1000));\n}", "async function getNetworkDownloadSpeed()\n{\n const baseUrl = 'https://pruebasbotanax.000webhostapp.com/videos/13-138039_4k-ultra-hd-dragon.jpg';\n const fileSizeInBytes = 50000000;\n\n const downloadSPeed = await testNetworkSpeed.checkDownloadSpeed(baseUrl, fileSizeInBytes);\n\n console.log(downloadSPeed);\n}", "function cockroachSpeed(s) {\n const secsInHour = 3600;\n const centimetersInKilometers = 100000;\n\n return Math.floor((s*centimetersInKilometers)/secsInHour);\n}", "function spendSomeTime() {\n let total = 0;\n for (let i = 0; i < 10000; i++) {\n total += i;\n }\n}", "function MediaBuffer$_getBufferBytes(time, chunks) {\n var chunk = chunks.getForTime(time);\n var byteCount = 0;\n if (chunk && chunk.media) {\n // interpolate first chunk (this is how logging spec wants it)\n byteCount += Math$floor(Number$clamp((chunk.endTime - time) / chunk.duration, 0, 1) * chunk.media.length);\n chunk = chunk.next;\n }\n while (chunk && chunk.media) {\n byteCount += chunk.media.length;\n chunk = chunk.next;\n }\n return byteCount;\n}", "function pipeLength(throughput) {\n throughput = throughput.div(RationalFromFloat(60));\n if (RationalFromFloat(200).less(throughput)) {\n return null;\n } if (RationalFromFloat(100).less(throughput)) {\n return zero;\n } if (pipeThreshold.less(throughput)) {\n const numerator = throughput.add(RationalFromFloat(150));\n const denominator = RationalFromFloat(3)\n .mul(throughput)\n .sub(RationalFromFloat(50));\n return numerator.div(denominator);\n }\n return RationalFromFloat(4000).div(throughput).sub(RationalFromFloat(39));\n}", "async fetchTotalSupply() {\n return Number(200000000);\n }", "get uptime() {\n if (this._state === exports.ClientState.ACTIVE\n && this._currentConnectionStartTime) {\n return Date.now() - this._currentConnectionStartTime;\n }\n else {\n return 0;\n }\n }", "function n(){if(!e.s_loadT){var t=(new Date).getTime(),n=e.performance?performance.timing:0,i=n?n.requestStart:e.inHeadTS||0;s_loadT=i?Math.round((t-i)/100):\"\"}return s_loadT}", "function bytesForMsOfBitrate(ms, bitrateKbps) {\n return Math.ceil((bitrateKbps * (1000 / 8)) * (ms / 1000));\n}", "function bnpChunkSize(r) { return Math.floor(Math.LN2 * this.DB / Math.log(r)); }", "getUsageStats() {\n return `Buffer: ${bytes(this.recentBuffer.length)}, lrErrors: ${this.lrErrors}`;\n }", "async calculateCpuUsage() {\n this.__cpuUsage = await utils.getCpuUsage({ timeout: this.__cpuUsageInterval });\n }", "function _calculateSustainableVideoBitrate(bandwidth, latency) {\n // solve following equasion for videoChunkSize\n // mediaDuration = downloadTime = audioChunkCount * (_latency + audioChunkSize / _bandwidth) + videoChunkCount * (_latency + videoChunkSize / _bandwidth);\n var videoChunkSize = (((_testDuration - _audioChunkCount * (latency + _audioChunkSize / bandwidth)) / _videoChunkCount) - latency) * bandwidth;\n return Math$floor((videoChunkSize / _videoChunkDuration) * BPMStoKBPS);\n }", "function gb(bytes) {\n return mb(bytes) / SIZE;\n}", "function mb(bytes) {\n return kb(bytes) / SIZE;\n}", "function mgBytesToSize(bytes, precision) {\r\tvar sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\r if (bytes == 0) return '0 Bytes';\r var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));\r return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];\r}", "function CurrentGcMilliseconds() {\r\n}", "outputBytes(b, count) {\n if (this.buf != null) {\n p = this.bufPos;\n for (let i = 0; i < count; i++) {\n this.buf[p++] = parseFloat(b / 255);\n }\n }\n this.bufPos += count;\n }", "function calc_size(bsize) {\n\n var defs = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];\n var counter = 0;\n\n while(bsize > 1024) {\n bsize /= 1024;\n counter++;\n }\n\n console.log((Math.round(bsize * 100) / 100) + defs[counter]);\n\n}", "function detect_latency(tt) {\n\t var adjusted_time = utils.rnow() - TIME_DRIFT;\n\t return adjusted_time - tt / 10000;\n\t }", "function d3_timer_sweep() {\n var t0,\n t1 = d3_timer_queueHead,\n time = Infinity;\n while (t1) {\n if (t1.flush) {\n t1 = t0 ? t0.next = t1.next : d3_timer_queueHead = t1.next;\n } else {\n if (t1.time < time) time = t1.time;\n t1 = (t0 = t1).next;\n }\n }\n d3_timer_queueTail = t0;\n return time;\n}", "function detect_latency(tt) {\n var adjusted_time = rnow() - TIME_DRIFT;\n return adjusted_time - tt / 10000;\n }", "function roundByteSize(bytes){\r\n\t\tvar powers = [6, 3, 0, -3],\r\n\t\t\tsuffixes = [\"MB\", \"KB\", \"B\", \"mB\"],\r\n\t\t\tDECIMAL_PLACES_TO_SHOW = 1;\r\n\t\t\r\n\t\tfor(var i = 0, len = powers.length, lim; i < len; i++){\r\n\t\t\tlim = Math.pow(10, powers[i]);\r\n\t\t\t\r\n\t\t\tif(bytes >= lim)\r\n\t\t\t\treturn (bytes / lim).toFixed(DECIMAL_PLACES_TO_SHOW) + suffixes[i];\r\n\t\t}\r\n\t}", "function sumWebWorker() {\n worker.addEventListener('message', function (e) {\n var t1 = performance.now();\n document.getElementById(\"result-webWorker\").innerHTML = t1 - t0 + \"ms (result=\" + e.data + \")\";\n }, false);\n var t0 = performance.now();\n worker.postMessage({count: count});\n}", "addLoadingTime(time) {\n this.loadTimes.push(time.totalMilliseconds);\n if (this.loadTimes.length > 100) {\n this.loadTimes.pop();\n }\n let sum = 0;\n this.loadTimes.forEach((t) => sum += t);\n this.nextLoadTimePrediction = Math.round(sum / this.loadTimes.length);\n // log(sprintf(\"New Time: %s \\t Next Prediction: %s\", time.totalMilliseconds, this.nextLoadTimePrediction));\n }", "function formatSpeed(bits) {\n var sizes = ['b/s', 'kb/s', 'Mb/s', 'Gb/s', 'Tb/s']\n if (bits === 0) {\n return '0 b/s'\n }\n var i = parseInt(Math.floor(Math.log(bits) / Math.log(1024)), 10)\n return Math.round(bits / Math.pow(1024, i), 2) + ' ' + sizes[i]\n}", "function bnpChunkSize(r)\n{\n return Math.floor(Math.LN2 * this.DB / Math.log(r));\n}", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }", "function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }" ]
[ "0.6508586", "0.6091145", "0.5925868", "0.591433", "0.5827529", "0.5751863", "0.57444245", "0.57324314", "0.56583023", "0.56513727", "0.5635747", "0.5610187", "0.56025785", "0.5594923", "0.55727565", "0.5547173", "0.5543636", "0.55419546", "0.5533669", "0.5532342", "0.5529149", "0.55269057", "0.55246603", "0.55154926", "0.5492204", "0.54865706", "0.54865706", "0.5466864", "0.5453923", "0.54424024", "0.54254264", "0.54201776", "0.54062444", "0.53579396", "0.5352728", "0.53428805", "0.53315884", "0.5327259", "0.5306248", "0.52828366", "0.52763975", "0.5262691", "0.52532285", "0.5243501", "0.52365595", "0.5236398", "0.52355343", "0.52350265", "0.5223586", "0.5222276", "0.52199614", "0.52189946", "0.5210245", "0.52078277", "0.52057666", "0.51934", "0.5191537", "0.5185356", "0.5174805", "0.5169109", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647", "0.5159647" ]
0.0
-1
Response Times Over Time
function refreshResponseTimeOverTime(fixTimestamps) { var infos = responseTimesOverTimeInfos; prepareSeries(infos.data); if(infos.data.result.series.length == 0) { setEmptyGraph("#bodyResponseTimeOverTime"); return; } if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotResponseTimesOverTime"))){ infos.createGraph(); }else{ var choiceContainer = $("#choicesResponseTimesOverTime"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotResponseTimesOverTime", "#overviewResponseTimesOverTime"); $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function responseTime (req, res) {\n if (!res._header || !req._startAt) {\n return ''\n }\n\n var tdiff = process.hrtime(req._startAt)\n , ms = tdiff[0] * 1e3 + tdiff[1] * 1e-6\n\n return ms.toFixed(3)\n}", "function getServerTime(request, response) {\r\n\tvar time = new Date();\r\n\t\r\n\tvar result = {success: true, time: time};\r\n\tresponse.json(result); \r\n}", "get timings() {\n var _a;\n return (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.timings;\n }", "function getTimings (eventTimes) {\n return {\n // There is no DNS lookup with IP address\n dnsLookup: eventTimes.dnsLookupAt !== undefined ? getHrTimeDurationInMs(eventTimes.startAt, eventTimes.dnsLookupAt) : undefined,\n tcpConnection: getHrTimeDurationInMs(eventTimes.dnsLookupAt || eventTimes.startAt, eventTimes.tcpConnectionAt),\n tlsHandshake: eventTimes.tlsHandshakeAt !== undefined ? (getHrTimeDurationInMs(eventTimes.tcpConnectionAt, eventTimes.tlsHandshakeAt)) : undefined,\n firstByte: getHrTimeDurationInMs((eventTimes.tlsHandshakeAt || eventTimes.tcpConnectionAt), eventTimes.firstByteAt),\n contentTransfer: getHrTimeDurationInMs(eventTimes.firstByteAt, eventTimes.endAt),\n cachedResponseTime: (eventTimes.cacheLookupAt != undefined && eventTimes.cacheReturnAt != undefined) ? getHrTimeDurationInMs(eventTimes.cacheLookupAt, eventTimes.cacheReturnAt) : undefined,\n total: getHrTimeDurationInMs(eventTimes.startAt, eventTimes.endAt)\n }\n}", "getTime() {\n return new Promise((resolve, reject) => {\n this.doRequest('public', 'Time').then((response) => {\n resolve(response);\n }).catch(error => reject(error));\n });\n }", "age() {\n let age = Math.max(0, (this._responseTime - this.date()) / 1000);\n if (this._resHeaders.age) {\n let ageValue = this._ageValue();\n if (ageValue > age) age = ageValue;\n }\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "function getServerLocalDiffTime(){\n var startRequest = new Date().getTime();\n var config = getHdcontrolObject();\n var endRequest = new Date().getTime();\n var requestTime = parseInt((endRequest -startRequest)/1000);\n\n var diffTime = parseInt(parseInt(buyingTime/1000) - config.stime - requestTime);\n return diffTime;\n }", "get requestTime() {\n return this.get('x-request-time');\n }", "function GetTime()\r\n{\r\n Samples.AspNet.WebService.GetServerTime(\r\n SucceededCallback);\r\n \r\n}", "async getResponseTime() {\n\n const user = this.ctx.params.userId;\n let time = this.ctx.params.day;\n\n // set the duration time\n switch(time.toLowerCase()) {\n case 'week':\n time = 7;\n break;\n case 'month':\n time = 30;\n break;\n case '3month':\n time = 90;\n break;\n default:\n time = 180;\n break;\n }\n\n try {\n let str = `select checkerId, checkerName, count(id)\n from eventTAT\n where now() - interval '$1 d' < to_timestamp(createAt / 1000)\n and type = 2 and duration < 1000 * 60 * $2\n and shopId in (\n select shopId from shopUser\n where userId = $3)\n group by checkerId, checkerName\n order by checkerId`;\n const count1 = await this.app.db.query(str, [time, this.app.config.time.checkerResponseTime[0], user]);\n\n str = `select checkerId, checkerName, count(id)\n from eventTAT\n where now() - interval '$1 d' < to_timestamp(createAt / 1000)\n and type = 2 and duration > 1000 * 60 * $2 and duration < 1000 * 60 * $3\n and shopId in (\n select shopId from shopUser\n where userId = $4)\n group by checkerId, checkerName\n order by checkerId`;\n const count2 = await this.app.db.query(str, [time, this.app.config.time.checkerResponseTime[0], this.app.config.time.checkerResponseTime[1], user]);\n\n str = `select checkerId, checkerName, count(id)\n from eventTAT\n where now() - interval '$1 d' < to_timestamp(createAt / 1000)\n and type = 2 and duration > 1000 * 60 * $2\n and shopId in (\n select shopId from shopUser\n where userId = $3)\n group by checkerId, checkerName\n order by checkerId`;\n const count3 = await this.app.db.query(str, [time, this.app.config.time.checkerResponseTime[2], user]);\n\n const temp = {};\n count1.map(obj => {\n if (!temp[obj.checkerid]) {\n temp[obj.checkerid] = {\n checkerId: obj.checkerid,\n checkerName: obj.checkername,\n count1: +obj.count,\n count2: 0,\n count3: 0,\n }\n }\n });\n\n count2.map(obj => {\n if (!temp[obj.checkerid]) {\n temp[obj.checkerid] = {\n checkerId: obj.checkerid,\n checkerName: obj.checkername,\n count1: 0,\n count2: +obj.count,\n count3: 0\n }\n } else {\n temp[obj.checkerid].count2 = +obj.count;\n }\n });\n\n\n count3.map(obj => {\n if (!temp[obj.checkerid]) {\n temp[obj.checkerid] = {\n checkerId: obj.checkerid,\n checkerName: obj.checkername,\n count1: 0,\n count2: 0,\n count3: +obj.count,\n }\n } else {\n temp[obj[checkerid]].count3 = +obj.count;\n }\n });\n\n this.response(200, Object.values(temp));\n } catch (err) {\n this.response(400, 'get checker response time failed');\n }\n }", "getReqPerTime() {\n let sum_time = 0.0\n let dif = 0.0\n for (let d = 0; d < this.state.data.length; d++) {\n dif = new Date(this.state.data[d].dt_end_log).getTime() - new Date(this.state.data[d].dt_Start_Log).getTime()\n sum_time += dif / 1000\n }\n \n return (sum_time / this.state.data.length)\n }", "setServerTimeDiff(timeUrl) {\n\t\tif(timeUrl == undefined || timeUrl == \"\"){\n\t\t\treturn;\n\t\t}\n\t\tlet parsed = url.parse(timeUrl);\n\t\tconst options = {\n\t\t\thost: parsed.host,\n\t\t\tpath: parsed.path,\n\t\t\ttimeout: 3000\n\t\t};\n\t\tlet str = \"\";\n\t\tconst latencyAdjustment = new Date().getTime();\n\t\thttps.request(options, (res) => {\n\t\t\t//another chunk of data has been received, so append it to `str`\n\t\t\tres.on(\"data\", (chunk) => {\n\t\t\t\tstr += chunk;\n\t\t\t});\n\n\t\t\t//the whole response has been received\n\t\t\tres.on(\"end\", () => {\n\t\t\t\tlet serverTime = JSON.parse(str).time;\n\t\t\t\tthis.serverTimeDiff = new Date(serverTime) - new Date().getTime() - (new Date().getTime() - latencyAdjustment);\n\n\t\t\t\t//console.log(\"ServerTimeDiff \"+this.serverTimeDiff);\n\t\t\t\t//console.log(\"time diff: \"+(new Date().getTime()-latencyAdjustment));\n\t\t\t});\n\n\t\t\tres.on(\"timeout\", () => {\n\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\trequest.abort();\n\t\t\t\tconsole.log(\"Server time could not be set. Timed out\");\n\t\t\t});\n\n\t\t\tres.on(\"error\", () => {\n\t\t\t\tconsole.log(\"Couldn't get time from time server\");\n\t\t\t});\n\t\t}).end();\n\t}", "function timeTaken() {\n let t = -1;\n for (let i = 0; i < result.length; i++) {\n if (result[i].time > t) {\n t = result[i].time;\n }\n }\n\n return t;\n }", "get timeDetails() {\n let now = new Date().getTime();\n return {\n quizTime: this._time,\n start: this._startTime,\n end: this._endTime,\n elapsedTime: ((this._endTime || now) - this._startTime) / 1000, // ms to sec\n remainingTime: secToTimeStr(this._remainingTime),\n timeOver: this[TIME_OVER_SYM]\n }\n }", "metricTargetResponseTime(props) {\n try {\n jsiiDeprecationWarnings.print(\"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer#metricTargetResponseTime\", \"Use ``ApplicationLoadBalancer.metrics.targetResponseTime`` instead\");\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_MetricOptions(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.metricTargetResponseTime);\n }\n throw error;\n }\n return this.metrics.targetResponseTime(props);\n }", "function responce_time(r) {\n\t\t\tvar nextr = e.C + \n\t\t\t\t_.chain(tasks_)\n\t\t\t\t\t// Sum including every task with \n\t\t\t\t\t// less dealine that current task\n\t\t\t\t\t.filter(function(t) {\n\t\t\t\t\t\treturn t.D < e.D;\n\t\t\t\t\t})\n\t\t\t\t\t.map(function(t) {\n\t\t\t\t\t\treturn Math.ceil(r / t.T) * t.C;\n\t\t\t\t\t})\n\t\t\t\t\t.foldl(sum, 0)\n\t\t\t\t\t.value();\n\n\t\t\tif(nextr === r) return r;\n\t\t\treturn arguments.callee(nextr);\n\t\t}", "function getServerTime() {\n return $.ajax({async: false}).getResponseHeader( 'Date' );\n }", "function getServerTime() {\n return $.ajax({async: false}).getResponseHeader( 'Date' );\n }", "function getServerTime() {\n return $.ajax({async: false}).getResponseHeader( 'Date' );\n }", "timeRemaining(reqTimeStamp) {\n let endTime= reqTimeStamp + this.validationWindow;\n let now = parseInt(new Date().getTime()/1000);\n return (endTime - now)\n }", "date() {\n if (this._trustServerDate) {\n return this._serverDate();\n }\n return this._responseTime;\n }", "function print_time() {\n //console.clear();\n console.log(\"local_time : \", Date.now());\n console.log(\"server_time : \", api.get_time());\n console.log(\"delta_time : \", Date.now() - api.get_time());\n console.log(\"\");\n }", "date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }", "date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }", "function respondWithTime(){\n sendMessage(buildBotMessage(new Date().toUTCString()));\n}", "function responseUsed(response) {\n lastUsedResponse = response;\n return robot.brain.set(responseUsageKey(response.stemsString), moment.utc().toISOString());\n }", "async function handleTeeTimesResponse (response, sessionAttributes) {\n if (response.TeeTimes.length <= NO_COURSES) {\n // When there are no courses, you need to broaden your search range\n var noTeeTimesResponse = 'Your Search results did not return any tee times. '\n return new Promise((resolve, reject) => {\n resolve(noTeeTimesResponse)\n })\n } else {\n // Give the user the tee time options\n try {\n let res = await formatTeeTimes(response, sessionAttributes)\n return new Promise((resolve, reject) => {\n resolve(res)\n })\n } catch(err) {\n return new Promise((resolve, reject) => {\n reject(err)\n })\n }\n }\n}", "function timePassed(response)\n{\n $(\"span#date\").text(response.date);\n $(\"span#partyHealth\").text(response.partyHealth);\n livingMembers = response.livingMembers;\n $(\"span#livingMembers\").text(livingMembers);\n\n if (livingMembers <= 0)\n {\n isGameloopDisallowed = true;\n stopGameLoop();\n $(\"div#nextLandmark\").hide();\n $(\"div#partyDied\").show();\n $(\"#rest_div\").hide();\n $(\"#supply_div\").hide();\n }\n}", "get uptime() {\n return new Date().getTime() - this._startTime.getTime();\n }", "overTime(){\n\t\t//\n\t}", "function requestTime() {\n var request = new XMLHttpRequest();\n\n // Ask the server for another copy of ServerDate.js but specify a unique number on the URL querystring\n // so that we don't get the browser cached Javascript file\n // Use HEAD request instead of GET because we don't need file content\n request.open('HEAD', URL + '?noCache=' + Date.now());\n\n /*\n // At the earliest possible moment of the response, record the time at\n // which we received it.\n request.onreadystatechange = function() {\n // If we got the headers and everything's OK\n if ((this.readyState === this.HEADERS_RECEIVED) &&\n (this.status === 200)) {\n }\n };*/\n\n // Process the server's response.\n request.onload = function() {\n // If OK\n if (this.status === 200) {\n try {\n // Process the server's Date from the response header\n setServerDateTime(this.getResponseHeader('Date'));\n } catch (exception) {\n // Show Console log\n }\n }\n };\n\n // Send the request.\n request.send();\n }", "function timeUpdate(data){\n var t = new Date();\n var curHr = t.getHours();\n var curMin = t.getMinutes();\n //var curSec = t.getSeconds();\n\n\n var recordTime = data.time;\n var hh_mm_ss = recordTime.split(\":\");\n\n var startDate = new Date(0, 0, 0, curHr, curMin, 0);\n var endDate = new Date(0, 0, 0, hh_mm_ss[0], hh_mm_ss[1], 0);\n var diff = Math.abs( endDate.getTime() - startDate.getTime() );\n\n if(Math.floor(diff/1000)<30){\n return \"just now\";\n }\n else if(Math.floor(diff/1000<60)){\n return \"few seconds ago\";\n }\n else{\n var hours = Math.floor(diff / 1000 / 60 / 60);\n if(hours <1){\n diff -= hours * 1000 * 60 * 60;\n var minutes = Math.floor(diff / 1000 / 60);\n return minutes +\" minutes ago\";\n }\n else{\n return hours + \" hours ago\";\n }\n\n }\n}", "function getResourceTiming(since) {\n\t\t/*eslint no-script-url:0*/\n\t\tvar entries = findPerformanceEntriesForFrame(BOOMR.window, true, 0, 0),\n\t\t i, e, results = {}, initiatorType, url, data,\n\t\t navStart = getNavStartTime(BOOMR.window);\n\n\t\tif (!entries || !entries.length) {\n\t\t\treturn {};\n\t\t}\n\n\t\tfor (i = 0; i < entries.length; i++) {\n\t\t\te = entries[i];\n\n\t\t\tif (e.name.indexOf(\"about:\") === 0 ||\n\t\t\t e.name.indexOf(\"javascript:\") === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (e.name.indexOf(BOOMR.url) > -1 ||\n\t\t\t e.name.indexOf(BOOMR.config_url) > -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (since && (navStart + e.startTime) < since) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Compress the RT data into a string:\n\t\t\t//\n\t\t\t// 1. Start with the initiator type, which is mapped to a number.\n\t\t\t// 2. Put the timestamps into an array in a set order (reverse chronological order),\n\t\t\t// which pushes timestamps that are more likely to be zero (duration since\n\t\t\t// startTime) towards the end of the array (eg redirect* and domainLookup*).\n\t\t\t// 3. Convert these timestamps to Base36, with empty or zero times being an empty string\n\t\t\t// 4. Join the array on commas\n\t\t\t// 5. Trim all trailing empty commas (eg \",,,\")\n\t\t\t//\n\n\t\t\t// prefix initiatorType to the string\n\t\t\tinitiatorType = initiatorTypes[e.initiatorType];\n\t\t\tif (typeof initiatorType === \"undefined\") {\n\t\t\t\tinitiatorType = 0;\n\t\t\t}\n\n\t\t\tdata = initiatorType + [\n\t\t\t\ttrimTiming(e.startTime, 0),\n\t\t\t\ttrimTiming(e.responseEnd, e.startTime),\n\t\t\t\ttrimTiming(e.responseStart, e.startTime),\n\t\t\t\ttrimTiming(e.requestStart, e.startTime),\n\t\t\t\ttrimTiming(e.connectEnd, e.startTime),\n\t\t\t\ttrimTiming(e.secureConnectionStart, e.startTime),\n\t\t\t\ttrimTiming(e.connectStart, e.startTime),\n\t\t\t\ttrimTiming(e.domainLookupEnd, e.startTime),\n\t\t\t\ttrimTiming(e.domainLookupStart, e.startTime),\n\t\t\t\ttrimTiming(e.redirectEnd, e.startTime),\n\t\t\t\ttrimTiming(e.redirectStart, e.startTime)\n\t\t\t].map(toBase36).join(\",\").replace(/,+$/, \"\");\n\n\t\t\turl = BOOMR.utils.cleanupURL(e.name);\n\n\t\t\t// if this entry already exists, add a pipe as a separator\n\t\t\tif (results[url] !== undefined) {\n\t\t\t\tresults[url] += \"|\" + data;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresults[url] = data;\n\t\t\t}\n\t\t}\n\n\t\treturn optimizeTrie(convertToTrie(results), true);\n\t}", "function startResponseScreen() {\n responseTime = setInterval(increaseResponse,1000);\n}", "function getWebcamTimeCreated(time) {\n\tvar now = new Date();\n\tvar seconds = Math.ceil(((now.getTime() / 1000) - time));\n\tvar response = \"\";\n\tif (seconds < 60) {\n\t\tresponse = seconds + \" second(s) ago\";\n\t} else if (seconds >= 60 && seconds < 3600) {\n\t\tresponse = Math.round(seconds / 60) + \" minute(s) ago\";\n\t} else if (seconds >= 3600 && seconds < 86400) {\n\t\tresponse = Math.round(seconds / 3600) + \" hour(s) ago\";\n\t} else {\n\t\tresponse = Math.round(seconds / 86400) + \" day(s) ago\";\n\t}\n\treturn response;\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if (infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if (fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if (isGraph($(\"#flotResponseTimesOverTime\"))) {\n infos.createGraph();\n } else {\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\n \"#flotResponseTimesOverTime\",\n \"#overviewResponseTimesOverTime\"\n );\n $(\"#footerResponseTimesOverTime .legendColorBox > div\").each(function (i) {\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function getTimeElapsed() {\n return now() - _roundTimeStamp;\n }", "function printTotals(){\n var endMilliseconds = new Date().getTime();\n var totalMilliseconds = endMilliseconds - pound.startMilliseconds;\n console.log('pound completed %s requests in %s ms. \\nreceived responses: %s. \\nhighest number of open connections was: %s. \\nrequest errors: %s' +\n '\\nrequests per second: %s. \\nresponses per second: %s',\n pound.requestsGenerated, totalMilliseconds,\n pound.responsesReceived,\n pound.highestOpenConnectionsAtOneTime,\n pound.requestErrorCount,\n pound.requestsPerSecond,\n pound.responsesPerSecond);\n }", "function incrementTime() {\r\n // Calculate how long since we last retrieved weather and other data. \r\n var t1 = lastDataCheck.getTime();\r\n var t2 = new Date().getTime();\r\n var timespanMS = parseInt(t2-t1);\r\n\t\t\r\n if (moment.duration(timespanMS, 'ms').minutes() >= 15) {\r\n locationSearchHandler(lastQuery); // It's been awhile, refresh all the data. \r\n } else {\t\r\n // Loop through the locations, update the offset time\r\n for (var ii in locData.locations) {\r\n $('#locDate_' + locData.locations[ii].id).html(Util.getOffsetDisplayDate(locData.locations[ii].timeZone.offsetMS, displayDateFormat));\r\n $('#locTime_' + locData.locations[ii].id).html(Util.getOffsetDisplayDate(locData.locations[ii].timeZone.offsetMS, displayTimeFormat));\r\n }\r\n }\r\n }", "wait_SwitchPlayers_timer(){\n if (this.lastResponse[0] != this.client.response[0]) {\n this.lastResponse = this.client.response;\n console.log(this.lastResponse);\n this.parseResponse(this.lastResponse[1]);\n this.state = 'CHANGE_PLAYER';\n }\n }", "function requestTime(req, res, next) {\n req.requestTime = moment().format();\n next();\n}", "function requestTime() {\n console.log(\"Requesting Rescue Time data...\");\n\n request('https://www.rescuetime.com/anapi/daily_summary_feed?key=' + rescue_key, function(err, resp, body){\n \n console.log(\"Processing Rescue Time data...\");\n\n var json = JSON.parse(body);\n\n var week = 7;\n var total = 0;\n var msg = \"\";\n\n for (var i = 0; i < week; i++) {\n var d = week - i - 1;\n total += json[d].total_hours;\n var day = moment(json[d].date).format(\"ddd, MMM D\");\n msg += day + \": \" + json[d].total_duration_formatted;\n msg += (d == 0) ? \"\" : \"\\n\";\n }\n\n var totalHours = Math.floor(total);\n var totalHrWord = (totalHours == 1) ? \"hour\" : \"hours\";\n var totalMinutes = Math.ceil((total - totalHours) * 60);\n var totalMinWord = (totalMinutes == 1) ? \"minute\" : \"minutes\";\n\n var totalMsg = totalHours + \" \" + totalHrWord + \" and \" + totalMinutes + \" \" + totalMinWord;\n\n var toPost = \"I spent \" + totalMsg + \" on my laptop and smartphone in the past 7 days:\\n\" + msg;\n\n post(toPost);\n\n // for (var day in json) {\n // console.log(json[day].date + \": \" + json[day].total_duration_formatted);\n // }\n\n });\n}", "function statistics() {\n\t/*var time = Date.now() - startTime - pauseTime;\n\t\tvar seconds = (time / 1000 % 60).toFixed(2);\n\t\tvar minutes = ~~(time / 60000);\n\t\tstatsTime.innerHTML = (minutes < 10 ? '0' : '') + minutes +\n\t(seconds < 10 ? ':0' : ':') + seconds;*/\n}", "setTime(result) {\n this.setState({resultTimes: result.response.times})\n }", "function updateTimePast() {\n if(!serverObj){\n return;\n }\n var currentTime = new Date().getTime();\n\n for(var i = 0; i < serverObj.length;i++){\n var timePast = currentTime - serverObj[i].date;\n $(\".message_footer span\")[i].innerHTML = convertTime(timePast);\n }\n }", "hammertime() {\n common.logging.info(common.i18n.t('notices.httpServer.cantTouchThis'));\n return Promise.resolve(this);\n }", "function returnTripTime(data){\n\ttripTime = data.StationToStationInfos[0].RailTime;\n\tdirection = data.StationToStationInfos[0].RailTime;\n\ttotalTime = parseInt(parseInt(tripTime)+parseInt(waitTime)+parseInt(delayTime));\n\n\tsessionStorage.totalTime = JSON.stringify(totalTime);\n\n\tsessionStorage.tripTime = JSON.stringify(tripTime);\n\tsessionStorage.waitTime = JSON.stringify(waitTime);\n\tsessionStorage.delayTime = JSON.stringify(delayTime);\n\n\t//Now that we have all metro data, move on to the spotify API\n\tgetSpotifyPlaylist(getPlaylistItems, desiredMood);\n}", "get total_time() { return this._total_time; }", "async getproposeTime(req, res) {\n try {\n await matchService.getproposeTime(req.user.id, req.params.id).then(response => {\n return res.status(HttpStatus.OK).send(response)\n }).catch(error => {\n if (error.error) {\n return res.status(HttpStatus.INTERNAL_SERVER_ERROR).send(error)\n } else if (error.code) {\n return res.status(HttpStatus.BAD_REQUEST).send(error)\n } else {\n return res.status(HttpStatus.NOT_FOUND).send(error)\n }\n })\n } catch (err) {\n return res.status(500).send(err)\n }\n }", "GetForecastArrivalTime(origins, destination) {\n let queryString = `https://dev.virtualearth.net/REST/v1/Routes/DistanceMatrix?origins=${origins.latitude},${origins.logitude}&destinations=${destination.latitude},${destination.logitude}&travelMode=${this.ConfigTable.travelMode}&key=${this.ConfigTable.BingMapApiKey}`;\n let duration = 0;\n this.axios.get(queryString)\n .then((response) => {\n //console.log(response.data.resourceSets[0].resources[0]); \n duration = response.data.resourceSets[0].resources[0].results[0].travelDuration;\n //console.log('good');//used for test\n }).catch((error) => {\n duration = -1; // error happens\n });\n return duration;\n }", "_getTime () {\r\n return (Date.now() - this._startTime) / 1000\r\n }", "getReadableTime() {\n // Debugging line.\n Helper.printDebugLine(this.getReadableTime, __filename, __line);\n\n // Stop the time please. How long was the crawling process?\n let ms = new Date() - this.startTime,\n time = Parser.parseTime(ms),\n timeString = `${time.d} days, ${time.h}:${time.m}:${time.s}`;\n\n this.output.write(timeString, true, 'success');\n this.output.writeLine(`Stopped at: ${new Date()}`, true, 'success');\n }", "function statistics() {\n var time = Date.now() - startTime - pauseTime;\n var seconds = (time / 1000 % 60).toFixed(2);\n var minutes = ~~(time / 60000);\n statsTime.innerHTML = (minutes < 10 ? '0' : '') + minutes +\n (seconds < 10 ? ':0' : ':') + seconds;\n}", "async function activeContract(){\r\n try{\r\n let sendRequest = await fetch('/timing');\r\n let result = await sendRequest.text();\r\n timerDeadline(parseInt(result));\r\n }catch(err){\r\n console.log(err);\r\n }\r\n }", "function handleSocketTime(time)\n{\n}", "get uptime() {\n if (this._state === exports.ClientState.ACTIVE\n && this._currentConnectionStartTime) {\n return Date.now() - this._currentConnectionStartTime;\n }\n else {\n return 0;\n }\n }", "get handlerTimings() {\n const handlerTimings = {};\n\n for (const key of Object.keys(this.transports)) {\n if (this.transports[key]) {\n Object.assign(handlerTimings, this.transports[key].timings);\n }\n }\n\n return handlerTimings;\n }", "endTime(){\r\n var duration = (Math.random() * (2*60 - 1)*1000 + 1000);\r\n var now = new Date().getTime();\r\n return (now + duration);\r\n }", "function timeQuestion() {\n //If is different is because the user have not responded all questions\n if (countQuestion != questionList.length) {\n countTime--;\n $(\"#time\").text(countTime);\n\n //If countTime is zero is because the time finished\n if (countTime == 1) {\n countLoose++;\n visibleAnswer(false, true);\n }\n }\n //The responded all question, and we have to stop timer\n else {\n clearInterval(time);\n }\n }", "get time() {}", "function getTimeLapse(session){\n\tconsole.log(\"getTimeLapse() executing\");\n\tvar botTime = new Date(session.userData.lastMessageSent);\n\tvar userTime = new Date(session.message.localTimestamp);\n\tvar userTimeManual = new Date(session.userData.lastMessageReceived);\n\tconsole.log(\"Time Lapse Info:\");\n\tvar timeLapseMs = userTimeManual - botTime;\n\tconsole.log(\"Time lapse in ms is: \" + timeLapseMs);\n\tvar timeLapseHMS = convertMsToHMS(timeLapseMs);\n\tconsole.log(\"Time lapse in HH:MM:SS: \" + timeLapseHMS);\n\treturn timeLapseHMS;\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 32400000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function getTodaysTimeSpent() {\n\t\t$.ajax({\n\t\t\tmethod: 'GET',\n\t\t\turl: baseUrl + '/time',\n\t\t\theaders: {'Authorization': token},\n\t\t\tsuccess: handleSucces,\n\t\t\terror: (err) => console.log(err)\n\t\t});\n\t}", "updateRemainingTime() {\n\n this.callsCounter++;\n //cada 25 llamadas, quito un segundo\n if (this.callsCounter % 25 == 0) {\n if (this.time.seconds == 0) {\n this.time.minutes -= 1;\n this.time.seconds = 60;\n }\n this.time.seconds -= 1;\n }\n //Se activa el hurryUp\n if (this.callsCounter == this.hurryUpStartTime) {\n this.hurryUpTime = true;\n }\n //Se llama al metodo cada 5 llamadas \n if (this.callsCounter >= this.hurryUpStartTime\n && this.callsCounter % 5 == 0) {\n this.hurryUp();\n }\n\n }", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function ajaxd_timed() {\n let time = new Date(),\n seconds = time.getSeconds()\n if (seconds == 0) {\n loadDepartures();\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -21600000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimeOverTime(fixTimestamps) {\n var infos = responseTimesOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyResponseTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimesOverTime\"))){\n infos.createGraph();\n }else{\n var choiceContainer = $(\"#choicesResponseTimesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimesOverTime\", \"#overviewResponseTimesOverTime\");\n $('#footerResponseTimesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}" ]
[ "0.7092822", "0.6836103", "0.639537", "0.63374466", "0.6251988", "0.61462384", "0.6100139", "0.6068924", "0.6020777", "0.60106874", "0.60009605", "0.59932894", "0.59754544", "0.597369", "0.59192896", "0.5914399", "0.5872192", "0.5872192", "0.5872192", "0.5850241", "0.5811009", "0.58025056", "0.5798813", "0.5798813", "0.57844436", "0.57692987", "0.5756244", "0.5732054", "0.5728822", "0.572821", "0.56879056", "0.56774545", "0.56648654", "0.56630266", "0.56611913", "0.56429756", "0.5638923", "0.56358457", "0.56335735", "0.5612568", "0.5588585", "0.5584996", "0.5582251", "0.55822444", "0.55733126", "0.55551237", "0.555145", "0.55473644", "0.55451506", "0.55330426", "0.5526993", "0.5516274", "0.55162257", "0.55084753", "0.54919964", "0.54916996", "0.54885536", "0.5487117", "0.5486195", "0.54822606", "0.5479629", "0.5476823", "0.5464596", "0.5462934", "0.54571074", "0.54571074", "0.54571074", "0.54571074", "0.54571074", "0.54571074", "0.54571074", "0.54571074", "0.54553103", "0.54521024", "0.54498327", "0.54498327", "0.54498327", "0.54498327", "0.54498327", "0.54498327", "0.5449683", "0.5449683", "0.5449683", "0.5449683", "0.5449683", "0.5449683", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171", "0.5448171" ]
0.0
-1
Connect Time Over Time
function refreshConnectTimeOverTime(fixTimestamps) { var infos = connectTimeOverTimeInfos; prepareSeries(infos.data); if(infos.data.result.series.length == 0) { setEmptyGraph("#bodyConnectTimeOverTime"); return; } if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotConnectTimeOverTime"))) { infos.createGraph(); }else { var choiceContainer = $("#choicesConnectTimeOverTime"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotConnectTimeOverTime", "#overviewConnectTimeOverTime"); $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "connectTimeout() {\n var worker = cluster.workers[this.worker_key]\n if ( worker !== undefined ) {\n if ( !(worker.isConnected()) ) {\n var onset = this.trackingStartTime\n var diff = Date.now() - onset\n //\n //if ( diff > MAX_CONNECT_FAIL_TIME ) writeConsoleLog('log',{component: CONSOLE_LOG_TAG_COMP},`DISCONNECT TIMEOUT ${this.worker_key}`)\n //\n return ( diff > MAX_CONNECT_FAIL_TIME ) \n }\n } else {\n return true\n }\n return false\n }", "function connectNow() {\n\t\t\tsettings.lastTick = 0;\n\t\t\tscheduleNextTick();\n\t\t}", "overTime(){\n\t\t//\n\t}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if (infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if (fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if (isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n } else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\n \"#flotConnectTimeOverTime\",\n \"#overviewConnectTimeOverTime\"\n );\n $(\"#footerConnectTimeOverTime .legendColorBox > div\").each(function (i) {\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function handleSocketTime(time)\n{\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -21600000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 32400000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -10800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 21600000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 10800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 10800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 10800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 10800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 10800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 10800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 10800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 18000000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 14400000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\r\n var infos = connectTimeOverTimeInfos;\r\n prepareSeries(infos.data);\r\n if(infos.data.result.series.length == 0) {\r\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\r\n return;\r\n }\r\n if(fixTimestamps) {\r\n fixTimeStamps(infos.data.result.series, 3600000);\r\n }\r\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\r\n infos.createGraph();\r\n }else {\r\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n createLegend(choiceContainer, infos);\r\n infos.createGraph();\r\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\r\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\r\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\r\n });\r\n }\r\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 19800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 19800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 19800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 19800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshConnectTimeOverTime(fixTimestamps) {\n var infos = connectTimeOverTimeInfos;\n prepareSeries(infos.data);\n if(infos.data.result.series.length == 0) {\n setEmptyGraph(\"#bodyConnectTimeOverTime\");\n return;\n }\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 19800000);\n }\n if(isGraph($(\"#flotConnectTimeOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesConnectTimeOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotConnectTimeOverTime\", \"#overviewConnectTimeOverTime\");\n $('#footerConnectTimeOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}" ]
[ "0.57900476", "0.5770421", "0.5753667", "0.5660272", "0.55595124", "0.553363", "0.5530261", "0.5530261", "0.5530261", "0.5530261", "0.5530261", "0.5530261", "0.5530261", "0.5530261", "0.5528221", "0.55238473", "0.55238473", "0.55238473", "0.55238473", "0.55238473", "0.55238473", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55215293", "0.55205715", "0.55205715", "0.55205715", "0.55205715", "0.55205715", "0.55205715", "0.5518727", "0.5518452", "0.551593", "0.551593", "0.5513183", "0.5513183", "0.5513183", "0.5513183", "0.5513183", "0.5513183", "0.5513183", "0.55093646", "0.5508101", "0.5508101", "0.5508101", "0.5508101", "0.5508101", "0.5508101", "0.5508101", "0.5508101", "0.5508101", "0.5508101", "0.5508101", "0.55030245", "0.5502629", "0.55021286", "0.55021286", "0.55021286", "0.55021286", "0.55021286" ]
0.5523547
36
Response Time Percentiles Over Time
function refreshResponseTimePercentilesOverTime(fixTimestamps) { var infos = responseTimePercentilesOverTimeInfos; prepareSeries(infos.data); if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotResponseTimePercentilesOverTime"))) { infos.createGraph(); }else { var choiceContainer = $("#choicesResponseTimePercentilesOverTime"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotResponseTimePercentilesOverTime", "#overviewResponseTimePercentilesOverTime"); $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getReqPerTime() {\n let sum_time = 0.0\n let dif = 0.0\n for (let d = 0; d < this.state.data.length; d++) {\n dif = new Date(this.state.data[d].dt_end_log).getTime() - new Date(this.state.data[d].dt_Start_Log).getTime()\n sum_time += dif / 1000\n }\n \n return (sum_time / this.state.data.length)\n }", "calculatePercentages() {\n this.runs.forEach(run => {\n const data = {};\n data.runTime = (run.runningTime / run.totalTime) * 100;\n data.walkTime = 100 - data.runTime;\n data.runDistance = (run.distance / 100) * data.runTime;\n data.walkDistance = run.distance - data.runDistance;\n this.percentages.push(data);\n });\n }", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if (fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 28800000);\n }\n if (isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n } else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\n \"#flotResponseTimePercentilesOverTime\",\n \"#overviewResponseTimePercentilesOverTime\"\n );\n $(\"#footerResponseTimePercentilesOverTime .legendColorBox > div\").each(\n function (i) {\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n }\n );\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 32400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -36000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function updateProgress() {\n let completed = 0;\n for (let i = 0; i < result.length; i++) {\n if (result[i].time != -1) {\n completed++;\n }\n }\n\n let percent = Math.floor((completed * 100) / result.length);\n let temp = \"\" + percent + \"%\";\n return temp;\n }", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -21600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 3600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -25200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -28800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -14400000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 21600000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, 7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -7200000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -18000000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}", "function refreshResponseTimePercentilesOverTime(fixTimestamps) {\n var infos = responseTimePercentilesOverTimeInfos;\n prepareSeries(infos.data);\n if(fixTimestamps) {\n fixTimeStamps(infos.data.result.series, -10800000);\n }\n if(isGraph($(\"#flotResponseTimePercentilesOverTime\"))) {\n infos.createGraph();\n }else {\n var choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n createLegend(choiceContainer, infos);\n infos.createGraph();\n setGraphZoomable(\"#flotResponseTimePercentilesOverTime\", \"#overviewResponseTimePercentilesOverTime\");\n $('#footerResponseTimePercentilesOverTime .legendColorBox > div').each(function(i){\n $(this).clone().prependTo(choiceContainer.find(\"li\").eq(i));\n });\n }\n}" ]
[ "0.6469232", "0.59043026", "0.57266444", "0.55641556", "0.55416846", "0.55416846", "0.55416846", "0.55416846", "0.55416846", "0.5537933", "0.5534539", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55343693", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.55332816", "0.5530325", "0.5527759", "0.55267847", "0.55267847", "0.55267847", "0.55267847", "0.55267847", "0.55267847", "0.5525353", "0.55218434", "0.55218434", "0.55218434", "0.55218434", "0.55218434", "0.55218434", "0.55218434", "0.55218434", "0.55218434", "0.55218434", "0.55218434", "0.55218434", "0.5518755", "0.5518755", "0.55120313", "0.55120313", "0.55120313", "0.55120313", "0.55120313", "0.55120313", "0.55119365" ]
0.55089223
100
Response Time vs Request
function refreshResponseTimeVsRequest() { var infos = responseTimeVsRequestInfos; prepareSeries(infos.data); if (isGraph($("#flotResponseTimeVsRequest"))){ infos.createGraph(); }else{ var choiceContainer = $("#choicesResponseTimeVsRequest"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotResponseTimeVsRequest", "#overviewResponseTimeVsRequest"); $('#footerResponseRimeVsRequest .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function responseTime (req, res) {\n if (!res._header || !req._startAt) {\n return ''\n }\n\n var tdiff = process.hrtime(req._startAt)\n , ms = tdiff[0] * 1e3 + tdiff[1] * 1e-6\n\n return ms.toFixed(3)\n}", "function getServerTime(request, response) {\r\n\tvar time = new Date();\r\n\t\r\n\tvar result = {success: true, time: time};\r\n\tresponse.json(result); \r\n}", "get requestTime() {\n return this.get('x-request-time');\n }", "function requestTime(req, res, next) {\n req.requestTime = moment().format();\n next();\n}", "function requestTime() {\n var request = new XMLHttpRequest();\n\n // Ask the server for another copy of ServerDate.js but specify a unique number on the URL querystring\n // so that we don't get the browser cached Javascript file\n // Use HEAD request instead of GET because we don't need file content\n request.open('HEAD', URL + '?noCache=' + Date.now());\n\n /*\n // At the earliest possible moment of the response, record the time at\n // which we received it.\n request.onreadystatechange = function() {\n // If we got the headers and everything's OK\n if ((this.readyState === this.HEADERS_RECEIVED) &&\n (this.status === 200)) {\n }\n };*/\n\n // Process the server's response.\n request.onload = function() {\n // If OK\n if (this.status === 200) {\n try {\n // Process the server's Date from the response header\n setServerDateTime(this.getResponseHeader('Date'));\n } catch (exception) {\n // Show Console log\n }\n }\n };\n\n // Send the request.\n request.send();\n }", "date() {\n if (this._trustServerDate) {\n return this._serverDate();\n }\n return this._responseTime;\n }", "get timings() {\n var _a;\n return (_a = this[kRequest]) === null || _a === void 0 ? void 0 : _a.timings;\n }", "function getServerLocalDiffTime(){\n var startRequest = new Date().getTime();\n var config = getHdcontrolObject();\n var endRequest = new Date().getTime();\n var requestTime = parseInt((endRequest -startRequest)/1000);\n\n var diffTime = parseInt(parseInt(buyingTime/1000) - config.stime - requestTime);\n return diffTime;\n }", "function getServerTime() {\n return $.ajax({async: false}).getResponseHeader( 'Date' );\n }", "function getServerTime() {\n return $.ajax({async: false}).getResponseHeader( 'Date' );\n }", "function getServerTime() {\n return $.ajax({async: false}).getResponseHeader( 'Date' );\n }", "date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }", "date() {\n const serverDate = Date.parse(this._resHeaders.date);\n if (isFinite(serverDate)) {\n return serverDate;\n }\n return this._responseTime;\n }", "function GetTime()\r\n{\r\n Samples.AspNet.WebService.GetServerTime(\r\n SucceededCallback);\r\n \r\n}", "age() {\n let age = Math.max(0, (this._responseTime - this.date()) / 1000);\n if (this._resHeaders.age) {\n let ageValue = this._ageValue();\n if (ageValue > age) age = ageValue;\n }\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "setServerTimeDiff(timeUrl) {\n\t\tif(timeUrl == undefined || timeUrl == \"\"){\n\t\t\treturn;\n\t\t}\n\t\tlet parsed = url.parse(timeUrl);\n\t\tconst options = {\n\t\t\thost: parsed.host,\n\t\t\tpath: parsed.path,\n\t\t\ttimeout: 3000\n\t\t};\n\t\tlet str = \"\";\n\t\tconst latencyAdjustment = new Date().getTime();\n\t\thttps.request(options, (res) => {\n\t\t\t//another chunk of data has been received, so append it to `str`\n\t\t\tres.on(\"data\", (chunk) => {\n\t\t\t\tstr += chunk;\n\t\t\t});\n\n\t\t\t//the whole response has been received\n\t\t\tres.on(\"end\", () => {\n\t\t\t\tlet serverTime = JSON.parse(str).time;\n\t\t\t\tthis.serverTimeDiff = new Date(serverTime) - new Date().getTime() - (new Date().getTime() - latencyAdjustment);\n\n\t\t\t\t//console.log(\"ServerTimeDiff \"+this.serverTimeDiff);\n\t\t\t\t//console.log(\"time diff: \"+(new Date().getTime()-latencyAdjustment));\n\t\t\t});\n\n\t\t\tres.on(\"timeout\", () => {\n\t\t\t\t// eslint-disable-next-line no-undef\n\t\t\t\trequest.abort();\n\t\t\t\tconsole.log(\"Server time could not be set. Timed out\");\n\t\t\t});\n\n\t\t\tres.on(\"error\", () => {\n\t\t\t\tconsole.log(\"Couldn't get time from time server\");\n\t\t\t});\n\t\t}).end();\n\t}", "getTime() {\n return new Promise((resolve, reject) => {\n this.doRequest('public', 'Time').then((response) => {\n resolve(response);\n }).catch(error => reject(error));\n });\n }", "function onRequest(request, response) {\n const now = new Date();\n const item = url.parse(request.url, true);\n const pathname = item.pathname;\n let data = {}\n data.received = now;\n data.path = pathname;\n let params = null;\n\n // process any query parameters\n if (item.query && Object.keys(item.query).length > 0) {\n params = item.query; \n } \n\n data = handlePath(pathname, params, data);\n data.completed = new Date();\n // assemble the response\n const processingTime = data.completed - data.received;\n const responseCode = data.responseCode || 200;\n const responseData = JSON.stringify(data);\n response.writeHead(responseCode, {\"Content-Type\": \"application/json\"});\n response.end(responseData, (content) => {\n // pad with leading zeros up to 4 digits otherwise just show it as is\n let padTime = '' + processingTime;\n if (processingTime < 10000) {\n padTime = ('0000' + processingTime).slice(-4) \n }\n\n const message = \n 'LOG: ' + new Date().toISOString() + ' ' + responseCode + ' ' + padTime + ' ' +\n responseData;\n if (responseCode >= 400) {\n console.error(message);\n } else {\n console.log(message);\n }\n });\n}", "function n(){if(!e.s_loadT){var t=(new Date).getTime(),n=e.performance?performance.timing:0,i=n?n.requestStart:e.inHeadTS||0;s_loadT=i?Math.round((t-i)/100):\"\"}return s_loadT}", "function onRequestFinished () {\n // Dec open request count\n stats.dec(TRACKERS.OPEN_REQUESTS);\n\n // Increase number of successful reqs\n stats.inc(TRACKERS.TOTAL_REQ_SERVED);\n\n // Add response time\n var timerName = util.format(TRACKERS.RES_TIME_FOR_PATH, this.url);\n stats.timing(timerName, (Date.now() - this.reqStartTime));\n}", "_handleMeta(res, requestLocalTimestamp) {\n if (!res.meta) throw new Error('Cannot find .meta in response.');\n if (!res.meta.serverTime) throw new Error('Cannot find .meta.serverTime in response.');\n\n // update deltaTime and weight it \n this._deltaTime.value = (this._deltaTime.value * this._deltaTime.weight + res.meta.serverTime - requestLocalTimestamp) / ++this._deltaTime.weight;\n }", "function logRequests(request, response, next) {\n const { method, url } = request;\n\n const logLabel = `[${method.toUpperCase()}] ${url}`;\n\n console.time(logLabel);\n console.log(logLabel);\n\n // return next(); //chama a próxima middleware\n /**\n * posso executar o next como função sem precisar do return (return next();),\n * caso eu queira executar outra rota após o next()\n * */\n\n next();\n\n console.timeEnd(logLabel);\n}", "getReqPerTime() {\n let sum_time = 0.0\n let dif = 0.0\n for (let d = 0; d < this.state.data.length; d++) {\n dif = new Date(this.state.data[d].dt_end_log).getTime() - new Date(this.state.data[d].dt_Start_Log).getTime()\n sum_time += dif / 1000\n }\n \n return (sum_time / this.state.data.length)\n }", "function responce_time(r) {\n\t\t\tvar nextr = e.C + \n\t\t\t\t_.chain(tasks_)\n\t\t\t\t\t// Sum including every task with \n\t\t\t\t\t// less dealine that current task\n\t\t\t\t\t.filter(function(t) {\n\t\t\t\t\t\treturn t.D < e.D;\n\t\t\t\t\t})\n\t\t\t\t\t.map(function(t) {\n\t\t\t\t\t\treturn Math.ceil(r / t.T) * t.C;\n\t\t\t\t\t})\n\t\t\t\t\t.foldl(sum, 0)\n\t\t\t\t\t.value();\n\n\t\t\tif(nextr === r) return r;\n\t\t\treturn arguments.callee(nextr);\n\t\t}", "function getTimestamp(req, res) {\n\n\tres.setHeader('Content-Type', 'application/json');\n\tres.send(JSON.stringify({\n\t\ttimestamp: Date.now()\n\t}));\n}", "function req(uri, cb) {\n return lib.req_json({'uri':uri, 'time_C':self.time_C}, cb);\n }", "function HttpRequest(req, responseTime) {\n this.reqUrl = req.url;\n this.hitCount = 1;\n this.errorCount = 0;\n this.totalResponseTime = responseTime;\n this.averageResponseTime = responseTime;\n this.latestResponseTime = responseTime;\n this.method = req.method;\n this.goodResps = [];\n this.badResps = [];\n\n var responseJson = {\n resp: responseTime,\n timestamp: req.time,\n statusCode: req.statusCode\n };\n\n if (req.requestHeader && req.requestHeader.host) {\n var protocol = 'http';\n if (req.header && req.header.indexOf('HTTPS') >= 0) {\n protocol = 'https';\n }\n responseJson.url_prefix = protocol + '://' + req.requestHeader.host;\n } else {\n responseJson.url_prefix = '';\n }\n\n if (req.statusCode >= 400) {\n this.errorCount = 1;\n this.badResps.push(responseJson);\n } else {\n this.goodResps.push(responseJson);\n }\n\n this.errorRate = this.errorCount / this.hitCount;\n}", "async function query_server_clock() {\n if (loopback_mode == \"main\") {\n // I got yer server right here!\n server_clock = Math.round(Date.now() * sample_rate / 1000.0);\n } else {\n // Support relative paths\n var target_url = new URL(server_path, document.location);\n var request_time_ms = Date.now();\n var fetch_result = await fetch(target_url, {\n method: \"get\", // default\n cache: \"no-store\",\n });\n // We need one-way latency; dividing by 2 is unprincipled but probably close enough.\n // XXX: This is not actually correct. We should really be using the roundtrip latency here. Because we want to know not \"what is the server clock now\", but \"what will the server clock be by the time my request reaches the server.\"\n // Proposed alternative:\n /*\n var request_time_samples = Math.round(request_time_ms * sample_rate / 1000.0);\n var metadata = JSON.parse(fetch_result.headers.get(\"X-Audio-Metadata\"));\n // Add this to \"our time now\" to yield \"server time when it gets our request.\"\n server_sample_offset = metadata[\"server_clock\"] - request_time_samples;\n // Note: In the presence of network jitter, our message can get to the server either before or after the target server moment. This means that if our target server moment is \"now\", our actual requested moment could end up in the future. Someone on one side or the other has to deal with this. But in general if we are requesting \"now\" it means we do not expect to get audio data at all, so it should be okay for us to never ask for audio data in the case (and it should be ok for the server to give us zeros for \"future\" data, since we should never have asked, but that's what _would_ be there.)\n */\n var server_latency_ms = (Date.now() - request_time_ms) / 2.0; // Wrong, see above\n var metadata = JSON.parse(fetch_result.headers.get(\"X-Audio-Metadata\"));\n server_clock = Math.round(metadata[\"server_clock\"] + server_latency_ms * sample_rate / 1000.0);\n lib.log(LOG_INFO, \"Server clock is estimated to be:\", server_clock, \" (\", metadata[\"server_clock\"], \"+\", server_latency_ms * sample_rate / 1000.0);\n }\n}", "function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):'';s_loadT=s_loadT/10}return s_loadT}", "function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):'';s_loadT=s_loadT/10}return s_loadT}", "function checker (req, res, next) {\n // Rate limitter per USER\n checkReqsIntensivity(req, res, next)\n\n // calculate current rps\n if (__req_num_local === options.calcRpsEachNseconds) {\n // calculate requests per second\n end = new Date()\n __current_rps = (__req_num_local / ((end - begin) / 1000)).toFixed(0)\n\n // print statistics\n console.log('\\n\\nIncoming Connections: ' + __req_num)\n console.log('Requests per second: ' + __current_rps + ' Time: ' + ((end - begin) / 1000).toFixed(3) + ', Requests: ' + __req_num_local + '\\n')\n\n __req_num_local = 0\n begin = new Date()\n }\n\n __req_num++\n __req_num_local++\n}", "function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):''}return s_loadT}", "function s_getLoadTime(){if(!window.s_loadT){var b=new Date().getTime(),o=window.performance?performance.timing:0,a=o?o.requestStart:window.inHeadTS||0;s_loadT=a?Math.round((b-a)/100):''}return s_loadT}", "async getproposeTime(req, res) {\n try {\n await matchService.getproposeTime(req.user.id, req.params.id).then(response => {\n return res.status(HttpStatus.OK).send(response)\n }).catch(error => {\n if (error.error) {\n return res.status(HttpStatus.INTERNAL_SERVER_ERROR).send(error)\n } else if (error.code) {\n return res.status(HttpStatus.BAD_REQUEST).send(error)\n } else {\n return res.status(HttpStatus.NOT_FOUND).send(error)\n }\n })\n } catch (err) {\n return res.status(500).send(err)\n }\n }", "function testRequest() {\n setChildTextNode(\"resultsRequest\", \"running...\");\n\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n\tvar timer = new Date().getTime()// new chrome.Interval();\n\t// timer.start();\n\tvar tab = tabs[0];\n\tchrome.tabs.sendMessage(tab.id, {counter: 1}, function handler(response) {\n\t if (response.counter < 3000) {\n\t\tchrome.tabs.sendMessage(tab.id, {counter: response.counter}, handler);\n\t } else {\n\t\t// timer.stop();\n\t\tvar end = new Date().getTime()\n\t\t\n\t\tvar usec = Math.round(( end - timer));\n\t\tsetChildTextNode(\"resultsRequest\", response.counter + \" response.counter \" + usec + \"usec\");\n\t }\n\t});\n });\n}", "static getTime() {\n const currentTime = Date.now();\n\n if (!mockedPageLoadTime)\n return currentTime;\n\n const difference = currentTime - actualPageLoadTime;\n return mockedPageLoadTime + difference;\n }", "get session_time() { return (!this.jsonString) ? API.throwSCORMError(405) : this._session_time; }", "function getResourceTiming(since) {\n\t\t/*eslint no-script-url:0*/\n\t\tvar entries = findPerformanceEntriesForFrame(BOOMR.window, true, 0, 0),\n\t\t i, e, results = {}, initiatorType, url, data,\n\t\t navStart = getNavStartTime(BOOMR.window);\n\n\t\tif (!entries || !entries.length) {\n\t\t\treturn {};\n\t\t}\n\n\t\tfor (i = 0; i < entries.length; i++) {\n\t\t\te = entries[i];\n\n\t\t\tif (e.name.indexOf(\"about:\") === 0 ||\n\t\t\t e.name.indexOf(\"javascript:\") === 0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (e.name.indexOf(BOOMR.url) > -1 ||\n\t\t\t e.name.indexOf(BOOMR.config_url) > -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (since && (navStart + e.startTime) < since) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Compress the RT data into a string:\n\t\t\t//\n\t\t\t// 1. Start with the initiator type, which is mapped to a number.\n\t\t\t// 2. Put the timestamps into an array in a set order (reverse chronological order),\n\t\t\t// which pushes timestamps that are more likely to be zero (duration since\n\t\t\t// startTime) towards the end of the array (eg redirect* and domainLookup*).\n\t\t\t// 3. Convert these timestamps to Base36, with empty or zero times being an empty string\n\t\t\t// 4. Join the array on commas\n\t\t\t// 5. Trim all trailing empty commas (eg \",,,\")\n\t\t\t//\n\n\t\t\t// prefix initiatorType to the string\n\t\t\tinitiatorType = initiatorTypes[e.initiatorType];\n\t\t\tif (typeof initiatorType === \"undefined\") {\n\t\t\t\tinitiatorType = 0;\n\t\t\t}\n\n\t\t\tdata = initiatorType + [\n\t\t\t\ttrimTiming(e.startTime, 0),\n\t\t\t\ttrimTiming(e.responseEnd, e.startTime),\n\t\t\t\ttrimTiming(e.responseStart, e.startTime),\n\t\t\t\ttrimTiming(e.requestStart, e.startTime),\n\t\t\t\ttrimTiming(e.connectEnd, e.startTime),\n\t\t\t\ttrimTiming(e.secureConnectionStart, e.startTime),\n\t\t\t\ttrimTiming(e.connectStart, e.startTime),\n\t\t\t\ttrimTiming(e.domainLookupEnd, e.startTime),\n\t\t\t\ttrimTiming(e.domainLookupStart, e.startTime),\n\t\t\t\ttrimTiming(e.redirectEnd, e.startTime),\n\t\t\t\ttrimTiming(e.redirectStart, e.startTime)\n\t\t\t].map(toBase36).join(\",\").replace(/,+$/, \"\");\n\n\t\t\turl = BOOMR.utils.cleanupURL(e.name);\n\n\t\t\t// if this entry already exists, add a pipe as a separator\n\t\t\tif (results[url] !== undefined) {\n\t\t\t\tresults[url] += \"|\" + data;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tresults[url] = data;\n\t\t\t}\n\t\t}\n\n\t\treturn optimizeTrie(convertToTrie(results), true);\n\t}", "function print_time() {\n //console.clear();\n console.log(\"local_time : \", Date.now());\n console.log(\"server_time : \", api.get_time());\n console.log(\"delta_time : \", Date.now() - api.get_time());\n console.log(\"\");\n }", "age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "async function activeContract(){\r\n try{\r\n let sendRequest = await fetch('/timing');\r\n let result = await sendRequest.text();\r\n timerDeadline(parseInt(result));\r\n }catch(err){\r\n console.log(err);\r\n }\r\n }", "function get_servertime(callback) {\n\t$.ajax({\n\t\turl :\"common/now_ajax\",\n\t\ttype : \"post\",\n\t\tdataType : 'json',\n\t\tsuccess : function(ret) {\n\t\t\tif (ret.err_code == 0)\n\t\t\t{\n\t\t\t\tcallback(ret.now);\n\t\t\t}\n\t\t},\n\t\terror : function() {\n\t\t},\n\t\tcomplete : function() {\n\t\t}\n\t});\n}", "function fetchRandomFriendsInfo(request,response) {\n\n var requestTime = new Date().getTime();\n\n var userId = request.body.userid;\n var searchText = request.body.searchText;\n var timeStamp = request.body.timeStamp;\n\n logger.info('UserId ',userId,' requested with searchText : ',searchText );\n response.type('application/json');\n\n if ((userId === undefined || userId == null) || (searchText === undefined || searchText == null || searchText=='') ) {\n response.end(JSON.stringify({\n 'status': 403,\n 'message': 'Invalid data received',\n 'data': null\n }));\n }\n else {\n queryHandler.fetchRandomFriendsInfo(userId, searchText,timeStamp, function (err, queryResult) {\n\n response.type('application/json');\n if (err) {\n console.error(\"Error fetching records : \", err);\n response.end(JSON.stringify({'status': 500, 'message': \"Internal server error.\\n\"}));\n }\n else {\n // console.info(\"Response successfully sent : \\n\", queryResult, \"\\n\\n\");\n if (queryResult == null) {\n\n response.end(JSON.stringify({\n 'status': 404,\n 'message': 'User requested for is not found',\n 'data': queryResult\n }));\n }\n else {\n\n response.end(JSON.stringify({'status': 200, 'message': 'successfull', 'data': queryResult}));\n }\n }\n\n var responseTime = new Date().getTime() - requestTime ;\n logger.info(\"RESPONSE TIME FOR REQUEST /fetchRandomFriendsInfo : \",responseTime, \" ms.\");\n });\n\n }\n}", "function responseUsed(response) {\n lastUsedResponse = response;\n return robot.brain.set(responseUsageKey(response.stemsString), moment.utc().toISOString());\n }", "function funRequest(timestamp){\n var end = new Date().getTime()\n timeFunRequest = end-startR\n console.log(\"funRequest \"+timeFunRequest)\n startR = new Date().getTime()\n RID = window.requestAnimationFrame(funRequest)\n}", "async proposeTime(req, res) {\n try {\n await matchService.proposeTime(req.user.id, req.body).then(response => {\n return res.status(HttpStatus.OK).send(response)\n }).catch(error => {\n if (error.error) {\n return res.status(HttpStatus.INTERNAL_SERVER_ERROR).send(error)\n } else if (error.code) {\n return res.status(HttpStatus.BAD_REQUEST).send(error)\n } else {\n return res.status(HttpStatus.NOT_FOUND).send(error)\n }\n })\n } catch (err) {\n return res.status(500).send(err)\n }\n }", "function sendLaunchTimeRequest() {\n\t// wrap the summand and addend as XAL doubles and send the request to the server\n\tmessage_session.sendRequest( \"getLaunchTime\", function( response ) {\n\t\tvar result = response.result;\t\t// get the result\n\t\tvar launch_time_elem = document.getElementById( \"launchtime\" );\t// get the output HTML field\n\t\tlaunch_time_elem.innerHTML = result.from_xal();\n\t} );\n}", "function getEndTime(request){\r\n request.endTime = new Date(request.date);\r\n switch (request.duration){\r\n case \"30 minutes\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 30);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n case \"45 minutes\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 45);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n case \"1 hour\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 60);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n case \"2 hours\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 120);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n }\r\n}", "function ServeTimeStateJSON( request, response, instanceHash ) {\n var instanceState = { \"time\": global.instances[ instanceHash ].getTime( ), \"rate\": global.instances[ instanceHash ].rate, \"playing\": global.instances[ instanceHash ].isPlaying( ), \"paused\": global.instances[ instanceHash ].isPaused( ), \"stopped\": global.instances[ instanceHash ].isStopped( ) };\n serve.JSON( instanceState, response, url.parse( request.url, true ) );\n}", "hammertime() {\n common.logging.info(common.i18n.t('notices.httpServer.cantTouchThis'));\n return Promise.resolve(this);\n }", "metricTargetResponseTime(props) {\n try {\n jsiiDeprecationWarnings.print(\"aws-cdk-lib.aws_elasticloadbalancingv2.ApplicationLoadBalancer#metricTargetResponseTime\", \"Use ``ApplicationLoadBalancer.metrics.targetResponseTime`` instead\");\n jsiiDeprecationWarnings.aws_cdk_lib_aws_cloudwatch_MetricOptions(props);\n }\n catch (error) {\n if (process.env.JSII_DEBUG !== \"1\" && error.name === \"DeprecationError\") {\n Error.captureStackTrace(error, this.metricTargetResponseTime);\n }\n throw error;\n }\n return this.metrics.targetResponseTime(props);\n }", "_getTime () {\r\n return (Date.now() - this._startTime) / 1000\r\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 cpuBound(req, res, next) {\n var key = Math.random() < 0.5 ? 'ninjaturtles' : 'powerrangers';\n var hmac = crypto.createHmac('sha512WithRSAEncryption', key);\n var date = Date.now() + '';\n hmac.setEncoding('base64');\n hmac.end(date, function() {\n res.send('A hashed date for you! ' + hmac.read());\n });\n }", "timeRemaining(reqTimeStamp) {\n let endTime= reqTimeStamp + this.validationWindow;\n let now = parseInt(new Date().getTime()/1000);\n return (endTime - now)\n }", "getTime() {\n return this.startTime ? Math.floor((Date.now() - this.startTime) / 1000) : 0;\n }", "function currentServerTime() {\n return firstServerTimestamp + (Date.now() - gameStart) - RENDER_DELAY;\n}", "infectionByRequestedTime() {\n const factor = this.powerFactor();\n return this.currentlyInfected() * 2 ** factor;\n }", "function startResponseScreen() {\n responseTime = setInterval(increaseResponse,1000);\n}", "function requestListener(req, response) {\n setTimeout(function slowListen(){response.end('Hello there!');},10000);\n }", "function handlePing(req, res){\n var response = { ping: new Date }\n res.jsonp(response)\n}", "if(iRequestStart >= oCache.oCacheData.length){\r\n \tbNeedServer=true;\r\n }", "function handleChiMetRequest(response) {\n\n var speechOutput = '';\n var cardTitle = 'Chimet';\n var chiResponseString = '';\n\n // start http timer\n console.time('http-request');\n\n // go get\n http.get(URI, function (res) {\n\n console.log('handleChiMetRequest: HTTP response for Status Code: '+res.statusCode+', for: '+URI);\n\n // if for some reason we did not get a HTTP 200 OK\n if (res.statusCode != 200) {\n\t console.log(\"handleChiMetRequest: Non 200 Response for: \"+URI);\n forecastResponseCallback(new Error(\"handleChiMetRequest: Non 200 Response for: \"+URI));\n console.timeEnd('http-request');\n }\n\n // got some more data to append\n res.on('data', function (data) {\n chiResponseString += data;\n });\n\n // in theory finished!\n res.on('end', function () {\n // should have a sensible result\n chiDataTime = new Date().getTime();\n chiData = chiResponseString.split(',');\n console.log(\"handleChiMetRequest: res.on done\");\n console.timeEnd('http-request');\n\n // format response\n speechOutput = chiData[1]+'. '+chiData[0]+'. '\n +getCompassDir(+chiData[4])+', ' +getBeaufort(chiData[2])\n +', gusting '+getBeaufort(chiData[3])+'. '\n +'Tide height '+chiData[5]+'. '\n +'Air temp '+chiData[9]+' degrees.';\n\n\t console.log(\"handleChiMetRequest: speechOutput is: \"+speechOutput);\n\t response.tellWithCard('Chai met. '+speechOutput, cardTitle, 'Chimet. '+speechOutput);\n\n });\n }).on('error', function (e) {\n console.timeEnd('http-request');\n console.log(\"handleChiMetRequest: Communications error: \" + e.message);\n });\n\n}", "function handleSocketTime(time)\n{\n}", "function fetch_pageload(hostname,path,callback) {\n\tvar rc = { hostname: hostname, path: path };\n\tvar url = \"http://\" + hostname + path\n\ttry {\n\t\tvar sdate = new Date();\n\t\trequest({url: url, json:true }, function(err,res,body){\n\t\t\tvar edate = new Date();\n\t\t\tvar page_load = edate - sdate\n\t\t\tObject.assign(rc,{\"page_load\": page_load });\n\t\t\tconsole.log(\"Pageload: \",url,\" \",page_load,\"ms\");\n\t\t callback({},rc);\n\t\t});\n\t} catch (e) {\n\t\tconsole.log(\"Pageload: Error loading \",url );\n\t\tObject.assign(rc,{\"pageload\": 0 });\n\t\tcallback({},rc);\n\t}\t\n}", "function onRequest(c_req, c_res) {\n\n console.log('Method used: ' + c_req.method);\n\n //sleep.msleep(options.delay);\n var parsedURL = url.parse(c_req.url);\n\n var reqOptions = {\n\n host: options.server,\n path: parsedURL.path,\n port: options.port,\n localport: options.local_port,\n max_requests: options.max_requests\n };\n\n // get clients browser record\n var br_rec = c_req.headers[\"user-agent\"];\n\n // ensure this browser has its record in our browserRecords\n if (browserRecords[br_rec] === undefined) {\n browserRecords[br_rec] = [];\n }\n\n // delete the timestamps older than 10 minutes (= 10 * 60 * 1000 miliseconds)\n if (browserRecords[br_rec].length > 0 && browserRecords[br_rec][0] <= (Date.now() - (10 * 60 * 1000))) {\n browserRecords[br_rec].shift();\n }\n\n // if browser exceeds max_requests\n if (browserRecords[br_rec].length >= reqOptions['max_requests']) {\n console.log(\"Max Request limit exceeded! Connection Refused!\");\n c_res.statusCode = 429; // TOO MANY REQUESTS\n c_res.end(\"429 - MAX REQUEST EXCEEDED!\"); // end response\n return;\n }\n\n // add timestamp for the new request to browserRecords\n browserRecords[br_rec].push(Date.now());\n\n var c_data = \"\";\n\n c_req.setEncoding('binary');// allows us to get all kinds of data\n\n //storing data coming in client request in a string\n c_req.on('data', function (chunk) {\n c_data += chunk;\n });\n\n // processing the data in an event handler\n c_req.on('end', function () {\n\n reqOptions.method = c_req.method;\n reqOptions.headers = c_req.headers;\n\n reqOptions.headers['host'] = reqOptions.host + \":\" + reqOptions.port;\n\n var s_data = \"\";\n\n callbackFunc = function (res) {\n\n res.setEncoding('binary');\n\n res.on('data', function (chunk) {\n s_data += chunk;\n });\n\n res.on('end', function () {\n\n // Handling Redirect errors by parsing the new URL\n if (res.statusCode == 301 || res.statusCode == 302 || res.statusCode == 303 || res.statusCode == 307 || res.statusCode == 308) {\n var temp = url.parse(res.headers.location);\n console.log(res.headers.location);\n\n if (temp.protocol.startsWith(\"https\")) {\n\n c_res.statusCode = 405;// Method not allowed\n c_res.end(\"405 - HTTPS REDIRECT DENIED!\");// end response\n\n return;\n }\n\n reqOptions.host = temp.hostname;\n reqOptions.path = temp.path;\n reqOptions.port = temp.port;\n reqOptions.headers['host'] = temp.host + \":\" + ((temp.port == null) ? '80' : temp.port);\n\n //Since 303 error makes it a compulsion to use GET instead of POST request\n if (res.statusCode == 303) {\n reqOptions.method = \"GET\";\n c_data = \"\";\n }\n\n s_data = \"\";\n var s_req = http.request(reqOptions, callbackFunc).end(c_data, 'binary');\n }\n else {\n // No redirect ERROR\n var ext = require('path').extname(reqOptions.path);\n \n c_res.writeHead(res.statusCode, res.headers);\n c_res.end(s_data, 'binary');\n }\n });\n }\n var request = http.request(reqOptions, callbackFunc).end(c_data, 'binary');\n });\n}", "lastRequest() {\n return this._lastRequest;\n }", "function receiver(request, sender, sendResponse) {\n getLevel(request.time,request.level);\n}", "get uptime() {\n if (this._state === exports.ClientState.ACTIVE\n && this._currentConnectionStartTime) {\n return Date.now() - this._currentConnectionStartTime;\n }\n else {\n return 0;\n }\n }", "function time() {\n\treturn Date.now() / 1000.0;\n}", "function goRequest(i){\n\tvar requestId = requestBody.id;\n\t//parses it to string so it can be used\n\trequestBody = JSON.stringify(requestBody);\n\trequest.write(requestBody);\n\t//starts stopwatch for current request\n\tstopwatch[i].start = new Date().getTime();\n\tconsole.log('Login Sent ' + requestId);\n\trequire('fs').writeFile('./results/' + 'Request_id_' + requestId + '_' + momentTime() +'.txt', requestBody);\n\trequest.end();\n\t//delay that is calculated by the desired tps\n\tsleep(msDelay);\n}", "_startRequest() {\n if (this._timeoutID !== undefined)\n clearTimeout(this._timeoutID);\n \n this._makeRequest()\n .then(({ request }) => {\n if (!this.isStarted)\n return;\n \n let delay = this._defaultTimeout;\n \n // Read ResponseHeader\n let cacheControl = request.getResponseHeader('Cache-Control');\n if (cacheControl !== null) {\n let maxAges = /(^|,)max-age=([0-9]+)($|,)/.exec(cacheControl);\n if (maxAges !== null &&\n maxAges[2] > 0)\n delay = Math.round(maxAges[2]*1000);\n }\n \n this.trigger('success:request', { request });\n \n if (delay !== undefined)\n this._planRequest({ delay });\n }, ({ request } = {}) => {\n if (!this.isStarted)\n return;\n \n if (request === undefined)\n return;\n \n this.trigger('error:request', { request });\n \n if (this._timeoutOnError !== undefined)\n this._planRequest({ delay: this._timeoutOnError });\n });\n }", "get uptime() {\n return new Date().getTime() - this._startTime.getTime();\n }", "function respondWithTime(){\n sendMessage(buildBotMessage(new Date().toUTCString()));\n}", "function getTime() {\n return performance.now()\n}", "async receive(request, response) {}", "async getNow() {\n const calculateNowViaServerTime$ = this.serverTime$.pipe(map(reference => this.calculateNow(reference)), first());\n return await this.serverSupportsTime$.pipe(timeout(5000), first(supportsServerTime => supportsServerTime !== 'unknown'), mergeMap(supportsServerTime => supportsServerTime ? calculateNowViaServerTime$ : of(Date.now())), catchError(() => of(Date.now()))).toPromise();\n }", "function statusCallback(latency, result, error){\n console.log(result.body);\n console.log('------------------');\n console.log('Current latency %j, result %j', latency, error ? JSON.stringify(error) + result.toString() : result);\n console.log('------------------');\n console.log('Request elapsed milliseconds:', error ? error.requestElapsed : result.requestElapsed);\n console.log('Request index :', error ? error.requestIndex : result.requestIndex);\n console.log('Request loadtest() instance index :', error ? error.instanceIndex : result.instanceIndex);\n}", "function bar(req, res) {\n //res.send(\"<a href='/foo'>foo</a>\")\n const t2 = new Date().getSeconds()\n res.send(`${t} ${t2}`)\n}", "requested (req) {\n this.lastChildReq = req.url;\n this.usedDates.unshift(Date.now());\n if (this.usedDates.length > 10) this.usedDates.pop();\n }", "function getWebcamTimeCreated(time) {\n\tvar now = new Date();\n\tvar seconds = Math.ceil(((now.getTime() / 1000) - time));\n\tvar response = \"\";\n\tif (seconds < 60) {\n\t\tresponse = seconds + \" second(s) ago\";\n\t} else if (seconds >= 60 && seconds < 3600) {\n\t\tresponse = Math.round(seconds / 60) + \" minute(s) ago\";\n\t} else if (seconds >= 3600 && seconds < 86400) {\n\t\tresponse = Math.round(seconds / 3600) + \" hour(s) ago\";\n\t} else {\n\t\tresponse = Math.round(seconds / 86400) + \" day(s) ago\";\n\t}\n\treturn response;\n}", "function serverTime() {\n\tlet currentServerTime = (new Date()).toString();\n\treturn currentServerTime\n}", "function getTime() {\n return performance.now();\n}", "function logRequest(){\n res.removeListener('finish', logRequest);\n res.removeListener('close', logRequest);\n httpLogger.info({\n startTime: req._startTime,\n duration: (new Date() - req._startTime),\n statusCode: req.statusCode,\n method: req.method,\n ip: req.ip,\n uri: req.originalUrl,\n userId: (req.user && req.user._id.toString())\n });\n }", "endTime(){\r\n var duration = (Math.random() * (2*60 - 1)*1000 + 1000);\r\n var now = new Date().getTime();\r\n return (now + duration);\r\n }", "function RequestUpdate() {\r\n //if we are already waiting for a response we shouldn't send another request\r\n if (waiting) return;\r\n //set the waiting flag to true we are going to send a new request for update\r\n waiting=true;\r\n socket.emit('Update', {lastTime:lastTime});\r\n}", "function handleRequest(req, res) {\n\n var self = this;\n\n console.log('=======================================');\n\n var perf = (new util.performance());\n console.log('Request: ', req.method, req.url);\n req.setEncoding('utf8');\n\n // console.log(req.headers);\n\n function endRequest(){\n parseQS();\n }\n req.on('end', endRequest);\n\n function endResponse(){\n console.log('Request took ' + perf.end('ms') + ' ms');\n console.log('=======================================');\n }\n res.on('finish', endResponse);\n\n function serverError(message) {\n message = (message || \"The server experienced an internal error\\n\") + \"\";\n res.writeHead(404, {\n \"Content-Type\": \"text/plain\",\n \"Content-Length\": message.length\n });\n if (req.method !== \"HEAD\") {\n res.write(message);\n }\n self.emit('serverError');\n\n res.end();\n // console.log('=======================================');\n }\n req.on('error', serverError);\n\n var refreshCache = false;\n if (req.headers['cache-control'] == 'max-age=0') {\n refreshCache = true;\n }\n req.searchCache = require.searchCache;\n req.uncache = require.uncache;\n\n //========================== Request\n\n\n this.params = {};\n this.headers = [];\n this.body = '';\n\n var uri = url_parse(req.url);\n var path = uri.pathname;\n if (path.length > 1 && path.charAt(path.length-1) == '/') {\n path = path.slice(0, path.length - 1);\n }\n if (!path) {\n path = '/';\n }\n\n // console.log(path);\n\n var content_type = mime.getMime(path);\n // console.log(content_type);\n\n function parseQS() {\n var query = typeof uri.query == 'string' ? qs.parse(uri.query) : uri.query;\n for (var key in query) {\n if (self.params[key] !== undefined) {\n if (typeof self.params[key] != 'array') {\n self.params[key] = [self.params[key]];\n }\n self.params[key].push(query[key]);\n } else {\n self.params[key] = query[key];\n }\n }\n req.params = self.params;\n\n // console.log(self.params);\n }\n\n //Checks a Javascript object if the key exists and if the value is a match on that key. 'value' can be an array (OR query). Will partially match. Returns true || false;\n req.queryObject = function(key, value, obj){\n function test(obj, key, value) {\n if (key in obj && obj[key].indexOf(value) > -1) {\n return true\n } else {\n return false;\n }\n }\n var include = false;\n if (typeof value == 'array') {\n for (var j = 0; j < value.length; ++j) {\n if (test(obj, key, value[j])) {\n include = true;\n break;\n }\n }\n } else {\n if (test(obj, key, value)) {\n include = true;\n }\n }\n return include;\n }\n\n function onData(data) {\n console.log(\"Data received\", data);\n self.body += data;\n // Too much POST data, kill the connection!\n if (self.body.length > 1e6) {\n req.connection.destroy();\n }\n self.emit('onData');\n }\n\n function onReadable(){\n var ret = '';\n while (ret += req.read()){\n console.log(\"Readable received\", ret);\n }\n self.body += ret;\n return ret;\n }\n\n function onEnd() {\n // console.log(\"Request ending\");\n self.params = !!self.body ? qs.parse(self.body) : {};\n // console.log(self.params);\n // use self.params['blah'], etc.\n self.emit('onEnd');\n self.body = '';\n\n parseQS();\n emitResponse.call(self, req, res);\n }\n\n if (req.url === '/favicon.ico') {\n res.writeHead(200, {'Content-Type': 'image/x-icon'} );\n res.end();\n // console.log('favicon requested');\n return;\n }\n\n if (req.method == 'POST') {\n req.on('data', onData);\n // req.on(\"readable\", onReadable);\n req.on('end', onEnd);\n } else {\n parseQS();\n emitResponse.call(self, req, res);\n }\n\n //========================== Response\n\n res.redirect = function redirect(location) {\n res.writeHead(302, {\"Location\": location});\n res.end();\n }\n\n function emitResponse(req, res) {\n\n // console.log(\"Emitting response\");\n\n var self = this;\n\n function notFound(message) {\n message = (message || \"Not Found\\n\") + \"\";\n res.writeHead(404, {\n \"Content-Type\": \"text/plain\",\n \"Content-Length\": message.length\n });\n if (req.method !== \"HEAD\") {\n res.write(message);\n }\n self.emit('notFound');\n\n res.end();\n // console.log('=======================================');\n }\n\n function simpleResponse(code, body, content_type, extra_headers) {\n body = body || \"\";\n res.writeHead(code, (extra_headers || []).concat(\n [ [\"Content-Type\", content_type],\n [\"Content-Length\", Buffer.byteLength(body, 'utf8')]\n ]));\n if (req.method !== \"HEAD\")\n res.write(body, 'utf8');\n res.end();\n }\n\n res.simpleText = function (code, body, extra_headers) {\n simpleResponse(code, body, \"text/plain\", (extra_headers || []).concat(self.headers));\n };\n\n res.simpleHtml = function (code, body, extra_headers) {\n simpleResponse(code, body, \"text/html\", (extra_headers || []).concat(self.headers));\n };\n\n res.simpleJson = function (code, json, extra_headers) {\n simpleResponse(code, JSON.stringify(json), \"application/json\", (extra_headers || []).concat(self.headers));\n };\n\n res.notFound = function (message) {\n notFound(message);\n };\n\n res.onlyHead = function (code, extra_headers) {\n res.writeHead(code, (extra_headers || [])\n .concat(self.headers)\n .concat(\n [[\"Content-Type\", content_type]]\n )\n );\n res.end();\n }\n\n // console.log(util.inspect(self, { showHidden: true, depth: 4 }));\n // res.simpleJson(200, {test:true});\n // return;\n\n var controllerPath = '';\n var resourceId = 0;\n controllerPath = path.split('/');\n\n if (!!controllerPath[controllerPath.length-1]\n && !isNaN(parseInt(controllerPath[controllerPath.length-1]))) {\n resourceId = parseInt(controllerPath[controllerPath.length-1]);\n controllerPath = controllerPath.slice(0, controllerPath.length-1).join('/');\n } else {\n controllerPath = path;\n resourceId = 0;\n }\n\n // console.log(controllerPath);\n\n var RESPONSE_TYPE = {\n JSON : 1,\n MODULE : 2,\n HTML : 3,\n CONTROLLER : 4,\n OTHER : 5\n }\n\n var resourcePath = '';\n var resourceType = 0;\n\n if (req.method == \"GET\" && fs.existsSync('.' + path + '.json')) {\n resourcePath = '.' + path + '.json';\n resourceType = RESPONSE_TYPE.JSON;\n } else if (fs.existsSync('./public' + path) && fs.statSync('./public' + path).isFile()) {\n resourcePath = './public' + path;\n resourceType = RESPONSE_TYPE.HTML;\n } else if (fs.existsSync('.' + path + '.js')) {\n resourcePath = '.' + path + '.js';\n resourceType = RESPONSE_TYPE.MODULE;\n } else if (req.method != \"GET\" && fs.existsSync('.' + controllerPath + '.js')) {\n resourcePath = '.' + controllerPath + '.js';\n req.params.resourceId = resourceId;\n resourceType = RESPONSE_TYPE.MODULE;\n } else if (path.charAt(path.length-1) == '/') {\n if (fs.existsSync('./public' + path + 'index.html')) {\n resourcePath = './public' + path + 'index.html';\n resourceType = RESPONSE_TYPE.HTML;\n } else {\n self.body = \"<h1>No index file found. Please place an index.html file in \"+'./public' + path+\"</h1>\";\n res.simpleHtml(200, self.body);\n return;\n }\n }\n\n if (refreshCache) {\n // require.uncache(resourcePath);\n console.log('Cache max-age set to 0');\n }\n\n if (path.indexOf('lib/') > -1) {\n resourcePath = '';\n resourceType = 0;\n // console.log(\"whoops\")\n }\n\n switch(resourceType) {\n case RESPONSE_TYPE.JSON :\n res.simpleJson(200, require(resourcePath));\n break;\n case RESPONSE_TYPE.MODULE :\n var controller = require(resourcePath).Controller;\n // console.log(controller);\n res.simpleJson(200, controller[req.method.toLowerCase()](req, res) );\n break;\n case RESPONSE_TYPE.HTML :\n var content_type = mime.getMime(resourcePath);\n self.body = fs.readFileSync(resourcePath, {encoding: 'utf8'});\n simpleResponse(200, self.body, content_type);\n break;\n case RESPONSE_TYPE.OTHER :\n break;\n default :\n res.notFound('That resource doesn\\'t exist');\n break;\n }\n }\n}", "function o2ws_get_time() { return o2ws_get_float(); }", "function get_time() {\n return new Date().getTime();\n}", "function get_time() {\n return new Date().getTime();\n}", "_requestIfNeeded() {\n if (this._requestId === null && this._head.next) {\n // ensure callbacks get correct delta\n this.lastTime = performance.now();\n this._requestId = requestAnimationFrame(this._tick);\n }\n }", "function calc() { // @ret Object: { processing, redirect, appcache,\n // dns, dom, load, fetch }\n // processing - Number: Processing time\n // redirect - Number: redirect elapsed\n // appcache - Number: Application cache elapsed\n // dns - Number: DomainLookup elapsed\n // dom - Number: DOMContentLoaded event elapsed\n // load - Number: window.load event elapsed\n // fetch - Number: fetchStart to window.load event finished\n // @help: Perf.calc\n // @desc: calc performance data\n\n var tm = (global.performance || 0).timing || 0;\n\n if (!tm) {\n return { processing: 0, redirect: 0, appcache: 0,\n dns: 0, dom: 0, load: 0, fetch: 0 };\n }\n return {\n processing: tm.loadEventStart - tm.responseEnd,\n redirect: tm.redirectEnd - tm.redirectStart,\n appcache: tm.domainLookupStart - tm.fetchStart,\n dns: tm.domainLookupEnd - tm.domainLookupStart,\n dom: tm.domContentLoadedEventEnd - tm.domContentLoadedEventStart,\n load: tm.loadEventEnd - tm.loadEventStart,\n fetch: tm.loadEventEnd - tm.fetchStart\n };\n}", "function DynamicClass_request(elm)\n {\n logDebug(\"DynamicClass_request: \", elm.source) ;\n var def = doTimedXMLHttpRequest(elm.source, pollerTimeout);\n def.addBoth(DynamicClass_receive, elm) ;\n return;\n }", "function log(tokens, req, res) {\n return [\n tokens.method(req, res),\n tokens.url(req, res),\n tokens.status(req, res),\n tokens.res(req, res, \"Content-Length\"),\n \"-\",\n tokens[\"response-time\"](req, res),\n \"ms\",\n ].join(\" \");\n}", "function ConRequest(res,time){\n this.res = res\n this.time = time\n this.sendAlert = function(uid,devID){\n this.res.send({type:\"alert\",uid:uid,devID:devID})\n }\n this.sendMsg = function(msg){\n this.res.send(msg)\n }\n this.send = function(msg){\n this.res.send(msg)\n }\n}", "function now() {\r\n return window.performance.now();\r\n}", "function processGetRequest(req, res) {\n console.log(\"incoming get request, serving...\");\n res.writeHead(200, {\n 'Access-Control-Allow-Origin': 'http://localhost:63342',\n 'Content-Type': 'text/event-stream',\n 'cache-control': \"no-cache\"\n });\n let currTime = new Date().getTime();\n\n // 'loop' using recursion (cannot use while loop with sleep in node.js)\n sendEvent(res, currTime);\n }", "function detect_latency(tt) {\n var adjusted_time = rnow() - TIME_DRIFT;\n return adjusted_time - tt / 10000;\n }", "get lastAccessed() {\n return this.originalResponse.lastAccessed;\n }", "get lastAccessed() {\n return this.originalResponse.lastAccessed;\n }" ]
[ "0.75744617", "0.7416566", "0.6893877", "0.68084794", "0.6781717", "0.6561443", "0.652187", "0.65142745", "0.6462254", "0.6462254", "0.6462254", "0.6245028", "0.6245028", "0.62287295", "0.6191165", "0.61851764", "0.61500037", "0.61434627", "0.6104452", "0.60714453", "0.59459287", "0.59060436", "0.58571017", "0.57958275", "0.57907593", "0.5785792", "0.57779795", "0.5763611", "0.5759912", "0.5759912", "0.5755042", "0.5715072", "0.5715072", "0.5685011", "0.5681855", "0.5670702", "0.5629755", "0.56014997", "0.56004673", "0.5581636", "0.5581636", "0.5580826", "0.5537459", "0.5533365", "0.5530549", "0.5523495", "0.55213124", "0.5512377", "0.55032367", "0.54988503", "0.54851866", "0.5474145", "0.5436811", "0.5421889", "0.541727", "0.53949934", "0.538233", "0.53657097", "0.53635037", "0.5360236", "0.53594816", "0.5354047", "0.5345034", "0.5340865", "0.5337077", "0.5320799", "0.53133166", "0.5312918", "0.5309177", "0.53040355", "0.52969545", "0.5293698", "0.5292852", "0.5289349", "0.52813035", "0.52800304", "0.52789706", "0.5273481", "0.52660996", "0.5264179", "0.52552384", "0.52538586", "0.5253618", "0.52498597", "0.52491856", "0.5242672", "0.5240507", "0.52375615", "0.5215095", "0.52128035", "0.52128035", "0.52121925", "0.52084476", "0.52074724", "0.52071625", "0.52045405", "0.52040297", "0.5199833", "0.5197118", "0.5192249", "0.5192249" ]
0.0
-1
Total Transactions per second
function refreshTotalTPS(fixTimestamps) { var infos = totalTPSInfos; // We want to ignore seriesFilter prepareSeries(infos.data, false, true); if(fixTimestamps) { fixTimeStamps(infos.data.result.series, 28800000); } if(isGraph($("#flotTotalTPS"))){ infos.createGraph(); }else{ var choiceContainer = $("#choicesTotalTPS"); createLegend(choiceContainer, infos); infos.createGraph(); setGraphZoomable("#flotTotalTPS", "#overviewTotalTPS"); $('#footerTotalTPS .legendColorBox > div').each(function(i){ $(this).clone().prependTo(choiceContainer.find("li").eq(i)); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "totalTime() {\n let time = 0\n this.measures.forEach(m => time += m.totalTime())\n return time\n }", "function updateValues() {\n\tconst amounts = transactions.map((transaction) => transaction.time);\n\n\tconst total = amounts.reduce((acc, item) => (acc += item), 0);\n\t//console.log(time, amounts, total);\n\n\tbalance.innerText = `${total} min`;\n}", "getReqPerTime() {\n let sum_time = 0.0\n let dif = 0.0\n for (let d = 0; d < this.state.data.length; d++) {\n dif = new Date(this.state.data[d].dt_end_log).getTime() - new Date(this.state.data[d].dt_Start_Log).getTime()\n sum_time += dif / 1000\n }\n \n return (sum_time / this.state.data.length)\n }", "getTrafficLogTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficLogs()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_LOG_COUNT', count)\n }\n\n getItems()\n }", "getTrafficTraceTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficTraces()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_TRACE_COUNT', count)\n }\n\n getItems()\n }", "getTotalCost() {\n return this.transactions.map(t => t.cost).reduce((acc, value) => acc + value, 0);\n }", "function calculateTotalTime() {\n\t\tfor ( var i = 0, count = times.length; i < count; i++ ) {\n\t\t\ttotalTime += +times[i].time;\n\t\t}\n\t}", "function calculateTotalTime() {\n\t\tfor ( var i = 0, count = times.length; i < count; i++ ) {\n\t\t\ttotalTime += +times[i].time;\n\t\t}\n\t}", "totalTime() {\n return this.duration() / (this.tempo() / 60)\n }", "@computed get priceFetchDiffSeconds() {\n return (this.lastPriceFetchTime - Date.now()) / 1000;\n }", "calculateSeconds() {\n const millisecondsToSeconds = 0.001;\n let totalmilliseconds = Date.now() - this.birthday.getTime();\n this.secondsCount = totalmilliseconds * millisecondsToSeconds;\n\n return this.secondsCount;\n }", "static getTotalTime() {\r\n let totalTimer = 0;\r\n const profiles = Store.getProfiles();\r\n if (localStorage.getItem('profiles') !== null) {\r\n profiles.forEach((profile) => {\r\n totalTimer += profile.monthTime;\r\n });\r\n }\r\n return totalTimer;\r\n }", "get total_time() { return this._total_time; }", "async getTotalPayouts() {\n // todo pass blockchain identity\n const totalAmount = await this.blockchain\n .getTotalPayouts(this.profileService.getIdentity()).response;\n this.socket.emit('total_payouts', totalAmount);\n }", "timeTaken(){\n var resultTime = this._endTime - this._startTime; \n var diff = Math.ceil(resultTime / 1000); \n this._timeTaken = diff;\n return diff ;\n }", "getTotalProductionPerSecond() {\n var productionPerSecond = 0;\n Object\n .keys(this.Model.upgrades)\n .forEach( (key, index) => {\n productionPerSecond += this.getProductionPerSecond(key);\n });\n return Math.round(productionPerSecond * 10) / 10;\n }", "totalUpdates() {\n return 30;\n }", "function ReduceTime() {\n totalSeconds = totalSeconds - 30;\n return totalSeconds;\n }", "function Total(DailyRent, time) {\r\n TotalRent = DailyRent * time;\r\n }", "get messagesPerSecond() {\n return this.getNumberAttribute('messages_per_second');\n }", "getTotalMilliseconds() {\n return this._quantity;\n }", "function utregningTid() {\n spentMilliseconds = Math.floor(finishTime - startTime);\n //spentSeconds = spentMilliseconds / 1000;?\n totalTider.push(spentMilliseconds);\n total = totalTider.reduce((a, b) => a + b, 0);\n snitt = total / totalTider.length;\n}", "seconds(prevTime, curTime){\n let time = curTime - prevTime;\n let seconds = time/1000;\n return seconds.toFixed(2);\n}", "getTotal(transaction){\n var total = 0;\n for(var i = 0;i<transaction.details.recipients.length;i++){\n total += transaction.details.recipients[i].amount;\n }\n\n return total + transaction.details.fee;\n }", "getTotalPayment() {\n let total = 0;\n this.operations.forEach(op => {\n total += op.amount;\n });\n return total;\n }", "function TotalSeconds(date) {\n return parseInt((date.getTime() - datedefault.getTime()) / 1000);\n}", "function calcularPorcentajeTranscurrido(tiempoTrans, tiempoTotal){\n return (tiempoTrans/tiempoTotal)*100;\n}", "function calculateTransactionTotal(transData) {\n\t\t\tlet fromTotal = transData.from.amount,\n\t\t\t\tfromLoading = transData.from.loading,\n\t\t\t\ttoTotal = transData.to.amount,\n\t\t\t\ttoLoading = transData.to.loading;\n\n\t\t\tlet fromCommission = 0,\n\t\t\t\ttoCommission = 0,\n\t\t\t\tcommissionLoading = false;\n\n\t\t\tif (commission) {\n\t\t\t\tfor (let commId in transData.commission) {\n\t\t\t\t\tlet commData = transData.commission[commId];\n\n\t\t\t\t\tfromCommission += (commData.feeInAccountCurrency || 0);\n\t\t\t\t\ttoCommission += (commData.feeInPaymentCurrency || 0);\n\t\t\t\t\tcommissionLoading = commissionLoading || commData.loading;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tcommission: {\n\t\t\t\t\tfrom: fromCommission,\n\t\t\t\t\tto: toCommission,\n\t\t\t\t\tloading: commissionLoading\n\t\t\t\t},\n\t\t\t\tfrom: {\n\t\t\t\t\tcurrency: transData.from.currency,\n\t\t\t\t\tamount: transData.from.amount + fromCommission,\n\t\t\t\t\tloading: transData.from.loading || commissionLoading,\n\t\t\t\t},\n\t\t\t\tto: {\n\t\t\t\t\tcurrency: transData.to.currency,\n\t\t\t\t\tamount: transData.to.amount + toCommission,\n\t\t\t\t\tloading: transData.to.loading || commissionLoading,\n\t\t\t\t},\n\t\t\t}\n\t\t}", "function printTotals(){\n var endMilliseconds = new Date().getTime();\n var totalMilliseconds = endMilliseconds - pound.startMilliseconds;\n console.log('pound completed %s requests in %s ms. \\nreceived responses: %s. \\nhighest number of open connections was: %s. \\nrequest errors: %s' +\n '\\nrequests per second: %s. \\nresponses per second: %s',\n pound.requestsGenerated, totalMilliseconds,\n pound.responsesReceived,\n pound.highestOpenConnectionsAtOneTime,\n pound.requestErrorCount,\n pound.requestsPerSecond,\n pound.responsesPerSecond);\n }", "get uptime() {\n if (this._state === exports.ClientState.ACTIVE\n && this._currentConnectionStartTime) {\n return Date.now() - this._currentConnectionStartTime;\n }\n else {\n return 0;\n }\n }", "_getTime () {\r\n return (Date.now() - this._startTime) / 1000\r\n }", "function CalculateTime(){\n now = Date.now();\n deltaTime = (now - lastUpdate) / 1000;\n lastUpdate = now;\n}", "getTotalTime(){\n return this.totalTime;\n }", "function statistics() {\n\t/*var time = Date.now() - startTime - pauseTime;\n\t\tvar seconds = (time / 1000 % 60).toFixed(2);\n\t\tvar minutes = ~~(time / 60000);\n\t\tstatsTime.innerHTML = (minutes < 10 ? '0' : '') + minutes +\n\t(seconds < 10 ? ':0' : ':') + seconds;*/\n}", "function recordSegmentDownloadRate() {\r\n\ttotalEndTime = performance.now();\r\n\tvar totalTime = totalEndTime - totalStartTime;\r\n\tdocument.getElementById(\"result\").events_textarea.value += \"TotalTime:\" + totalTime + \"\\n\";\r\n}", "function seconds_elapsed() {\n var date_now = new Date();\n var time_now = date_now.getTime();\n var time_diff = time_now - startTime;\n var seconds_elapsed = Math.floor(time_diff / 1000);\n return (seconds_elapsed);\n}", "totalSpent(){\n return this.meals().reduce((a,b)=>(a += b.price), 0);\n }", "function statistics() {\n var time = Date.now() - startTime - pauseTime;\n var seconds = (time / 1000 % 60).toFixed(2);\n var minutes = ~~(time / 60000);\n statsTime.innerHTML = (minutes < 10 ? '0' : '') + minutes +\n (seconds < 10 ? ':0' : ':') + seconds;\n}", "getTrafficRouteTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficRoutes()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_ROUTE_COUNT', count)\n }\n\n getItems()\n }", "total() {\n return transactionObj.incomes() + transactionObj.expenses()\n }", "function MilliSecondsElapsed()\r\n{\r\n\toTimeNow = new Date();\r\n\treturn (oTimeNow - ACROSDK.oTimeStart);\r\n}", "function getTimeSecs()\n{\n return (new Date()).getTime() / 1000;\n}", "function billsTotal(){\n totally = totalCall + totalSms;\n }", "function spendSomeTime() {\n let total = 0;\n for (let i = 0; i < 10000; i++) {\n total += i;\n }\n}", "function calcularTiempoEjecucion(){\n\t\tvar tiempo = new Date().getTime() - tiempo_ejecucion;\n\t\tvar div = find(\"//div[@class='div3']\", XPFirst);\n\t\tdiv.appendChild(elem(\"P\", \"TB: \" + tiempo + \" ms\"));\n\t}", "getCumulativeTotal() {\n var transactions = fake_data.transactions.sort((a, b) => {\n return new Date(a.date) - new Date(b.date);\n });\n console.log(transactions);\n var starting_balance = fake_data.balance;\n var totalValues = [];\n var total = 0;\n transactions.forEach((t) => {\n starting_balance += t.amount;\n totalValues.push(starting_balance);\n });\n return totalValues;\n }", "function calcTimeComplete(log) {\n let timeComplete = 0;\n for (let entry of log) {\n timeComplete += entry.timeInMinutes;\n }\n return timeComplete;\n }", "function timeSeconds() {\n return timeMS() / 1000;\n}", "total(){\n return Transaction.incomes() + Transaction.expenses();\n }", "function getTotalThreat(){\n\t\tvar total = 0;\n\t\t/* Rate multiplier */\n\t\tswitch ( (amounts || defaultParams).rateMultiplier ){\n\t\t\tcase RateMultiplier.TIMES1:\n\t\t\t\tbreak;\n\t\t\tcase RateMultiplier.TIMES2:\n\t\t\t\ttotal += 10;\n\t\t\t\tbreak;\n\t\t\tcase RateMultiplier.TIMES4:\n\t\t\t\ttotal += 20;\n\t\t\t\tbreak;\n\t\t}\n\t\treturn total;\n\t}", "get dailyUsage() {\n if (this.transactionBatches.length === 0) return 0;\n\n // Get all transaction batches confirmed in the last three months\n const sinceDate = new Date();\n sinceDate.setTime(sinceDate.getTime() - USAGE_PERIOD_MILLISECONDS);\n const transactionBatches = this.transactionBatches\n .filtered('transaction.confirmDate >= $0', sinceDate);\n\n // Get the total usage over that period\n const totalUsage = getTotal(transactionBatches, 'usage');\n\n\n // Calculate and return the daily usage over either the usage period, or since this batch was\n // added if that is shorter\n const currentDate = new Date();\n let usagePeriod = millisecondsToDays(USAGE_PERIOD_MILLISECONDS);\n if (transactionBatches.length === this.transactionBatches.length) {\n // This item batch has no transaction batches older than the usage period constant,\n // use the actual amount of time it has been around for as the usage period\n usagePeriod = millisecondsToDays(currentDate.getTime() - this.addedDate.getTime());\n }\n const dailyUsage = usagePeriod ? totalUsage / usagePeriod : 0;\n return dailyUsage;\n }", "function getTotal() {\n const { cart } = state;\n\n const res = cart.reduce((prev, product) => {\n return (prev + (product.price * product.count));\n }, 0);\n\n dispatch({\n type: 'TOTAL',\n payload: res\n });\n }", "function getCall() {\n return callTot.toFixed(2);\n }", "function Calls() {\n return callTotal.toFixed(2);\n }", "function getTotalTime(songs) {\n var total = 0;\n for(var i = 0; i < songs.length; i++) {\n total += (parseInt(songs[i].length1) + parseInt(songs[i].length2));\n }\n return total;\n}", "function calcTotalTotal() {\n totalTotal = 0;\n for (var i = 0; i < hours.length; i++) {\n totalTotal += combinedHourlyCookies[i];\n }\n}", "function getTotalBalance (s, cb) {\n s.exchange.getBalance(s, function (err, balance) {\n if (err) {\n console.log(err)\n return cb(err)\n \n }\n \n var summary = {product: s.product_id, asset: balance.asset, currency: balance.currency}\n\n s.exchange.getQuote({product_id: s.product_id}, function (err, quote) {\n if (err) return cb(err)\n asset_value = n(balance.asset).multiply(quote.ask)\n summary.currency_value = n(balance.currency)\n //myLog(s.product_id + \": \" + n(balance.asset).format('0.00') + \" \" + quote.ask + \" Total: \" + asset_value.format('0.00'))\n summary.ask = quote.ask\n summary.asset_value = asset_value\n cb(summary)\n })\n })\n \n }", "_getChangePercentPerMinute(currTrade, prevTrade) {\n this.logger.log(base_1.LogLevel.TRACE, `currQuote: ${currTrade.p} prevQuote: ${prevTrade.p} -- currQuote.t = ${currTrade.t} --- prevQuote.t = ${prevTrade.t}`);\n this.logger.log(base_1.LogLevel.TRACE, `Time difference in seconds: ${((currTrade.t / 1000) - (prevTrade.t / 1000))}`);\n let currTradePrice = new decimal_js_1.Decimal(currTrade.p);\n let prevTradePrice = new decimal_js_1.Decimal(prevTrade.p);\n // This gets the difference between the two quotes, and get's the % of that change of a share price. i.e (11 - 10) / 11 = 10%;\n let changePercent = new decimal_js_1.Decimal(currTradePrice.minus(prevTradePrice)).dividedBy(currTradePrice).times(100);\n console.log(`ChangePercent: ${changePercent.toString()}`);\n //Gets time difference in seconds, and translate to minutes\n let currTradeSeconds = new decimal_js_1.Decimal(currTrade.t).dividedBy(1000);\n let prevTradeSeconds = new decimal_js_1.Decimal(prevTrade.t).dividedBy(1000);\n let timeDifferenceInMinutes = new decimal_js_1.Decimal(new decimal_js_1.Decimal(currTradeSeconds).minus(prevTradeSeconds)).dividedBy(60);\n console.log(`TimeDifferenceInSeconds: ${timeDifferenceInMinutes.toString()}`);\n //Returns the rate of increase (as a percentage) per minute;\n return changePercent.dividedBy(timeDifferenceInMinutes).toNumber();\n }", "function timeToRead(array) {\n\t\tvar total = 0;\n\n\t\tarray.each(function() {\n\t\t\ttotal += Math.round(60*$(this).text().split(' ').length/200); // 200 = number of words per minute\n\t\t});\t\n\n\t\treturn total; \n\t}", "function TotalCount()\n{\n\tvar totalcount = 0;\n\tfor (var i in Cart) {\n\t totalcount += Cart[i].count;\n\t}\n\treturn totalcount;\n}", "function getProgress() {\n if (_currSec < 0) {\n return 0;\n } else {\n return Math.floor((_currSec / _totalSecs) * 100);\n }\n }", "computeTotals()\n {\n if (this.file.transactions.length == 0)\n return\n\n this.totalSpendings = this.file.transactions\n .map(x => Math.min(x.amount, 0))\n .reduce((acc, x) => acc + x)\n\n this.totalIncome = this.file.transactions\n .map(x => Math.max(x.amount, 0))\n .reduce((acc, x) => acc + x)\n }", "function rxFetchUserCount() {\n logger.info(`shortDelay: ${shortDelay} shortUpdateDuration:${shortUpdateDuration}`);\n rx.Observable.timer(shortDelay, shortUpdateDuration).flatMap(() => {\n logger.info(`[time task] rxFetchUserCount :::`);\n return user.getUserCount();\n }).subscribe(data => {\n logger.info(`[time task] fetch user count next ${JSON.stringify(data)}`);\n global.userCount = data;\n ServerConfig.userCount = data;\n }, error => {\n logger.error(`[time task] fetch user count error ${error}`);\n })\n}", "async fetchTotalSupply() {\n return Number(200000000);\n }", "function calculateAcitivtyTotalAndUpdate(activityAmount) {\n let currentAmount = parseInt($(\"span#total-activities\").text());\n currentAmount += activityAmount;\n $(\"span#total-activities\").empty().text(currentAmount);\n\n }", "getTrafficPermissionTotalCount ({ commit }) {\n const getItems = async () => {\n const entities = await api.getAllTrafficPermissions()\n const count = entities.items.length\n\n commit('SET_TOTAL_TRAFFIC_PERMISSION_COUNT', count)\n }\n\n getItems()\n }", "calcTime(){\n const numIng=this.ingredients.length;//ingredients is an array \n const periods= Math.ceil(numIng/3);\n this.time=periods*15;\n }", "getCompletedPerUnit() {\n return this.recentProgress / this.windowLength;\n }", "get progress() {\n if (this.loop) {\n const now = this.now();\n const ticks = this._clock.getTicksAtTime(now);\n return ((ticks - this._loopStart) / (this._loopEnd - this._loopStart));\n }\n else {\n return 0;\n }\n }", "function totalAutoMoneyPerSecond() {\n MoneyForThisRound += MoneyPerSecondForThisRound / 10; //add money per sec to money for this round\n totalMoney += MoneyPerSecondForThisRound / 10;\n if(totalMPS < MoneyPerSecondForThisRound){\n totalMPS = MoneyPerSecondForThisRound;\n }\n displayMoney(); \n}", "calculate() {\n if (this.store.length == 0) return 0;\n let intervals = [];\n let total = 0;\n for (var i = 1; i < this.store.length; i++) {\n let interval = this.store[i] - this.store[i - 1];\n if (isNaN(interval)) debugger;\n intervals.push(interval);\n total += interval;\n }\n\n if (this.store[0] < performance.now() - 5000) {\n // Haven't received any pulses for a while, reset\n this.store = [];\n return 0;\n }\n if (total == 0) return 0;\n return total / (this.store.length - 1);\n }", "getTime() {\n return this.startTime ? Math.floor((Date.now() - this.startTime) / 1000) : 0;\n }", "function updateCostTotal() {\n console.log(\"Total purchases: $\" + sessionCostTotal.toFixed(2) + \"\\n\");\n}", "balance(){\nlet sum = 0\nfor (let i=0; i < this.transactions.length; i++) {\n sum = sum + this.transactions[i].amount;\n} return sum\n }", "function countSum() {\n\tvar sum = 0;\n\tvar timeWasted = JSON.parse(localStorage[\"timeWasted\"]);\n\t\tif (timeWasted !== undefined) {\n\t\t\tsum = timeWasted + UPDATE_SECONDS;\n\t\t\tlocalStorage[\"timeWasted\"] = JSON.stringify(sum);\n\t\t\tconsole.log('Total time wasted is ' + sum + ' seconds');\n\n\t\t\tvar target = JSON.parse(localStorage[\"target\"]);\n\t\t\tvar key = localStorage[\"keyVal\"];\n\t\t\tif (target !== 0 && !waiting && key !== \"Vaan\" && key !== \"Squall\") {\n\t\t\t\tcheckWasteTarget(sum, target);\n\t\t\t}\t\n\t\t\telse console.log(\"no target set\");\n\t\t\tif (waiting) console.log(\"waiting patiently\");\n\t\t}\n\t\telse console.log(\"PANIC: timeWasted undefined!!\");\n}", "function getSumTotalBytes () {\n return getActiveDownloads().reduce((acc, item) => acc + item.getTotalBytes(), 0)\n}", "function timeRun() {\n return ((new Date()).getTime() - START_TIME)/1000;\n}", "function secondsCount(hours, minutes, seconds) {\n return hours * 3600 + minutes * 60 + seconds; \n}", "function averageTime(total, numberOfElements) {\t\t\n\t\t\tvar avg = ( (total / 1000) / numberOfElements);\n\t\t\treturn avg;\n\t\t}", "function getTotalCount() {\n\t// go through all pCount in data array. then return total quantity.\n\tvar totalCount = 0; //default value 0\n\tvar jsonStr = cookieObj.get(\"datas\");\n\tvar listObj = JSON.parse(jsonStr);\n\tfor(var i = 0; i < listObj.length; i++) {\n\t\ttotalCount = listObj[i].pCount + totalCount;\n\t}\n\treturn totalCount;\n}", "get_txCount()\n {\n return this.liveFunc._txCount;\n }", "function Transaction() {\n\n function typeTranslate(type) {\n switch (type) {\n case 'in':\n return 'Incoming';\n case 'out':\n return 'Spent';\n case 'pending':\n return 'pending';\n case 'pool':\n return 'Pool';\n case 'failed':\n return 'Failed';\n default:\n throw new Error('Unknown transaction type: ' + type);\n }\n }\n\n function format(val) {\n return val < 10 ? '0' + val.toString() : val.toString();\n }\n\n function toTime(dt) {\n return [dt.getHours(), dt.getMinutes(), dt.getSeconds()].map(format).join(':');\n }\n\n function toDate(dt) {\n return [dt.getDate(), dt.getMonth() + 1, dt.getFullYear()].map(format).join('.');\n }\n\n this.generateTableRow = function (tx, price_usd) {\n\n var type = typeTranslate(tx.type);\n var dt = new Date(tx.timestamp * 1000);\n var date = toDate(dt);\n var time = toTime(dt);\n var amount = Math.round(tx.amount / 1000000000) / 1000;\n var usd = Math.round(amount * price_usd);\n var template = '\\n <td>' + type + '</td>\\n <td>\\n <div class=\"transactions-table__xmr bold\">' + amount + ' XMR</div>\\n <div class=\"transactions-table__usd\">' + usd + ' USD</div>\\n </td>\\n <td>' + tx.payment_id + '</td>\\n <td>' + date + '</td>\\n <td data-transaction-id=\"' + tx.txid + '\">\\n <div class=\"transactions-table__time\">' + time + '</div>\\n <div class=\"transactions-table__details\">details</div>\\n </td>\\n ';\n var tr = document.createElement('tr');\n tr.innerHTML = template;\n tr.className = \"tr-generated\";\n return tr;\n };\n\n this.compare = function (tx1, tx2) {\n return tx1.txid === tx2.txid;\n };\n\n this.datetime = function (tx) {\n var dt = new Date(tx.timestamp * 1000);\n return { date: toDate(dt), time: toTime(dt) };\n };\n\n // this.findRestorHeight = function(txs){\n // let out = txs\n // .filter((tx)=>{\n // return tx.type === 'out';\n // }).sort((tx1,tx2)=>{\n // return tx1.timestamp - tx2.timestamp;\n // });\n // };\n}", "function get_trades_total() {\n let total_trades = stories_data[current_story]\n .filter(x => x.PartnerISO == \"WLD\")\n .map(x => parseInt(x.Value))\n .reduce((x,y) => x + y);\n return total_trades;\n}", "function getTotal() {\n\t\treturn cart.reduce((current, next) => {\n\t\t\treturn current + next.price * next.count;\n\t\t}, 0);\n\t}", "static getRefreshCost() {\n let notComplete = player.completedQuestList.filter((elem) => { return !elem(); }).length;\n return Math.floor(250000 * Math.LOG10E * Math.log(Math.pow(notComplete, 4) + 1));\n }", "function interval() {\n var requestsRemaining = Math.max(1, remaining);\n // Always underconsume, and leave a bit of a buffer by pretending the rate\n // is running out earlier.\n var timeTillReset = Math.max(1, (resetAt + 500) * 1000 - Date.now());\n return timeTillReset / requestsRemaining;\n}", "function getTotal(counters) {\n return counters.reduce((sum, c) => sum + c.state.count, 0);\n}", "incTotal(delta: number = 1) {\n const { total } = this.getState();\n this.setTotal(total + delta);\n }", "getDelta() {\n\t\tlet diff = 0;\n\t\tif ( this.autoStart && ! this.running ) {\n\t\t\tthis.start();\n\t\t\treturn 0;\n\t\t}\n\t\tif ( this.running ) {\n\t\t\tconst newTime = ( typeof performance === 'undefined' ? Date : performance ).now();\n\t\t\tdiff = ( newTime - this.oldTime ) / 1000;\n\t\t\tthis.oldTime = newTime;\n\t\t\tthis.elapsedTime += diff;\n\t\t}\n\t\treturn diff;\n\t}", "function countT() {\n ++Seconds;\n var hour = Math.floor(Seconds /3600);\n var minute = Math.floor((Seconds - hour*3600)/60);\n var xseconds = Seconds - (hour*3600 + minute*60);\n document.getElementById(\"time\").innerHTML = hour + \":\" + minute + \":\" + xseconds;\n}", "async function getTotalCount(){\n\n return dbConnection.collection(collection.log).aggregate(\n [\n {\n $group :\n {\n _id : \"$conversation_id\",\n conversations: { $push: \"$$ROOT\" }\n }\n },\n {$unwind: \"$conversations\"},\n {$group: {\n _id: \"$_id\",\n firstItem: { $first: \"$conversations\"},\n lastItem: { $last: \"$conversations\"},\n countItem: { \"$sum\": 1 }\n }},\n\n { \"$project\": {\n\n \"minutes\": {\n \"$divide\": [{ \"$subtract\": [ \"$lastItem.date\", \"$firstItem.date\" ] }, 1000*60]\n },\n \"counter\": \"$lastItem.context.system.dialog_request_counter\"\n },\n },\n {\n \"$match\": { \"counter\": {$gt: 1 } }\n },\n {\n $count: \"total_doc\"\n }\n ],\n {\n cursor: {\n batchSize: 10000\n },\n allowDiskUse: true,\n explain: false\n }, null)\n .toArray()\n .then((total_doc) => total_doc)\n}", "function transaction() {\n // * CURRENT transaction\n if (AccountType === \"CURRENT\") {\n Accounts[AccountID].current += TransactionValue;\n\n // * SAVINGS transaction\n } else if (AccountType === \"SAVINGS\") {\n // (1) - if withdrawal is made from SAVINGS but the required sum does not exist, only the total available amount is transferred\n // i.e. SAVINGS does not drop below 0\n if (TransactionValue < 0 && Accounts[AccountID].savings < Math.abs(TransactionValue)) {\n Accounts[AccountID].savings -= Accounts[AccountID].savings;\n // (2) - regular SAVINGS transaction\n } else {\n Accounts[AccountID].savings += TransactionValue;\n }\n }\n }", "keskiarvo() {\n let sum = this.state.timer20.reduce((previous, current) => current += previous);\n let avg = sum / this.state.timer20.length;\n return avg\n }", "get uptime() {\n return new Date().getTime() - this._startTime.getTime();\n }", "total() {\n const rawTotal = this.rawTotal();\n const appliedDiscounts = this.getAppliedDiscounts();\n const discountTotal = this.discountSrv.total(appliedDiscounts);\n return rawTotal - discountTotal;\n }", "function ms_seconds(x){ return x / 1000;}", "updateTCUs() {\r\n this.calculateTCUs(-1, -1);\r\n }", "countBalance() {\n\t\tvar bal = 0;\n\t\tfor(var i=0;i<this.coins.length;i++) {\n\t\t\tbal += this.coins[i].value;\n\t\t}\n\t\tthis.balance = bal;\n\t}", "function getTotalSeconds(time) {\n var parts = time.split(':');\n return ((parseInt(parts[0]) * 60) + parseInt(parts[1]));\n }", "function getTotalMoney() {\n return Purchase.find().then(function(purchases) {\n let total = 0;\n for (i=0; i < purchases.length; i++) {\n total += purchases[i].cost;\n }\n return total;\n })\n}", "async function numberkmsPerc() {\n let kms = 0;\n const response = await fetch(`${urlBaseSQL}/read/user/vehicles/${idUser}`, {\n headers: {\n \"Authorization\": auth\n }\n })\n if (response.status == 200) {\n const veicules = await response.json();\n for (const veicule of veicules) {\n const response2 = await fetch(`${urlBaseSQL}/trip/read/${veicule.id}`, {\n headers: {\n 'Authorization': auth\n }\n });\n if (response2.status == 200) {\n const trips = await response2.json();\n for (const trip of trips) {\n console.log(typeof trip.distance);\n kms += (trip.distance / 1000);\n }\n }\n }\n }\n numeroKmsPerc.innerHTML = parseFloat(Math.round(kms * 100) / 100);\n }" ]
[ "0.65046084", "0.6479991", "0.6461238", "0.6340553", "0.63175285", "0.62999165", "0.6285214", "0.6285214", "0.6269029", "0.62109965", "0.6122031", "0.611619", "0.5952385", "0.587621", "0.5870545", "0.584586", "0.58369875", "0.58181375", "0.5804055", "0.5803499", "0.579104", "0.5776333", "0.5758213", "0.5746034", "0.57080793", "0.56842583", "0.56750053", "0.56723386", "0.56606287", "0.56287557", "0.5615434", "0.5593544", "0.55725527", "0.556448", "0.55434215", "0.55409557", "0.5540938", "0.5532406", "0.5524011", "0.5515253", "0.55125326", "0.55079913", "0.5485764", "0.54848737", "0.54816073", "0.54778105", "0.5465797", "0.5464079", "0.5458355", "0.5450182", "0.5434956", "0.5432739", "0.5419642", "0.5417567", "0.54153883", "0.5409912", "0.5408442", "0.540397", "0.5401974", "0.5397221", "0.5388144", "0.5387058", "0.53807014", "0.5379493", "0.5377937", "0.5376146", "0.53732014", "0.5360195", "0.53541917", "0.53532445", "0.5353137", "0.5352101", "0.5344748", "0.53437686", "0.5340982", "0.5339338", "0.5329593", "0.532318", "0.53153586", "0.5314649", "0.52997106", "0.52995986", "0.52925086", "0.52897894", "0.5283364", "0.52807975", "0.52765924", "0.5275327", "0.52736133", "0.527209", "0.5265014", "0.5262419", "0.5262095", "0.5255594", "0.52550054", "0.525456", "0.5248324", "0.5246273", "0.5242979", "0.52420235", "0.5238782" ]
0.0
-1
Collapse the graph matching the specified DOM element depending the collapsed status
function collapse(elem, collapsed){ if(collapsed){ $(elem).parent().find(".fa-chevron-up").removeClass("fa-chevron-up").addClass("fa-chevron-down"); } else { $(elem).parent().find(".fa-chevron-down").removeClass("fa-chevron-down").addClass("fa-chevron-up"); if (elem.id == "bodyBytesThroughputOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshBytesThroughputOverTime(true); } document.location.href="#bytesThroughputOverTime"; } else if (elem.id == "bodyLatenciesOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshLatenciesOverTime(true); } document.location.href="#latenciesOverTime"; } else if (elem.id == "bodyCustomGraph") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshCustomGraph(true); } document.location.href="#responseCustomGraph"; } else if (elem.id == "bodyConnectTimeOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshConnectTimeOverTime(true); } document.location.href="#connectTimeOverTime"; } else if (elem.id == "bodyResponseTimePercentilesOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshResponseTimePercentilesOverTime(true); } document.location.href="#responseTimePercentilesOverTime"; } else if (elem.id == "bodyResponseTimeDistribution") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshResponseTimeDistribution(); } document.location.href="#responseTimeDistribution" ; } else if (elem.id == "bodySyntheticResponseTimeDistribution") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshSyntheticResponseTimeDistribution(); } document.location.href="#syntheticResponseTimeDistribution" ; } else if (elem.id == "bodyActiveThreadsOverTime") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshActiveThreadsOverTime(true); } document.location.href="#activeThreadsOverTime"; } else if (elem.id == "bodyTimeVsThreads") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshTimeVsThreads(); } document.location.href="#timeVsThreads" ; } else if (elem.id == "bodyCodesPerSecond") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshCodesPerSecond(true); } document.location.href="#codesPerSecond"; } else if (elem.id == "bodyTransactionsPerSecond") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshTransactionsPerSecond(true); } document.location.href="#transactionsPerSecond"; } else if (elem.id == "bodyTotalTPS") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshTotalTPS(true); } document.location.href="#totalTPS"; } else if (elem.id == "bodyResponseTimeVsRequest") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshResponseTimeVsRequest(); } document.location.href="#responseTimeVsRequest"; } else if (elem.id == "bodyLatenciesVsRequest") { if (isGraph($(elem).find('.flot-chart-content')) == false) { refreshLatenciesVsRequest(); } document.location.href="#latencyVsRequest"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function collapse_unload(d,svg_dom)\n\t\t{\n\n\t\t\t//get all nodes\n\t\t\tvar nodes = d3.select(svg_dom).selectAll(\"g.node\").data();\n\t\t\tvar idx = nodes.findIndex( //find node that is already opened\n\t\t\t\t\tfunction(element)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn ( element.depth === d.depth && element.children &&\n\t\t\t\t\t\t\t\telement.id !== d.id )\n\t\t\t\t\t});\n\t\t\t\n\t\t\tif(idx !== -1)\n\t\t\t{\t\t\t\t\n\t\t\t\ttoggle(nodes[idx]);\n\t\t\t\t\n\t\t\t\tdelete nodes[idx].children;\n\t\t\t\tdelete nodes[idx].loaded;\n\t\t\t}\n\t\t}", "function collapseDrawer() {\n var collapsible = event.srcElement; // gets executor\n\n event.srcElement.classList.toggle(\"active\");\n\n var drawerContent = event.srcElement.nextElementSibling;\n if (drawerContent.style.maxHeight) {\n drawerContent.style.maxHeight = null;\n } else {\n drawerContent.style.maxHeight = drawerContent.scrollHeight + \"px\";\n }\n\n\n}", "completeCollapse() {\n toggle(this.element, false);\n this.layoutBox_ = layoutRectLtwh(\n this.layoutBox_.left,\n this.layoutBox_.top,\n 0,\n 0\n );\n this.isFixed_ = false;\n this.element.updateLayoutBox(this.getLayoutBox());\n const owner = this.getOwner();\n if (owner) {\n owner.collapsedCallback(this.element);\n }\n }", "function collapse(elem, collapsed){\n if(collapsed){\n $(elem).parent().find(\".fa-chevron-up\").removeClass(\"fa-chevron-up\").addClass(\"fa-chevron-down\");\n } else {\n $(elem).parent().find(\".fa-chevron-down\").removeClass(\"fa-chevron-down\").addClass(\"fa-chevron-up\");\n if (elem.id == \"bodyBytesThroughputOverTime\") {\n if (isGraph($(elem).find('.flot-chart-content')) == false) {\n refreshBytesThroughputOverTime(true);\n }\n document.location.href=\"#responseTimesOverTime\";\n } else if (elem.id == \"bodyLantenciesOverTime\") {\n if (isGraph($(elem).find('.flot-chart-content')) == false) {\n refreshLatenciesOverTime(true);\n }\n document.location.href=\"#latenciesOverTime\";\n } else if (elem.id == \"bodyResponseTimeDistribution\") {\n if (isGraph($(elem).find('.flot-chart-content')) == false) {\n refreshResponseTimeDistribution();\n }\n document.location.href=\"#responseTimeDistribution\" ;\n } else if (elem.id == \"bodyActiveThreadsOverTime\") {\n if (isGraph($(elem).find('.flot-chart-content')) == false) {\n refreshActiveThreadsOverTime(true);\n }\n document.location.href=\"#activeThreadsOverTime\";\n } else if (elem.id == \"bodyTimeVsThreads\") {\n if (isGraph($(elem).find('.flot-chart-content')) == false) {\n refreshTimeVsThreads();\n }\n document.location.href=\"#timeVsThreads\" ;\n } else if (elem.id == \"bodyCodesPerSecond\") {\n if (isGraph($(elem).find('.flot-chart-content')) == false) {\n refreshCodesPerSecond(true);\n }\n document.location.href=\"#codesPerSecond\";\n } else if (elem.id == \"bodyTransactionsPerSecond\") {\n if (isGraph($(elem).find('.flot-chart-content')) == false) {\n refreshTransactionsPerSecond(true);\n }\n document.location.href=\"#transactionsPerSecond\";\n } else if (elem.id == \"bodyResponseTimeVsRequest\") {\n if (isGraph($(elem).find('.flot-chart-content')) == false) {\n refreshResponseTimeVsRequest();\n }\n document.location.href=\"#responseTimeVsRequest\";\n } else if (elem.id == \"bodyLatenciesVsRequest\") {\n if (isGraph($(elem).find('.flot-chart-content')) == false) {\n refreshLatenciesVsRequest();\n }\n document.location.href=\"#latencyVsRequest\";\n }\n }\n}" ]
[ "0.6733574", "0.66582936", "0.6610769", "0.6518608" ]
0.0
-1
Activates or deactivates all series of the specified graph (represented by id parameter) depending on checked argument.
function toggleAll(id, checked){ var placeholder = document.getElementById(id); var cases = $(placeholder).find(':checkbox'); cases.prop('checked', checked); $(cases).parent().children().children().toggleClass("legend-disabled", !checked); var choiceContainer; if ( id == "choicesBytesThroughputOverTime"){ choiceContainer = $("#choicesBytesThroughputOverTime"); refreshBytesThroughputOverTime(false); } else if(id == "choicesResponseTimesOverTime"){ choiceContainer = $("#choicesResponseTimesOverTime"); refreshResponseTimeOverTime(false); }else if(id == "choicesResponseCustomGraph"){ choiceContainer = $("#choicesResponseCustomGraph"); refreshCustomGraph(false); } else if ( id == "choicesLatenciesOverTime"){ choiceContainer = $("#choicesLatenciesOverTime"); refreshLatenciesOverTime(false); } else if ( id == "choicesConnectTimeOverTime"){ choiceContainer = $("#choicesConnectTimeOverTime"); refreshConnectTimeOverTime(false); } else if ( id == "choicesResponseTimePercentilesOverTime"){ choiceContainer = $("#choicesResponseTimePercentilesOverTime"); refreshResponseTimePercentilesOverTime(false); } else if ( id == "choicesResponseTimePercentiles"){ choiceContainer = $("#choicesResponseTimePercentiles"); refreshResponseTimePercentiles(); } else if(id == "choicesActiveThreadsOverTime"){ choiceContainer = $("#choicesActiveThreadsOverTime"); refreshActiveThreadsOverTime(false); } else if ( id == "choicesTimeVsThreads"){ choiceContainer = $("#choicesTimeVsThreads"); refreshTimeVsThreads(); } else if ( id == "choicesSyntheticResponseTimeDistribution"){ choiceContainer = $("#choicesSyntheticResponseTimeDistribution"); refreshSyntheticResponseTimeDistribution(); } else if ( id == "choicesResponseTimeDistribution"){ choiceContainer = $("#choicesResponseTimeDistribution"); refreshResponseTimeDistribution(); } else if ( id == "choicesHitsPerSecond"){ choiceContainer = $("#choicesHitsPerSecond"); refreshHitsPerSecond(false); } else if(id == "choicesCodesPerSecond"){ choiceContainer = $("#choicesCodesPerSecond"); refreshCodesPerSecond(false); } else if ( id == "choicesTransactionsPerSecond"){ choiceContainer = $("#choicesTransactionsPerSecond"); refreshTransactionsPerSecond(false); } else if ( id == "choicesTotalTPS"){ choiceContainer = $("#choicesTotalTPS"); refreshTotalTPS(false); } else if ( id == "choicesResponseTimeVsRequest"){ choiceContainer = $("#choicesResponseTimeVsRequest"); refreshResponseTimeVsRequest(); } else if ( id == "choicesLatencyVsRequest"){ choiceContainer = $("#choicesLatencyVsRequest"); refreshLatenciesVsRequest(); } var color = checked ? "black" : "#818181"; if(choiceContainer != null) { choiceContainer.find("label").each(function(){ this.style.color = color; }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function switchAllGraphItems(flag) {\n\t$$('.graphCheckBox').each(function(checkbox) {\n\t\tif (!checkbox.disabled) {\n\t\t\tcheckbox.checked = flag;\n\t\t}\n\t});\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id){\r\n toggleAll(id, true);\r\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function checkAll(id){\n toggleAll(id, true);\n}", "function setChecked(id, checked) {\n elem = document.getElementById(id);\n if( elem ) {\n if( checked ) {\n elem.setAttribute(\"checked\", true);\n\n // It takes some time for the system to restart properly.\n setTimeout(function() {\n eyecanOptions.onTabChange(elem);\n }, 1000);\n }\n else {\n elem.removeAttribute(\"checked\");\n }\n }\n }", "function toggleGraphOnClick() {\n var graphName = $(this).attr(\"name\");\n var graph = $('#' + graphName);\n if(graph.length == 1) {\n graph.toggle('slow');\n }\n else {\n var dataName = data_names[graphName];\n if ($.inArray(dataName, interventionVariables) == -1)\n drawChart(dataName, dataName, data[dataName], timeDomain, \"variable\");\n else\n drawChart(dataName, dataName, data[dataName], timeDomain, \"intervention\");\n\n }\n}", "function checkID(){\n opt.target.querySelector(\"input[data-id='\" + cfg.id + \"']\").checked = cfg.checked;\n }", "function setGraph(param) {\n if(param === false){\n drawGraph( $('#y-value').val(),false);}\n else if(param === true) {\n drawGraph( $('#y-value').val(),true);}\n}", "function toggleYears(id, arrayPos) {\n show_data[arrayPos] = document.getElementById(id).checked;\n currentGraphShown();\n}", "function optionChanged(id) {\n charting(id);\n meta(id);\n}// change(id)", "function changeBool(checkbox) {\n var clickableTD = document.getElementsByClassName(\"clickable_chart\");\n console.log(clickableTD);\n console.log(checkbox.checked);\n if (checkbox.checked) {\n for (var i = 0; i < clickableTD.length; i++) {\n clickableTD[i].setAttribute(\"onclick\",\"showChartDirectDict(this.parentNode.parentNode, true);\");\n }\n } else {\n for (var i = 0; i < clickableTD.length; i++) {\n clickableTD[i].setAttribute(\"onclick\",\"showChartDirectDict(this.parentNode.parentNode, false);\");\n }\n }\n}", "function checkID() {\n\t\t\t\topt.target.querySelector(\"input[data-id='\" + cfg.id + \"']\").checked = cfg.checked;\n\t\t\t}", "function updateYear(clickedYear){\r\n for(var i = 2000; i < 2018; i++) {\r\n eval('clicked' + i + '=false');\r\n }\r\n eval('clicked' + clickedYear + '=true');\r\n\r\n for(var i = 2000; i < 2018; i++) {\r\n if(eval('clicked' + i)){\r\n document.getElementById(i.toString()).style.border = \"solid black 4px\";\r\n }\r\n else{\r\n document.getElementById(i.toString()).style.border = \"none\";\r\n }\r\n }\r\n //creates border to highlight which year is selected\r\n selYear = clickedYear;\r\n updateRadialGraph(clickedCounty, clickedYear, \"#radBar\");\r\n\r\n} //end of update clicked", "function visControlChanged(e) {\n switch(e.target.id) {\n case \"chkDepression\":\n e.target.checked ? window.chart.series[0].show() : window.chart.series[0].hide();\n break;\n \n case \"chkAnxiety\":\n e.target.checked ? window.chart.series[1].show() : window.chart.series[1].hide();\n break;\n \n case \"chkStress1\":\n e.target.checked ? window.chart.series[2].show() : window.chart.series[2].hide();\n break;\n\n case \"chkSuicide\":\n e.target.checked ? window.chart.series[3].show() : window.chart.series[3].hide();\n break;\n\n case \"chkAAQ2\":\n e.target.checked ? window.chart.series[4].show() : window.chart.series[4].hide();\n break;\n\n case \"chkTrendLine\":\n alert(\"checkbox: \" + e.target.id + \" is now \" + (e.target.checked ? \"checked\" : \"UNchecked\"));\n break;\n\n default:\n window.alert(\"unknown checkbox: \" + e.target.id); \n }\n}", "function updateCheckBox(id, connectors, constraints) {\n var enabled, connector, checked;\n var diagram = $(\"#diagram\").ejDiagram(\"instance\");\n enabled = connectors[0].constraints & constraints ? true : false;\n if (connectors.length == 1) $(\"#\" + id).ejCheckBox({ enabled: enabled });\n else {\n for (var i = 1; i < connectors.length; i++) {\n connector = connectors[i];\n if (diagram.getObjectType(connector) == \"connector\") {\n if ((connector.constraints & constraints ? true : false) != enabled) {\n $(\"#\" + id).ejCheckBox({ enabled: false });\n checked = true;\n break;\n }\n }\n }\n }\n if (!checked) {\n $(\"#\" + id).ejCheckBox({ enabled: true });\n $(\"#\" + id).ejCheckBox({ checked: enabled });\n }\n}", "function optionChanged(id) {\n // console.log(id);\n barPlots(id);\n // guagePlots(id);\n\n bubblePlots(id);\n guagePlots(id);\n\n}", "function switchGraphButtons(flag) {\n\tif (flag) {\n\t\tenableField($(\"selectAllGraphsButton\"));\n\t\tenableField($(\"selectNoGraphsButton\"));\n\t} else {\n\t\tdisableField($(\"selectAllGraphsButton\"));\n\t\tdisableField($(\"selectNoGraphsButton\"));\n\t}\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"responseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function toggleAll(id, checked){\r\n var placeholder = document.getElementById(id);\r\n\r\n var cases = $(placeholder).find(':checkbox');\r\n cases.prop('checked', checked);\r\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\r\n\r\n var choiceContainer;\r\n if ( id == \"choicesBytesThroughputOverTime\"){\r\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\r\n refreshBytesThroughputOverTime(false);\r\n } else if(id == \"choicesResponseTimesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\r\n refreshResponseTimeOverTime(false);\r\n }else if(id == \"choicesResponseCustomGraph\"){\r\n choiceContainer = $(\"#choicesResponseCustomGraph\");\r\n refreshCustomGraph(false);\r\n } else if ( id == \"choicesLatenciesOverTime\"){\r\n choiceContainer = $(\"#choicesLatenciesOverTime\");\r\n refreshLatenciesOverTime(false);\r\n } else if ( id == \"choicesConnectTimeOverTime\"){\r\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\r\n refreshConnectTimeOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentilesOverTime\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\r\n refreshResponseTimePercentilesOverTime(false);\r\n } else if ( id == \"choicesResponseTimePercentiles\"){\r\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\r\n refreshResponseTimePercentiles();\r\n } else if(id == \"choicesActiveThreadsOverTime\"){\r\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\r\n refreshActiveThreadsOverTime(false);\r\n } else if ( id == \"choicesTimeVsThreads\"){\r\n choiceContainer = $(\"#choicesTimeVsThreads\");\r\n refreshTimeVsThreads();\r\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\r\n refreshSyntheticResponseTimeDistribution();\r\n } else if ( id == \"choicesResponseTimeDistribution\"){\r\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\r\n refreshResponseTimeDistribution();\r\n } else if ( id == \"choicesHitsPerSecond\"){\r\n choiceContainer = $(\"#choicesHitsPerSecond\");\r\n refreshHitsPerSecond(false);\r\n } else if(id == \"choicesCodesPerSecond\"){\r\n choiceContainer = $(\"#choicesCodesPerSecond\");\r\n refreshCodesPerSecond(false);\r\n } else if ( id == \"choicesTransactionsPerSecond\"){\r\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\r\n refreshTransactionsPerSecond(false);\r\n } else if ( id == \"choicesTotalTPS\"){\r\n choiceContainer = $(\"#choicesTotalTPS\");\r\n refreshTotalTPS(false);\r\n } else if ( id == \"choicesResponseTimeVsRequest\"){\r\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\r\n refreshResponseTimeVsRequest();\r\n } else if ( id == \"choicesLatencyVsRequest\"){\r\n choiceContainer = $(\"#choicesLatencyVsRequest\");\r\n refreshLatenciesVsRequest();\r\n }\r\n var color = checked ? \"black\" : \"#818181\";\r\n if(choiceContainer != null) {\r\n choiceContainer.find(\"label\").each(function(){\r\n this.style.color = color;\r\n });\r\n }\r\n}", "function updateSelection (){\n //initially all subject are active\n // on click all subject become inactive\n self.clickFlag = true;\n\n\n //1) check if subject is already active\n console.log(this.id)\n var elm = this.id\n var clickedSubjectId = self.svg.selectAll('.subject-bar')\n .filter(function (d) {\n return d.key == elm\n }).attr('id');\n if (self.activeSubjects.indexOf(clickedSubjectId) <= -1 ){\n //2) if not add it to the active array\n self.activeSubjects.push(clickedSubjectId)\n self.svg.select(clickedSubjectId)\n .attr('class', 'subject-bar active')\n } else {\n //remove from the array\n self.activeSubjects.splice(self.activeSubjects.indexOf(clickedSubjectId) , 1)\n }\n\n // make unselected bars inactive\n self.svg.selectAll('.subject-bar')\n .filter(function (d) {\n return self.activeSubjects.indexOf(d.key) <= -1\n })\n .attr('class', 'subject-bar inactive')\n\n console.log(self.activeSubjects)\n // filter domain\n self.dimension.filter(function(d){\n return self.activeSubjects.indexOf(d) > -1\n })\n\n // update all charts\n self.dispatch.call('update')\n\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked){\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(':checkbox');\n cases.prop('checked', checked);\n $(cases).parent().children().children().toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if ( id == \"choicesBytesThroughputOverTime\"){\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if(id == \"choicesResponseTimesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n }else if(id == \"choicesResponseCustomGraph\"){\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if ( id == \"choicesLatenciesOverTime\"){\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if ( id == \"choicesConnectTimeOverTime\"){\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if ( id == \"responseTimePercentilesOverTime\"){\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if ( id == \"choicesResponseTimePercentiles\"){\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if(id == \"choicesActiveThreadsOverTime\"){\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if ( id == \"choicesTimeVsThreads\"){\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if ( id == \"choicesSyntheticResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if ( id == \"choicesResponseTimeDistribution\"){\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if ( id == \"choicesHitsPerSecond\"){\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if(id == \"choicesCodesPerSecond\"){\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if ( id == \"choicesTransactionsPerSecond\"){\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if ( id == \"choicesTotalTPS\"){\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if ( id == \"choicesResponseTimeVsRequest\"){\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if ( id == \"choicesLatencyVsRequest\"){\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n choiceContainer.find(\"label\").each(function(){\n this.style.color = color;\n });\n}", "function toggleAll(id, checked) {\n var placeholder = document.getElementById(id);\n\n var cases = $(placeholder).find(\":checkbox\");\n cases.prop(\"checked\", checked);\n $(cases)\n .parent()\n .children()\n .children()\n .toggleClass(\"legend-disabled\", !checked);\n\n var choiceContainer;\n if (id == \"choicesBytesThroughputOverTime\") {\n choiceContainer = $(\"#choicesBytesThroughputOverTime\");\n refreshBytesThroughputOverTime(false);\n } else if (id == \"choicesResponseTimesOverTime\") {\n choiceContainer = $(\"#choicesResponseTimesOverTime\");\n refreshResponseTimeOverTime(false);\n } else if (id == \"choicesResponseCustomGraph\") {\n choiceContainer = $(\"#choicesResponseCustomGraph\");\n refreshCustomGraph(false);\n } else if (id == \"choicesLatenciesOverTime\") {\n choiceContainer = $(\"#choicesLatenciesOverTime\");\n refreshLatenciesOverTime(false);\n } else if (id == \"choicesConnectTimeOverTime\") {\n choiceContainer = $(\"#choicesConnectTimeOverTime\");\n refreshConnectTimeOverTime(false);\n } else if (id == \"choicesResponseTimePercentilesOverTime\") {\n choiceContainer = $(\"#choicesResponseTimePercentilesOverTime\");\n refreshResponseTimePercentilesOverTime(false);\n } else if (id == \"choicesResponseTimePercentiles\") {\n choiceContainer = $(\"#choicesResponseTimePercentiles\");\n refreshResponseTimePercentiles();\n } else if (id == \"choicesActiveThreadsOverTime\") {\n choiceContainer = $(\"#choicesActiveThreadsOverTime\");\n refreshActiveThreadsOverTime(false);\n } else if (id == \"choicesTimeVsThreads\") {\n choiceContainer = $(\"#choicesTimeVsThreads\");\n refreshTimeVsThreads();\n } else if (id == \"choicesSyntheticResponseTimeDistribution\") {\n choiceContainer = $(\"#choicesSyntheticResponseTimeDistribution\");\n refreshSyntheticResponseTimeDistribution();\n } else if (id == \"choicesResponseTimeDistribution\") {\n choiceContainer = $(\"#choicesResponseTimeDistribution\");\n refreshResponseTimeDistribution();\n } else if (id == \"choicesHitsPerSecond\") {\n choiceContainer = $(\"#choicesHitsPerSecond\");\n refreshHitsPerSecond(false);\n } else if (id == \"choicesCodesPerSecond\") {\n choiceContainer = $(\"#choicesCodesPerSecond\");\n refreshCodesPerSecond(false);\n } else if (id == \"choicesTransactionsPerSecond\") {\n choiceContainer = $(\"#choicesTransactionsPerSecond\");\n refreshTransactionsPerSecond(false);\n } else if (id == \"choicesTotalTPS\") {\n choiceContainer = $(\"#choicesTotalTPS\");\n refreshTotalTPS(false);\n } else if (id == \"choicesResponseTimeVsRequest\") {\n choiceContainer = $(\"#choicesResponseTimeVsRequest\");\n refreshResponseTimeVsRequest();\n } else if (id == \"choicesLatencyVsRequest\") {\n choiceContainer = $(\"#choicesLatencyVsRequest\");\n refreshLatenciesVsRequest();\n }\n var color = checked ? \"black\" : \"#818181\";\n if (choiceContainer != null) {\n choiceContainer.find(\"label\").each(function () {\n this.style.color = color;\n });\n }\n}" ]
[ "0.53520834", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.5350999", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.53087956", "0.51691335", "0.5121212", "0.5115145", "0.51047724", "0.5070495", "0.503194", "0.5022164", "0.5011435", "0.49595088", "0.49279392", "0.4901839", "0.48669416", "0.48629275", "0.48562387", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.48356587", "0.4816963", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.48168027", "0.4806088" ]
0.0
-1
displays the applicable team's logo if the user wins
function displayTeamLogo() { var teamLogoImgElement = document.createElement('img'); teamLogoImgElement.setAttribute('src', game.imgUrl); teamLogoElement.appendChild(teamLogoImgElement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTeamLogo(team){\n var logo = document.getElementById('logo');\n\n if (team){\n logo.src = '/static/img/'+team+'.svg';\n }\n else {\n logo.src = '/static/img/NFL.svg';\n }\n}", "displayWinner() {\n var winningPiece = game.isXTurn ? 'x' : 'o'\n if(game.singleplayer || game.vsAi)\n game.winner = winningPiece\n else\n {\n if(game.player === winningPiece)\n game.winner = game.username\n else\n game.winner = game.opponent\n }\n\n\n game.saveBoard()\n\n game.state.start('win')\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}", "function showWinner(winPic){\n \n document.getElementById('winner').style.display = \"block\"; \n document.getElementById('winImg').src = winPic;\n\n}", "function renderGameOverModal(state) {\n let gameOverStatus = document.getElementById('game-over-status');\n \n if(state.user.isWinner) {\n gameOverStatus.innerText = \"You won!\";\n gameOverStatus.classList.add(\"text-success\");\n } else {\n gameOverStatus.innerText = \"You lost!\";\n gameOverStatus.classList.add('text-danger');\n }\n\n gameOverModal.show();\n}", "function checkWinner() {\n\n // Select any random icon \n const computerChoice = pickRandomChoice();\n \n // Display user and computer choice\n updateSelection(user_select, userChoice);\n updateSelection(computer_select, computerChoice);\n\n //GAME RULES \n // Draw game if user and computer have the same choice\n if(userChoice === computerChoice){ \n winner.innerText = 'draw';\n }\n\n // Check if User Win \n else if(\n (userChoice === 'paper' && computerChoice === 'rock') || (userChoice === 'rock' && computerChoice === 'scissors')\n ||\n (userChoice === 'scissors' && computerChoice === 'paper')\n ) {\n // Display User Win\n updateScore();\n winner.innerText = 'you win';\n }\n \n // Else Computer Win\n else {\n \n // Display User Lost\n updateComscore();\n winner.innerText = 'you loss';\n }\n}", "function avatarPlaced() {\n var showPlayer = document.getElementById('showPlayer');\n\n // Check for a win\n var winner = gameState.getWinner();\n if (winner != \"\") {\n\t\tshowPlayer.innerHTML = \"Game Stopped\"; // This should be put in a function\n showPlayer.style.color='purple';\n gameState.active = false;\n }\n // Check for a tie\n checkForTie();\n\n // Swap turn player\n if (showPlayer.innerHTML === \"Player 1\") {\n showPlayer.innerHTML = \"Player 2\";\n showPlayer.style.color = \"red\";\n } else {\n showPlayer.innerHTML = \"Player 1\";\n showPlayer.style.color = \"blue\";\n }\n}", "function youWin() {\n wins++;\n $(\".placeholder\").html(\"<img src='assets/images/youwin.gif' alt='winner' width='250px' height='185px' />\");\n }", "function winner() {\n if (game.wins > game.losses) {\n document.querySelector('#modal-show .content p').innerHTML = `<span style= \"color: green\"> ${params.playerName} ( ${game.wins} - ${game.losses} ) Computer </span><br><p style= \"color: green\">${params.playerName} WON THE GAME!!! :)</p>`\n } else if (game.wins < game.losses) {\n document.querySelector('#modal-show .content p').innerHTML = `<span style= \"color: #FF0000\"> ${params.playerName} ( ${game.wins} - ${game.losses} ) Computer </span><br><p style= \"color: #FF0000\">${params.playerName} LOST THE GAME!!! :( </p>`\n } else {\n document.querySelector('#modal-show .content p').innerHTML = `<span style= \"color: gray\"> ${params.playerName} ( ${game.wins} - ${game.losses} ) Computer </span><br><p style= \"color: gray\"> IT IS A DRAW!!! :| TRY AGAIN !</p>`\n }\n\n}", "function drawHumanWin(){\n document.getElementById('winner').innerHTML =\n `<img class= \"w-75\" src=\"${humanWin.img}\" id =\"animal-pic\" alt=\"humanWin\">`\n}", "gameOver() {\n if (playerScore === winningScore || computerScore === winningScore) {\n isGameOver = true;\n // Set Winner\n let winner = playerScore === winningScore ? 'Player' : 'Computer';\n this._showGameOverEl(winner);\n }\n }", "userWins() {\n console.clear();\n console.log(\n logo({\n name,\n font: fonts[Math.floor(Math.random() * fonts.length)],\n logoColor: colors[Math.floor(Math.random() * colors.length)],\n borderColor: colors[Math.floor(Math.random() * colors.length)],\n })\n .emptyLine()\n .center('General! You saved the day!!!')\n .render()\n );\n console.log(cliColor.yellow(\" _______________\"));\n console.log(cliColor.yellow(\" |@@@@| |####|\"));\n console.log(cliColor.yellow(\" |@@@@| |####|\"));\n console.log(cliColor.yellow(\" |@@@@| |####|\"));\n console.log(cliColor.yellow(\" \\\\@@@@| |####/\"));\n console.log(cliColor.yellow(\" \\\\@@@| |###/\"));\n console.log(cliColor.yellow(\" `@@|_____|##'\"));\n console.log(cliColor.yellow(\" (O)\"));\n console.log(cliColor.yellow(\" .-'''''-.\"));\n console.log(cliColor.yellow(\" .' * * * `.\"));\n console.log(cliColor.yellow(\" : * * :\"));\n console.log(cliColor.yellow(` : ~ ${cliColor.green('Y O U')} ~ :`));\n console.log(cliColor.yellow(` : ~ ${cliColor.green('W I N !')} ~ :`));\n console.log(cliColor.yellow(\" : * * :\"));\n console.log(cliColor.yellow(\" `. * * * .'\"));\n console.log(cliColor.yellow(\" `-.....-'\"));\n\n }", "function renderGame (){\n\n //setup new instructions\n var newInst = $(\"<h3>\");\n newInst.text(\"Welcome back, \"+username);\n newInst.addClass(\"col s12 center-align\");\n $(\"#instructions\").html(newInst);\n \n $(\"#game\").show();\n\n $(\"#yourName\").text(username);\n\n\n if(oppChoice){\n $(\"#opponentChoice\").css(\"opacity\", \"1\");\n } \n // if you haven't chosen, set instructions to say choose\n if (yourChoice){\n $(\"#yourChoice\").css(\"background-image\", \"url('assets/images/\"+yourChoice+\".png')\");\n $(\"#yourChoice\").css(\"opacity\", \"1\");\n \n // if you haven't chosen, show buttons \n } else {\n renderButtons();\n }\n\n updateStatus();\n}", "function winner(){\n if (playerScore > 4 || computerScore > 4) {\n document.getElementById('reset').style.visibility = \"visible\";\n document.getElementById('rock').style.visibility = \"hidden\";\n document.getElementById('paper').style.visibility = \"hidden\";\n document.getElementById('scissors').style.visibility = \"hidden\";\n \n if (playerScore > 4) {\n outcome = 'You won the game!';\n \n } else if (computerScore > 4) {\n outcome = 'You lost the game!';\n }\n }\n outcomeDisplay.textContent = outcome;\n}", "computerWins() {\n console.clear();\n console.log(\n logo({\n name: 'YOU LOSE!',\n font: fonts[Math.floor(Math.random() * fonts.length)],\n logoColor: colors[Math.floor(Math.random() * colors.length)],\n borderColor: colors[Math.floor(Math.random() * colors.length)],\n })\n .emptyLine()\n .render()\n );\n }", "function whoWon(){\n\tif(gameOver() == true){\n\t\tmodal.style.display = \"block\";\n\t\t$(\".modalContent\").removeClass(\"closeModal\");\n\t\t$(\".modalContent\").addClass(\"openModal\");\n\n\t\tif(playerScores[0] > playerScores[1]){\n\t\t\t$(\".modalBody\").empty().append(\"Player 1 has won!\");\n\t\t\t// $(\".modalBody\").append(\"Player 1 has won!\");\n\t\t} \n\n\t\telse if(playerScores[1] > playerScores[0]){\n\t\t\t$(\".modalBody\").empty().append(\"Player 2 has won!\");\n\t\t\t// $(\".modalBody\").append(\"Player 2 has won!\");\n\t\t} \n\n\t\telse{\n\t\t\t$(\".modalBody\").empty().append(\"It's a draw...\");\n\t\t\t// $(\".modalBody\").append(\"It's a draw...\");\n\t\t}\n\t}\n}", "showComputerAndPlayerIcons() {\n var fontSize = 32;\n context.font = `${fontSize}px sans-serif`;\n context.fillStyle = 'white';\n\n var p = this.getVsDims();\n this.selectVsImage(computerSprite.image, playerSprite.image, computer);\n\n context.drawImage(computerSprite.image, p[0].x, p[0].y, p[0].w, p[0].h);\n context.fillText(\"/\", p[1].x-7, p[1].y+fontSize-8);\n context.drawImage(playerSprite.image, p[1].x, p[1].y, p[1].w, p[1].h);\n }", "function playerIcon(player) {\n // There will only be 2 players: X and O\n return player === 'X' ? 'clear' : 'lens'; \n\n}", "function drawlogo (x, y, size, teamName) {\n\treturn svg.append(\"svg:image\")\n\t\t.attr(\"xlink:href\", \"../Resources/logos/logo_\" + teamName + \".png\")\n\t\t.attr(\"x\", x)\n\t\t.attr(\"y\", y)\n\t\t.attr(\"width\", size)\n\t\t.attr(\"height\", size);\n}", "winner() {\r\n this.state = STATES.win;\r\n this.htmlOverlay.innerHTML = \"<p>Congratulation you are the winner</p>\";\r\n this.htmlOverlay.style.display = \"block\";\r\n }", "function whoWins(winner) {\r\n var winString = document.createElement(\"DIV\");\r\n winString.classList.add(\"winnerText\");\r\n\r\n if (winner == 1) {\r\n winString.innerHTML = \"Player Wins\";\r\n playerwins.innerHTML = ++playerHand.wins;\r\n\r\n } else {\r\n winString.innerHTML = \"Dealer Wins\";\r\n dealerwins.innerHTML = ++dealerHand.wins;\r\n }\r\n winnerarea.appendChild(winString);\r\n gameOver();\r\n }", "function showwinner() {\n if (player1pointscore > player2pointscore) {\n winner = player1getname + \" is de WINNAAR !!!\";\n }\n else if ((player1pointscore < player2pointscore)){\n winner = player2getname + \" is de Winnaar !!!\";\n }\n else {\n winner = \"Gelijk Spel!!\";\n }\n thewinner.innerHTML = winner;\n thewinner.style.visibility = 'visible'\n debeurt.style.visibility = 'hidden'\n restartgamebutton.style.visibility = 'visible'\n cardvisibility.style.visibility = 'hidden'\n}", "function checkWinner() {\n $('.winner').prop('hidden', false);\n\n if (playerScore > 21) {\n if (dealerScore > 21) {\n $('.winner').text('You Both Busted!');\n } else {\n $('.winner').text('You Lost!');\n $('.dealer').addClass('shadow');\n }\n } else if (dealerScore > 21) {\n $('.winner').text('You Won!');\n $('.player').addClass('shadow');\n } else if (playerScore > dealerScore) {\n $('.winner').text('You Won!');\n $('.player').addClass('shadow');\n } else if (dealerScore > playerScore) {\n $('.winner').text('You Lost!');\n $('.dealer').addClass('shadow');\n } else {\n $('.winner').text('Push (Draw)');\n }\n\n}", "gameOver() {\n //Leaves game screen and returns to overlay\n $(\"#overlay\").show();\n //If player has 5 misses\n if (this.missed === 5) {\n //Gives overlay lose class name\n overlay.className = \"lose\"\n //Shows losing message\n $(\".title\").text(\"You’re not Superman you know!\");\n } else {\n //Gives overlay win class name\n overlay.className = \"win\"\n //Shows winning message\n $(\".title\").text(\"This is my gift , my curse. Who am I? I’m Spiderman.!\");\n }\n\n }", "function findWinner(x, y) {\n if (x == y) {\n $(\"#winner\").text(\"Players 1 and 2 Win!!!\");\n $(\"#p1emoji\").html(\"<i class='fas fa-dice'></i>\");\n $(\"#p2emoji\").html(\"<i class='fas fa-dice'></i>\");\n }\n else if (x > y) {\n $(\"#winner\").text(\"Player 1 Wins!!!\");\n $(\"#p1emoji\").html(\"<i class='fas fa-dice'></i>\");\n }\n else {\n $(\"#winner\").text(\"Player 2 Wins!!!\");\n $(\"#p2emoji\").html(\"<i class='fas fa-dice'></i>\");\n }\n}", "function displayWin() {\n $(\"#result-image\").attr(\"src\", \"https://media.giphy.com/media/l3OAyWrV5CIjyiedmF/giphy.gif\");\n $(\"#result-image\").attr(\"height\", \"250px\");\n $('#result').text(\"You Win!!\");\n\n\n }", "function displayWinner(winner, loser) {\n let winnerElem = document.getElementById(`${winner}-footer`);\n let loserElem = document.getElementById(`${loser}-footer`);\n loserElem.classList.add(\"hidden\");\n winnerElem.innerText += \" Wins!\";\n\n winnerElem.style.color = (winner === \"player\") ? \"green\" : \"red\";\n}", "function gameOver(gameWon) {\n // Highlight the winning pattern\n for (let index of winCombos[gameWon.index]) {\n document.getElementById(index).classList.add(\"ttt__table__cell--highlight\");\n }\n // Display the overlay\n displayOverlay(\n `${playerNames[gameWon.player]} Win${gameWon.player === com ? \"s\" : \"\"}!`\n );\n}", "function renderMatchInfo(item) {\n \n if(item.home_team.penalties !== 0 && item.away_team.penalties !== 0) {\n return `<div class=\"centered-text\">\n <h2>${item.home_team_country} vs ${item.away_team_country}</h2>\n <h3>${item.home_team.goals}(${item.home_team.penalties}) : ${item.away_team.goals}(${item.away_team.penalties})</h3>\n </div> `}\n else\n {\n return `<div class=\"centered-text\">\n <h2>${item.home_team_country} vs ${item.away_team_country}</h2>\n <h3>${item.home_team.goals} : ${item.away_team.goals}</h3>\n </div> ` \n }\n}", "function gameOver() {\n if (document.getElementById(\"player1\").classList.contains(\"active\")) {\n console.log(\"Player 1 Winner\");\n document.querySelector(\".message\").innerHTML = `${playerOne} WINNER`;\n document.querySelector(\"#finish\").classList.add(\"screen-win-one\");\n } else if (document.getElementById(\"player2\").classList.contains(\"active\")) {\n console.log(\"Player 2 Winner\");\n document.querySelector(\"#finish\").classList.add(\"screen-win-two\");\n if (gameType === \"PvP\") {\n document.querySelector(\".message\").innerHTML = `${playerTwo} WINNER`;\n }else {\n document.querySelector(\".message\").innerHTML = `COMPUTER WINNER`;\n }\n \n }\n hideClassById(\"board\");\n showClassById(\"finish\");\n} //function gameOver()", "gameOver(gameWon) {\n const overlay = document.getElementById('overlay');\n const gameOverMessage = document.getElementById(\"game-over-message\");\n if (gameWon === false) {\n gameOverMessage.textContent = 'Sorry, better luck next time!';\n overlay.className = \"lose\";\n overlay.style.display = '';\n } else if (gameWon === true) {\n gameOverMessage.textContent = 'Great job!';\n overlay.className = \"win\";\n overlay.style.display = '';\n }\n }", "showGameStatus(gameWin) {\n const div = document.createElement(`div`);\n div.classList.add(`game-status`);\n div.innerHTML = `${gameWin ? 'WIN!' : 'GAME OVER!'}`;\n this.DOMGrid.appendChild(div);\n }", "function drawWinner(winner){\n\tlet x = winner[0]\n\tlet y = winner[1]\n\tlet num = winner[2]\n\tlet img = winner[3]\n\tlet w = winner[3].width/2\n\tlet h = winner[3].height/2\n\tlet isFemale = winner[4]\n\tlet winnerXOffset = picScale\n\tlet winnerYOffset = picScale\n\tlet textboxY = y + h + winnerYOffset\n\n\tnoFill();\n\tstroke(5, 98, 50)\n\tstrokeWeight(3)\n\trect(x, y, winnerXOffset, winnerYOffset) // for main (smaller) img\n\n\tlet rectHeight = h + h/3\n\t// bottom right\n\tif (x <= cWidth - w && y <= cHeight - rectHeight){\n\t\timage(img, x + winnerXOffset, y + winnerYOffset, w, h)\n\t\tdrawCaption(x + winnerXOffset, y + h + winnerYOffset, w, h, num, isFemale)\n\t}\n\t// bottom left\n\telse if (x >= cWidth - w && y <= cHeight - rectHeight){\n\t\timage(img, x - w, y + winnerYOffset, w, h)\n\t\tdrawCaption(x - w, y + h + winnerYOffset, w, h, num, isFemale)\n\t}\n\t// top right\n\telse if (x <= cWidth - w && y >= cHeight - rectHeight){\n\t\timage(img, x + winnerXOffset, y - rectHeight, w, h)\n\t\tdrawCaption(x + winnerXOffset, y - h/3, w, h, num, isFemale)\n\t}\n\t// top left\n\telse if (x >= cWidth - w && y >= cHeight - rectHeight){\n\t\timage(img, x - w, y - rectHeight, w, h)\n\t\tdrawCaption(x - w, y - h/3, w, h, num, isFemale)\n\t}\n\n}", "function drawWinner(){\n var isWinner = true;\n for (var i = 0; i < answers.length; i++){\n if (!answers[i].found){\n isWinner = false;\n }\n }\n if (isWinner){\n tile.beginPath();\n tile.strokeStyle = '#36a500';\n tile.fillStyle = '#000000';\n tile.lineWidth = 25;\n tile.fillRect(100, 90, 300, 200);\n tile.clearRect(110, 100, 280, 180);\n tile.strokeRect(120, 110, 260, 160);\n tile.font = 'bold 42pt serif';\n tile.fillText('You Win!', 137, 208);\n tile.closePath();\n }\n}", "function checkGameOver(){\n if (game.game_over()) {\n var winner;\n if(game.in_stalemate()){\n info = \"Stalemate\";\n }\n announcedGameOver = true;\n if(game.in_draw()){\n winner = \"Draw\";\n if(game.in_stalemate()){\n winner = \"Stalemate\";\n }\n $('#engineStatus').html(winner);\n }\n if(game.in_checkmate()){\n winner = game.turn() == 'w' ? 'Black won!' : 'White won!';\n $('#engineStatus').html(winner);\n }\n }\n }", "function populateScreenTeam (teamObj){\n let team = \"<p>\" + teamObj.name + \"</p>\";\n let wins = \"<p style='color: #2b9642'>\";\n wins += teamObj.wins;\n wins += \" wins</p>\";\n let losses = \"<p style='color: #7a212c'>\";\n losses += teamObj.losses;\n losses += \" losses</p>\";\n $('#about-team').append(team);\n $('#about-team').append(wins);\n $('#about-team').append(losses);\n }", "function winnerFound() {\n hideDice();\n gamePlaying = false;\n //Change player name to winner\n document.getElementById(\"name-\" + activePlayer).textContent = \"Winner\";\n // Change classes to Winner\n document\n .querySelector(\".player-\" + activePlayer + \"-panel\")\n .classList.add(\"winner\");\n document\n .querySelector(\".player-\" + activePlayer + \"-panel\")\n .classList.remove(\"active\");\n }", "function showScore(score) {\n $(\"<p>\").text(`Correct Answers: ${score}`);\n $(\"<p>\").text(`Incorrect Answers: ${score}`);\n $(\"<p>\").text(`unanswered: ${score}`);\n //checking to see which text + image to display to the user \n if (score === 4) {\n // text if you win \n alert(\"Victory! Ron Swanson is proud.\");\n // image if you win \n $(\"#ron\").show();\n \n } else {\n //text if you lose \n alert(\"Try again! Sometimes you have to work a litle, so you can ball a lot!\");\n //image if you lose \n $(\"#ralphio\").show();\n \n }\n \n }", "function displayHumanPlayerClothing () {\n /* collect the images */\n var clothingImages = humanPlayer.clothing.map(function(c) {\n return { src: c.image,\n alt: c.name.initCap() };\n });\n \n /* display the remaining clothing items */\n clothingImages.reverse();\n $gameClothingLabel.html(\"Your Clothing\");\n for (var i = 0; i < 8; i++) {\n if (clothingImages[i]) {\n $gameClothingCells[i].attr(clothingImages[i]);\n $gameClothingCells[i].css({opacity: 1});\n } else {\n $gameClothingCells[i].css({opacity: 0});\n }\n }\n}", "function scoreCounter(team) {\n\n // Game runs as long as both sides haven't scored 5 yet\n if(boyScore <= 5 && bugScore <= 5) {\n // If either side scores increase team score and add a symbol to the visual counter\n if(team === 'bug')\n {\n bugScore++;\n bugCount.textContent = bugScore;\n const newBug = document.createElement('span');\n newBug.innerHTML = '<img src=\"images/enemy-bug.png\">';\n bugs.appendChild(newBug);\n } else if (team === 'boy') {\n boyScore++;\n boyCount.textContent = boyScore;\n const newBoy = document.createElement('span');\n newBoy.innerHTML = '<img src=\"images/char-boy-wins.png\">';\n goldenBoy.appendChild(newBoy);\n }\n }\n // As soon as one team reaches a score of 5\n if (boyScore === 5 || bugScore === 5) {\n // Stop enemy movement\n for(enemy of allEnemies) {\n enemy.stopEnemy();\n }\n // Open modal and display winner message\n if (boyScore > bugScore) {\n modal.classList.add('open');\n message.textContent = 'Boy wins';\n } else {\n modal.classList.add('open');\n message.textContent = 'Bugs win';\n }\n }\n}", "function checkWinner() {\n stopLoop();\n Game.powerUpCanvas.font = \"italic 36px calibri\";\n\n if (Game.players[1].score > Game.players[0].score) {\n Game.powerUpCanvas.fillStyle = \"Purple\";\n Game.powerUpCanvas.fillText(\"Purple player wins!\", 100, 250);\n }\n\n else if (Game.players[0].score > Game.players[1].score) {\n Game.powerUpCanvas.fillStyle = \"Green\";\n Game.powerUpCanvas.fillText(\"Green player wins!\", 500, 250);\n Game.players[0].srcX = 326;\n Game.players[0].srcY = 1182;\n }\n else if (Game.players[1].score === Game.players[0].score) {\n Game.powerUpCanvas.fillText(\"Draw!\", 390, 250);\n }\n}", "function displayWinner(winner) {\n document.getElementById('overlay').classList.remove('hide');\n // let winContainer = document.getElementsByClassName('win-container');\n // winContainer[0].classList.add('win');\n // couldn't ever get this animation to work - there's something I haven't learned yet\n // about how to apply transition timing to javascript css changes.\n document.getElementById('win-dialog').textContent = `${winner} the winner!`;\n}", "gameOver(gameWon) {\r\n const overlay = document.querySelector('#overlay');\r\n const overlayDiv = document.querySelector('#game-over-message');\r\n const startButton = document.querySelector('#btn__reset');\r\n const startMessage = document.querySelector('.title');\r\n if (gameWon) {\r\n overlayDiv.textContent = 'You won!!!';\r\n overlay.className = 'win';\r\n startButton.value = 'play_again';\r\n startButton.textContent = 'Play Again';\r\n startMessage.className = 'title winning';\r\n } else {\r\n overlayDiv.textContent = 'You lost :(';\r\n overlay.className = 'lose';\r\n startButton.textContent = 'Play Again';\r\n startButton.value = 'play_again';\r\n startMessage.className = 'title not_winning';\r\n }\r\n overlay.style.display = 'block';\r\n }", "function getTeamLogo(abbr) {\n\t\t\n\t\tteamLogo = \"\";\n\t\tteams.forEach(function(teamName) {\n\t\t\tif (abbr === teamName.abbr) {\n\t\t\t\tteamLogo = teamName.imageURL;\n\t\t\t}\n });\n \n\t\treturn teamLogo;\n }", "function gameovercheck() {\n\t\tif (lives === 0) {\n\t\t\tball.y_speed = 0;\n\t\t\tball.x_speed = 0;\n\t\t\tcontext.font = \"40px Copperplate\";\n\t\t\tcontext.fillText(\"GAME OVER\", width/2 - 120, height/2 + 35);\n\t\t\tgameover = 1;\n\t\t\tdocument.getElementById(\"newgame\").style.visibility = \"visible\";\n\t\t}\n\t\telse if (brickcount === 0) {\n\t\t\tball.y_speed = 0;\n\t\t\tball.x_speed = 0;\n\t\t\tcontext.font = \"40px Copperplate\";\n\t\t\tcontext.fillText(\"YOU WIN!\", width/2 - 95, height/2 + 35);\n\t\t\tgameover = 1;\n\t\t\tdocument.getElementById(\"newgame\").style.visibility = \"visible\";\n\t\t}\n\t}", "function winGame(){\n var canvas = document.getElementById(\"mainCanvas\");\n canvas.innerHTML = \"\";\n var titleBox = document.createElement('div');\n titleBox.setAttribute(\"class\", \"col s12 center-align\");\n var title = document.createElement('h3');\n var titleText = document.createTextNode(\"You Won!\");\n title.appendChild(titleText);\n titleBox.appendChild(title);\n document.getElementById(\"mainCanvas\").appendChild(titleBox);\n\n var fgm = document.createElement(\"img\");\n loc = 'assets/feelsgoodman.png';\n fgm.src = loc;\n fgm.setAttribute(\"height\", \"300\");\n fgm.setAttribute(\"width\", \"500\");\n fgm.setAttribute(\"alt\", \"You win, FeelsGoodMan\");\n var imgBox = document.createElement('div');\n imgBox.setAttribute(\"class\", \"col s12 center-align\");\n imgBox.appendChild(fgm);\n document.getElementById(\"mainCanvas\").appendChild(imgBox);\n }", "function declareWinner(who){\r\n document.querySelector('.endgame').style.display='block';\r\n document.querySelector('.endgame .text').innerText= who;\r\n\r\n }", "winner(winState) { \r\n for (let i in winState.spaces) {\r\n $(\"#\"+ winState.spaces[i]).addClass(\"winTile\");\r\n }\r\n $(\"#resultBox\").show()\r\n $(\"#resultBox\").html(\"Player \" +this.curPlayer +\" wins\");\r\n $(\".tile\").prop(\"disabled\", true);\r\n this.gameOver = true; //Stops AI going if player won\r\n }", "gameOver(){\n const overlay = document.querySelector(\"#overlay\");\n overlay.style.display = 'flex';\n const h1 = overlay.querySelector('h1');\n if(this.checkForWin()){\n overlay.className = 'win';\n //h1.style.color = 'green';\n h1.textContent = \"Congratulations! You won!\";\n }else{\n overlay.className = 'lose';\n //h1.style.color = 'red';\n h1.textContent = \"Game Over. Better luck next time.\";\n }\n this.resetGame();\n }", "function playerWins(){\n $(\".timer\").html(\"info: <strong>Game Over</strong>\");\n $(\".info\").html(\"final score: <strong> \" + wins + \"/\" + characters.length + \" </strong>\");\n $(\".characterImage\").html(\"<img src = \\\"assets/images/end-game.jpg\\\">\");\n $(\"img\").css(\"width\", \"540px\");\n $(\"img\").css(\"height\", \"300px\");\n $(\"img\").css(\"margin-left\", \"100px\");\n $(\"img\").css(\"margin-right\", \"auto\");\n $(\"img\").css(\"margin-top\", \"150px\");\n $(\"img\").css(\"margin-bottom\", \"auto\");\n \n \n }", "function victory( player ) {\n if ( player === \"playerOne\" ) {\n playerOneScoreDisplay.classList.toggle( \"winner\" );\n } else {\n playerTwoScoreDisplay.classList.toggle( \"winner\" );\n }\n}", "function declareWinner(who) {\n\tdocument.querySelector(\".endgame\").style.display = \"block\";\n\tdocument.querySelector(\".endgame .text\").innerText = who;\n}", "function displayGIF(status,correctAnswer) {\n \n if(status === \"win\") {\n $(\".triviaText\").html(`\n <p>Congrats you chose correctly!</p>\n <p>The correct answer was ${correctAnswer}</p>\n <img src=\"${randomImage()}\"/>\n `)\n }\n else if (status === \"lose\") {\n $(\".triviaText\").html(`\n <p>The answer you chose was incorrect!</p>\n <p>The correct answer was ${correctAnswer}</p>\n <img src=\"${randomImage()}\"/>\n `)\n }\n}", "function win() {\n if (defenders == 0) {\n console.log('Game Win');\n $('#display').empty();\n var winText = document.createElement('h2');\n winText.className = 'text-light';\n winText.textContent ='You have won the game... Click Resart Game to play again...'\n $('#display').append(winText);\n };\n }", "game_over(who){\n let what\n if (who == \"Red\") {\n what = $(\"#enemy_img\")\n } else {\n what = $(\"#player_img\")\n }\n document.getElementById('battleTheme').pause();\n what.fadeOut(1500);\n window.setTimeout(function(){\n document.getElementById(\"status_text\").innerHTML= who+\" is victorious!\";\n },805);\n window.setTimeout(function(){\n $('#bg_image').hide();\n }, 4000);\n }", "function determineWinner() {\n var winner = \"none\";\n if (redTilesPosition.rTile1 == 56 && redTilesPosition.rTile2 == 56 && redTilesPosition.rTile3 == 56 && redTilesPosition.rTile4 == 56) {\n winner = \"red\";\n document.getElementById('winner').innerHTML.concat(\" is RED\");\n } else if (yellowTilesPosition.yTile1 == 56 && yellowTilesPosition.yTile2 == 56 && yellowTilesPosition.yTile3 == 56 && yellowTilesPosition.yTile4 == 56) {\n winner = \"yellow\";\n document.getElementById('winner').innerHTML.concat(\" is YELLOW\");\n } else if (greenTilesPosition.gTile1 == 56 && greenTilesPosition.gTile2 == 56 && greenTilesPosition.gTile3 == 56 && greenTilesPosition.gTile4 == 56) {\n winner = \"green\";\n document.getElementById('winner').innerHTML.concat(\" is GREEN\");\n } else if (blueTilesPosition.bTile1 == 56 && blueTilesPosition.bTile2 == 56 && blueTilesPosition.bTile3 == 56 && blueTilesPosition.bTile4 == 56) {\n winner = \"blue\";\n document.getElementById('winner').innerHTML.concat(\" is BLUE\");\n\n }\n return winner;\n}", "function showYouWin() {\n gameover.style.display = \"block\";\n youwon.style.display = \"block\";\n}", "function winnerWinner() {\r\n\r\n\ttextDialogue(john, \"John: Hey, well that wasn't so bad.\", 0);\r\n\ttextDialogue(player, player.name + \": Yeah I suppose that could have gone worse\", 1000);\r\n\ttextDialogue(john, \"John: Looks like its about that time...\", 2000);\r\n\ttextDialogue(player, player.name + \": YEE-HAW\", 3000);\r\n\r\n\t// add firework image and such to signify more than just text\r\n\ttextDialogue(narrator, \"Narocube: Hey, you win! \\n Go home... refresh to play again\", 5000);\r\n}", "gameOver(gameWon) {\r\n const startScreen = document.getElementById('overlay');\r\n startScreen.style.display = 'block';\r\n\r\n const gameEndMessage = document.getElementById('game-over-message');\r\n const gameEndOverlay = document.getElementById('overlay');\r\n if (gameWon) {\r\n gameEndMessage.textContent = 'Good Work, You Won!';\r\n gameEndOverlay.classList.replace('start', 'win');\r\n } else {\r\n gameEndMessage.textContent = 'You Lost... Beter Luck Next Time!';\r\n gameEndOverlay.classList.replace('start', 'lose');\r\n }\r\n }", "function gameover() {\n if (lossCounter === 3) {\n $(\".main\").hide();\n $(\"#game-over\").show();\n }\n else if (winCounter === 3) {\n $(\".main\").hide();\n $(\"#surprise\").show();\n }\n else {}\n }", "function announceWinner(who) {\r\n document.querySelector(\".finishGame\").style.display = \"inline-block\";\r\n document.querySelector(\".finishGame .text\").innerText = who;\r\n\r\n}", "function playerSymbol() {\n if (playerOneScore.className === \"player-score active-player\"){\n return \"url('src/img/o.svg')\"\n } else if (playerTwoScore.className === \"player-score active-player\"){\n return \"url('src/img/x.svg')\"\n }\n}", "function getWinner() {\n if (donkey.result > elephant.result) {\n winner = \"Donkey !\";\n winnerImage = donkeyImg;\n } else {\n winner = \"Elephant\";\n winnerImage = elephantImg;\n }\n\n return winner; // return value\n}", "function showGameOver() {\n textSize(32);\n textAlign(CENTER,CENTER);\n fill(0);\n\nif (preyEaten > 0) {\nvar gameOverText = \"GAME OVER\\n\";\nfill(random(255))\ngameOverText += \"You ate \" + preyEaten + \" innocent circles,\\n\";\ngameOverText += \"you monster.\\n\";\ntext(gameOverText,width/2,height/2);\n}\nelse {\nvar gameOverText = \"WINNER\\n\";\nfill(255,255,0);\ngameOverText += \"You ate \" + preyEaten + \" innocent circles,\\n\";\ngameOverText += \"you considerate soul.\\n\";\ntext(gameOverText,width/2,height/2);\n}\n}", "renderLogos() {\n return _.map(this.state.teams, (team, id) =>\n <TeamLogo key={id} team={team} onClick={this.onTeamSelect.bind(this)} />\n );\n }", "function displayTurn() {\n if (starter == false)\n turn.innerHTML = `Player ${\n computerTurn\n ? `<i class=\"far fa-circle header-circle\"></i>`\n : `<i class=\"fas fa-times header-times\"></i>`\n }'s turn`;\n else {\n turn.innerHTML = `Player ${\n computerTurn\n ? `<i class=\"fas fa-times header-times\"></i>`\n : `<i class=\"far fa-circle header-circle\"></i>`\n }'s turn`;\n }\n}", "function winner(){\n gameMode = false;\n $('.pop-up').html(curPlayer + \" is victorious! <br><br> Press 'New Game' to play again\");\n $('.pop-up').css(\"visibility\", \"visible\");\n}", "function checkWin() {\n if (matchFound === 8) {\n $(\"#runner\").css(\"display\",\"none\")\n $(\".win-modal\").css(\"display\",\"block\");\n $(\".win-modal .stars\").text(stars);\n $(\".win-modal .moves\").text(moves);\n $(\".win-modal .runner\").text(minute + \":\" + second);\n }\n }", "function renderPlayerGoal(item) {\n if(item.type_of_event === 'goal'){\n return `<p>${item.player} at \"${item.time}\"</p>\n <img src='http://clipart-library.com/images/pT58x9r7c.png' class='soccer-ball' alt='image of a soccer ball'>`\n }\n if(item.type_of_event === 'goal-penalty'){\n return `<p>${item.player} at \"${item.time}\"</p> \n <img src='https://thumbs.dreamstime.com/b/den-blonda-tecknad-filmm%C3%A5lvakten-med-flailing-bev%C3%A4pnar-v%C3%A4ntande-p%C3%A5-straff-95129888.jpg' class='penalty-kick' alt='image of a penalty kick'>`\n }\n if(item.type_of_event === 'goal-own')\n {\n return `<p>${item.player} at \"${item.time}\"</p>\n <img src='https://www.toonpool.com/user/6485/files/worst_soccer_player_ever_1071775.jpg' class='soccer-ball-bad' alt='image of a person kicking himself in the head'>`\n }\n}", "function declareWinner(who) {\n document.querySelector(\".endgame\").style.display = \"block\";\n document.querySelector(\".endgame .text\").innerText = who;\n}", "gameOver(gameWon){\n \t\tconst divOverlay = document.getElementById('overlay')\n\n \t\t//display the divOverlay\n \t\tdivOverlay.style.display = '';\n\n \t\t//changes the h1 message depending on the outcome of the game\n \t\tif(gameWon === true){\n \t\t\tdivOverlay.className = 'win';\n \t\t\tdivOverlay.querySelector('h1').innerText = \"By the bear of Zeus, you did it!\";\n \t\t}else{\n \t\t\tdivOverlay.className = 'lose';\n \t\t\tdivOverlay.querySelector('h1').innerText = \"Stay classy by trying again.\";\n \t\t}\n\n \t\t//Give the button on div overlay a 'Play Again?' message\n \t\tdocument.getElementById('btn__reset').innerText = 'Play Again?';\n\n\n \t}", "function displayWin() {\n $(\"#winner-message\").show();\n }", "function checkWin() {\n if(countryText.indexOf(\"_\") === -1) {\n\n isgameOver = true;\n wins++;\n disptotalWins.innerText = wins;\n dispuserMessage.innerHTML = \"\"\n dispkeyCont.innerHTML = \"You won a trip to \" + pickedCountry + \" !\";\n dispgameInstr.innerHTML = \" CONGRATULATIONS!\";\n //Update image and display\n dispimage.src = \"assets/images/Uganda.png\";\n dispkeySubcont.innerHTML = \"Go pack your Bags & Enjoy you Vacation!\";\n\n\n }\n}", "function gamelogoTemplate(playedgame){\n return `\n <div class=\"gameTitles sameColor topcente totheleft gamespaces overvlow\">\n <a href=\"https://store.steampowered.com/app/${playedgame.appid}/\">\n <img class=\"gamelogo\" src =\"http://media.steampowered.com/steamcommunity/public/images/apps/${playedgame.appid}/${playedgame.img_logo_url}.jpg\">\n </a>\n <h2 class=\"text-center\" >${displayname(playedgame)}</h2>\n <p class=\"text-center\">${timeplayed(playedgame.playtime_forever)} hrs on record</p>\n </div>\n `\n}", "#determineIfGameOver() {\n const p1victory = this.players[1].gameboard.allShipsSunk();\n const p2victory = this.players[0].gameboard.allShipsSunk();\n \n if (p1victory) {\n this.#page.setDialog(GAME_STATE.p1victory);\n this.#isWinnerP1 = true;\n } else if (p2victory) {\n this.#page.setDialog(GAME_STATE.p2victory);\n this.#isWinnerP1 = false;\n }\n\n if (p1victory || p2victory) {\n this.#gameOver = true;\n this.#endGame();\n }\n }", "gameOver() {\r\n const overlay = document.querySelector('#overlay');\r\n const h1 = document.querySelector('#game-over-message');\r\n\r\n if (this.checkForWin() === true) {\r\n overlay.style.display = '';\r\n h1.textContent = 'WIN';\r\n overlay.className = 'win';\r\n this.resetGame();\r\n } else {\r\n overlay.style.display = '';\r\n h1.textContent = 'LOST';\r\n overlay.className = 'lose';\r\n this.resetGame();\r\n }\r\n }", "function checkWinner(){\n if (dogOneCurrentStep > 19){\n $(\"#dogOne\").css({transform: 'translate(0px,-5px)'});\n boardMsg(\"Congratulation!! \" + playerOne + \" WINS!!!\")\n } else if (dogTwoCurrentStep > 19) {\n $(\"#dogTwo\").css({transform: 'translate(0px,-5px)'});\n boardMsg(\"Congratulation!! \" + playerTwo + \" WINS!!!\")\n }\n }", "getGamesHeader() {\n if(this.state.team) {\n return (\n <h3 className='unselectable text-center'> {this.state.team.team_name} vs 76ers</h3>\n );\n }\n }", "renderMainHeading(isShaked){\n\t\tconst title = document.querySelector(\".buttons h1\");\n\t\ttitle.innerHTML = \"C'mon, show them who is the BOSS\";\n\t\ttitle.classList.remove(\"winner\");\n\n\t\tif(isShaked === true){\n\t\t\tif(this.winners.length === 1){\n\t\t\t\tsetTimeout(()=>{\n\t\t\t\t\ttitle.innerHTML = `Player ${this.winners[0]} wins!`;\n\t\t\t\t\ttitle.classList.add(\"winner\");\n\t\t\t\t}, 1000);\n\t\t\t} else{\n\t\t\t\tthis.winners.sort((a,b) => a-b);\n\t\t\t\tsetTimeout(()=>{\n\t\t\t\t\ttitle.innerHTML = `Draw! Players ${this.winners.slice(0, this.winners.length-1).join(\", \")} and ${this.winners[this.winners.length-1]} go again!`;\n\t\t\t\t\ttitle.classList.add(\"winner\");\n\t\t\t\t}, 1000);\n\t\t\t};\n\t\t}\n\t}", "checkWin() {\n if ($('.unmatched').length === 0) {\n $('.game-wrapper').css({\n 'background-image': 'url(./images/leo.jpg)'\n });\n }\n }", "function declareWinner(who) {\r\n document.querySelector(\" .endgame\").style.display = \"block\";\r\n document.querySelector(\" .endgame .text\").innerText = who;\r\n}", "function guessWhat(result) {\nvar randomGuess = Math.floor(Math.random()*2);\nif (guessWhat ===0) {\n$(\"#guess-image\").html(\n \"<aziz-acharki-592558-unsplash.jpg>\"\n );\n}\n else { \n $(\"#guess-image\").html(\n \"daniel-pascoa-253357-unsplash.jpg>\"\n);\n } \n if ( result===randomGuess){\n wins++;\n $(\"#win-lose\").html(\"<h2>Winner!</h2>\");\n $(\"#wins\").html(\"<h3>\" + wins + \"</h3>\");\n }\n else {\n losses++;\n $(\"#win-lose\").html(\"<h2>Loser!</h2>\");\n $(\"#losses\").html(\"<h3>\" + losses + \"</h3>\");\n }\n}", "function drawTeamBanner (x, y, width, height, teamName) {\t\n\treturn svg.append(\"svg:image\")\n\t\t.attr(\"xlink:href\", \"../Resources/banners/banner_\" + teamName + \".png\")\n\t\t.attr(\"x\", x)\n\t\t.attr(\"y\", y)\n\t\t.attr(\"width\", width)\n\t\t.attr(\"height\", height);\n}", "renderPlayer(teams) {\n const {t, classes} = this.props\n\n const summoner_name = this.props.profile.user && this.props.profile.user.username\n let totalkills = 0\n let player_info\n teams['winner'].forEach(participant => {\n if (summoner_name.toLocaleLowerCase() == participant.name.toLocaleLowerCase()) {\n player_info = participant\n }\n totalkills += participant.kills\n })\n teams['loser'].forEach(participant => {\n if (summoner_name.toLocaleLowerCase() == participant.name.toLocaleLowerCase()) {\n player_info = participant\n }\n totalkills += participant.kills\n })\n\n const champion_url = player_info && '/static/img/champion/' + player_info.champion + '.png'\n const champion_stats = player_info && this.state.champion_stats[player_info.champion]\n\n const lane_icon = player_info ? Matches.lane_icon(player_info['lane']) : false\n\n return (\n <Grid container key={'player'} direction={\"row\"} alignItems={\"center\"} justify={\"center\"}>\n <Grid xs={6} md={4} item container justify={\"flex-start\"} alignItems={'center'} spacing={1} wrap={\"nowrap\"}>\n <Grid item>\n {player_info &&\n <Image className={classes.champion_icon} src={champion_url} rounded/>\n }\n </Grid>\n <Grid xs item container direction={'column'} justify={\"flex-start\"} alignItems={'center'}>\n <Grid item className={classes.full_width}>\n <Typography variant={'body1'} align={\"left\"}>{champion_stats && champion_stats['name']}</Typography>\n </Grid>\n <Grid item className={classes.full_width}>\n {lane_icon}\n </Grid>\n </Grid>\n </Grid>\n <Grid xs={6} md={4} item direction={'column'} container justify={\"center\"} alignItems={'center'}>\n <Grid xs item>\n {player_info &&\n <Typography variant={'h5'}>{player_info.kills}/{player_info.deaths}/{player_info.assists}</Typography>\n }\n </Grid>\n <Grid xs item>\n {player_info &&\n <Typography\n variant={'body1'}>KP {Math.round(((player_info.kills + player_info.assists) / totalkills) * 100)}%</Typography>\n }\n </Grid>\n </Grid>\n <Grid xs={4} item container direction={'column'} className={classes.goldndamage}>\n <Grid item container direction={'row'} key={'gold'}>\n <Grid xs={3} item container justify={'flex-end'}>\n <Gold size={\"md\"}/>\n </Grid>\n <Grid xs={3} item>\n <Typography variant={'body1'}>{player_info && player_info.gold_earned}</Typography>\n </Grid>\n </Grid>\n <Grid item container direction={'row'} key={'dmg'}>\n <Grid xs={3} item container justify={'flex-end'}>\n <Damage size={\"md\"}/>\n </Grid>\n <Grid xs={3} item>\n <Typography variant={'body1'}>{player_info && player_info.total_dmg}</Typography>\n </Grid>\n </Grid>\n </Grid>\n </Grid>\n )\n }", "function isDraw() {\n if (occupiedCells === 9 && !isGameOver()) {\n playerDisplay.textContent = \"IT'S A TIE!\";\n modalHeader.textContent = \"IT'S A TIE!\";\n modalText.textContent = \"\";\n\n isGameOver(true);\n }\n}", "function showGameOver() {\n push();\n textSize(32);\n textAlign(CENTER, CENTER);\n fill(255);\n\n let gameOverText = \"GAME OVER\\n\";\n gameOverText = gameOverText + \"Your lust gave way \" + otherGenderEaten + \" times for Eve\\n\";\n gameOverText = gameOverText + \"before you died.\"\n\n text(gameOverText, width / 2, height / 2);\n pop();\n}", "function showGameOver() {\n // drwaTinyFireflies is here to keep the fireflies during\n // game over\n drawTinyFireflies();\n // Set up the font\n textFont(\"LUCUDIA BRIGHT\");\n textSize(32);\n textAlign(CENTER, CENTER);\n noStroke();\n // color is light yellow to stand out better\n fill(255, 254, 166);\n // Set up the text to display\n let gameOverText = \"GAME OVER\\n\"; // \\n means \"new line\"\n gameOverText = gameOverText + \"You ate \" + preyEaten + \" fireflies\\n\";\n gameOverText = gameOverText + \"before you died.\\n\\n\"\n // Display it in the centre of the screen\n text(gameOverText, width / 2, height / 2);\n\n // Added text to tell player how to try again\n textSize(20)\n text(\"Press the SPACEBAR to TRY AGAIN\", 250, 400);\n\n}", "function youWin() {\r\n // Message log message, color and size font\r\n msgLog().style.color = \"#BE1830\";\r\n msgLog().style.fontSize = \"2em\";\r\n msgLog().textContent = \"YOU WIN\";\r\n\r\n // Generate a new random Number after userd win\r\n randomNumber = Math.floor(Math.random() * 100 + 1);\r\n console.log(\"NEW RANDOMNUMBER: \" + randomNumber);\r\n\r\n // Change logo to green check\r\n // 1. Elimitate text from the msg\r\n // 2. Create Image\r\n // 3. Append Image \r\n document.querySelector('.questionLogo').textContent = '';\r\n var questionlogo = document.createElement('img');\r\n questionlogo.src = 'win.png';\r\n document.querySelector('.questionLogo').appendChild(questionlogo);\r\n // Change Background Color when win\r\n document.body.style.backgroundColor = '#0A3227';\r\n \r\n}", "function showScoreBoard() {\n let title = level >= 15 ? 'Congrats, you won!' : 'Ah, you lost!',\n titleX = level >= 15 ? 152 : 220,\n titleY = 280,\n totalScore = level * 60 + GemsCollected.blue * 30 + GemsCollected.green * 40 + GemsCollected.orange * 50,\n scoreBoard = Resources.get('images/score-board.jpg'),\n starResource = Resources.get('images/Star.png'),\n gemBlueResource = Resources.get('images/Gem-Blue.png'),\n gemGreenResource = Resources.get('images/Gem-Green.png'),\n gemOrangeResource = Resources.get('images/Gem-Orange.png'),\n offset = 70;\n // Draw image assets\n ctx.drawImage(scoreBoard, (canvas.width - scoreBoard.width) / 2, (canvas.height - scoreBoard.height - offset) / 2);\n ctx.drawImage(starResource, 175, 260 - offset, starResource.width / 1.5, starResource.height / 1.5);\n ctx.drawImage(gemBlueResource, 180, 345 - offset, gemBlueResource.width / 1.8, gemBlueResource.height / 1.8);\n ctx.drawImage(gemGreenResource, 180, 425 - offset, gemGreenResource.width / 1.8, gemGreenResource.height / 1.8);\n ctx.drawImage(gemOrangeResource, 180, 505 - offset, gemOrangeResource.width / 1.8, gemOrangeResource.height / 1.8);\n // Draw text\n ctx.font = \"50px Gaegu\";\n ctx.fillStyle = \"#fff\";\n ctx.strokeStyle = \"#000\";\n ctx.lineWidth = 3;\n ctx.strokeText(title, titleX, titleY - offset);\n ctx.fillText(title, titleX, titleY - offset);\n ctx.font = \"45px Gaegu\";\n ctx.strokeText(level + ' x 60 = ' + level * 60, 270, 340 - offset);\n ctx.fillText(level + ' x 60 = ' + level * 60, 270, 340 - offset);\n ctx.strokeText(GemsCollected.blue + ' x 30 = ' + GemsCollected.blue * 30, 270, 420 - offset);\n ctx.fillText(GemsCollected.blue + ' x 30 = ' + GemsCollected.blue * 30, 270, 420 - offset);\n ctx.strokeText(GemsCollected.green + ' x 40 = ' + GemsCollected.green * 40, 270, 500 - offset);\n ctx.fillText(GemsCollected.green + ' x 40 = ' + GemsCollected.green * 40, 270, 500 - offset);\n ctx.strokeText(GemsCollected.orange + ' x 50 = ' + GemsCollected.orange * 50, 270, 580 - offset);\n ctx.fillText(GemsCollected.orange + ' x 50 = ' + GemsCollected.orange * 50, 270, 580 - offset);\n ctx.strokeText('_______', 270, 640 - offset);\n ctx.fillText('_______', 270, 640 - offset);\n ctx.strokeText('Total: ' + totalScore.toString(), 270, 640 - offset);\n ctx.fillText('Total: ' + totalScore.toString(), 270, 640 - offset);\n ctx.strokeText('Spacebar to restart', 170, 680);\n ctx.fillText('Spacebar to restart', 170, 680);\n }", "function changeImage() {\r\n //Change player selection image\r\n if (playerSelection == \"rock\") {\r\n playerSelectionImg.innerHTML = '<i class=\"far fa-hand-rock\"></i>';\r\n } \r\n else if (playerSelection == \"paper\") {\r\n playerSelectionImg.innerHTML = '<i class=\"far fa-hand-paper\"></i>';\r\n } \r\n else {\r\n playerSelectionImg.innerHTML = '<i class=\"far fa-hand-scissors\"></i>';\r\n } \r\n\r\n //Change computer selection image\r\n if (computerSelection == \"rock\") {\r\n computerSelectionImg.innerHTML = '<i class=\"far fa-hand-rock\"></i>';\r\n } \r\n else if (computerSelection == \"paper\") {\r\n computerSelectionImg.innerHTML = '<i class=\"far fa-hand-paper\"></i>';\r\n } \r\n else {\r\n computerSelectionImg.innerHTML = '<i class=\"far fa-hand-scissors\"></i>';\r\n } \r\n}", "function gameWonAnime(gameScore) {\n\t gameArea.canvas.removeLayers().clearCanvas();\n\n\t var height = gameArea.canvas.height();\n\t var width = gameArea.canvas.width();\n\n\t var scale = width;\n\t var pY = (height - width) / 2;\n\t var pX = 0;\n\n\t if (height < width)\n\t {\n\t scale = height;\n\t pX = (width - height) / 2;\n\t pY = 0;\n\t }\n\t \n\t gameArea.canvas.drawImage({\n\t source: \"images/Fear_Fork.png\", \n\t layer: true,\n\t name: 'fork',\n\t x: pX, y: pY,\n\t width: scale,\n\t height: scale,\n\t fromCenter: false,\n\t click: function () {\n\t displaySimpleModal({\n\t title: \"You Beat The Game!\",\n\t message: \"Congratulations! You are a master Maze Runner! </b> Your High Score is \" + gameScore,\n\t buttonMsg: \"Reset Game\",\n\t messageImg: robotImages.win\n\t });\n\t }\n\t });\n\t}", "function userWins(playerSelection) {\n userCurrentScore++;\n document.querySelector(\"h1\").textContent = `Current Leader: ${\n userCurrentScore >= computerCurrentScore ? \"You\" : \"Computer\"\n }`;\n document.querySelector(\n \"h2\"\n ).textContent = `You win! ${playerSelection} beats ${computerSelection}`;\n document.querySelector(\"h2\").classList.remove(\"loose\");\n document.querySelector(\"h2\").classList.add(\"win\");\n document.querySelector(\"h2\").classList.remove(\"invisible\");\n document.querySelector(\".refresh\").classList.remove(\"invisible\");\n document.querySelector(\".yourScore\").textContent = userCurrentScore;\n if (userCurrentScore == 5) {\n automate(\"nothing\");\n }\n}", "function updateScoreArea(winner){\r\n console.log(winner)\r\n //if player has the higher score then player wins\r\n if(winner==getPlayerName()){\r\n let winner=getPlayerName()\r\n document.getElementById('winner-text').innerHTML=winner+ \"wins!\"\r\n //if computer has the higher score then computer wins\r\n } else if (winner==getCompName()){\r\n let winner=getCompName()\r\n document.getElementById('winner-text').innerHTML=winner+ \"wins!\"\r\n //if tie display tie\r\n } else {\r\n document.getElementById('winner-text').innerHTML=\"It's a tie!\"\r\n }\r\n}", "function gameOverWin()\r\n{\r\n let over = document.getElementById('gameover');\r\n over.style.display = \"block\";\r\n over.style.backgroundImage = \"url(./resources/endscreen.jpg)\";\r\n over.style.backgroundSize = \"100% 100%\";\r\n\r\n // Display victor text\r\n document.getElementById('endmsg').innerHTML = \"You escaped...this time.\"\r\n \r\n // Calculate and display score\r\n let scoreText = document.getElementById('score');\r\n collision = collision || 1; // Make sure collisions is at least 1\r\n score = Math.ceil(timeLeft * (collision));\r\n\r\n if(hard == true)\r\n score *= 2;\r\n\r\n scoreText.innerHTML = \"<strong>Score: <strong>\" + score.toString();\r\n}", "function win() {\n fill(tileWhite.fill.r, tileWhite.fill.g, tileWhite.fill.b); // Same white as white tiles\n displayText(`Congrats!\n The princess will definitely notice you.\n Click anywhere to get more bread!`);\n}", "function declareWinner (winner) {\n winnerResult.css('display', 'block')\n reset.css('display', 'block')\n winner = winner === player1 ? 'player2' : 'player1'\n winnerResult.html(winner + ' ' + 'WINS!')\n}", "function isWinner(Score, activePlayer){\n if(Score===100){\n var winner=document.querySelector(`#name-${activePlayer}`)\n winner.classList.add('winner')\n winner.textContent=`Winner!!, ${winner.textContent}`\n \n document.querySelector(\".btn-roll\").style.display='none' \n }\n}", "function alertWinner() {\n const winnerAlert = document.createElement('div');\n body.appendChild(winnerAlert);\n if (humanScore == 5) {\n winnerAlert.textContent = 'HUMAN wins!';\n } else if (computerScore == 5) {\n winnerAlert.textContent = 'COMPUTER wins!';\n }\n}", "function selWinnerFin(){\n mainCard.src = \"images/card.svg\";\n gameData.win = Math.round(Math.random());\n console.log(`${gameData.win}`);\n if (gameData.win == 0) {\n turn.innerHTML = `The computer chooses: ${gameData.players[0]}`;\n deck1.remove();\n deck2.remove();\n gameData.score[0]++;\n }\n else if (gameData.win == 1) {\n turn.innerHTML = `The computer chooses: ${gameData.players[1]}`;\n deck1.remove();\n deck2.remove();\n gameData.score[1]++;\n }\n setTimeout(function(){showWinner();}, 1000);\n}", "function GameOver()\n{\n StreakManager();\n SwitchWinnerPhoto();\n player_performance--;\n gamesLost++;\n gameResultContainer.style.display = \"block\";\n _playAgain.style.display = \"flex\";\n _gameResult.textContent = \"YOU LOSE!\";\n _gameResult.classList.add(\"opponent\");\n _gameEndMessage.textContent = \"Mission failed! We'll get him next time.\" \n}" ]
[ "0.66348463", "0.6508447", "0.6492891", "0.6305778", "0.6291713", "0.6288001", "0.62786627", "0.6266288", "0.6236114", "0.6235135", "0.61864746", "0.6158112", "0.6156759", "0.612372", "0.61211056", "0.6102502", "0.60912615", "0.6085351", "0.6070993", "0.6053503", "0.60490084", "0.60463613", "0.60392386", "0.60149723", "0.60116106", "0.60081285", "0.6007083", "0.5996082", "0.5995092", "0.5976494", "0.5976213", "0.5975643", "0.59754795", "0.5966358", "0.59648675", "0.59552073", "0.5944195", "0.5942461", "0.5936316", "0.59345293", "0.5925554", "0.5921402", "0.58957165", "0.5894419", "0.5891914", "0.5891727", "0.58900696", "0.58884877", "0.58826864", "0.5875096", "0.58693063", "0.58653104", "0.58625376", "0.5856979", "0.5850189", "0.5849937", "0.58427507", "0.5841912", "0.5838078", "0.5835118", "0.58319265", "0.582744", "0.5823683", "0.58234936", "0.58225846", "0.58217686", "0.58214104", "0.5817783", "0.58167696", "0.5809487", "0.5804466", "0.58017164", "0.5797712", "0.57923436", "0.57873666", "0.5787265", "0.5784416", "0.5780451", "0.5778573", "0.57777166", "0.57763386", "0.5773588", "0.57714725", "0.5768052", "0.57634044", "0.5754995", "0.57535267", "0.57512325", "0.57508737", "0.5747151", "0.57468235", "0.5745174", "0.57415015", "0.5737491", "0.5731081", "0.5729975", "0.5728316", "0.57242435", "0.5722963", "0.57228345" ]
0.73233277
0
Initialize map from google API
function initMap(lat, lng) { // The location of user var currentPos = { lat: lat, lng: lng }; // The map, centered at Athens var map = new google.maps.Map(document.getElementById("googleMap"), { zoom: 15, center: currentPos }); // The marker, positioned at Athens var marker = new google.maps.Marker({ position: currentPos, map: map }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gmap_initialize() {\n var gmap_options = {\n center: new google.maps.LatLng(40, -80),\n zoom: 2,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n gmap = new google.maps.Map(document.getElementById(\"hud_gca_api_gmap_canvas\"), gmap_options);\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 37.4419, lng: -122.1430},\n zoom: 9,\n mapTypeId: 'hybrid'\n });\n}", "function googleMapSetup() {\n map.initialise();\n}", "function googleMapSetup() {\n map.initialise();\n}", "function initMap() {\n map = document.getElementById(\"map\");\n detailsService = new google.maps.places.PlacesService(map);\n /* here i am now setting default values for my map when it initially loads */\n map = new google.maps.Map(map, {\n center: {\n lat: -34.397,\n lng: 150.644\n },\n zoom: 8\n });\n loadApp();\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 10,\n center: { lat: 41.8781, lng: -87.6298 },\n });\n \n }", "function initMap() {\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 8,\n center: { lat: 35.717, lng: 139.731 },\n });\n}", "function init() {\n\tmap = new google.maps.Map(document.getElementById('map-canvas'),\n myOptions);\n\tgetMyLocation();\n}", "function initMap() {\n map = new google.maps.Map(\n document.getElementById('map'),\n {\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: { lat: 42.3601, lng: -71.0589 },\n zoom: 12\n }\n );\n}", "function initializeMap() {\n map = new google.maps.Map(document.getElementById('map_canvas'), {\n zoom: 18,\n center: mapCenter,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n });\n }", "function initMap() {\n // Create a map object and specify the DOM element for display.\n // New map initiated, with some options, waiting for data updating.\n mapGoogle = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 0.0, lng: 0.0},\n zoom: 17,\n mapTypeId: 'terrain',\n scaleControl: true,\n mapTypeControl: true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.DROPDOWN_MENU, mapTypeIds: ['roadmap', 'hybrid'],\n }\n });\n}", "function initMap() {\n let mapOptions = { center: initialCoords, zoom: 14, styles: mapStyles.grey }\n myMap = new google.maps.Map(document.querySelector('#myMap'), mapOptions)\n getFilms(myMap)\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.397, lng: 150.644},\n zoom: 8\n });\n \n}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"small-map\"), {\n center: {\n lat: 52.022,\n lng: 8.532,\n },\n zoom: 13,\n // mapTypeId: 'hybrid'\n });\n}", "function initMap() {\n var location = new google.maps.LatLng(29.7292957, -95.5481154);\n\n var mapoptions = {\n center: location,\n zoom: 17,\n };\n\n var map = new google.maps.Map(\n document.getElementById('map-container'),\n mapoptions\n );\n\n var marker = new google.maps.Marker({\n position: location,\n map: map,\n title: 'Houston',\n });\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: { lat: 0, lng: 0 },\n zoom: 2,\n });\n}", "function initMap () {\n // Set basic map config up\n // These can be overridden by config options contained in\n // $scope.mapConfig\n var options = {};\n if ( $scope.mapConfig && $scope.mapConfig instanceof Object ) {\n Object.keys( $scope.mapConfig ).forEach( function ( key ) {\n options[ key ] = $scope.mapConfig[ key ];\n });\n }\n\n // Build the map and save a reference to the created map object in the\n // $scope for reference later from controller\n $scope.googleMap = new googleMaps.GoogleMap( $element[ 0 ].children[ 0 ].children[ 0 ], $scope, $compile, options );\n\n // Also set a scope variable for checking map loaded status\n $scope.mapLoaded = true;\n }", "function initMap() {\r\n\t\"use strict\";\r\n\t\tmap = new google.maps.Map(document.getElementById(\"map\"), {\r\n\t\t\tcenter: {lat: 12.971599, lng: 77.594563},\r\n\t\t\tzoom: 12,\r\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\r\n\t\t\tmapTypeControl: false\r\n\t\t});\r\n\t}", "function initMap(){\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -3.0665, lng: 37.3507},\n zoom: 10\n })\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.6131516, lng:-58.3772316}, /* Coordenadas de la ciudad de Buenos Aires */\n zoom: 12\n });\n }", "function initMap() {\r\n\tlet uluru = {\r\n\t\tlat: -36.879889,\r\n\t\tlng: 174.707658\r\n\t};\r\n\tconst map = new google.maps.Map(\r\n\t\tdocument.getElementById('googleMap'), {\r\n\t\t\tzoom: 12,\r\n\t\t\tcenter: uluru\r\n\t\t}\r\n\t);\r\n\tconst marker = new google.maps.Marker({\r\n\t\tposition: uluru,\r\n\t\tmap: map\r\n\t});\r\n}", "function initMap() {\r\n map = new google.maps.Map(document.getElementById('map'), {\r\n center: {lat: -34.397, lng: 150.644},\r\n zoom: 8\r\n });\r\n}", "function initMap() {\n // Constructor creates a new map - only center and zoom are required.\n map = new google.maps.Map(document.getElementById('container'), initialLocation);\n setMarkers();\n}", "function initialize() {\n var mapProp = {\n center:new google.maps.LatLng(51.502784, -0.019059),\n zoom:15,\n mapTypeId:google.maps.MapTypeId.ROADMAP\n };\n var map=new google.maps.Map(document.getElementById(\"googleMap\"), mapProp);\n}", "function initMap() {\n\t\t// initialise map with coords and zoom level\n\t\tvar durban = new google.maps.LatLng(-29.728146, 31.083943);\n\t\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\t\tcenter: durban,\n\t\t\tzoom: 11\n\t\t});\n\t}", "function initMap() {\n console.log('initMap');\n\n // ======= map styles =======\n var styleArray = [\n { featureType: \"all\",\n stylers: [\n { saturation: -80 }\n ]\n },\n { featureType: \"road.arterial\",\n elementType: \"geometry\",\n stylers: [\n { hue: \"#00ffee\" },\n { saturation: 50 }\n ]\n },\n { featureType: \"poi.business\",\n elementType: \"labels\",\n stylers: [\n { visibility: \"off\" }\n ]\n }\n ];\n\n // ======= map object =======\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 38.89, lng: -77.00},\n disableDefaultUI: true,\n draggable: false,\n scrollwheel: false,\n styles: styleArray, // styles for map tiles\n mapTypeId: google.maps.MapTypeId.TERRAIN,\n zoom: 10\n });\n\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 0, lng: 0},\n zoom: 3\n });\n}", "function bp_element_google_map_init() {\n bp_element_google_map_create_map(window.jQuery);\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), { center: loc, zoom: z });\n}", "function init() {\n \n // set some default map details, initial center point, zoom and style\n var mapOptions = {\n center: new google.maps.LatLng(38.250206, 1.265472),\n zoom: 2,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n \n // create the map and reference the div#map-canvas container\n map = new google.maps.Map(document.getElementById(\"map-canvas\"), mapOptions);\n \n // get the animals (ajax) \n // and render them on the map\n renderPlaces();\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map-canvas'), {\n center: {lat: -34.397, lng: 150.644},\n zoom: 16\n })\n initAutocomplete(map)\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: { lat: -34.397, lng: 150.644 },\n zoom: 8\n });\n}", "function initMap() {\n // Create a new Map and its configuration\n map = new google.maps.Map(document.getElementById('map'), {\n center: initialLL,\n zoom: 16,\n mapTypeId: 'terrain',\n mapTypeControl: true,\n styles: snazzyStyle,\n });\n findCoordinatesByName();\n}", "function initMap() {\n var map;\n map = new google.maps.Map(document.getElementById(\"map-view\"), {\n center: { lat: -34.397, lng: 150.644 },\n zoom: 8\n });\n\n\n}", "function initMap() {\n geocoder = new google.maps.Geocoder()\n\n map = new google.maps.Map(document.getElementById('map'), {\n // コントローラーで定義した変数から緯度経度を呼び出し、マップの中心に表示\n center: {\n lat: gon.user.latitude, \n lng: gon.user.longitude\n },\n zoom: 16,\n });\n\n marker = new google.maps.Marker({\n // コントローラーで定義した変数から緯度経度を呼び出し、マーカーを立てる\n position: {\n lat: gon.user.latitude,\n lng: gon.user.longitude\n },\n map: map\n });\n}", "function initGoogleMap() {\n console.log(\"map loaded\")\n // set the address by providing lat and lng \n var uluru = {lat: 51.4809440, lng:-0.1281286};\n\n // give map the class and set map's position\n var map = new google.maps.Map(\n document.getElementById('map2'), { zoom: 15, center: uluru });\n\n // adjust the map so that the marker is in the center\n var marker = new google.maps.Marker({position: uluru, map: map});\n}", "function initMap(){\n\n\t//Initializing the Map\n\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\tcenter: coor,\n\t\tzoom: 12,\n\t\tstyles: [{\n\t\t\tstylers: [{ visibility: 'simplified' }]\n\t\t}, {\n\t\t\telementType: 'labels',\n\t\t\tstylers: [{ visibility: 'off' }]\n\t\t}]\n\t});\n\n\t//Initializing the InfoWindow\n\tinfoWindow = new google.maps.InfoWindow();\n\n\t//Initializing the Service\n\tservice = new google.maps.places.PlacesService(map);\n\n \t//The idle event is a debounced event, so we can query & listen without\n //throwing too many requests at the server.\n map.addListener('idle', performSearch);\n}", "function initialise() {\n\tvar myLatlng = new google.maps.LatLng(-27.4667, 153.0333);\n\tvar mapOptions = {\n center: myLatlng,\n zoom: 10,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\t\n\tvar map = new google.maps.Map(document.getElementById('Map'), mapOptions)\n}", "function initMap() {\n var mapOptions = {\n center: { lat: 37.378285, lng: -121.966043 },\n zoom: 11,\n mapTypeId: 'roadmap'\n };\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n}", "function initMap() {\n\t\t\t// The location\n\t\t\tconst centerMap = {\n\t\t\t\tlat: 48.015500,\n\t\t\t\tlng: 37.751331\n\t\t\t};\n\t\t\t// The map\n\t\t\tconst map = new google.maps.Map(document.getElementById(\"map\"), {\n\t\t\t\tzoom: 15,\n\t\t\t\tcenter: centerMap,\n\t\t\t});\n\t\t\t// The marker\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tposition: {\n\t\t\t\t\tlat: 48.015500,\n\t\t\t\t\tlng: 37.751331\n\t\t\t\t},\n\t\t\t\tmap: map,\n\t\t\t});\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tposition: {\n\t\t\t\t\tlat: 48.017591,\n\t\t\t\t\tlng: 37.752336\n\t\t\t\t},\n\t\t\t\tmap: map,\n\t\t\t});\n\t\t}", "function initMap() {\n\tmap = new google.maps.Map(document.getElementById('map'), {\n \t\t// Centers on SF\n \t\tcenter: {lat: 37.7749, lng: -122.4194},\n \t\tzoom: 4\n\t});\n}", "function initMap() {\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 15,\n center: {lat: 37.652223, lng: -119.026379},\n mapTypeId: 'terrain'\n });\n plotMap(map);\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 10,\n center: {\n lat: 37.29723,\n lng: -122.0982877\n }\n });\n geocoder = new google.maps.Geocoder();\n\n\n return;\n}", "function initialize() {\n let neighborhood = new google.maps.LatLng(47.608013,-122.335167);\n\n map = new google.maps.Map(document.getElementById('map-results'), {\n center: neighborhood,\n zoom: 10\n });\n}", "function initMap() {\n var latLng = null;\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 37.09024, lng: -100.712891}, //initially centered in the middle of the US, quickly replaced with current location\n zoom: 4\n// mapTypeId: google.maps.MapTypeId.ROADMAP\n });\n\n\t//https://developers.google.com/places/place-id\n\t// set up places service to search for counties and drop pins\n\tservice = new google.maps.places.PlacesService(map);\n}", "function initMap() {\n // The map, centered on the venue\n geocoder = new google.maps.Geocoder();\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n });\n}", "function init() {\n window.map = new google.maps.Map(document.getElementById('google-map'), {\n minZoom: 1,\n maxZoom: 7,\n streetViewControl: false,\n mapTypeControl: false\n });\n var normcore = new google.maps.StyledMapType(mapStyle);\n map.mapTypes.set('normcore', normcore);\n map.setMapTypeId('normcore');\n\n var position = {\n lat: 33.2304160,\n lng: 121.4737010\n };\n\n var latlngbounds = new google.maps.LatLngBounds();\n var latlng = new google.maps.LatLng(position);\n latlngbounds.extend(latlng);\n window.map.fitBounds(latlngbounds);\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: 37.78,\n lng: -122.44\n },\n zoom: 6\n });\n\n}", "function initMap() {\n\tconst uluru = { lat: 41.611350, lng: -87.066910 };\n\tconst map = new google.maps.Map(document.getElementById(\"map\"), {\n\t zoom: 4,\n\t center: uluru,\n\t});\n\t// The marker, positioned at Uluru\n\tconst marker = new google.maps.Marker({\n\t position: uluru,\n\t map: map,\n\t});\n }", "function initMap(){\n map = new google.maps.Map(document.getElementById(\"googlemap\"), {\n zoom: 13\n });\n}", "function initMap() {\n var defalutLocation = new google.maps.LatLng(42.4062040, -71.1188770);\n\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 16,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: defalutLocation\n });\n}", "function init_map(data) {\n\t\n var latlng = new google.maps.LatLng(38.98826233,-76.944944485);\t// define initial location\n var options = {\n zoom: 15,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n map = new google.maps.Map(document.getElementById(\"map\"), options);\n updateMap(data);\n}", "initMap() {\n var uluru = {lat: -25.363, lng: 131.044};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 4,\n center: uluru\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n }", "function mapInitialize() {\n\t\t\tvar mapOptions = {\n\t\t\t\tscrollwheel: false,\n\t\t\t\tzoom: 15,\n\t\t\t\tcenter: center\n\t\t\t};\n\t\t\tmap = new google.maps.Map(map_canvas.get(0), mapOptions);\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tposition: myLatlng,\n\t\t\t\tmap: map,\n\t\t\t\ticon: image\n\t\t\t});\n\t\t}", "function initialize() {\n // The document should have a dummy <div> with ID 'map', since the API wants one.\n // It's a bit hackish, since we don't actually want to display a map.\n var map = new google.maps.Map(document.getElementById('map'));\n service = new google.maps.places.PlacesService(map);\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n \tcenter: new google.maps.LatLng(58.7897104,-96.0892755),\n \tzoom: 4,\n \tmapTypeId: 'terrain',\n\t\t\tmapTypeControl: true,\n \t\tmapTypeControlOptions: {\n \tstyle: google.maps.MapTypeControlStyle.DROPDOWN_MENU,\n \tposition: google.maps.ControlPosition.RIGHT_TOP\n \t\t}\t\t\t\n });\n\t\n\t\tgetJSONData();\n \n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 3,\n center: { lat: 48.446913, lng: -3.3781 },\n mapTypeControl: false,\n panControl: false,\n zoomControl: true,\n streetViewControl: false\n });\n\n infoWindow = new google.maps.InfoWindow({\n content: document.getElementById('infoMapWindow')\n });\n // Resets textboxes and drop down list.\n resetData();\n // Create the autocomplete object and associate it with the UI input control.\n autocomplete = new google.maps.places.Autocomplete(\n (\n document.getElementById('locationSearch')), {\n types: ['(cities)']\n });\n places = new google.maps.places.PlacesService(map);\n autocomplete.addListener('place_changed', onPlaceChanged);\n}", "function initMap() {\n logger('function initMap is called');\n map = new gmap.Map(document.getElementById('map'), {\n center: {\n lat: 22.451754,\n lng: 114.164387\n },\n zoom: defaultZoomLevel\n });\n model.markers.forEach(function (marker) {\n createMarker(marker);\n });\n logger('function initMap is ended');\n }", "function initMap() {\n if ( ! $('#map').length ) { return; }\n var center = {lat: 59.958088, lng: 11.049032};\n\n var map = new google.maps.Map(document.getElementById('map'), {\n 'center': center,\n 'scrollwheel': false,\n 'zoom': 15,\n 'styles': MAPSTYLING\n });\n\n var marker = new google.maps.Marker({\n 'position': center,\n 'map': map,\n 'title': 'Chi restaurant & bar, Parkalleén 3'\n });\n}", "function initMap() {\n // create a container to draw the map inside a <div>\n const mapCanvas = (document.getElementById(\"map-container\"));\n\n // define some map properties\n const mapOptions = {\n center: {lat: 43.011987, lng: -81.200276},\n zoom: 7\n };\n\n // call the constructor to create a new map object\n // and then get your geo location\n map = new google.maps.Map(mapCanvas, mapOptions);\n\n //create new infoWindow object to get information about the place\n infoWindow = new google.maps.InfoWindow;\n\n // close infoWindow in case there are some open infoWindows\n google.maps.event.addListener(map, \"click\", function() {\n infoWindow.close();\n });\n\n //set new map position\n getLocation();\n\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n // Christchurch location\n center: {lat: -43.532054, lng: 172.636225},\n zoom: 12\n });\n infowindow = new google.maps.InfoWindow({});\n }", "function initMap() {\n var usa = { lat: 42.87, lng: -97.38 };\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 4,\n center: usa\n });\n}", "function initMap() {\n}", "function initMap() {\n // The location of Uluru\n const uluru = { lat: 6.574399, lng: 3.34028 };\n // The map, centered at Uluru\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: uluru,\n });\n // The marker, positioned at Uluru\n const marker = new google.maps.Marker({\n position: uluru,\n map: map,\n });\n }", "function initMap() {\n var uluru = {lat: 32.829620, lng:-117.278161};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 15,\n center: uluru\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n }", "function initialize() {\n\t\tconsole.log(\"opt\");\n var mapOptions = {\n\t\t\tcenter: new google.maps.LatLng(elementObj[0], elementObj[1]),\n\t\t\tzoom: 8,\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n };\n var map = new google.maps.Map(document.getElementById(\"geoinputMap\"),\n\t\t\t\t\t\t\t\t\t mapOptions);\n\t}", "function initialize() {\n var mapOptions = {\n zoom: 10\n };\n map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\n // HTML5 geolocation\n if(navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n setMap(position.coords.latitude, position.coords.longitude);\n }, function() {\n //Geolocation service failed. Default to Detroit\n setMap(42.3314285278,-83.0457534790);\n });\n } else { //Browser doesn't support Geolocation. Default to Detroit\n setMap(42.3314285278,-83.0457534790);\n }\n}", "function initialize(){\n var mapCanvas = document.getElementById('map');\n var mapOptions = {\n center: new google.maps.LatLng(32.8810, -117.2380),\n zoom: 14,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n }\n var map = new google.maps.Map(mapCanvas, mapOptions);\n}", "function gmInitialize() {\n $('#contents').html('<div id=\"map\"></div>');\n var myLatLng = new google.maps.LatLng(29.516596899999996, -95.71289100000001);\n GEO = new google.maps.Geocoder();\n MAP = new google.maps.Map(document.getElementById('contents'), {\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: myLatLng,\n zoom: 4\n });\n}", "function initialize() {\n geocoder = new google.maps.Geocoder();\n var latlng = new google.maps.LatLng(40.781346, -73.966614);\n var mapOptions = {\n zoom: 12,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n disableDefaultUI: true\n }\n map = new google.maps.Map(document.getElementById(\"map-canvas\"), mapOptions);\n}", "function initMap() {\n // The area where the map would center on\n const cary_NC = {lat: 35.7881812, lng: -78.7951261};\n\n // Constructor creates a new map - only center and zoom are required.\n return new google.maps.Map(document.getElementById('map'), {\n center: cary_NC,\n zoom: 12,\n style: myMapStyles\n });\n }", "function initMap() {\n\tvar $map = $('#map').removeClass('center-text')[0];\n\n\tmap = new google.maps.Map($map, {\n\t\tcenter: {lat: 40.7413549, lng: -73.99802439999996},\n\t\tzoom: 13,\n\t\t// hide style/zoom/streetview UI\n\t\tdisableDefaultUI: true,\n\t\tstyles: mapStyle\n\t});\n\n\tinfoWindow = new google.maps.InfoWindow();\n\tinitMarkers();\n}", "function initMap() {\n var mapDiv = document.getElementById('contact-map-inside');\n var map = new google.maps.Map(mapDiv, {\n center: {\n lat: 40.7058254,\n lng: -74.1180847\n },\n zoom: 12\n });\n}", "function initMap() {\n\t// The location of Uluru\n\tvar uluru = { lat: 49.411791, lng: 32.021873 };\n\t// The map, centered at Uluru\n\tvar map = new google.maps.Map(\n\t\tdocument.getElementById('map'), { zoom: 17, center: uluru });\n\t// The marker, positioned at Uluru\n\tvar marker = new google.maps.Marker({ position: uluru, map: map });\n}", "function initMap() {\n\t// The location of Uluru\n\tvar uluru = {lat: 19.387584, lng: -99.223988};\n\t// The map, centered at Uluru\n\tvar map = new google.maps.Map(\n\t\t\tdocument.getElementById('map'), {zoom: 15, center: uluru});\n\t// The marker, positioned at Uluru\n\tvar marker = new google.maps.Marker({position: uluru, map: map});\n}", "function initMap() {\n // The location of Uluru\n const beckbagan = { lat: 22.538142445390086, lng: 88.36075198119023 };\n // The map, centered at Uluru\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 400,\n center: beckbagan,\n });\n // The marker, positioned at Uluru\n const marker = new google.maps.Marker({\n position: beckbagan,\n map: map,\n });\n }", "function initMap() {\n // Constructor creates a new map - only center and zoom are required.\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.397, lng: 150.644},\n scrollwheel: false,\n zoom: 8\n });\n bounds = new google.maps.LatLngBounds();\n largeInfowindow = new google.maps.InfoWindow();\n initApp();\n}", "function initMap() {\n map = new google.maps.Map2($('#map').get(0));\n map.setCenter(new google.maps.LatLng(39,-96), 4);\n\n geocoder = new google.maps.ClientGeocoder();\n \n // anything besides default will not work in list view\n map.setUIToDefault();\n}", "function initialize() {\n var center = new google.maps.LatLng(22.3511148,78.6677428);\n var mapOptions = {\n zoom: 5,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: center,\n };\n this.map = new google.maps.Map(document.getElementById('map_canvas'),\n mapOptions);\n}", "function initMap() {\n var uluru = {lat: 47.2357137, lng: 39.701505};\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 15,\n center: uluru\n });\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n}", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n center: new google.maps.LatLng(40.730610,-73.935242),\n zoom: 8,\n mapTypeId: 'terrain'\n });\n loadKmlLayer(src, src2, map);\n }", "function initMap() {\r\n // The location of Uluru\r\n const uluru = { lat: 55.74303813644981, lng: 37.58454627585226 };\r\n // The map, centered at Uluru\r\n const map = new google.maps.Map(document.getElementById(\"map\"), {\r\n zoom: 14,\r\n center: uluru,\r\n });\r\n // The marker, positioned at Uluru\r\n const marker = new google.maps.Marker({\r\n position: uluru,\r\n map: map,\r\n });\r\n }", "function initialize() {\n\t\tmap = new google.maps.Map(document.getElementById('map'), {\n\t\t\tzoom: 4,\n\t\t\tminZoom: 4,\n\t\t\tmaxZoom: 10,\n\t\t\tcenter: new google.maps.LatLng(52, 18),\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP,\n\t\t\tpanControl: false,\n\t\t\tzoomControl: true,\n\t\t\tzoomControlOptions: {\n\t\t\t\tstyle: google.maps.ZoomControlStyle.LARGE,\n\t\t\t\tposition: google.maps.ControlPosition.RIGHT_TOP\n\t\t\t},\n\t\t\tstreetViewControl: false,\n\t\t\tmapTypeControl: false,\n\t\t\tdraggable: true,\n\t\t\tscrollwheel: false\n\t\t});\n\n\t\tvar styledMap = new google.maps.StyledMapType(exports.MapSettings.mapStyles, {name: \"Styled Map\"});\n\t\tmap.mapTypes.set('map_style', styledMap);\n\t\tmap.setMapTypeId('map_style');\n\t}", "function mapInit(){\n var center = {\n lat: 53.1683441,\n lng: 8.6510992\n };\n var map = new google.maps.Map(document.querySelector('.jacobshack-map'), {\n center: center,\n zoom: 16,\n scrollwheel: false,\n });\n var marker = new google.maps.Marker({\n position: center,\n map: map,\n title: 'jacobsHack!'\n });\n }", "function initialize(){\n geocoder = new google.maps.Geocoder();\n var latlng = new google.maps.LatLng(0,0);\n var myOptions = {\n zoom: 1,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n }\n map = new google.maps.Map(document.getElementById(\"map_canvas\"), myOptions);\n}", "function initMap() {\n var map;\n var home = {lat: 39.581 , lng: -104.916};\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: -34.397, lng: 150.644},\n center: home,\n zoom: 16\n });\n\n //var marker = new google.maps.Marker({map: map, position: home,title:\"ass eating capital of america2\"});\n\n Window.google_map = map;\n}", "function initMap() {\n\tupdateYear();\n map = new google.maps.Map($('#map')[0], { \n \tzoom:6,\n center:{lat: 43, lng: -76},\n \tbackgroundColor:\"#d8e8ff\",\n \tstreetViewControl:false,\n mapTypeControl:false,\n maxZoom:15,\n minZoom:5,\n clickableIcons:false\n });\n \tmap.fitBounds({north: 43.5, south: 40.5, west: -76, east: -74});\n \n $.getJSON( \"guide_data.json\", onGuideLoad)\n .fail(function() {console.log( \"guide load error\" );});\n\n\t\n \t$.ajax({\n\t\turl: \"https://data.ny.gov/resource/dzn2-x287.json?$where=starts_with(waterbody,'HUDSON R')\",\n\t\ttype: \"GET\",\n\t\tdata: {\n\t\t \"$limit\" : 75000,\n\t\t \"$$app_token\" : \"6VuR0Szvnvt58kUl87cNa4tdF\"\n\t\t}\n\t}).done(onJSONLoad);\n}", "function initMap() {\n // The location of Uluru\n var uluru = {lat: 54.913185, lng: 9.779275};\n // The map, centered at Uluru\n var map = new google.maps.Map(\n document.getElementById('map'), {zoom: 4, center: uluru});\n // The marker, positioned at Uluru\n var marker = new google.maps.Marker({position: uluru, map: map});\n }", "function initMap() {\n // define map and render it into the map div\n map = new google.maps.Map(document.getElementById('map'), {\n center: {lat: 40.7501481, lng: -111.8665667},\n zoom: 2,\n backgroundColor: '#af9a6b',\n styles: styles,\n mapTypeId: 'terrain',\n mapTypeControl: true\n });\n // define bounds\n bounds = new google.maps.LatLngBounds();\n // define largeInfowindow\n largeInfowindow = new google.maps.InfoWindow();\n // create all map markers\n createMarkers();\n}", "function my_initial()\n\t{\n\t\tgeo=new google.maps.Geocoder();\n\t\tvar mymap={\n\t\tcenter:new google.maps.LatLng(28.613939,77.209021),\n\t\tzoom:3,\n\tmapTypeId:google.maps.MapTypeId.ROADMAP\n\t}\n\tmap=new google.maps.Map(document.getElementById(\"googlemaps\"),mymap);\n\t}", "loadMap() {\n this.loadScript = false\n loadScript(\"https://maps.googleapis.com/maps/api/js?key=AIzaSyBsBLzRJXJvP71hA4Mw3HqILtRQmX_1zBs&callback=initMap\")\n window.initMap = this.initMap;\n window.google = {}\n }", "function mapInitialize() {\n city = new google.maps.LatLng(52.520008, 13.404954);\n map = new google.maps.Map(document.getElementById('map'), {\n center: city,\n zoom: 12,\n zoomControlOptions: {\n position: google.maps.ControlPosition.LEFT_CENTER,\n style: google.maps.ZoomControlStyle.SMALL\n },\n mapTypeControl: false,\n panControl: false\n });\n clearTimeout(self.mapRequestTimeout);\n\n google.maps.event.addDomListener(window, \"resize\", function() {\n var center = map.getCenter();\n google.maps.event.trigger(map, \"resize\");\n map.setCenter(center);\n });\n\n infowindow = new google.maps.InfoWindow({\n maxWidth: 300\n });\n getMeetups('berlin');\n }", "function initMap() {\n \"use strict\";\n //se 172nd ave & se rock creek ct, clackamas: 45.421765, -122.485646\n currentCenter = new google.maps.LatLng(45.421765, -122.485646);\n var i;\n \n map = new google.maps.Map(document.getElementById('map'), {\n center: currentCenter,\n zoom: zoomFactor\n });\n \n map.setMapTypeId(google.maps.MapTypeId.SATELLITE);\n \n getAllCompanies();\n}", "function initMap() {\n\n var map = new google.maps.Map(document.getElementById('map'), {\n zoom: 10,\n center: {lat: 41.7072608, lng: 45.0963375},\n scrollwheel: false\n });\n\n setMarkers(map);\n}", "function initMap() {\n\n map = new google.maps.Map(document.getElementById('map'), {\n // Fallback location for the map if geolocation is not enabled\n center: { lat: 1.290270, lng: 103.851959 },\n zoom: 10,\n });\n\n infoWindow = new google.maps.InfoWindow;\n\n // To find user's location and place an infowindow\n geolocate(infoWindow, map, geolocateResult);\n\n // To enable auto-complete in the search location input field\n autocomplete();\n\n // Used for Jasmine Testing\n return true;\n\n}", "function initMap() {\n\t\t\t // The location of Uluru\n\t\t\t var uluru = {lat: -25.344, lng: 131.036};\n\t\t\t // The map, centered at Uluru\n\t\t\t var map = new google.maps.Map(\n\t\t\t document.getElementById('map'), {zoom: 4, center: uluru});\n\t\t\t // The marker, positioned at Uluru\n\t\t\t var marker = new google.maps.Marker({position: uluru, map: map});\n\t\t\t\t}", "function InitializeMap() {\n\n var mapCanvas=document.getElementById('map-canvas');\n\n var mapOptions={\n disableDefaultUI: true\n };\n\n mapElement=new google.maps.Map(mapCanvas, mapOptions);\n\n // fill map with markers\n\n // Sets the boundaries of the map based on pin locations\n window.mapBounds=new google.maps.LatLngBounds();\n\n // look for locations\n LocationFinder();\n}", "function initialise() {\n\tvar myLatlng = new google.maps.LatLng(-27.4667, 153.0333);\n\tvar mapOptions = {\n center: myLatlng,\n zoom: 10,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n\t\n \n\tvar map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions)\n\t\n\tvar marker = new google.maps.Marker({\n\t\tposition: myLatlng,\n\t\tmap: map,\n\t\ttitle: 'Brisbane'\n\t});\n}", "function initMap() {\n // The location of Uluru\n const uluru = { lat: -25.344, lng: 131.036 };\n // The map, centered at Uluru\n map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: uluru,\n });\n console.log(\"initmap map\");\n console.log(map);\n // The marker, positioned at Uluru\n const marker = new google.maps.Marker({\n position: uluru,\n map: map,\n });\n} // end of function initMap", "function initMap() {\n\n \t\t\n \t\tvar mapLatitude = 31.423308 ; // Google map latitude \n \t\tvar mapLongitude = -8.075145 ; // Google map Longitude \n\n\t var myLatlng = new google.maps.LatLng( mapLatitude, mapLongitude );\n\n\t var mapOptions = {\n\n\t center: myLatlng,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,\n\t zoom: 10,\n\t scrollwheel: false\n\t }; \n\n\t var map = new google.maps.Map(document.getElementById(\"contact-map\"), mapOptions);\n\n\t var marker = new google.maps.Marker({\n\t \t\n\t position: myLatlng,\n\t map : map,\n\t \n\t });\n\n\t // To add the marker to the map, call setMap();\n\t marker.setMap(map);\n\n\t // Map Custom style\n\t var styles = [\n\t\t {\n\t\t stylers: [\n\t\t { hue: \"#1f76bd\" },\n\t\t { saturation: 80 }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"geometry\",\n\t\t stylers: [\n\t\t { lightness: 80 },\n\t\t { visibility: \"simplified\" }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"labels\",\n\t\t stylers: [\n\t\t { visibility: \"off\" }\n\t\t ]\n\t\t }\n\t\t];\n\n\t\tmap.setOptions({styles: styles});\n\n\t}", "function initMap() {\n\n \t\t\n \t\tvar mapLatitude = 31.423308 ; // Google map latitude \n \t\tvar mapLongitude = -8.075145 ; // Google map Longitude \n\n\t var myLatlng = new google.maps.LatLng( mapLatitude, mapLongitude );\n\n\t var mapOptions = {\n\n\t center: myLatlng,\n\t mapTypeId: google.maps.MapTypeId.ROADMAP,\n\t zoom: 10,\n\t scrollwheel: false\n\t }; \n\n\t var map = new google.maps.Map(document.getElementById(\"contact-map\"), mapOptions);\n\n\t var marker = new google.maps.Marker({\n\t \t\n\t position: myLatlng,\n\t map : map,\n\t \n\t });\n\n\t // To add the marker to the map, call setMap();\n\t marker.setMap(map);\n\n\t // Map Custom style\n\t var styles = [\n\t\t {\n\t\t stylers: [\n\t\t { hue: \"#1f76bd\" },\n\t\t { saturation: 80 }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"geometry\",\n\t\t stylers: [\n\t\t { lightness: 80 },\n\t\t { visibility: \"simplified\" }\n\t\t ]\n\t\t },{\n\t\t featureType: \"road\",\n\t\t elementType: \"labels\",\n\t\t stylers: [\n\t\t { visibility: \"off\" }\n\t\t ]\n\t\t }\n\t\t];\n\n\t\tmap.setOptions({styles: styles});\n\n\t}" ]
[ "0.78562695", "0.77401686", "0.77093166", "0.77093166", "0.7649136", "0.76373667", "0.7629684", "0.761697", "0.76127934", "0.7611841", "0.7599866", "0.7599786", "0.75382257", "0.75365853", "0.7534764", "0.7527984", "0.75078046", "0.75060475", "0.7505698", "0.74972254", "0.7490238", "0.7488667", "0.7488578", "0.74875796", "0.7487572", "0.7484794", "0.7479808", "0.74621826", "0.745674", "0.7452369", "0.7438814", "0.7437317", "0.74353874", "0.7434107", "0.7426194", "0.74181765", "0.7399961", "0.7396048", "0.73926073", "0.7386702", "0.73849696", "0.7382831", "0.73795545", "0.7362327", "0.7356473", "0.7352887", "0.7348675", "0.73388547", "0.732952", "0.732897", "0.7323112", "0.73224896", "0.7322101", "0.73048526", "0.7294888", "0.72945845", "0.72925985", "0.7292437", "0.72907346", "0.7289126", "0.72876245", "0.7285458", "0.7284243", "0.72793734", "0.72777647", "0.72739416", "0.7270901", "0.72694933", "0.7264391", "0.7253536", "0.72510356", "0.724421", "0.72438127", "0.7239753", "0.72289294", "0.721658", "0.72165644", "0.72152245", "0.7215211", "0.721375", "0.7209596", "0.7206879", "0.7204852", "0.7200126", "0.7199725", "0.7197354", "0.7190304", "0.71769816", "0.7171601", "0.7167939", "0.71649975", "0.7162543", "0.71533483", "0.7149218", "0.7144779", "0.7142175", "0.71419466", "0.71411306", "0.7140267", "0.7137945", "0.7137945" ]
0.0
-1
Normalize a port into a number, string, or false.
function normalizePort(val) { var port = parseInt(val, 10); if (isNaN(port)) { // named pipe return val; } if (port >= 0) { // port number return port; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "normalizePort(val){\n /**\n * Normalize a port into a number, string, or false.\n */\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n }", "function normalize_port(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n\tconst port = parseInt(val, 10);\n\n\t// eslint-disable-next-line no-restricted-globals\n\tif (isNaN(port)) {\n\t\t// named pipe\n\t\treturn val;\n\t}\n\n\tif (port >= 0) {\n\t\t// port number\n\t\treturn port;\n\t}\n\n\treturn false;\n}", "function normalizePort(val) {\r\n const parsedPort = parseInt(val, 10);\r\n if (isNaN(parsedPort)) {\r\n // named pipe\r\n return val;\r\n }\r\n if (parsedPort >= 0) {\r\n // port number\r\n return parsedPort;\r\n }\r\n return false;\r\n}", "function normalizePort(val) {\n\tconst port = parseInt(val, 10);\n\n\tif (isNaN(port)) {\n\t\t// named pipe\n\t\treturn val;\n\t}\n\n\tif (port >= 0) {\n\t\t// port number\n\t\treturn port;\n\t}\n\n\treturn false;\n}", "function normalizePort (val) {\n const port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n }", "function normalizePort (val) {\n var port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n }", "function normalizePort(val) {\n const portNum = parseInt(val, 10);\n\n // eslint-disable-next-line no-restricted-globals\n if (isNaN(portNum)) {\n // named pipe\n return val;\n }\n\n if (portNum >= 0) {\n // port number\n return portNum;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n }", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n }", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val: string) {\n const parsedPort = parseInt(val, 10);\n\n if (isNaN(parsedPort)) {\n // named pipe\n return val;\n }\n\n if (parsedPort >= 0) {\n // port number\n return parsedPort;\n }\n\n return false;\n }", "function normalizePort(val) {\n const port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n }", "function normalizePort (val) {\n var port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n}", "function normalizePort(val) {\n const port = parseInt(val, 10)\n\n // eslint-disable-next-line\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n }", "function normalizePort(val) {\n\tconst port = parseInt(val, 10);\n\tconst isNumber = value => !Number.isNaN(parseFloat(value));\n\n\tif (isNumber(port)) {\n\t\t// named pipe\n\t\treturn val;\n\t}\n\n\tif (port >= 0) {\n\t\t// port number\n\t\treturn port;\n\t}\n\n\treturn false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10)\n\n if (isNaN(port)) {\n // named pipe\n return val\n }\n\n if (port >= 0) {\n // port number\n return port\n }\n\n return false\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n \n if (isNaN(port)) {\n // named pipe\n return val;\n }\n \n if (port >= 0) {\n // port number\n return port;\n }\n \n return false;\n }", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) { //eslint-disable-line no-restricted-globals\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n if (port >= 0) {\n // port number\n return port;\n }\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n const port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n}", "function normalizePort(val) {\n var port = parseInt(val, 10);\n\n if (isNaN(port)) {\n // named pipe\n return val;\n }\n\n if (port >= 0) {\n // port number\n return port;\n }\n\n return false;\n }" ]
[ "0.844777", "0.84337467", "0.8424202", "0.8402083", "0.83947915", "0.8393728", "0.83874613", "0.8383658", "0.8378447", "0.8378447", "0.83705056", "0.83705056", "0.83705056", "0.83705056", "0.83705056", "0.83705056", "0.83700824", "0.8367369", "0.83595544", "0.83580923", "0.83578897", "0.8355143", "0.8352155", "0.8351912", "0.8350366", "0.8350366", "0.83503217", "0.83503217", "0.83503217", "0.8350263" ]
0.0
-1
Event listener for HTTP server "error" event.
function onError(error) { if (error.syscall !== 'listen') { throw error; } var bind = 'Port ' + _config2.default.port; // handle specific listen errors with friendly messages switch (error.code) { case 'EACCES': console.error(bind + ' requires elevated privileges'); process.exit(1); break; case 'EADDRINUSE': console.error(bind + ' is already in use'); process.exit(1); break; default: throw error; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function httpOnError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n logger.error(error.code + ' not equal listen', 'serverOnErrorHandler', 10);\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(\n error.code + ':elavated privileges required',\n 'serverOnErrorHandler',\n 10\n );\n process.exit(1);\n break;\n case 'EADDRINUSE':\n logger.error(\n error.code + ':port is already in use.',\n 'serverOnErrorHandler',\n 10\n );\n process.exit(1);\n break;\n default:\n logger.error(\n error.code + ':some unknown error occured',\n 'serverOnErrorHandler',\n 10\n );\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n logger.error(error.code + ' not equal listen', 'serverOnErrorHandler', 10)\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(error.code + ':elavated privileges required', 'serverOnErrorHandler', 10);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n logger.error(error.code + ':port is already in use.', 'serverOnErrorHandler', 10);\n process.exit(1);\n break;\n default:\n logger.error(error.code + ':some unknown error occured', 'serverOnErrorHandler', 10);\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n logger.captureError(error.code + ' not equal listen', 'serverOnErrorHandler', 10)\n throw error;\n }\n \n \n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.captureError(error.code + ':elavated privileges required', 'serverOnErrorHandler', 10);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n logger.captureError(error.code + ':port is already in use.', 'serverOnErrorHandler', 10);\n process.exit(1);\n break;\n default:\n logger.captureError(error.code + ':some unknown error occured', 'serverOnErrorHandler', 10);\n throw error;\n }\n }", "function handle_error(error) {\n console.log(\"Error from server\", error);\n}", "error (listener) { this.errorListener = listener }", "function onerror (err) {\n debug('http.ClientRequest \"error\" event: %o', err.stack || err);\n fn(err);\n }", "_onError( e ) {\n let response = this._resolveResponseData();\n let error = this._resolveErrorText( response );\n this._callHandler( 'error', this._xhr, error, response );\n this._onComplete( response );\n }", "function getError() {\n\tvar xmlhttp = new XMLHttpRequest();\n\txmlhttp.addEventListener(\"load\", reqListenerError);\n\txmlhttp.open(\"GET\", \"http://httpstat.us/500\");\n\txmlhttp.send();\n}", "function onError(event) {\n\t\tconsole.log('Client socket: Error occured, messsage: ' + event.data);\n\t\tcastEvent('onError', event);\n\t}", "function onError(error) {\n\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n var counter = error.message + 1\n if (counter < 1000) {\n randomPort = randPort();\n\n port = normalizePort(process.env.PORT || randomPort);\n app.set('port', port);\n console.warn(\"Port Occupied. Running on port\", port);\n\n // Create HTTP server.\n\n server = http.createServer(app);\n server.listen(port);\n server.on('error', function(e) {\n e.message = counter\n return onError(e)});\n server.on('listening', onListening);\n break;\n }\n else {\n console.error(\"Ports full\")\n process.exit(1);\n break;\n }\n default:\n throw error;\n }\n}", "function onError (error) {\n if (error.syscall !== 'listen') {\n throw error\n }\n const bind = typeof port === 'string' ? 'Pipe ' + app.get('port') : 'Port ' + app.get('port')\n // handle specific listen errors\n switch (error.code) {\n case 'EACCES':\n logger.error(util.format(bind, 'requires elevated privileges'))\n console.error(bind + ' requires elevated privileges')\n process.exit(1)\n case 'EADDRINUSE':\n logger.error(util.format(bind, ' is already in use'))\n console.error(bind + ' is already in use')\n process.exit(1)\n default:\n logger.error(util.format('http server: ', error))\n throw error\n }\n}", "onError( error, request, response ) {\n\n\t\tconsole.log( chalk.red.bold( \"Global Error Handler:\" ) );\n\t\tconsole.log( error );\n\n\t\t// If the headers have already been sent, it's too late to adjust the output, so\n\t\t// just end the response so it doesn't hang.\n\t\tif ( response.headersSent ) {\n\n\t\t\treturn( response.end() );\n\n\t\t}\n\n\t\t// Render the not found error page.\n\t\tif ( error.message === \"Not Found\" ) {\n\n\t\t\tresponse.status( 404 );\n\t\t\tresponse.setView( \"common:error.notfound\" );\n\n\t\t} else {\n\n\t\t\t// Render the fatal error page.\n\t\t\tresponse.rc.title = \"Server Error\";\n\t\t\tresponse.rc.description = \"An unexpected error occurred. Our team is looking into it.\";\n\t\t\tresponse.status( 500 );\n\t\t\tresponse.setView( \"common:error.fatal\" );\n\n\t\t}\n\t\t\n\t}", "function onError(error) {\n debug('onError');\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string'\n ? `Pipe ${port}`\n : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(`${bind} requires elevated privileges. Exiting.`, { error, tags: 'exit' });\n exitProcess(110);\n break;\n case 'EADDRINUSE':\n logger.error(`${bind} is already in use. Exiting.`, { error, tags: 'exit' });\n exitProcess(111);\n break;\n default:\n logger.error('HTTP server error', { error, tags: 'server' });\n throw error;\n }\n}", "function onError(error) {\n self.error('Error : ' + error.status + ' ' + error.statusText);\n }", "$errorHandler(e, url, config, request) {\r\n if (e instanceof ResponseError) {\r\n throw e;\r\n }\r\n else {\r\n // Network error!\r\n throw new ResponseError('Unkown Error: ', ResponseErrors.UnknownError, e, {\r\n url, config, request\r\n });\r\n }\r\n }", "error(error) {\n this.__processEvent('error', error);\n }", "function errorHandler(error) {\n console.log(\"error occured\", error);\n alert(\"server not responding, try again later!\")\n}", "_onSocketError(variable, evt) {\n variable._socketConnected = false;\n this.freeSocket(variable);\n // EVENT: ON_ERROR\n initiateCallback(VARIABLE_CONSTANTS.EVENT.ERROR, variable, _.get(evt, 'data') || 'Error while connecting with ' + variable.service, evt);\n }", "function connectionErrorHandler(error) {\n var socket = this\n if (socket.res) {\n if (socket.res.request) {\n socket.res.request.emit('error', error)\n } else {\n socket.res.emit('error', error)\n }\n } else {\n socket._httpMessage.emit('error', error)\n }\n}", "function httpError(response, error, xhr) {\n try {\n $.lib.logError('['+endpoint+'] httpError.response=' + JSON.stringify(response), LOGTAG+'.httpError');\n var processedresponse = processHTTPResponse(false, response, error, xhr);\n if (_.isFunction(onError)) {\n _.defer(function(){ onError(processedresponse); });\n }\n } catch(E) {\n $.lib.logError(E, 'feetapi.httpError');\n }\n }", "function onSocketError(err) {\n let data = _data.get(this);\n\n data.error = err;\n\n _data.set(this, data);\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\r\n if (error.syscall !== 'listen') {\r\n throw error;\r\n }\r\n\r\n // handle specific listen errors with friendly messages\r\n switch (error.code) {\r\n case 'EACCES':\r\n console.error('Port ', port, ' requires elevated privileges.');\r\n process.exit(1);\r\n break;\r\n case 'EADDRINUSE':\r\n console.error('Port ', port, ' is already in use.');\r\n process.exit(1);\r\n break;\r\n default:\r\n console.error('Unknown error code: ', error.code);\r\n throw error;\r\n }\r\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(port + ' requires elevated privileges');\n break;\n case 'EADDRINUSE':\n logger.error(port + ' is already in use');\n break;\n default:\n throw error;\n }\n}", "onError(err) {\n debug$3(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "function onError(error)\n{\n if(error.syscall !== 'listen') {\n throw error;\n }\n\n //\n //\thandle specific listen errors with friendly messages\n //\n switch(error.code)\n {\n case 'EACCES':\n console.error(\"Port %d requires elevated privileges\", port);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(\"Port %d is already in use\", port);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error\n }\n\n const bind = typeof Utils.readConfig('http_port') === 'string'\n ? 'Pipe ' + Utils.readConfig('http_port')\n : 'Port ' + Utils.readConfig('http_port')\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges')\n process.exit(1)\n break\n case 'EADDRINUSE':\n console.error(bind + ' is already in use')\n process.exit(1)\n break\n default:\n throw error\n }\n }", "function onError(error) {\n \n if (error.syscall !== 'listen') {\n throw error\n }\n \n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error('Port ' + port + ' requires elevated privileges')\n process.exit(1)\n break\n case 'EADDRINUSE':\n logger.error('Port ' + port + ' is already in use')\n process.exit(1)\n break\n default:\n throw error\n }\n }", "function request_error_handler(error, script_name)\n{\n\t// Handle individual errors here.\n\tif ( error == 'db_connect' )\n\t\talert('ERROR: Could not process request at this time. Database unavailable.');\n\telse if ( error == 'script_not_found' )\n\t\talert('ERROR: The script specified to handle this request does not exist.');\n\telse if ( error == 'login_required' )\n\t\talert('ERROR: Your session has timed out. Please log in again.');\n\telse if ( error == 'dirty_script_name' )\n\t\talert('ERROR: Invalid characters in script name: '+ script_name);\n\telse if ( error == 'AJAX_failed' )\n\t\talert('ERROR: The AJAX request could not be completed: '+ script_name);\n\telse\n\t\talert('ERROR: '+ error);\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`${bindInfo.portType} ${bindInfo.port} requires elevated privileges`);\n process.exit(1);\n break;\n\n case 'EADDRINUSE':\n console.error(`${bindInfo.portType} ${bindInfo.port} is already in use`);\n process.exit(1);\n break;\n\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`Port ${port} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`Port ${port} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n //console.log(error);\n if (error.syscall !== 'listen') {\n throw error;\n }\n \n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n \n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n server.close();\n //process.exit(1);\n break;\n default:\n throw error;\n }\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n /*! ES6 support */\n<% if (es6) { -%>\n <%- varconst %> bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n<% } else { -%>\n <%- varconst %> bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n<% } -%>\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n<% if (es6) { -%>\n console.error(`${bind} requires elevated privileges`);\n<% } else { -%>\n console.error(bind + ' requires elevated privileges');\n<% } -%>\n process.exit(1);\n // break;\n case 'EADDRINUSE':\n<% if (es6) { -%>\n console.error(`${bind} is already in use`);\n<% } else { -%>\n console.error(bind + ' is already in use');\n<% } -%>\n process.exit(1);\n // break;\n default:\n throw error;\n }\n}", "function handleError(_e,_xhr,_custom) {\n\t\t\tif (_custom) {\n\t\t\t\t_custom(e,xhr);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tTi.API.error('Error: '+JSON.stringify(_e)+'\\nServer response: '+_xhr.responseText);\n\t\t\t\tapp.ui.alert(L('error'), L('error_general'));\n\t\t\t\tTi.App.fireEvent('app:hide.loader');\n\t\t\t}\n\t\t}", "function onConnectionFailed() {\r\n\t\t console.error('Connection Failed!');\r\n\t\t}", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "onError(err) {\n debug(\"socket error %j\", err);\n Socket.priorWebsocketSuccess = false;\n this.emit(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "function onConnectionFailed(){\n\t\t\tconsole.error(\"Connection Failed!\")\n\t\t}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`Port ${error.port} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`Port ${error.port} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function errorHandler (error) {\n console.error(error)\n throw new Error('Failed at server side')\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`${port} port requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`${port} port is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "onError(e) {\n this.handleNetworkingError(`Socket error: ${JSON.parse(e)}`);\n this.websocket.close();\n this.scheduleReconnect();\n }", "function onError(error) {\n\tif (error.syscall !== 'listen') {\n\t\tthrow error;\n\t}\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\t\tcase 'EACCES':\n\t\t\tconsole.error('Port ' + port + ' requires elevated privileges');\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tcase 'EADDRINUSE':\n\t\t\tconsole.error('Port ' + port + ' is already in use');\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow error;\n\t}\n}", "[net.onError](err) {\n console.log('SC:error', err);\n }", "function onErrorRequest(error) {\r\n\t\t\tconsole.log(\"err [\" + error.name + \"] msg[\" + error.message + \"]\");\r\n\t\t}", "function on_error(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const port = error.port;\n\n const bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error('These ports may require elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error('These ports may already be in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n}", "function onError(evt) {\n console.log(\"ERROR: \" + evt.data);\n}", "onError(err) {\n this._closeSocket(err.message);\n }", "registerErrorListener() {\n onError(error => {\n console.log(JSON.stringify(error));\n });\n }", "function registerEventError(errorMessage) {\n registerWebview.emit('error', errorMessage);\n}", "function onError(error) { handleError.call(this, 'error', error);}", "onError(err) {\n Socket$1.priorWebsocketSuccess = false;\n this.emitReserved(\"error\", err);\n this.onClose(\"transport error\", err);\n }", "onError(fn) {\n\n this.eventEmitter.on(settings.socket.error, (data) => {\n\n fn(data)\n });\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`{bind} requires elevated privileges`);\n logger.error({\"message\": `${bind} requires elevated privileges`, \"user\": 'system', \"namespace\": 'www.server.bind.privileges'});\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`{bind} is already in use`);\n logger.error({\"message\": `${port} is already in use`, \"user\": 'system', \"namespace\": 'www.server.bind.use'});\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n var exit = false;\n var errorMessage = 'Error: ';\n switch (error.code) {\n case 'EACCES':\n errorMessage += bind + ' requires elevated privileges.';\n exit = true;\n break;\n case 'EADDRINUSE':\n errorMessage += bind + ' is already in use.';\n exit = true;\n break;\n default:\n errorMessage += error.message || 'Something broke.';\n\n console.error(errorMessage);\n\n // If the process is a child process (e.g. started in Gulp)\n // then inform the parent process that the server has errored.\n if (process.send) {\n process.send(startMessage);\n }\n\n // Exit or rethrow.\n if (exit) {\n process.exit(1);\n } else {\n throw error;\n }\n }\n}", "onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n \n var bind = typeof this.port === 'string'\n ? 'Pipe ' + this.port\n : 'Port ' + this.port;\n \n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n }", "function onError(error) {\n debugErr(error)\n if (error.syscall !== 'listen') {\n throw error\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES': throw new Error(config.port + ' requires elevated privileges')\n case 'EADDRINUSE': throw new Error(config.port + ' is already in use')\n default: throw error\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n let bind = typeof webSocketPort === 'string'\n ? 'Pipe ' + webSocketPort\n : 'Port ' + webSocketPort;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError (error) {\n if (error.syscall !== 'listen') {\n throw error\n }\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.log(chalk.white.bgRed(`\\nError: Port ${port} requires elevated privileges\\n`))\n process.exit(1)\n case 'EADDRINUSE':\n console.log(chalk.white.bgRed(`\\nError: Port ${port} is already in use\\n`))\n process.exit(1)\n default:\n console.log(chalk.white.bgRed(`\\nError: ${error}\\n`))\n }\n}", "_onError(event) {\n const span = document.createElement(\"span\");\n span.innerHTML = \"\" + \"Upload failed. Retrying in 5 seconds.\";\n this.node.appendChild(span);\n this.retry = setTimeout(() => this.callbackUpload(), 5000, this.data);\n\n TheFragebogen.logger.error(this.constructor.name + \".callbackUpload()\", \"Upload failed with HTTP code: \" + this.request.status + \". Retrying in 5 seconds.\");\n }", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n switch (error.code) {\n case \"EACCES\":\n console.error(port + \" requires elevated privileges\");\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(port + \" is already in use\");\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n\tif (error.syscall !== 'listen') {\n\t\tthrow error;\n\t}\n\n\tconst bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\tcase 'EACCES':\n\t\tlogger.error(`${bind} requires elevated privileges`);\n\t\tprocess.exit(1);\n\t\tbreak;\n\tcase 'EADDRINUSE':\n\t\tlogger.error(`${bind} is already in use`);\n\t\tprocess.exit(1);\n\t\tbreak;\n\tdefault:\n\t\tthrow error;\n\t}\n}", "function onError(error) {\n if (error.syscall !== 'listen') throw error;\n var bind = typeof port === 'string' ? 'Pipe ' + port: 'Port ' + port;\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.log(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.log(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n console.log('Erro de listening '+error.syscall );\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "onerror(err) {\n debug(\"error\", err);\n this.emitReserved(\"error\", err);\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n log.fatal(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n log.fatal(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n const bind = typeof port === \"string\" ? `Pipe ${port}` : `Port ${port}`;\n\n // manejar errores de escucha específicos con mensajes amigables\n switch (error.code) {\n case \"EACCES\":\n console.error(`${bind}, Requiere Privilegios`);\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(`${bind} Esta en uso`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string'\n ? `Pipe ${port}`\n : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n log.error(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n log.error(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n handleError.call(this, 'error', error);\n }", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n var bind = typeof port === \"string\" ? \"Pipe \" + port : \"Port \" + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case \"EACCES\":\n console.error(bind + \" requires elevated privileges\");\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(bind + \" is already in use\");\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n }", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n const bind = typeof port === \"string\" ? `Pipe ${port}` : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case \"EACCES\":\n console.error(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n\tif (error.syscall !== 'listen') {\n\t\tthrow error;\n\t}\n\n\tconst bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\tcase 'EACCES':\n\t\tconsole.error(`${bind} requires elevated privileges`);\n\t\tprocess.exit(1);\n\t\tbreak;\n\tcase 'EADDRINUSE':\n\t\tconsole.error(`${bind} is already in use`);\n\t\tprocess.exit(1);\n\t\tbreak;\n\tdefault:\n\t\tthrow error;\n\t}\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error\n }\n\n const addr = this.address()\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges')\n process.exit(1)\n break\n case 'EADDRINUSE':\n console.error(bind + ' is already in use')\n process.exit(1)\n break\n default:\n throw error\n }\n}", "function onError(error) {\n\tif (error.syscall !== \"listen\") {\n\t\tthrow error;\n\t}\n\n\tvar bind = typeof port === \"string\" ? \"Pipe \" + port : \"Port \" + port;\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\t\tcase \"EACCES\":\n\t\t\tconsole.error(bind + \" requires elevated privileges\");\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tcase \"EADDRINUSE\":\n\t\t\tconsole.error(bind + \" is already in use\");\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow error;\n\t}\n}", "onRequestError(err) {\n log('request error', err)\n this.emit('error', err)\n if (err.status === 401) this.onUnauthorized()\n else this.reopen()\n }", "function onError(error) {\n\tif (error.syscall !== 'listen') {\n\t\tthrow error;\n\t}\n\n\tconst bind = typeof port === 'string' ? `Pipe ${port}` : `Port '${port}`;\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\t\tcase 'EACCES':\n\t\t\tconsole.error(`${bind} requires elevated privileges`);\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tcase 'EADDRINUSE':\n\t\t\tconsole.error(`${bind} is already in use`);\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow error;\n\t}\n}", "function onError (error) {\n if (error.syscall !== 'listen') {\n throw error\n }\n\n const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n // When things are going wrong, do not write to the log file, since it seems\n // that these messages disappear into a black hole rather than go to the log\n // file. Just write to the console for simplicity.\n case 'EACCES':\n console.error(`${bind} requires elevated privileges`)\n process.exit(1)\n case 'EADDRINUSE':\n console.error(`${bind} is already in use`)\n process.exit(1)\n default:\n throw error\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port; // eslint-disable-line\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(`${bind} requires elevated privileges.`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n logger.error(`${bind} is already in use.`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n var bind = typeof port === \"string\" ? \"Pipe \" + port : \"Port \" + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case \"EACCES\":\n console.error(bind + \" requires elevated privileges\");\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(bind + \" is already in use\");\n process.exit(1);\n break;\n default:\n throw error;\n }\n }", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string'\n ? `Pipe ${port}`\n : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = `${typeof port === 'string' ? 'Pipe' : 'Port'} ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n process.stderr.write(`${bind} requires elevated privileges\\n`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n process.stderr.write(`${bind} is already in use\\n`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = (typeof port === 'string') ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n //process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n //process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function $onServerUniqueError(error) {\n\n feedConsoleLines.call(this, \"SRV UNIQUE ERR\", error);\n\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? `Pipe ${port}` : `Port ${port}`;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n debug(`${bind} requires elevated privileges`);\n process.exit(1);\n break;\n case 'EADDRINUSE':\n debug(`${bind} is already in use`);\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n\tif (error.syscall !== 'listen') {\n\t\tthrow error;\n\t}\n\n\tconst bind = typeof port === 'string'\n\t\t? 'Pipe ' + port\n\t\t: 'Port ' + port;\n\n\t// handle specific listen errors with friendly messages\n\tswitch (error.code) {\n\t\tcase 'EACCES':\n\t\t\tconsole.error(bind + ' requires elevated privileges');\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tcase 'EADDRINUSE':\n\t\t\tconsole.error(bind + ' is already in use');\n\t\t\tprocess.exit(1);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow error;\n\t}\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof PORT === 'string' ?\n 'Pipe ' + PORT :\n 'Port ' + PORT;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== \"listen\") {\n throw error;\n }\n\n let bind = typeof port === \"string\" ? \"Pipe \" + port : \"Port \" + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case \"EACCES\":\n console.error(bind + \" requires elevated privileges\");\n process.exit(1);\n break;\n case \"EADDRINUSE\":\n console.error(bind + \" is already in use\");\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n const bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n console.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n console.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n let bind = typeof port === 'string' ? 'Pipe ' + port : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n notifier.notify('a_6', bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n notifier.notify('a_7', bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}", "function onError(error) {\n if (error.syscall !== 'listen') {\n throw error;\n }\n\n var bind = typeof port === 'string'\n ? 'Pipe ' + port\n : 'Port ' + port;\n\n // handle specific listen errors with friendly messages\n switch (error.code) {\n case 'EACCES':\n logger.error(bind + ' requires elevated privileges');\n process.exit(1);\n break;\n case 'EADDRINUSE':\n logger.error(bind + ' is already in use');\n process.exit(1);\n break;\n default:\n throw error;\n }\n}" ]
[ "0.7118962", "0.70567393", "0.70339364", "0.70246124", "0.6965733", "0.6882446", "0.68554044", "0.68311316", "0.6821094", "0.68109226", "0.6788116", "0.6782291", "0.6781704", "0.67701316", "0.6766919", "0.6750681", "0.6706457", "0.67013055", "0.66602784", "0.66561115", "0.66449386", "0.663756", "0.66304463", "0.66166097", "0.66144824", "0.6571695", "0.6563251", "0.6557553", "0.6551941", "0.65446603", "0.65423894", "0.65365136", "0.65345895", "0.65336424", "0.65249896", "0.65245503", "0.65199447", "0.6519027", "0.6519027", "0.6519027", "0.6517962", "0.6517812", "0.64978176", "0.6490181", "0.6487795", "0.6486418", "0.6476279", "0.6474651", "0.6470916", "0.6470036", "0.6467605", "0.6465449", "0.6460103", "0.64540863", "0.64523554", "0.6447808", "0.64209133", "0.6418471", "0.6403406", "0.6392323", "0.6390938", "0.63863397", "0.63856167", "0.63782954", "0.63732725", "0.6368462", "0.6354599", "0.635222", "0.63443315", "0.6341048", "0.63393646", "0.633331", "0.6311808", "0.63087493", "0.62979686", "0.62974846", "0.62966377", "0.6295016", "0.62934744", "0.62921005", "0.62885445", "0.6287896", "0.62850237", "0.6284157", "0.62835777", "0.62806505", "0.62790585", "0.6277347", "0.6272421", "0.6270398", "0.6267022", "0.6257946", "0.625793", "0.6256083", "0.6255376", "0.62528956", "0.6250743", "0.6250743", "0.62504447", "0.62501115" ]
0.6252459
96
Event listener for HTTP server "listening" event.
function onListening() { _logs('访问地址: ' + _config2.default.secheme + '://ip:' + port + '/'); _logs('APIDoc: ' + _config2.default.secheme + '://ip:' + apiPort + '/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onListeningHTTP () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP - Listening on ' + bind)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n log.debug('HTTP server listening on ' + bind);\n }", "function onListening() {\n logger.info('Webserver listening on port ' + server.address().port)\n }", "function onListening() {\n let addr = server.address();\n let bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n //debug('Listening on ' + bind);\n console.log('Http server is listening on ' + bind);\n}", "function onListening() {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('HTTP server listening on ' + bind)\n}", "function onListening() {\n var addr = httpsServer.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = httpsServer.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n\t\tvar addr = server.address();\n\t\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\t\tvar fqdn = scheme+\"://\"+host;\n\t\tcrawl.init(fqdn,host,scheme);\n\t}", "function onListening() {\n var addr = http.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n const address = httpServer.address().address;\n console.info(`Listening port ${port} on ${address} (with os.hostname=${os.hostname()})`);\n const entryFqdn = getEntryFqdn(address, port);\n console.info(`Use browser to open: ${entryFqdn}`);\n}", "function onListening() {\n\tdebug('Listening on port ' + server.address().port);\n}", "function httpOnListening() {\n var addr = httpServer.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address()\n const bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port\n mainWindow.webContents.send('listening', bind)\n}", "function onListening() {\n CALLBACK();\n const addr = server.address();\n const bind = typeof addr === 'string' ?\n `pipe ${addr}` :\n `port ${addr.port}`;\n debug(`Listening on ${bind}`);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening()\n{\n\tvar addr\t= server.address();\n\tvar bind\t= ('string' === typeof addr) ? 'pipe ' + addr : 'port ' + addr.port;\n\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n Object.keys(httpServers).forEach(key => {\n var httpServer = httpServers[key];\n var addr = httpServer.address()||{};\n var bind = typeof addr === \"string\"\n ? \"pipe \" + addr\n : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n })\n}", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n\tdebug(\"Listening on \" + bind);\n}", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('http://localhost:' + addr.port);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n\n console.log(\"----- onListening\");\n}", "function onListening() {\n var addr = process.env.ADDRESS || http_server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n\tvar addr = server.address();\n\tvar bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug( 'Listening on ' + bind );\n}", "function onListening() {\n var addr = server.address();\n var bind = (typeof addr === 'string') ? 'pipe ' + addr : 'port ' + addr.port;\n logger.info('>> LISTENING ON ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug_info('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n logger.debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n console.log(\"Listening on \" + bind);\n }", "function onListening() {\n debug('Listening on ' + port);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n\t\t\t'pipe ' + addr : 'port ' + addr.port;\n\t\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening(): void {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? `pipe ${addr}`\n : `port ${addr.port}`;\n debug(`Listening on ${bind}`);\n console.log(`Listening on ${bind}`);\n}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? `pipe ${addr}`\n : `port ${addr.port}`;\n\n debug(`Server listening on ${bind}`);\n logger.info(`Server listening on ${bind}`, { tags: 'server' });\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string' ?\r\n 'pipe ' + addr :\r\n 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n logger.info('Listening on ' + bind);\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "_attachListeners () {\n const onListening = () => {\n const address = this._server.address()\n debug(`server listening on ${address.address}:${address.port}`)\n this._readyState = Server.LISTENING\n }\n\n const onRequest = (request, response) => {\n debug(`incoming request from ${request.socket.address().address}`)\n request = Request.from(request)\n response = Response.from(response)\n this._handleRequest(request, response)\n }\n\n const onError = err => {\n this.emit('error', err)\n }\n\n const onClose = () => {\n this._readyState = Server.CLOSED\n }\n\n this._server.on('listening', onListening)\n this._server.on('request', onRequest)\n this._server.on('checkContinue', onRequest)\n this._server.on('error', onError)\n this._server.on('close', onClose)\n this._readyState = Server.READY\n }", "function onListening () {\n var addr = server.address()\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port\n debug('Listening on', bind)\n }", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = `${serverConfig.host}:${serverConfig.defaultPort}`;\n\t// const bind = typeof(addr) === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "onListening() {\n var addr = this.server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n let addr = server.address();\n let bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n log('Listening on ' + bind);\n}", "function onListening() {\n\tconst addr = server.address();\n\tconst bind = typeof addr === 'string'\n\t\t? 'pipe ' + addr\n\t\t: 'port ' + addr.port;\n\tdebug('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address();\n console.log(`Listening on ${addr.port}`);\n}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('demo:server')('Listening on ' + bind);\n}", "function onListening() {\n var serverURL = \"http://localhost:\" + config.port;\n console.log(\"server listening on \" + serverURL);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "onListening(server) {\n const { port } = server.listeningApp.address();\n console.log('Listening on port:', port);\n }", "function listener() {\r\n if (logged == 1) return;\r\n logged = 1;\r\n cfg.port = app.address().port;\r\n csl.log('Server running on port := ' + cfg.port);\r\n // Log the current configuration\r\n for (var key in cfg) {\r\n if (key != 'spdy' || key != 'https')\r\n csl.log(key + ' : ' + cfg[key]);\r\n }\r\n\r\n // If browser is true, launch it.\r\n if (cfg.browser) {\r\n var browser;\r\n switch (process.platform) {\r\n case \"win32\":\r\n browser = \"start\";\r\n break;\r\n case \"darwin\":\r\n browser = \"open\";\r\n break;\r\n default:\r\n browser = \"xdg-open\";\r\n break;\r\n }\r\n csl.warn('Opening a new browser window...');\r\n require('child_process').spawn(browser, ['http://localhost:' + app.address().port]);\r\n }\r\n }", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n }", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function on_listening() {\n const addr = server.address();\n const bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\"\n ? \"pipe \" + addr\n : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n\n var addr = this.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log(\"API Listening on port : \" + addr.port);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === \"string\" ? \"pipe \" + addr : \"port \" + addr.port;\n debug(\"Listening on \" + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('Listening on ' + bind);\n}", "function onListening() {\r\n var addr = server.address();\r\n var bind = typeof addr === 'string'\r\n ? 'pipe ' + addr\r\n : 'port ' + addr.port;\r\n debug('Listening on ' + bind);\r\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n console.log('API available on: /api/tasks');\n console.log('Socket connection available on: https://10.3.2.52:3333');\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening () {\n const addr = server.address()\n console.log(`Listening on https://localhost:${addr.port}`)\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ? 'pipe ' + addr : 'port ' + addr.port;\n debug( 'Listening on ' + bind );\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n const addr = server.address();\n const bind = typeof addr === 'string' ?\n 'pipe ' + addr :\n 'port ' + addr.port;\n info('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}", "function onListening() {\n var addr = server.address();\n var bind = typeof addr === 'string'\n ? 'pipe ' + addr\n : 'port ' + addr.port;\n debug('Listening on ' + bind);\n}" ]
[ "0.78544015", "0.7739864", "0.7633661", "0.7536681", "0.75315416", "0.73415786", "0.7334293", "0.7303103", "0.7302585", "0.7283272", "0.7272347", "0.72310024", "0.7227042", "0.7161825", "0.7126399", "0.7120529", "0.7105088", "0.7097603", "0.70819986", "0.7073328", "0.70719254", "0.7064543", "0.70569223", "0.70526415", "0.7046879", "0.7025578", "0.70166266", "0.70121104", "0.7006699", "0.6999854", "0.69989747", "0.69987744", "0.69936234", "0.6992609", "0.6987815", "0.6985446", "0.6984217", "0.6983552", "0.69733554", "0.69723195", "0.69716626", "0.6970775", "0.6966079", "0.69659793", "0.69625354", "0.69612044", "0.69612044", "0.69612044", "0.69612044", "0.69612044", "0.69601476", "0.69581234", "0.695575", "0.6953171", "0.6953171", "0.6948461", "0.693861", "0.6936511", "0.693597", "0.69353884", "0.6935276", "0.6935203", "0.69345504", "0.69325656", "0.69325656", "0.69325656", "0.69319385", "0.69300795", "0.6929751", "0.6926305", "0.6925752", "0.69256186", "0.69256186", "0.69256186", "0.69256186", "0.69256186", "0.69256186", "0.69256186", "0.69256186", "0.6924732", "0.6922069", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015", "0.69204015" ]
0.0
-1
Insert New Task in tasksList.
function insertNewTask() { let newTask = document.getElementById("input_new_task").value; let obj = {}; obj['id'] = taskCount; obj['task'] = newTask; obj['complete'] = false; tasksList.push(obj); taskCount += 1; const finalData = generateTasksList(); document.getElementById("divTasksList").innerHTML = finalData; document.getElementById("input_new_task").value = ''; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addNewTask() {\n let task = new Task(this.newTaskName);\n task.id = new Date().getMilliseconds();\n this.tasks.push(task);\n }", "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "addTasks(newTask)\n {\n this._tasks.push(newTask);\n }", "push(task){\n task.id = this.list.length;\n this.list.push(task); \n }", "function addNewTask(task) {\n let uniqueID = timeStamp();\n let data = {\n text: task,\n isDone: false,\n idNum: uniqueID,\n };\n toDoList.push(data);\n addTask(data);\n commitToLocalStorage(toDoList);\n}", "function addTask() {\n Task.addTask(info.newTask);\n info.newTask = \"\";\n }", "function addTask(taskID, task)\n{\n const table = $(\"#tasklist\");\n // create a new row\n const newRow = makeTasklistRow(taskID, task);\n // finally, stick the new row on the table\n const firstTask = tasksExist(\"tasklist\");\n if (firstTask)\n {\n firstTask.before(newRow);\n }\n else\n {\n table.append(newRow);\n }\n}", "function addTask(task){\n\ttasks.push(task);\n}", "function addTask(task){\n return db.insert(task,\"*\").into(\"tasks\");\n}", "addTask(newTask){\n this.tasks.push(newTask);\n }", "function addTask() {\r\n\r\n var taskId = \"task_\" + taskCount++;\r\n\r\n var task = createTask(taskId, \"\", \"\");\r\n taskList[taskId] = task;\r\n\r\n var domElement = createNewTaskDOMElement(task);\r\n taskListDOMElements[taskId] = domElement;\r\n\r\n showTaskDetail(task);\r\n}", "function placeTasks(){\n let app = $(\"#current-tasks\");\n let taskList = document.createElement('ul');\n app.append(taskList);\n loadTasks().then((tasks)=>{\n tasks.forEach(task=>{\n newTask(task.name, 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 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 addTask(list) {\n console.log(task);\n createList(task).then((data) => {\n if (data.error) {\n console.log(data.error);\n } else {\n console.log(data.data);\n setItems((prevValues) => {\n return [...prevValues, data.data];\n });\n setTask('');\n }\n });\n }", "function addTask(task) {\n return toDoList.push(task);\n}", "addTask(name, description, assignedTo, dueDate, status) {\n // increment id\n let id = this.currentId++;\n\n // push to tasks array\n this.tasks.push({\n id,\n name,\n description,\n assignedTo,\n dueDate,\n status,\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}", "addTask(taskObj) {\n\t\tconst todos = this.getAndParse('tasks');\n\t\ttodos.push(taskObj);\n\t\tthis.stringifyAndSet(todos, 'tasks');\n\t}", "function addTask () {\r\n tasks.setSelected(tasks.add())\r\n taskOverlay.hide()\r\n\r\n tabBar.updateAll()\r\n addTab()\r\n}", "addTask(task, successHandler, errorHandler) {\n var taskList = this.get(TASK_LIST)\n taskList.push(task);\n this.set(TASK_LIST, taskList);\n return saveData(this, sucessHandler, errorHandler)\n\n }", "addTask(e) {\n e.preventDefault();\n const value = this.addTaskForm.querySelector('input').value;\n if (value === '') return;\n this.tasks.createTask(new Task(value));\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\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}", "function addTask() {\n values={};\n values.task=$('#task').val();\n\n $.ajax({\n type: 'POST',\n url: '/task',\n data: values,\n success: function(){\n updateTaskList();\n }\n });\n}", "addTask(event){\n if(this.newTask == ''){\n return;\n }\n this.loading = true;\n insertTask({subject: this.newTask})\n .then(result => {\n console.log(result);\n this.todos.push({\n id: this.todos[this.todos.length - 1] ? this.todos[this.todos.length - 1].id + 1 : 0,\n name: this.newTask,\n recordId: result.Id\n });\n this.newTask = '';\n })\n .catch(error => console.log(error))\n .finally(() => this.loading = false);\n\n \n }", "addTask(task) {\n this.listTask = [...this.listTask, task];\n }", "function addTask(e) {\n\tvar inputEl = document.getElementById(\"input-task\");\n\t\n\tif (!inputEl.value.isNullOrWhitespace())\n\t{\n\t\t// Create a unique ID\n\t\tvar id = \"item-\" + tasks.length;\n\t\t\n\t\t// Create a new task\n\t\tvar task = new Task(id, inputEl.value, taskStatus.active);\n\t\t\n\t\t// Append the task to the DOM\n\t\taddTaskElement(task);\n\t\t\n\t\t// Reset input\n\t\tinputEl.value = \"\";\n\t}\n}", "function addTaskToList(task, list){\r\n //What is the task? @parameter task\r\n //Where is the task going? @List Parameter\r\n //What order / priority? lowest on the bottom(push)\r\n return list.push({\r\n text: task, completed: false\r\n });\r\n}", "function createTaskInDatabase (task) {\n firebase.database().ref('tasks').push(task)\n}", "addTask(task) {\n const taskList = this.state.taskList;\n\n // might want to arrange this as a dictionary later on\n let newTask = {\n // generate unique id\n id: crypto.randomBytes(16).toString(\"hex\"),\n name: task[0],\n date: task[1],\n type: task[2],\n isFinished: task[3],\n notes: task[4]\n }\n\n // add the new task into the state\n this.setState({\n taskList: taskList.concat(newTask),\n taskListLength: taskList.length,\n })\n\n // API call to insert into DB \n this.createNewTask(newTask);\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}", "function addNewTask (value, groupIndex) {\n\t\t\t\t\tvar task = {\n\t\t\t\t\t\tdescription: value,\n\t\t\t\t\t\tcompleted: false,\n\t\t\t\t\t\torder: scope.groups[groupIndex].groupTasks.length\n\t\t\t\t\t};\n\n\t\t\t\t\tscope.insertTask(groupIndex, task);\n\t\t\t\t\tscope.newDescription = \"\";\n\t\t\t\t\tscope.groups[groupIndex].inputVisible = false;\n\t\t\t\t\tscope.$digest();\n\t\t\t\t}", "function addTasks() {\n const text =\n document.getElementById('enter-task').value;\n if (text) {\n tasks.push(new Task(text)); // somehow connect the tasks to the list they are in (optional-ish)\n showTasks();\n }\n // window.localStorage.setItem(lists, JSON.stringify(text));\n }", "async function addTask() {\n\n // the next line is only for testing purposes\n allTasks = await getArrayFromBackend('allTasks');\n\n let task = getValues();\n allTasks.push(task);\n\n saveArrayToBackend('allTasks', allTasks);\n\n // the next line is only for testing purposes\n allTasks = await getArrayFromBackend('allTasks');\n\n clearFields();\n showSnackbar(\"Task pushed to backlog!\");\n\n //Show backlog page with new task added\n setTimeout(function () {\n document.location.href = \"../pages/backlog.html\";\n }, 3000);\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}", "function onclick_add_new_task() {\n insertNewTask();\n}", "function addListTask(data) {\n listTask.push(data)\n saveData()\n openModal()\n}", "function addNewTask() {\n buttonAdd.onclick = function () {\n if (!newText.value || !newText.value.trim()) return alert('Please, input your text')\n newContainer.classList.add(hiddenClass)\n let id = listTask.length ? listTask[listTask.length - 1].id + 1 : 0\n let date = new Date().toJSON()\n const task = {\n id,\n text: newText.value.trim(),\n date,\n completed: false\n }\n listTask.push(task)\n addTaskToDom(task, listBlock)\n newText.value = ''\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n }", "function addTask(title) {\n info.tasks.push({title: title, added: new Date()});\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}", "addTask(name, description, assignedTo, dueDate, createdDay, status, rating) {\n this.currentId++;\n const task = {\n Id: this.currentId,\n name,\n description,\n assignedTo,\n dueDate,\n createdDay,\n status,\n rating,\n };\n this.tasks.push(task);\n }", "function addTask() {\n\t\t\tvm.totalTime = 0;\n\t\t\ttaskDo.service.addTask(vm).then(function (response) {\n\t\t\t\tvm.sample=\"vamsi\";\n\t\t\t});\n\t\t}", "async addTask(input = { tasklistId: '0' }) {\n\n return await this.request({\n name: 'task.add',\n args: [input.tasklistId],\n params: {\n 'todo-item': input['todo-item']\n }\n });\n\n }", "function addTask(newTask) {\n\n console.log('in addTask', newTask);\n $.ajax({\n type: 'POST',\n url: '/todo',\n data: newTask,\n }).then(function (response) {\n console.log('Response from server-side:', response);\n getList();\n }).catch(function (error) {\n console.log('Error in POST client side', error);\n });\n}", "function addTask(name) {\n // Construct the Object from the given name\n let newTask = { title: name, isCompleted: 0 };\n\n todoListService.addTask(newTask).then((response) => {\n newTask.id = response.data.data[\"insertId\"];\n // Update the state\n setTasks([...tasks, newTask]);\n });\n\n // Update the server\n }", "function addTask(task){\n var txt = document.createTextNode(task);\n var li = document.createElement(\"LI\");\n li.appendChild(txt);\n li.id=counter;\n counter++;\n myTaskList.incomplete.push(li);\n addCloseButton(li);\n addChecked(li);\n updateTaskList();\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 newTask(e) {\n e.preventDefault();\n\n if(taskContent.trim() === \"\"){\n notifyError()\n return\n }\n\n const newTask = {\n content: taskContent,\n taskId: Math.random() * 10,\n checked: false,\n };\n\n setTasks([...tasks, newTask]);\n setTaskContent(\"\");\n }", "function taskCreate(cb) {\n\n var task = new Task({\n //_projectId: projects[0],\n _phaseId: phases[0],\n name: 'Phase 1',\n number: 1,\n start_date:'2017-06-06',\n end_date:'2018-02-06',\n priority: 'High',\n status: 'Ongoing',\n percentageComplete: 91,\n description: 'Create Models ',\n deletedAt: null\n });\n\n task.save(function (err) {\n if (err) {\n cb('task', null);\n return\n }\n console.log('New Task ' + task);\n tasks.push(task);\n cb(null, task)\n } );\n}", "function addTask(newTask) {\n //create list element and set its class\n const newTaskItem = document.createElement('li');\n newTaskItem.setAttribute('class', 'task_item');\n\n // create checkbox element and set its type and class\n const newCheckBtn = document.createElement('div');\n newCheckBtn.setAttribute('class', 'task_check_btn');\n\n // create span element and set its class and add new task input\n const newTaskBio = document.createElement('span');\n newTaskBio.setAttribute('class', 'task_bio');\n\n // add input value to li\n newTaskBio.innerText = newTask;\n\n // insert li tag inside the ul tag\n taskList.appendChild(newTaskItem);\n\n // insert checkbox to li\n newTaskItem.appendChild(newCheckBtn);\n\n // insert newTask into li\n newTaskItem.appendChild(newTaskBio);\n\n // run Function when task is completed and checkbox is check.\n onTaskComplete(newCheckBtn);\n}", "addTask(name, description, assignedTo, dueDate) {\n const task = {\n // Increment the currentId property\n id: this.currentId++,\n name: name,\n description: description,\n assignedTo: assignedTo,\n dueDate: dueDate,\n status: \"TODO\",\n };\n\n // Push the task to the tasks property\n this.tasks.push(task);\n }", "'tasks.insert'(text) {\n check(text, String);\n\n // Make sure the user is logged in before inserting a task\n if (! this.userId) {\n throw new Meteor.Error('not-authorized');\n }\n\n Tasks.insert({\n text,\n createdAt: new Date(), // Current time\n owner: this.userId, // id of logged in user\n username: Meteor.users.findOne(this.userId).username, // username of user\n });\n }", "addTask(description){\n var task = new Task(description);\n this.push(task);\n task.addToDom();\n }", "function Insert(task, response) {\n\t\"use strict\";\n\t\n\tmongoClient.connect(connectionString, function (err, db) {\n\t\tif (err) {\n\t\t\tconsole.log('Connection Failed. Error: ', err);\n\t\t} else {\n\t\t\tautoIncrement.getNextSequence(db, TASKS_COLLECTION, function (err, indexValue) {\n\t\t\t\tif (!err) {\n\t\t\t\t\ttask.id = indexValue\n\t\t\t\t\t\n\t\t\t\t\tdb.collection(TASKS_COLLECTION).insert(task, function (err, result) {\n\t\t\t\t\t\tassert.equal(err, null);\n\t\t\t\t\t\tresult.ops[0].registrationDate = ParseDate(result.ops[0].registrationDate);\n\t\t\t\t\t\tresult.ops[0].deadline = ParseDate(result.ops[0].deadline);\n\t\t\t\t\t\tresponse.status(201).send(result.ops[0]);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\n\t\t}\n\t});\n}", "function addTask(taskName) {\n // Use templateList.content.querySelector to select the component of the template.\n const taskElement = document.importNode(templateList.content.querySelector('.taskItem'), true);\n // Assign the class name\n taskElement.className = 'activeItem';\n // Select the components from the list.\n const activeItem = taskElement.querySelector('input');\n const activeIcon = taskElement.querySelector('label');\n // Change the icon and text.\n activeIcon.innerHTML = '&#10065';\n activeItem.value = taskName;\n // Append to ul\n taskList.appendChild(taskElement);\n}", "async addTask({ commit }, { title, date }) {\n await db.collection('tasks').add({\n id: new Date().getTime(),\n title: title,\n date: date,\n done: false\n });\n\n await commit('getTasks');\n }", "addNewTask(newTaskName) {\n const tasks = this.state.tasks.slice();\n tasks.push(newTaskName);\n this.saveTasks(tasks);\n this.setState({tasks: tasks, newTaskName: \"\"});\n }", "function addTask() {\n event.preventDefault();\n currentTask = {\n name: document.getElementById('newTaskForm').elements.taskName.value,\n status: document.getElementById('newTaskForm').elements.taskStatus.value,\n date: document.getElementById('newTaskForm').elements.taskDate.value,\n };\n // adding this object to the overall array\n console.log(currentTask);\n myTasks.push(currentTask);\n \n alert(\"Task added: \" + currentTask.name + \".\");\n document.getElementById('newTaskForm').reset();\n \n // updating/replacing the localStorage version.\n updateTasks();\n\n deleteDisplayList(-1);\n createTaskList(myTasks);\n \n // collapse the Property form\n document.getElementById('btnAddTaskCollapser').nextElementSibling.style.display = \"none\";\n}", "async addTasklist(input = { projectId: '0' }) {\n\n return await this.request({\n name: 'tasklist.add',\n args: [input.projectId],\n params: {\n 'todo-item': input['todo-item']\n }\n });\n\n }", "addItem(name, description,createdAt) {\n const item = {\n // Increment the currentId property\n id: this.currentId++,\n name: name,\n description: description,\n createdAt: createdAt\n };\n\n // Push the task to the tasks property\n this.items.push(item);\n }", "function addTask(event) {\n event.preventDefault();\n const taskDiv = document.createElement(\"div\");\n taskDiv.classList.add(\"task\");\n\n //List - append\n const newTask = document.createElement(\"li\");\n newTask.innerText = inpTask.value;\n newTask.classList.add(\"task-item\");\n taskDiv.appendChild(newTask);\n\n //Legg til i liste lokalt på pc\n\n saveLocalTasks(inpTask.value);\n\n\n //Done-button\n const doneBtn = document.createElement(\"button\");\n doneBtn.innerHTML = \"Done\";\n doneBtn.classList.add(\"done-btn\");\n taskDiv.appendChild(doneBtn);\n\n //Delete-button\n const deleteBtn = document.createElement(\"button\");\n deleteBtn.innerHTML = \"Delete\";\n deleteBtn.classList.add(\"del-btn\");\n taskDiv.appendChild(deleteBtn);\n\n //Add div to list\n taskList.appendChild(taskDiv);\n\n //Remove inp value\n inpTask.value = \"\";\n\n}", "function addtask(task) {\n event.preventDefault()\n $.ajax({\n type: 'POST',\n url: '/tasks',\n data: task\n }).then(function(response){\n console.log('back from POST', response);\n $('#listedTasks').empty();\n getTask();\n task = {\n task: $('#nameTask').val(''),\n notes: $('#notes').val('')\n };\n }).catch(function(error) {\n console.log('error in POST', error)\n alert('cannot to add');\n });\n}", "function addTask(req,res){\n\t\n\tconsole.log('******',req.body);\n\t\n\t// taskList.push(req.body);\n\tTodoList.create({\n\t\ttaskName:req.body.taskName,\n\t\tcategory:req.body.category,\n\t\tdueDate:req.body.dueDate\n\t},\n\t\tfunction(err, toDoList){\n\t\t\tif(err){\n\t\t\t\tconsole.log(\"Error in adding tasks\");\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconsole.log('*******', toDoList);\n\t\t\treturn res.redirect('back');\n\t\t}\n\t)\t\n\t}", "function addTask(projectid) {\n const task_name = document.querySelector('.todo_name').value; //get input data from dom\n const task_description = document.querySelector('.todo_description').value;\n const task_date = document.querySelector('.todo_date').value;\n let task_priority = '';\n\n if (document.querySelector('.todo_priority1').checked)\n task_priority = '1';\n else if (document.querySelector('.todo_priority2').checked)\n task_priority = '2';\n else if (document.querySelector('.todo_priority3').checked)\n task_priority = '3';\n else if (document.querySelector('.todo_priority4').checked)\n task_priority = '4';\n\n if (task_name == '' || task_description == '' || task_date == '' || task_priority == '')\n return;\n\n data.projects[projectid].tasks.push(new task(task_name, task_description, task_date, task_priority)) //add new project with name and id to list\n\n }", "function addTaskToProject(task) {\n projects[currentProject].tasks.push(task);\n}", "function addTask (description, callback) {\n var taskKey = datastore.key('Task');\n\n datastore.save({\n key: taskKey,\n data: [\n {\n name: 'created',\n value: new Date().toJSON()\n },\n {\n name: 'description',\n value: description,\n excludeFromIndexes: true\n },\n {\n name: 'done',\n value: false\n }\n ]\n }, function (err) {\n if (err) {\n return callback(err);\n }\n\n var taskId = taskKey.path.pop();\n console.log('Task %d created successfully.', taskId);\n return callback(null, taskKey);\n });\n}", "function AddTask() {\n const valid = validateForm()\n if (valid) {\n const newTaskInput = document.getElementById('newItem')\n const tagNameInput = document.getElementById('Tag')\n const tagColorInput = document.querySelector('input[name=\"inlineRadioOptions\"]:checked')\n\n const task = {\n title: newTaskInput.value,\n tag: {\n name: tagNameInput.value,\n color: tagColorInput.value\n },\n type: 'todo',\n state: false\n }\n\n list.items.push(task)\n localStorage.setItem('lists', JSON.stringify(allLists))\n resetForm()\n renderTasks()\n } else {\n const toast = new bootstrap.Toast(document.querySelector('.toast'))\n toast.show()\n }\n}", "static createTask(task={}){\n \n return new Promise(async (resolve, reject) => {\n try {\n //const person = new Task(task)\n const databaseLayer = new DatabaseLayer(async () => SQLite.openDatabase('didits.db'), Task.tableName)\n const items = [task]\n databaseLayer.bulkInsertOrReplace(items).then(response => {\n console.log(\"Insert id \"+JSON.stringify(response))\n resolve(response[0].insertId)\n }).catch((err) =>{\n reject(-1)\n })\n //await person.save()\n \n }\n catch {\n reject([])\n }\n });\n\n }", "function addtaskToStorage(check, title, date, priority) {\n var newTask = new NewTask(check, title, date, priority)\n currentProject.tasks.push(newTask)\n saveLocal()\n}", "function addEmptyTask() {\n $(\"#taskList\").append(\n \"<task class=\\\"task\\\">\" +\n \"<text class=\\\"action\\\"></text> \" +\n \"<date class=\\\"action\\\"></date> \" +\n \"<button onclick='model.editTask(this)'>Edit</button> \" +\n \"<button onclick='model.deleteTask(this)'>Delete</button> \" +\n \"<label for=\\\"action\\\">Done</label> \" +\n \"<input class=\\\"checkBox\\\" onclick='model.updateTask(this)' type=\\\"checkbox\\\">\" +\n \"<br>\" +\n \"</task>\"\n );\n }", "attachTask(message) {\n if (this._repeatOnList(message)) {\n $(\"#taskInput\").attr(\"placeholder\", \"Ja existe uma task identica!\")\n .parent().addClass(\"has-error\");\n return;\n }\n\n $(\"#taskInput\").attr(\"placeholder\", \"Insita sua tarefa...\")\n .parent().removeClass(\"has-error\");\n\n let task = {\n date : new Date(),\n open : true,\n message : message\n }, list = ls.getList();\n\n if(list[list.length - 1] != undefined) {\n var x = this.list[this.list.length - 1];\n task.id = x[\"id\"] + 1;\n } else {\n task.id =0;\n }\n\n ls.setItem(task);\n if (this.order == \"DESC\") {\n this.list.push(task)\n } else {\n let list = this.list.reverse();\n list.push(task);\n this.list = list.reverse();\n }\n }", "function addTask(input) {\n var listItem = createTask(input.value); // create the list item\n var taskList = $(input).siblings(\".taskList\").first(); // ul (taskList)\n\n // if there is no ul\n if (taskList.length > 0)\n taskList.append(listItem);\n else { // else create ul and add listText to it\n var ul = document.createElement(\"ul\");\n $(ul).addClass(\"taskList\");\n $(ul).append(listItem);\n $(ul).insertAfter(input);\n }\n bindTaskEvents(listItem);\n input.value = \"\";\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 addTodo() {\n \tself.todoList.unshift({task: self.text, done:false});\n \tself.text = null;\n\n }", "function addTask()\n{\n //The month scales from 0-11 so we need to add one.\n var tempMonth = new Date().getMonth() + 1;\n\n var td = new Date().getFullYear() + \"-\" + tempMonth + \"-\" + new Date().getDate() + \"|\" + new Date().getHours() + \":\" + new Date().getMinutes() + \":\" + new Date().getSeconds();\n var taskDate = td.toString();\n\n var md = new Date();\n var mDate = md.getTime();\n\n //Adding the input values to the array\n taskArr.push({Name: taskTitle.value, Description: taskDetails.value, Date: taskDate, MDate: mDate});\n console.log(taskArr);\n\n //calling the for loop to create the elements.\n floop();\n\n //Adding the listed items to the incompleteTaskList.\n incompletetaskList.appendChild(listItem);\n\n //Calls the BindTaskEvents and passes in the buttons' function.\n bindTaskEvents(listItem);\n\n //Resets the values of the input field.\n taskTitle.value = \"\";\n taskDetails.value = \"\";\n}", "function addTasktoLocalStorage(task){\n // init tasks\n let tasks;\n // Check if LS has tasks\n if (localStorage.getItem(\"tasks\") === null){\n // Init tasks as an array\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n tasks.push(task)\n\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n}", "async addTask(val){\n let newTask = await apiCalls.createTask(val);\n // Display new Task in page\n this.setState({tasks: [...this.state.tasks, newTask]});\n }", "@action\n addTaskToExistingDate(task, date) {\n this.content[date].push({\n task: task,\n id: Math.floor(Math.random() * 1000000000).toString(),\n notes: \"\"\n });\n }", "'tasks.insert'(text){\n check(text,String);\n\n //make sure the user is logged in before inserting a task\n if(!this.userId){\n throw new Meteor.Error('not-authorized');\n }\n\n Tasks.insert({\n text,\n createdAt : new Date(),\n owner : this.userId,\n username : Meteor.users.findOne(this.userId).username,\n private : true\n })\n }", "function createTask (req, res) {\n const { text, completed, createdDateAndTime, creator, orderIndex } = req.body;\n\n Task.findOne({ text }, (_, task) => {\n if (task) {\n return res.send('Task exists already');\n }\n });\n\n User\n .findById(creator)\n .exec((err, user) => {\n const newTask = new Task({ \n text, \n completed, \n createdDateAndTime, \n creator, \n orderIndex: user.tasks.length,\n });\n\n newTask.save((err) => {\n if (err) {\n return res.send(`Task wasn't saved`);\n }\n\n res.send(`Task successfuly created`);\n });\n\n user.tasks.push(newTask);\n user.save();\n });\n}", "function addTask() {\n\n // TODO: look javascript with the dom(document || javascript with html)\n let taskInput = document.getElementById(\"taskinput\");\n\n // TODO: look up conditionals if else\n if (taskInput.value === \"\") {\n alert(\"Invalid Value\")\n } else {\n taskList.push(taskInput.value)\n\n taskinput.value = \"\";\n }\n\n listTasks();\n\n // returns false for form so it doesn't reload\n return false;\n}", "function addTodo(){\n self.todoList.push({task: self.text, done: false});\n self.text = null;\n }", "function addTask() {\n //criou um elemento item\n const tarefa = document.createElement('li')\n //adicionou o conteudo do input ao item\n tarefa.innerText = input.value\n //adicionou o item à div listaTarefas\n listaTarefas.appendChild(tarefa)\n }", "function handAddTask(event) {\n\t\tif (event.keyCode == 13 && task !== \"\") {\n\t\t\t//&& task !== \"\" que no suceda cuando este vacio\n\t\t\tsetListarray([...listarray, task]);\n\t\t\tsetTask(\"\"); //esto sirve para evitar que agrege cosas en blanco\n\t\t}\n\t\t//keycode es para asignar una letra al keyup, 13 es codigo del enter\n\t\t//es agregar todo lo que ya tenia mas la nueva, list tiene toda la lista de tarea\n\t}", "addNewItem() {\n\t \tlet task = this.state.task;\n\t \tlet updated_list = this.props.data;\n\t \t\n\t \tupdated_list = updated_list.concat(task);\n\t \tthis.props.onItemAdd(updated_list);\n\t \tthis.setState({task : ''});\n \t\n \t}", "@action\n addTask(task, date) {\n if (this.content[date] === undefined) {\n this.addTaskToNewDate(task, date);\n } else {\n this.addTaskToExistingDate(task, date);\n }\n this.saveToStore();\n }", "function addTodo() {\n this.all.push({\n task: this.newTodo.task,\n done: false\n });\n\n this.newTodo.task = '';\n }", "addTask(task, callback) {\n var response;\n var newId = uuid.v1();\n task.taskId = newId;\n\n var validateMsg = validateTask(task);\n\n if (validateMsg) {\n response = {\n statusCode: 405,\n body: validateMsg\n };\n callback(null, response);\n return;\n }\n\n task = sanitizeTask(task);\n\n var params = {\n Item: task,\n TableName: this.tableName\n };\n console.log(JSON.stringify(task));\n this.db.putItem(params, function (err, data) {\n if (err) {\n callback(err, null);\n } else {\n response = {\n statusCode: 200,\n body: JSON.stringify({\n message: task\n }),\n };\n callback(null, response);\n }\n });\n }", "function taskCreator(nameValue, idValue, orderValue, stateValue) {\n\t\ttasks.push({name:nameValue,id:idValue,orderId:orderValue,state:stateValue});\n\t}", "function addItem() {\n var contents = document.getElementById('newTask').value;\n var item = new listItem(Date.now(), contents, false);\n masterList.push(item);\n showList(masterList);\n saveList();\n}", "function addTodo(){\n\t\t\tself.todoList.push({task: self.text, done: false});\n\t\t\tself.text = null;\n\t\t}", "function addTaskToDom({id, text, completed, date}, parent) {\n const newList = parent.appendChild(document.createElement('li'))\n newList.classList.add(listItemClass)\n newList.id = id\n newList.innerHTML = template\n .replace('@@text', text)\n .replace('@@date', new Date(date).toLocaleString('en-GB', {\n year: 'numeric',\n month: 'short',\n day: 'numeric'\n }))\n .replaceAll('@@id', id)\n .replace('@@checked', completed ? 'checked' : '')\n\n saveTask()\n checkedList()\n deleteTask()\n editTask()\n showInfoNoTask()\n }", "function addAppTasks(tasks, phaseId) { \n var list = $('.tasks[phase-id=' + phaseId + ']');\n list.append(Handlebars.templates['tasks']({\n label: 'Tasks',\n tasks: tasks\n }));\n \n $('.ui.checkbox').checkbox();\n\n // add a new add task label\n $('[phase-id=' + phaseId + '] .list').append(Handlebars.templates['new-task']);\n}", "function assignmentsAddTask() {\n\tvar idx = assignmentsGetCurrentIdx();\n\tif (idx == -1) {\n\t\talert(\"Please select a folder first.\");\n\t\treturn;\n\t}\n\twhile (!assignments[idx].folder) idx--;\n\t\n\tvar taskNo = 1, i = idx + 1, level = assignments[idx].level + 1;\n\tvar namePart = \"Zadatak\";\n\twhile (i<assignments.length && assignments[i].level >= level) {\n\t\tif (assignments[i].level == level && assignments[i].name == namePart+\" \"+taskNo)\n\t\t\ttaskNo++;\n\t\ti++;\n\t}\n\t\n\tvar newId = assignmentsGetNewId();\n\tvar assignment = {\n\t\tid: newId,\n\t\ttype: \"task\",\n\t\tname: namePart+\" \"+taskNo,\n\t\tpath: \"Z\"+taskNo,\n\t\tfolder: false,\n\t\tfiles: [],\n\t\thomework_id: null,\n\t\thidden: false,\n\t\tauthor: authorName,\n\t\tlevel: level,\n\t\tvisible: 1,\n\t\tselected: 1\n\t};\n\tif (i == assignments.length)\n\t\tassignments.push(assignment);\n\telse\n\t\tassignments.splice(i, 0, assignment);\n\t\n\t// If path is already use, prepend Z\n\twhile(!assignmentValidatePath(i, false))\n\t\tassignments[i].path = \"Z\" + assignments[i].path;\n\t\n\tassignmentsRender();\n\tassignmentsClickOn(newId);\n\tassignmentsSendToServer();\n}", "function addTask(someTask, id, done, trash) {\n // preventing the item code to work\n if (trash) {\n return;\n }\n\n const taskProgress = done ? check_Icon : uncheck_Icon;\n const lineThrough = done ? lineThrough_Icon : \"\";\n\n const item = `\n <li class=\"item\">\n <i class=\"far ${taskProgress} co\" job=\"complete\" id=\"${id}\"></i>\n <p class=\"text ${lineThrough}\">${someTask}</p>\n <i class=\"fas fa-trash de\" job=\"delete\" id=\"${id}\"></i>\n \n </li>\n \n `;\n const position = \"beforeend\";\n myList.insertAdjacentHTML(position, item);\n}", "function addTask(newTask) {\n // console.log(newTask);\n axios.post(\"/tasks\",newTask)\n .then(function (response) {\n newTask.Id = response.data;\n console.log(response.data);\n const path = location.pathname;\n axios.post(path,{task:newTask.Id})\n .then((res) => {\n });\n setTasks(prevTasks => {\n return [...prevTasks, newTask];\n });\n })\n .catch(function (error){\n console.log(error)\n });\n }", "function addTaskElement(task) {\n\t// Create elements\n\tvar listEl = document.getElementById(\"active-list\");\n\tvar taskEl = document.createElement(\"li\");\n\tvar textEl = document.createTextNode(task.name);\n\t\n\t// Set ID attribute\n\ttaskEl.setAttribute(\"id\", task.id);\n\t\n\t// Add text to task element\n\ttaskEl.appendChild(textEl);\n\t\n\t// Add task element to list\n\tlistEl.appendChild(taskEl);\n}", "function addTask(func){\n taskStack.push(func);\n tasksScanned++;\n}", "function Task(task) {\n this.task = task;\n this.id = 'new';\n }", "function addTask() \n{\n //Create a Variable to hold the Input Value\n var task = document.getElementById(\"inputValue\").value;\n //Clear off the Input Value after saving it in the task variable\n document.getElementById(\"inputValue\").value = \"\";\n //Add the task into our Array\n taskList.push(task);\n \n //Display the latest list of tasks\n displayList();\n}" ]
[ "0.77697766", "0.7426801", "0.728805", "0.7199783", "0.71790403", "0.7094858", "0.7071875", "0.7058259", "0.7021646", "0.70001817", "0.6999043", "0.6934997", "0.6866519", "0.68363464", "0.68361723", "0.6806032", "0.67924535", "0.67410225", "0.6737746", "0.67236584", "0.6673805", "0.66505134", "0.66210353", "0.6604182", "0.65820223", "0.657697", "0.6555711", "0.6549132", "0.65407413", "0.6531184", "0.65289205", "0.65150285", "0.6513855", "0.65108734", "0.65045166", "0.6491242", "0.6486733", "0.647656", "0.64571655", "0.64451885", "0.6437201", "0.6433226", "0.6426134", "0.6387665", "0.6375884", "0.6368374", "0.6346544", "0.63278645", "0.6322547", "0.63094896", "0.6306794", "0.6295413", "0.62663066", "0.62514114", "0.62408453", "0.6221339", "0.62115383", "0.6201753", "0.619054", "0.61777574", "0.6166785", "0.61123794", "0.61044025", "0.60986584", "0.608949", "0.607895", "0.6072549", "0.6064773", "0.6047009", "0.6042182", "0.6041512", "0.6040809", "0.60393834", "0.6014994", "0.6006427", "0.60044944", "0.60001814", "0.6000037", "0.59973824", "0.599517", "0.59949726", "0.59929854", "0.5988781", "0.595465", "0.5949964", "0.59467965", "0.5946465", "0.5934287", "0.59293324", "0.5914924", "0.5891426", "0.58909065", "0.5873725", "0.5864691", "0.58643925", "0.58624554", "0.5862174", "0.58569175", "0.58509034", "0.584995" ]
0.72836643
3
On Enter Key Press insert New Task in tasksList.
function addTaskOnEnterKey(event) { if (event.keyCode === 13) { insertNewTask(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addListKeyPress(event) {\n if (inputlength() > 0 && event.which === 13) {\n addTask();\n }\n}", "function handAddTask(event) {\n\t\tif (event.keyCode == 13 && task !== \"\") {\n\t\t\t//&& task !== \"\" que no suceda cuando este vacio\n\t\t\tsetListarray([...listarray, task]);\n\t\t\tsetTask(\"\"); //esto sirve para evitar que agrege cosas en blanco\n\t\t}\n\t\t//keycode es para asignar una letra al keyup, 13 es codigo del enter\n\t\t//es agregar todo lo que ya tenia mas la nueva, list tiene toda la lista de tarea\n\t}", "function addTask(event) {\n if (event.which === 13) {\n addTaskToToDoList();\n }\n}", "function appendTaskEnter(e) {\n\tvar value = document.getElementById(\"inputTask\").value; //store input into variable \n\t if (value && e.code === 'Enter') { \n\t \tdata.openTasks.push(value); //store input value in data object array\n\t \tdataObjectUpdated(); //update local storage \n\t \tcreateListElement(value); //update the DOM \n\t \ttask.value = \"\"; //clear input field \n\t} \n}", "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "function enterTrigger(e){\n if(e.keyCode === 13){\n handleAddTask();\n }\n}", "function addTasks() {\n const text =\n document.getElementById('enter-task').value;\n if (text) {\n tasks.push(new Task(text)); // somehow connect the tasks to the list they are in (optional-ish)\n showTasks();\n }\n // window.localStorage.setItem(lists, JSON.stringify(text));\n }", "function addNewTodoKeyListener(taskId) {\n var todo = jQuery(\"#new-todos\");\n var input = todo.find(\".edit input\");\n\n input.keypress(function(key) {\n if (key.keyCode == 13) {\n jQuery(\".todo-container\").load(\"/todos/create\", {\n \"_method\": \"POST\",\n task_id: taskId,\n \"todo[name]\": input.val()\n });\n\n key.stopPropagation();\n return false;\n }\n });\n}", "function keyboardNewTodo(event) {\n if (event.key == \"Enter\") {\n addTodo();\n }\n}", "function addTask(e) {\n\tvar inputEl = document.getElementById(\"input-task\");\n\t\n\tif (!inputEl.value.isNullOrWhitespace())\n\t{\n\t\t// Create a unique ID\n\t\tvar id = \"item-\" + tasks.length;\n\t\t\n\t\t// Create a new task\n\t\tvar task = new Task(id, inputEl.value, taskStatus.active);\n\t\t\n\t\t// Append the task to the DOM\n\t\taddTaskElement(task);\n\t\t\n\t\t// Reset input\n\t\tinputEl.value = \"\";\n\t}\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 addEnter(teclas){\r\n if(teclas.key === 'Enter'){ //Se a tecla pressionada for o Enter, adicionar tarefa\r\n addTask()\r\n }\r\n}", "addTask(e) {\n e.preventDefault();\n const value = this.addTaskForm.querySelector('input').value;\n if (value === '') return;\n this.tasks.createTask(new Task(value));\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\n }", "function newTaskKeyPress(o, e, type, i) {\n if (e.keyCode == _ENTER && o.value) {\n var data = {\n 'timezone': Intl.DateTimeFormat().resolvedOptions().timeZone,\n 'task': o.value,\n };\n if (type == 'day') {\n var container = $('#day' + i);\n data['dow'] = i;\n } else { // type == category\n var container = $('#cat' + i);\n data['category'] = i;\n }\n\n\n $.post({\n url: '/api/tasks/add',\n contentType: 'application/json',\n dataType: 'json',\n data: JSON.stringify(data),\n success: function(resp) {\n if (type == 'category') {\n var indicator = 'empty';\n } else {\n var indicator = 'none';\n }\n addTaskToContainer(resp['task'], resp['task_id'], container, 0);\n o.value = '';\n },\n statusCode: {\n 500: function() {\n this.fail();\n }\n },\n fail: function() {\n showFailBar('new task request failed');\n }\n });\n\n }\n}", "function insertNewTask() {\n let newTask = document.getElementById(\"input_new_task\").value;\n let obj = {};\n obj['id'] = taskCount;\n obj['task'] = newTask;\n obj['complete'] = false;\n tasksList.push(obj);\n taskCount += 1;\n const finalData = generateTasksList();\n document.getElementById(\"divTasksList\").innerHTML = finalData;\n document.getElementById(\"input_new_task\").value = '';\n}", "function addNewTask() {\n buttonAdd.onclick = function () {\n if (!newText.value || !newText.value.trim()) return alert('Please, input your text')\n newContainer.classList.add(hiddenClass)\n let id = listTask.length ? listTask[listTask.length - 1].id + 1 : 0\n let date = new Date().toJSON()\n const task = {\n id,\n text: newText.value.trim(),\n date,\n completed: false\n }\n listTask.push(task)\n addTaskToDom(task, listBlock)\n newText.value = ''\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n }", "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode /* event.which */ === 13) {\n\t\tcreateList();\n\t}\n}", "function addListAfterKeypress(event) {\n\tif (event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "function addKeyPressHandler(e, func) {\n if (e.code === \"Enter\" || e.code === \"NumpadEnter\") {\n addNewTask(usrInput.value);\n usrInput.value = \"\";\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 clickAddTaskButton(e) {\n\tvar addButtonEl = document.getElementById(\"add-task\");\n\t\n\tif (e.keyCode == 13)\n\t{\n\t\t// Don't do whatever you were gonna do!\n\t\te.preventDefault();\n\t\t// Click on the button\n\t\taddButtonEl.click();\n\t}\n}", "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\tcreateListElement();\n\t}\n}", "function addListAfterKeypress(event) {\n if (inputLength() > 0 && event.keyCode === 13) {\n createListItem();\n }\n}", "function add() {\n rl.question(`\\nWhat?\\n>`, (answer) => {\n list.push({\n task: answer,\n done: false\n })\n menu();\n });\n}", "function addListAfterKeypress(event) {\r\n\tif (inputLength() > 0 && event.keyCode === 13) {\r\n\t\tcreateListElement();\r\n\t}\r\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 addListAfterKeypress(event) {\n if (inputLength() > 0 && event.keyCode === 13) {\n createListElement();\n }\n}", "function addTask() {\n Task.addTask(info.newTask);\n info.newTask = \"\";\n }", "function addDOMTask (e, list = inbox) {\n\t// Obtener el texto del input\n\tif (e.key === 'Enter') {\n\t\t// Crear la tarea instanciando la clase\n\t\t// en este contexto this es el elemento en el que el evento fue ejecutado\n\t\tlet task = new Task (this.value);\n\t\t\n\t\t// Anadir la tarea a la lista\n\t\tlist.addTask(task, taskContainerElement);\n\n\t\t// Borrar el texto del input\n\t\tthis.value = '';\n\t}\n\n\t// console.log(e.key);\n}", "function addListAfterKeypress(event){\n if (input.value.leght>0 && event.which === 13){\n createListElement();\n }\n}", "function addTask() \n{\n //Create a Variable to hold the Input Value\n var task = document.getElementById(\"inputValue\").value;\n //Clear off the Input Value after saving it in the task variable\n document.getElementById(\"inputValue\").value = \"\";\n //Add the task into our Array\n taskList.push(task);\n \n //Display the latest list of tasks\n displayList();\n}", "function addListAfterKeypress(event) {\n\t\t// Event.keycode looks for keypress. #13 is the enter button\n\t\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\t\tcreateListElement(activeList, input.value);\n\t\t}\n}", "function enterToButton(event){\n if (event.keyCode === 13) { // Number 13 is the \"Enter\" key on the keyboad\n event.preventDefault(); // Cancel the default action, which is clear the input box and lose point \n addTaskButton.click(); // Trigger the button element with a click\n }\n}", "function createNewTask(e) {\r\n if (e.key == \"Enter\") {\r\n\r\n if (e.target.className == \"textInput\") {\r\n // If the user press enter in the insert task input\r\n\r\n let d = new Date();\r\n let task = {\r\n id: -1,\r\n taskText: e.target.value,\r\n taskDate: `${d.getDate()}, ${months[d.getDay()]}`,\r\n isChecked: false\r\n }\r\n\r\n let groupID = e.currentTarget.dataset.groupId;\r\n\r\n // =========================================================\r\n getGroup(Number(groupID)).then((res) => {\r\n\r\n res.addTask(task)\r\n updateGroup(res)\r\n\r\n e.target.parentNode.append(renderOneTaskElement(task, groupID))\r\n e.target.value = \"\"\r\n rerenderGroupElement(res)\r\n })\r\n // ==========================================================\r\n\r\n\r\n } else if (e.target.className == \"taskText\") {\r\n // If the user press enter in the task input\r\n\r\n let taskID = e.target.parentNode.dataset.taskId;\r\n let groupID = e.currentTarget.dataset.groupId;\r\n\r\n // =========================================================\r\n getGroup(Number(groupID)).then((res) => {\r\n\r\n res.modifyTask(e.target.value, taskID);\r\n updateGroup(res)\r\n\r\n rerenderGroupElement(res)\r\n })\r\n // ==========================================================\r\n\r\n } else if (e.target.tagName == \"INPUT\") {\r\n // If the user press enter in the group title input\r\n let value = e.target.value\r\n let heading = document.createElement(\"h1\")\r\n heading.innerText = value;\r\n e.target.parentNode.classList.remove(\"edit\")\r\n\r\n\r\n groupID = e.target.parentNode.parentNode.id;\r\n // =========================================================\r\n getGroup(Number(groupID)).then((res) => {\r\n\r\n res.name = value\r\n updateGroup(res)\r\n\r\n rerenderGroupElement(res)\r\n e.target.replaceWith(heading)\r\n })\r\n // ==========================================================\r\n\r\n\r\n }\r\n }\r\n}", "function addTodoOnEnter(e) {\n if (e.key == \"Enter\") {\n addTodo();\n }\n}", "function onclick_add_new_task() {\n insertNewTask();\n}", "function addListAfterKeypress(event) {\n if (inputLength() > 0 && event.which === 13) {\n createListElement();\n }\n}", "function addTask(event) {\n event.preventDefault();\n const taskDiv = document.createElement(\"div\");\n taskDiv.classList.add(\"task\");\n\n //List - append\n const newTask = document.createElement(\"li\");\n newTask.innerText = inpTask.value;\n newTask.classList.add(\"task-item\");\n taskDiv.appendChild(newTask);\n\n //Legg til i liste lokalt på pc\n\n saveLocalTasks(inpTask.value);\n\n\n //Done-button\n const doneBtn = document.createElement(\"button\");\n doneBtn.innerHTML = \"Done\";\n doneBtn.classList.add(\"done-btn\");\n taskDiv.appendChild(doneBtn);\n\n //Delete-button\n const deleteBtn = document.createElement(\"button\");\n deleteBtn.innerHTML = \"Delete\";\n deleteBtn.classList.add(\"del-btn\");\n taskDiv.appendChild(deleteBtn);\n\n //Add div to list\n taskList.appendChild(taskDiv);\n\n //Remove inp value\n inpTask.value = \"\";\n\n}", "function addOnKeypress () {\n $('#userInput').keypress(function(event) {\n if(event.which === 13) {\n event.preventDefault();\n appendToDo();\n }\n });\n}", "function addListAfterKeypress(event){\n //event.which is same as event.KeyCode\n if(inputLength() > 0 && event.keyCode === 13){\n createListElement();\n }\n}", "function addListByKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\t//event.which works too!\n\t\tcreateElement();\n\t}\n}", "function addListAfterKeyPress(event) {\n if (inputLength() > 0 && event.keyCode == 13) {\n createListElement();\n }\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}", "function addListAfterKeyPress(event){\n //13 is a keycode for \"Enter\"\n if(inputLength() > 0 && event.keyCode === 13){\n createListElement();\n }\n}", "function todoHandler(e){\n if(e.key =='Enter' && todo.value !== \"\"){\n allTasks[todo.value] = {task:todo.value,status:'pending'};\n todo.value = null;\n }\n displayAll();\n }", "addNewTask() {\n let task = new Task(this.newTaskName);\n task.id = new Date().getMilliseconds();\n this.tasks.push(task);\n }", "function newTask(e) {\n e.preventDefault();\n\n if(taskContent.trim() === \"\"){\n notifyError()\n return\n }\n\n const newTask = {\n content: taskContent,\n taskId: Math.random() * 10,\n checked: false,\n };\n\n setTasks([...tasks, newTask]);\n setTaskContent(\"\");\n }", "function newTask() {\n let newt = document.taskList.txtNewTask;\n if (newt.value !== \"\") {\n arrayTask.push(newt.value);\n localStorage.setItem(\"task\", arrayTask);\n displayTasks();\n newt.value = \"\";\n } else {\n alert(\"You must enter input data\");\n }\n}", "addNewDebtIfEnterKeyPressed(event) {\n const enterKey = 13;\n if (event.keyCode === enterKey) {\n this.addNewDebt();\n }\n }", "async function addToStore(evt) {\n\n if (evt.key === 'Enter') {\n\n const textRef = document.getElementById('task');\n const optionRef = document.getElementById('category');\n\n let task = textRef.value;\n let type = optionRef.options.selectedIndex;\n\n // No task added\n if (task.length === 0) {\n M.toast({ html: \"Task cannot be empty!\" });\n return;\n }\n\n await dispatch({ type: { task, type }, action: \"INSERT\" })\n M.toast({ html: \"Task added!\" });\n textRef.value = \"\";\n\n }\n }", "function handleAdd(){\n console.log('clicked on Submit button');\n\n let newTask = {\n task: $('#taskIn').val()\n }\n // run addTask with newTask variable\n addTask(newTask);\n\n // empty input task\n $('#taskIn').val('')\n} // end handleAdd", "function appendTaskClick() {\n\tvar value = document.getElementById(\"inputTask\").value; \n\tif (value) {\n\t\tdata.openTasks.push(value); //store in array \n\t \tdataObjectUpdated(); //update data storage \n\t \tcreateListElement(value); //display in DOM \n\t \ttask.value = \"\"; //clear input field \n\t}\n}", "addNewTodo(event) {\r\n if (event.keyCode == 13) {\r\n const text = event.target.value;\r\n if (text !== '') {\r\n const todo = {id:_.uniqueId(), text:text, active:true};\r\n this.setState({todos: this.state.todos.concat(todo)});\r\n event.target.value = '';\r\n }\r\n }\r\n }", "function newTask() {\n td.addTask(document.getElementById(\"new-task-text\").value);\n document.getElementById(\"new-task-text\").value = \"\";\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}", "function addTask(input) {\n var listItem = createTask(input.value); // create the list item\n var taskList = $(input).siblings(\".taskList\").first(); // ul (taskList)\n\n // if there is no ul\n if (taskList.length > 0)\n taskList.append(listItem);\n else { // else create ul and add listText to it\n var ul = document.createElement(\"ul\");\n $(ul).addClass(\"taskList\");\n $(ul).append(listItem);\n $(ul).insertAfter(input);\n }\n bindTaskEvents(listItem);\n input.value = \"\";\n }", "function addNewTask(e) {\n e.preventDefault();\n\n if (taskInput.value === '') {\n taskInput.style.borderColor = 'red';\n return;\n }\n\n const li = document.createElement('li');\n\n li.className = 'collection-item';\n\n li.appendChild(document.createTextNode(taskInput.value));\n\n const link = document.createElement('a');\n\n link.className = 'delete-item secondary-content';\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n\n li.appendChild(link);\n taskList.appendChild(li);\n taskInput.value = '';\n}", "function addItemsEnterPress() {\n var key = (event.keyCode ? event.keyCode : event.which); // Enter button code = 13\n if (key == 13) {\n addItemsClick();\n }\n }", "function addListenerMyListEnterNewList() {\n\t\t$(\".sidebar\").find(\".myList-newInput\").keydown(function(e) {\n\t\t\tif (e.which == \"13\") {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tif (checkMyListInput() == true) {\n\t\t\t\t\taddMyListItem( $(this).val() );\n\t\t\t\t\t$(\".myList-newForm\").hide();\n\t\t\t\t\t$(\".myList-newButton\").show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function addItem(){\n // Check to see if there is a value in the input textbox.\n if (inputText.value == \"\"){\n // If so, exit the function.\n return;\n }\n\n // If there is an input, add it to the list.\n // Create a date object.\n let timeStamp = new Date();\n\n // Make a new task object.\n let newTask = {id: timeStamp, content: inputText.value, completed: false};\n\n // Append the object to the array.\n list.push(newTask);\n\n // Print the list again.\n printList();\n\n // Remove the text from the textbox.\n inputText.value = \"\";\n\n // Save the list to local storage.\n saveList(list);\n}", "function checkSubTaskSend(event){\n if(event.keyCode === 13){\n // event.preventDefault\n addSubTask()\n }\n}", "function addTask() {\n\n // TODO: look javascript with the dom(document || javascript with html)\n let taskInput = document.getElementById(\"taskinput\");\n\n // TODO: look up conditionals if else\n if (taskInput.value === \"\") {\n alert(\"Invalid Value\")\n } else {\n taskList.push(taskInput.value)\n\n taskinput.value = \"\";\n }\n\n listTasks();\n\n // returns false for form so it doesn't reload\n return false;\n}", "function addItem() {\n var contents = document.getElementById('newTask').value;\n var item = new listItem(Date.now(), contents, false);\n masterList.push(item);\n showList(masterList);\n saveList();\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 handleEnterKey(event) {\n if (event.key === 'Enter') {\n addTodoItem()\n }\n}", "function addToList() {\n if ($(\"#js--project1-input\").val() != \"\") {\n var taskDescription = $(\"#js--project1-input\").val();\n $(\"#list\").append(taskItem(taskDescription));\n $(\"#js--project1-input\").val(\"\");\n } else {\n alert (\"you need to write something!\");\n }\n }", "function addTask() {\n 'use strict';\n var task = document.getElementById('task'); // Get form references\n // If task is entered, add it to the array and print array\n if (task.value) {\n tasks.push(task.value);\n printArray();\n // Update task input field with the blank string:\n document.getElementById('task').value = '';\n }\n return false;\n } // End of addTask() function.", "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 addTask () {\r\n tasks.setSelected(tasks.add())\r\n taskOverlay.hide()\r\n\r\n tabBar.updateAll()\r\n addTab()\r\n}", "function add() {\n var task = document.getElementById(\"task\").value;\n\n document.getElementById(\"task\").value = \"\";\n\n var d = new Date();\n var h = d.getHours();\n var m = d.getMinutes();\n var s = d.getSeconds();\n if (m < 10) {\n m = `0${m}`;\n }\n if (s < 10) {\n s = `0${s}`;\n }\n var text = `(${h}:${m}:${s})`;\n\n var todos = get_todos();\n\n if (task !== \"\") {\n todos.push(`${task} - ${text}`);\n localStorage.setItem(\"todo\", JSON.stringify(todos));\n show();\n }\n\n return false;\n}", "function addTask() {\r\n\r\n var taskId = \"task_\" + taskCount++;\r\n\r\n var task = createTask(taskId, \"\", \"\");\r\n taskList[taskId] = task;\r\n\r\n var domElement = createNewTaskDOMElement(task);\r\n taskListDOMElements[taskId] = domElement;\r\n\r\n showTaskDetail(task);\r\n}", "function addTask() {\n //criou um elemento item\n const tarefa = document.createElement('li')\n //adicionou o conteudo do input ao item\n tarefa.innerText = input.value\n //adicionou o item à div listaTarefas\n listaTarefas.appendChild(tarefa)\n }", "function createNewTask(){\n var item = document.createElement('li'),\n listContent = document.createTextNode(inputValue.value);\n item.appendChild(listContent);\n //Preventing the Creation of an Empty Task\n if(inputValue.value ===''){\n alert(\"Please ADD a Task\");\n }else{\n taskContainer.prepend(item);\n document.getElementById(\"taskContents\").value = \"\";\n item.className = 'newitem';\n }\n //Creating a Clear button to Clear ALL Tasks\n function clearTasks(){\n item.parentNode.removeChild(item);\n }\n deleteButton.addEventListener('click', clearTasks);\n //Adding the Finished Tasks to the CompletedTask section\n function completeTask(){\n completedTaskContainer.prepend(item);\n }\n item.addEventListener('click', completeTask);\n function clearcompleteTasks(){\n completedTaskContainer.removeChild(item);\n }\n //Creating a Clear button to Clear Completed Tasks only\n deletecompleteButton.addEventListener('click', clearcompleteTasks);\n}", "function createListItemEnterKey(event) {\n console.log(event.keyCode)\n\n if (input.value.length > 0 && event.keyCode === 13) {\n createListElement();\n }\n}", "function pushItems() {\n $(\"#newItem\").keypress(function (e) {\n if (e.which === 13 && $(this).val() !== \"\") {\n $(\"ul\").append(`<li class=\"border-bottom border-dark\"><span class=\"border-dark border-left-0\"><img class=\"fa-trash-alt align-middle\" src=\"images/trash.png\"></span>&nbsp${$(this).val()}&nbsp</li>`);\n $(this).val(\"\");\n }\n });\n return;\n}", "function handleAddClick() {\n console.log('add button clicked');\n let newTask = {};\n //puts input fields into an object\n newTask.task = $('#taskIn').val();\n newTask.type = $('#homeOrWork').val();\n newTask.notes = $('#notesIn').val();\n addTask(newTask);\n $('#taskIn').val('');\n $('#notesIn').val('');\n}", "handleKeyPress(e) {\n if (e.key === 'Enter') {\n this.populateList()\n }\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}", "function addNewTask(e){\n if(taskInput.value === '')\n {\n taskInput.style.borderColor = 'red';\n return;\n }\n\n //rest of code\n //create a li element when the user adds a task\n const li = document.createElement('li');\n //add a class\n li.className = 'collection-item';\n //create text node and append it\n li.appendChild(document.createTextNode(taskInput.value));\n //create new element for link\n const link = document.createElement('a');\n //add class and the x marker for a\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n link.className = 'delete-item secondary-content';\n //append link to li\n li.appendChild(link);\n if (checkAscend) {\n //append to ul\n taskList.appendChild(li);\n } else {\n taskList.prepend(li);\n } \n\n taskInput.value = '';\n \n \n e.preventDefault(); //disable form submission\n}", "function addTask(e){\r\n e.preventDefault(); // ata daor jonno ager theka set haoa default value kaj korbe na\r\n if(taskInput.value===''){\r\n alert('Add a Task!');\r\n }\r\n else{\r\n // create li element\r\n let li=document.createElement('li');\r\n li.appendChild(document.createTextNode(taskInput.value + \" \"\r\n ));\r\n let link=document.createElement('a');\r\n link.setAttribute('href','#');\r\n link.innerHTML='x';\r\n li.appendChild(link);\r\n taskList.appendChild(li);\r\n // local stroage a input task add korte\r\n storeTaskInLocalStorage(taskInput.value);\r\n taskInput.value=\" \";\r\n \r\n \r\n }\r\n}", "function addNewTask (value, groupIndex) {\n\t\t\t\t\tvar task = {\n\t\t\t\t\t\tdescription: value,\n\t\t\t\t\t\tcompleted: false,\n\t\t\t\t\t\torder: scope.groups[groupIndex].groupTasks.length\n\t\t\t\t\t};\n\n\t\t\t\t\tscope.insertTask(groupIndex, task);\n\t\t\t\t\tscope.newDescription = \"\";\n\t\t\t\t\tscope.groups[groupIndex].inputVisible = false;\n\t\t\t\t\tscope.$digest();\n\t\t\t\t}", "function add() { \n var task = document.getElementById('task').value;\n var todos = get_todos();\n todos.push(task);\n localStorage.setItem('todo', JSON.stringify(todos));\n document.getElementById('task').value = \"\";\n show();\n return false;\n }", "function addTaskFunc(inputValue)\n {\n var task=document.createElement('li');\n var taskDiv=document.createElement('div');\n taskDiv.innerText=inputValue;\n taskDiv.classList.add('taskDivClass')\n \n \n var buttonsCont = document.createElement('div');\n buttonsCont.classList.add('buttonContClass');\n \n var completed = document.createElement('button');\n completed.classList.add('completedButton')\n \n var edit = document.createElement('button');\n edit.classList.add('editButton')\n \n var deleteIt = document.createElement('button');\n deleteIt.classList.add('deleteButton')\n \n deleteIt.innerHTML=\"&#10006\";\n completed.innerHTML=\"&#10004\" ;\n edit.innerHTML=\"&#9998\";\n \n buttonsCont.appendChild(taskDiv);\n buttonsCont.appendChild(deleteIt);\n buttonsCont.appendChild(completed);\n buttonsCont.appendChild(edit);\n task.appendChild(buttonsCont);\n \n var list = document.getElementById(\"taskList\");\n list.insertBefore(task,list.childNodes[0]);\n document.getElementById(\"userInput\").focus();\n \n //eventlisteners for buttons\n deleteIt.addEventListener('click', deleteTask);\n completed.addEventListener('click', completeTask);\n edit.addEventListener('click', editTask);\n }", "function addTask(taskID, task)\n{\n const table = $(\"#tasklist\");\n // create a new row\n const newRow = makeTasklistRow(taskID, task);\n // finally, stick the new row on the table\n const firstTask = tasksExist(\"tasklist\");\n if (firstTask)\n {\n firstTask.before(newRow);\n }\n else\n {\n table.append(newRow);\n }\n}", "function addTask(e) {\r\n\r\n if (taskInput.value === '') {\r\n alert('Add a Task');\r\n } else {\r\n //Tasks In li Element//\r\n let li = document.createElement('li');\r\n\r\n li.appendChild(document.createTextNode(taskInput.value + \" \"));\r\n let link = document.createElement('a');\r\n link.setAttribute('href', '#');\r\n link.innerHTML = 'x';\r\n li.appendChild(link);\r\n taskList.appendChild(li);\r\n //Added local Storage Function//\r\n storeTaskInLocalStorage(taskInput.value);\r\n taskInput.value = '';\r\n }\r\n e.preventDefault();\r\n}", "function addTask(e){\n // 如果没有输入,提示请添加一个task;如果有输入,则添加到ul中\n if(taskInput.value === ''){\n alert('Add a task');\n } else{\n // 添加到ul中有以下步骤:\n // 1. 新建一个li标签,给li标签加class(美观)\n const li = document.createElement('li');\n li.className = 'collection-item';\n // 2. 新建一个text node在append to li\n li.appendChild(document.createTextNode(taskInput.value));\n // 3. 新建删除按钮,create new link element\n const link = document.createElement('a');\n link.className = 'delete-item secondary-content';\n // 4. a里面有个i的图标\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // 5. 把link挂到li上面\n li.appendChild(link);\n // 6. 把li挂到ul上\n ulTaskList.appendChild(li);\n\n // 把input的value存储到local storage\n storeTaskInLocalStorage(taskInput.value);\n // 7. clear 之前的input\n taskInput.value = '';\n }\n\n e.preventDefault(); // 防止跳转\n}", "function handleKeyPressOnTodoItem(e) {\n if (e.key === 'Enter') {\n addTodo()\n }\n}", "function addListAfterClick() {\n if (inputlength() > 0) {\n addTask();\n }\n}", "function addTask(e){\n e.preventDefault();\n \n if(!taskInput.value) {\n alert('add a task')\n return\n }\n let li = document.createElement('li')\n li.className = 'collection-item'\n li.appendChild(document.createTextNode(taskInput.value))\n let a = document.createElement('a')\n a.className = 'delete-item secondary-content'\n let i = document.createElement('i')\n i.className = ' fa fa-remove'\n a.appendChild(i)\n li.appendChild(a)\n taskList.appendChild(li)\n taskInput.value = ''\n\n}", "function addItem(e) {\n\t\tif (e.keyCode == 13) {\n\t\t\tsetInputValue(inputValue);\n\t\t\tconst list = inputList.concat(inputValue);\n\t\t\tsetInputList(list);\n\t\t\tsetInputValue(\"\");\n\n\t\t\tfetch(\"https://assets.breatheco.de/apis/fake/todos/user/13\", {\n\t\t\t\tmethod: \"PUT\",\n\t\t\t\tbody: JSON.stringify(list),\n\t\t\t\theaders: {\n\t\t\t\t\t\"Content-Type\": \"application/json\"\n\t\t\t\t}\n\t\t\t}).then(response => {\n\t\t\t\tif (response.ok) {\n\t\t\t\t\tfetch(\"https://assets.breatheco.de/apis/fake/todos/user/13\")\n\t\t\t\t\t\t.then(response => {\n\t\t\t\t\t\t\tif (!response.ok) {\n\t\t\t\t\t\t\t\tthrow new Error(response.statusText);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn response.json();\n\t\t\t\t\t\t})\n\t\t\t\t\t\t.then(data => setInputList(data))\n\t\t\t\t\t\t.catch(error => console.error(error));\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "function addTodo() {\n \tself.todoList.unshift({task: self.text, done:false});\n \tself.text = null;\n\n }", "function newTodo() {\n\n list.appendChild(addTask());\n document.getElementsByClassName(\"todo-text\")[count].focus();\n count++;\n checked++;\n updateItemCount();\n updateCheckedCount();\n}", "function inputHandle(event){\n //keycode \"13\" is the \"enter\" key on keyboard\n if (event.keyCode == 13 && event.target.value!= \"\"){\n \n const toDo = input.value;\n addItem(toDo,id,false,false)\n LIST.push({\n name: toDo,\n id: id,\n done: false,\n date:dateText, // just for popup-history use to add the date for every list.\n historyDisplay: false,// just for popup-history use to the LIST in popup history or not\n trash: false\n })\n localStorage.setItem(\"todo\", JSON.stringify(LIST)); //upload and update the storage\n id++;\n input.value= \"\" //set the input value blank after pressing enter.\n}}", "function addTodo(e) {\n if ( e.key === 'Enter' ) {\n e.preventDefault();\n\n if ( e.target.value !== '' ) {\n const todo = {\n id: Date.now(),\n name: e.target.value,\n completed: false\n }\n todos.push(todo);\n\n todoInput.value = '';\n\n addToLocalstorage(todos);\n renderTodos(todos);\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 }", "function addNewTodo(event) {\n event.preventDefault();\n\n let todoInput = document.querySelector(\"#todoInput\");\n todos.push({ task: todoInput.value, completed: false });\n populateTodoList(todos);\n todoInput.value = \"\";\n}", "function addLiAfterKeypress(event){\n if (inputLength() > 0 && event.key === 'Enter'){\n createLiElement();\n }\n}", "function addTask() {\n 'use strict';\n\n // Get the task:\n var task = document.getElementById('task');\n\n // Reference to where the output goes:\n var output = document.getElementById('output');\n\n \n // For the output:\n var message = '';\n\n if (task.value) {\n \n // Add the item to the array:\n tasks.push(task.value);\n \n // Update the page:\n message = '<h2>To-Do</h2><ol>';\n for (var i = 0, count = tasks.length; i < count; i++) {\n message += '<li>' + tasks[i] + '</li>';\n }\n message += '</ol>';\n output.innerHTML = message;\n \n } // End of task.value IF.\n\n \n\n // Return false to prevent submission:\n return false;\n \n} // End of addTask() function." ]
[ "0.7899116", "0.7895434", "0.78518033", "0.75416124", "0.74918026", "0.7310466", "0.7134301", "0.7114583", "0.70830345", "0.70828706", "0.70443434", "0.69933313", "0.6978122", "0.6973019", "0.6920375", "0.69105357", "0.6903763", "0.68780893", "0.68568623", "0.6845173", "0.6794392", "0.6792673", "0.6792673", "0.6792673", "0.67897254", "0.67809916", "0.67775303", "0.67620075", "0.6754026", "0.6745786", "0.6730134", "0.6726054", "0.6694959", "0.669089", "0.6690706", "0.66782236", "0.6669651", "0.66676074", "0.6660318", "0.6658665", "0.6656785", "0.66304916", "0.66287565", "0.66285807", "0.6602551", "0.6592117", "0.65883887", "0.65577143", "0.65439934", "0.6543747", "0.65433055", "0.65366167", "0.6520507", "0.65195704", "0.6518383", "0.6517941", "0.65143585", "0.64985555", "0.64635223", "0.64610535", "0.6460753", "0.64531845", "0.6452998", "0.6439588", "0.64257145", "0.6414417", "0.6414175", "0.6410181", "0.6407308", "0.64062786", "0.6385185", "0.6369415", "0.63679916", "0.63658977", "0.6359181", "0.6332393", "0.63244027", "0.6312739", "0.63026744", "0.62980527", "0.62929463", "0.62896144", "0.6284433", "0.6273076", "0.6266613", "0.624855", "0.62477577", "0.62425476", "0.6238207", "0.6230222", "0.6221959", "0.62130743", "0.6204569", "0.6204286", "0.62017727", "0.6198965", "0.61867523", "0.618144", "0.6179673", "0.61790234" ]
0.844476
0
On Task Checkox click update status of task in taskList.
function onClickTaskComplete(object) { var task_index = object.getAttribute('task_index'); if (object.checked) { tasksList[Math.abs((tasksList.length - 1) - task_index)].complete = true; document.getElementById("task_label_" + task_index).setAttribute('class', 'submited_task'); } else { tasksList[Math.abs((tasksList.length - 1) - task_index)].complete = false; document.getElementById("task_label_" + task_index).classList.remove('submited_task'); } console.log(tasksList); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 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 setTaskStatus() {\r\n let taskItem = this.parentNode.parentNode;\r\n let taskItemName = taskItem.querySelector('.taskName').innerText;\r\n for (var i=0; i<tasksData.length; i++){\r\n if (tasksData[i].taskName == taskItemName){\r\n if (this.checked) {\r\n tasksData[i].taskStatus = 1; //task completed\r\n break;\r\n } else {\r\n tasksData[i].taskStatus = 0; //task to do\r\n break;\r\n }\r\n }\r\n }\r\n\r\n //add to local storage\r\n datatoLocalstorage();\r\n}", "function handleStatus(e) {\n var identifier = null;\n const li = Array.from(list);\n let arrayIndex = null;\n\n //Split the piece of id to use like reference\n identifier = e.currentTarget.id.split(\"-\")[0];\n\n //Search in array the element.id which matches with identifier\n for (let i = 0; i < li.length; i++) {\n if (li[i].id === parseInt(identifier)) {\n arrayIndex = i;\n }\n }\n\n //Toogle the value of element.complete\n li[arrayIndex].complete = !li[arrayIndex].complete;\n\n //Update the global list\n setList(li);\n\n //Assign the changes and withdraw if the values matches\n if (li[arrayIndex].complete === true) {\n document.getElementById(`${identifier}-task`).classList.add(\"checked\");\n document\n .getElementById(`${identifier}-task-wrapper`)\n .children[1].classList.add(\"completed\");\n } else {\n document.getElementById(`${identifier}-task`).classList.remove(\"checked\");\n document\n .getElementById(`${identifier}-task-wrapper`)\n .children[1].classList.remove(\"completed\");\n }\n }", "function updateTaskHandler(event) {\n const isChecked = event.target.classList.contains('list__item-checkbox');\n if (!isChecked) {\n return;\n }\n const num = event.target.dataset.id;\n tasks[num].done = true;\n}", "function switchStatus() {\n var values = {};\n values.id = $(this).data('id');\n\n if ($(this).is(':checked')) {\n values.complete = true;\n } else {\n values.complete = false;\n }\n\n $.ajax({\n type: 'POST',\n url: 'task/switch',\n data: values,\n success: function(){\n updateTaskList();\n }\n });\n}", "function onToggleTask(event) {\n if (!event.target.classList.contains('list__item-checkbox')) {\n return;\n }\n\n let task = tasks.find(task => task.id === event.target.dataset.id)\n\n task.done = event.target.checked\n\n renderTasks(tasks)\n}", "async function updateTask(e) {\n // Get the ID of the task\n const taskId = e.target.id;\n\n // Find the task from the array\n const task = tasks.find(t => t._id === taskId);\n // If no task is found (shouldn't happen), just return\n if (!task) return;\n // Toggle completed status\n task.completed = !task.completed;\n\n // Get the label for the task, which contains the string\n // We find this by using nextSibling\n // It is next to the checkbox, which is in e.target\n const taskLabel = e.target.nextSibling;\n // Set the class for the task based on completed status\n taskLabel.className = task.completed ? 'completed' : '';\n // Call the server to save the changes\n await fetch(\n `/api/tasks/${taskId}`, // URL of the API\n {\n method: 'PUT', // method to modify items\n body: JSON.stringify(task), // put task in body\n headers: {\n 'Content-Type': 'application/json' // indicate return type of JSON\n }\n }\n );\n}", "function checkAllTask(e){\n\n var status = false;\n if(e.target.checked){\n status = true;\n }\n\n for(var i = 0 ; i < loginUser.tasks.length; i++){\n loginUser.tasks[i].status = status;\n }\n collectionOfUser.update(\n {\n id : loginUser.id,\n tasks : loginUser.tasks\n },\n function(user){\n loginUser = user;\n $('#containerShowTask').html('');\n showAllTasks(loginUser.tasks);\n },\n error \n );\n }", "function changeStatus(event) {\n // Get index of the list item to be updated\n let index = findIndexById(event.target.parentElement.id);\n\n // Make sure there is an index to use.\n if (index !== false) {\n // When the task is completed we update the text to have a line through it,\n // and then update the completed status and update the local storage\n if (event.target.checked) {\n event.target.parentElement.style.textDecoration = \"line-through\";\n toDos[index].completed = true;\n ls.setJSON(key, JSON.stringify(toDos));\n }\n // When the task is completed we update the text to remove the line, and then\n // update the completed status and update the local storage\n else {\n event.target.parentElement.style.textDecoration = \"none\";\n toDos[index].completed = false;\n ls.setJSON(key, JSON.stringify(toDos));\n }\n }\n}", "function changeTaskStatus(taskId){\n\t\tlet task = $('.task[data-id=\"'+taskId+'\"]');\n\t\tif (!task.hasClass('task-done')) {\n\t\t\ttask.addClass('task-done');\n\t\t\ttask.data('status', 'done');\n\t\t\ttask.attr('data-status', 'done');\n\t\t}else{\n\t\t\ttask.removeClass('task-done');\n\t\t\ttask.data('status', 'to_do');\n\t\t\ttask.attr('data-status', 'to_do');\n\t\t}\n\t}", "function taskCheck(){\n console.log(\"Check box clicked\");\n var tasks = getTasks();\n var index = ($(this).parent().parent().parent().parent().index());\n var task = tasks[index];\n task['done'] = ($(this).prop( \"checked\" ));\n writeTasks(tasks);\n var newTasks = getTasks()\n renderTasks(newTasks);\n console.log(\"checked index: \" ,index, \" set at \", $('.toDoList'));\n //$('.toDoList').data('deleteIndex', index);\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 handleTaskActiveStatusToggleClick(currentTask) {\n console.log(\"handleTaskActiveStatusToggleClick\");\n setTasks(\n tasks.map((task) => {\n if (task.id === currentTask.id) {\n if (task.status === TASK_STATUS_PENDING) {\n if (activeTasks.length >= activeTasksLimit) {\n notifyActiveTasksLimitReached();\n return task;\n }\n } else if (task.status === TASK_STATUS_ACTIVE) {\n if (pendingTasks.length >= tasksBacklogLimit) {\n notifyTasksBacklogLimitReached();\n return task;\n }\n }\n task.status =\n task.status === TASK_STATUS_PENDING\n ? TASK_STATUS_ACTIVE\n : TASK_STATUS_PENDING;\n task.activatedAt =\n task.status === TASK_STATUS_ACTIVE ? +new Date() : null;\n task.status === TASK_STATUS_ACTIVE\n ? notifyTaskActivated()\n : notifyTaskReBacklogged();\n }\n\n return task;\n })\n );\n }", "function toggleTaskStatus(e) {\n var target = e.target;\n target.classList.toggle(\"checked\");\n}", "function toggleTaskCompleted(id) {\n const updatedTasks = tasks.map((task) => {\n // if this task has the same ID as the edited task\n if (id === task.id) {\n // Toggle the checkbox value\n task.isCompleted = task.isCompleted === 1 ? 0 : 1;\n\n // Update the server\n todoListService\n .updateTask(id, task)\n .then((response) => console.log(response.data.message))\n .catch((error) => console.error(error));\n\n return { ...task };\n }\n return task;\n });\n // Set the component state to new updated Tasks\n setTasks(updatedTasks);\n }", "function updateStatus(taskIndex)\n{\n\t// update the model: if the item has been checked, set status to complete\n\t// and add completion date. If item is unchecked, set status to incomplete\n\t// and set completion date to be empty.\n\t\n\tif(todos[taskIndex].status == true) {\n\t\ttodos[taskIndex].status = false;\n\t\ttodos[taskIndex].completeDate = \"\";\n\t} else {\n\t\ttodos[taskIndex].status = true;\n\t\tvar d = new Date();\n\t\ttodos[taskIndex].completeDate = \" \" + (d.getMonth() + 1) + \"/\" + d.getDate() + \"/\" + d.getFullYear() + \" \" + formatAMPM(d);\n\t}\n\t\n\t// update the view\n\tview();\n\n}", "function handleTaskStatusCompletedToggleClick(currentTask) {\n console.log(\"handleTaskStatusCompletedToggleClick\");\n setTasks(\n tasks.map((task) => {\n if (task.id === currentTask.id) {\n if (\n task.status === TASK_STATUS_PENDING ||\n task.status === TASK_STATUS_DONE\n ) {\n task.status === TASK_STATUS_PENDING\n ? setTaskCompleted(task)\n : resetTaskPending(task);\n } else if (task.status === TASK_STATUS_ACTIVE) {\n setTaskCompleted(task);\n }\n }\n\n return task;\n })\n );\n }", "_onTaskStatusOpenUpdate() {\n try {\n \n $(\"#GridLoaderBG\").addClass(\"d-none\")\n gDashBoardData.CurrentClickedCheckBoxID = null;\n var ToBeRemovedIndex = []\n for (var k = 0; k < gDashBoardData.OpenedTasksIDArray.length; k++) {\n for (var i = 0; i < TableData.length; i++) {\n if (TableData[i][\"ID\"] == gDashBoardData.OpenedTasksIDArray[k]) {\n BKJSShared.NotificationMessage.ShowMessage(BKJSShared.NotificationMessage.MessageTypes.Success, \"Task opened.\", \"Task \" + TableData[i][\"Title\"] + \" has been opened.\", 1500)\n EOBEmployeeTasksStatus.CheckAndUpdateEmployeeStatus(TableData[i][\"Employee ID\"], this.ResetDashBoardSnapShots)\n ToBeRemovedIndex.push(k)\n break;\n }\n }\n }\n for (var m = 0; m < ToBeRemovedIndex.length; m++) {\n gDashBoardData.OpenedTasksIDArray.splice(ToBeRemovedIndex[m], 1);\n }\n this.FilterGridTasks();\n }\n catch (e) { BKJSShared.GlobalErrorHandler(e, \"DashboardMain._onTaskStatusOpenUpdate\"); }\n }", "function updateTask(checkBox) {\n var task = checkBox.closest(\"task\");\n var text = task.getElementsByTagName(\"text\");\n\n var keys = Object.keys(localStorage);\n var tasks = [];\n for (var i = 0; i < keys.length; i++) {\n tasks.push(localStorage.getItem(keys[i]));\n }\n for (i = 0; i < tasks.length; i++) {\n var storedTask = [];\n storedTask = JSON.parse(tasks[i]);\n if (text[0].innerHTML === storedTask[0]) {\n if (checkBox.checked !== storedTask[1]) {\n storedTask[1] = checkBox.checked;\n //Update local storage\n localStorage.removeItem(i);\n localStorage.setItem(i, JSON.stringify(storedTask));\n }\n }\n }\n view.flagOverdueTasks();\n }", "function taskStatusSync() {\n var taskListId = getTaskListId(TASK_LIST_NAME);\n var optionalArgs = {maxResults: 100,showHidden: true};\n var tasks = Tasks.Tasks.list(taskListId,optionalArgs);\n if (tasks.items) {\n for (var i = 0; i < tasks.items.length; i++) {\n var task = tasks.items[i];\n if (task.status == 'completed') {\n var firstLine = task.notes.split(\"\\n\")[0];\n var habiticaId = firstLine.trim();\n Logger.log(\"Completed task ID sent to Habitica: \" + habiticaId)\n scoreHabititcaTask(habiticaId);\n }\n }\n } else {\n Logger.log('No tasks found.');\n }\n}", "function doStatusChangeInLocalstorage(task){\n\n \n let dataList = JSON.parse(localStorage.getItem(\"allData\"));\n\n\n for(let i = 0;i < dataList.length ; ++i){\n\n \n taskObject = dataList[i] ;\n\n if(taskObject.task == task){\n\n\n \tif(taskObject.status == \"active\")\n \t\t taskObject.status = \"completed\" ;\n else if(taskObject.status == \"completed\")\n \t taskObject.status = \"active\" ;\n\n\n dataList[i] = taskObject ;\n localStorage.setItem(\"allData\" , JSON.stringify(dataList));\n decideToShowOrHide(taskObject);\n break;\t\n }\n\n }\n\n }", "handleStatusChange(taskId, e, data) {\n const task = _.find(this.state.tasks, {'task_id': taskId})\n const newStatus = data.value\n if (newStatus !== task.status) {\n let newTasks = this.state.tasks.slice()\n let newTask = _.find(newTasks, {'task_id': taskId})\n newTask.status = newStatus\n let filteredTasks = this.filterTasksByWorkspaces(newTasks,\n this.state.selectedWorkspaces);\n let displayTasks = filteredTasks.length > 0 ? filteredTasks : newTasks;\n let newCompletionPercentage = this.calculateCompletionPercentage(displayTasks);\n put(`/tasks/${task.task_id}`, {status: newStatus})\n .then(res => {\n this.setState({\n tasks: newTasks,\n completionPercentage: newCompletionPercentage,\n })\n console.log(`Successfully changed status to ${newStatus} for ${task.name}`)\n })\n .catch(err => console.log(err))\n }\n }", "'click .toggle-checked'() {\n Tasks.update(this.task._id, {\n $set: { checked: ! this.task.checked }, //Toggle If not checked: \"check\", else: \"uncheck\"\n });\n }", "function changeCompletionStatus(bool, id){\n const task = {\n completionStatus:bool\n };\n API.updateTask(task, id)\n .then(()=>{\n getTasks();\n }).catch();\n }", "function updateCompleteTasks() {\n var tasks = document.getElementsByTagName(\"task\");\n for (i = 0; i < tasks.length; i++) {\n var task = tasks[i];\n var checkBox = task.getElementsByTagName(\"input\");\n updateTask(checkBox[0]);\n }\n }", "changeStatus(indexToDo) {\n this.todos[indexToDo].completed = !this.todos[indexToDo].completed;\n }", "async toggleCompleteStatusAsync(id){\n console.log(\"toggle called\")\n let newCompletionStatus = this.getTaskById(id).taskCompleted == 0 ? 1 : 0\n\n let task = {}\n try{\n //wait for completion status to be changed\n await TaskService.changeCompletionStatusAsync(id, newCompletionStatus)\n //THEN get the task back from database\n task = await TaskService.getTaskAsync(id)\n } catch(e){\n console.log(e)\n }\n \n let newTaskList =[]\n for(let i=0; i<this.state.tasks.length; i++){\n if(this.state.tasks[i].taskId == id){\n newTaskList.push(task)\n } else {\n newTaskList.push(this.state.tasks[i])\n }\n }\n\n //use setState to update taskList stored in State\n this.setState({tasks:newTaskList})\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 putStatusUpdate() {\n\n //assigns Data to the parent div so that I can grab it later\n\n var taskId = $(this).parent().data('id')\n var task = {};\n task.id = taskId;\n\n //This is how I attached my toggle logic without toggle\n\n if ($(this).parent().hasClass('eachTask completed')) {\n\n //Assigns NO is the background color was 'completed' giving the option to redo a task or fix a misclick\n\n task.status = \"NO\";\n } else if ($(this).parent().hasClass('eachTask')) {\n task.status = \"YES\";\n } else {\n console.log(\"Couldn't read task Class\");\n }\n $.ajax({\n type: 'PUT',\n url: '/tasks/status/' + taskId,\n data: task,\n success: function() {\n console.log(\"updated status was posted to db\");\n getTasks();\n },\n error: function() {\n\n console.log('/POST update status didnt work');\n }\n });\n}", "changeTodoStatus(todoID) {\r\n const todoToToggle = todos.find(todo => todo.id === todoID)\r\n\r\n if (todoToToggle) todoToToggle.completed = !todoToToggle.completed\r\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 }", "function updateTask(taskId, taskStatus) {\n let allTasks = JSON.parse(localStorage.getItem(KEY_TASKS) || \"[]\").map(\n (task) => {\n if (task.id === taskId) {\n console.log(\"found\");\n return { ...task, done: taskStatus };\n }\n return task;\n }\n );\n localStorage.setItem(KEY_TASKS, JSON.stringify(allTasks));\n}", "function completeTask(e) {\n\tvar completedListEl = document.getElementById(\"completed-list\");\n\t\n\tvar taskEl = event.target;\n\tvar id = taskEl.id;\n\t\n\t// Find task and update its status\n\tfor (var i = 0; i < tasks.length; i++)\n\t{\n\t\tif (tasks[i].id === id)\n\t\t{\n\t\t\ttasks[i].status = taskStatus.completed;\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t// Move task element from active list to completed list\n\ttaskEl.remove();\n\tcompletedListEl.appendChild(taskEl);\n}", "Done(task) {\n for (let comTask of this.todos) {\n if (comTask.id == task.id) {\n if (task.isChecked == false) {\n comTask.cssClass = \"striket\";\n this.Completed(task);\n }\n else {\n comTask.cssClass = \"\";\n this.PendingTask(task);\n }\n }\n }\n }", "function markComplete(){\n console.log('complete click');\n let taskId = $(this).data(\"id\");\n \n \n $.ajax({\n method:'PUT',\n url: `/todo/${taskId}`,\n }).then(response => {\n console.log('mark complete', taskId);\n getTasks();\n }).catch(error =>{\n alert('Are you sure you did it?', error);\n })\n }", "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}", "function taskCompleted(){\n li.classList.toggle(\"done\");\n }", "function done(task) {\n if (task.checked === false) {\n task.checked = true;\n console.log(`%c${task.text}`, 'text-decoration: line-through');\n }\n\n //Changes order - done at the end\n listOfTasks = listOfTasks.sort((a, b) => {return a.checked - b.checked});\n \n //Saves changes in localStorage\n localStorage.setItem('tasks', JSON.stringify(listOfTasks));\n return listOfTasks;\n}", "updateTask() { \r\n\r\n }", "function toggle(id) {\n listTask.forEach(function(item) {\n if(item.id == id) {\n item.completed = !item.completed;\n };\n });\n\n addToLocalStorage(listTask);\n}", "function completeTask(elem) {\n elem.classList.toggle(check_Icon);\n elem.classList.toggle(uncheck_Icon);\n elem.parentNode.querySelector(\".text\").classList.toggle(lineThrough_Icon);\n\n // updating the list array\n LIST[elem.id].done = LIST[elem.id].done ? false : true;\n}", "function taskCompleted () {\n $(document).on('click', '#confirm', function() {\n var list = $('ul');\n for(var i=0; i<list[0].children.length; i++) {\n if (selectedTaskId === list[0].children[i].id) {\n $('#' + selectedTaskId + '').addClass('completed');\n }\n }\n });\n}", "function toggleTask(id) {\n const newTasks = [...tasks]\n const task = newTasks.find(task => task.id === id)\n task.complete = !task.complete\n setTasks(newTasks);\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}", "changeIsDone(id) {\n\t\tlet tasks = this.getAndParse('tasks');\n\t\tconst idx = tasks.findIndex(task => task.id === id);\n\t\ttasks[idx].isDone = !tasks[idx].isDone;\n\t\tthis.stringifyAndSet(tasks, 'tasks');\n\t\tconsole.log(tasks[idx].isDone);\n\t}", "updateTask(task) {\n return instance.put('todo-lists/tasks', task);\n }", "function taskComplete(item) {\n if (item.target.tagName === \"LI\") {\n item.target.classList.toggle(\"done\");\n }\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 }", "toggleCheckbox(id) {\n this.setState((prevState) => {\n // creates a new object, then maps it to find de equal 'id'\n let updatedTasks = prevState.tasks.map(task => {\n if (task.id === id){\n // Invert its value (true -> false -> true ...)\n task.completed = !task.completed;\n }\n return task;\n });\n // then update its value with the new object updated\n return {\n tasks: updatedTasks\n }\n });\n // console.log('changed', id); // Verify\n \n }", "checkTask(task) {\n const taskArray = [...this.state.tasks];\n const index = taskArray.map(t => t.text).indexOf(task);\n\n taskArray[index].done = !taskArray[index].done;\n\n this.setState({ tasks: taskArray });\n }", "function toggleTodoItem() {\n\n // find the taskbox which is the parent of this button. It contains the data\n const taskBox = $(this).closest('.task-box');\n\n const isComplete = taskBox.data().complete;\n const id = taskBox.data().id;\n\n $.ajax({\n url: `/todo-list/${id}`,\n type: 'PUT',\n data: {complete: isComplete\n }\n }).then(fetchTodoItems);\n \n}", "handleTaskListChange(tasks) {\n this.saveTasks(tasks);\n this.setState({tasks: tasks});\n }", "function upTask(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 //switches positions of current task and task above\n taskAbove = taskArr[taskPosition-2];\n taskCurr = taskArr[taskPosition-1];\n\n taskArr[taskPosition-2] = taskCurr;\n taskArr[taskPosition-1] = taskAbove;\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\n //rechecks boxes\n checksCheckBoxes();\n}", "StartTodoTask(data){\n // Add task to the InProgress List\n const newitem=data\n this.setState({inProgressList:[...this.state.inProgressList,newitem]})\n\n // Remove task from existing Todo List\n const newList=this.state.todoList.filter(task => task.taskid!==data.taskid)\n this.setState({todoList:newList})\n\n // Save in database\n axios.post(\"http://localhost:4000/api/updateTask\",{userName:this.state.userName,taskid:data.taskid,taskType:this.state.Cardtypes.INPROGRESS})\n .then(res=>{\n console.log(res)\n })\n .catch(err=>{\n console.log(err.response)\n })\n }", "function toggleTaskStatus(listItem) {\n const doneList = document.getElementById('task-list-2');\n const notDoneList = document.getElementById('task-list');\n\n\n\n if (listItem.classList.contains('text-secondary')) {\n\n\n\n doneList.removeChild(listItem);\n notDoneList.appendChild(listItem);\n } else {\n notDoneList.removeChild(listItem);\n doneList.appendChild(listItem);\n\n }\n\n\n listItem.classList.toggle('text-secondary');\n\n}", "changeMainTaskStatusWithId(taskId, status) {\n let realm = new Realm({schema: [TaskSchema, SubTaskSchema, NotesSchema]});\n const file = realm.objects('TASK').filtered('id == $0', taskId);\n realm.write(() => {\n file[0].isDone = status;\n });\n this.changeAllSubTaskStatusWithId(taskId, status);\n }", "function markTask(id, status){\r\n let dataSend = \"updateTask=exec&method=2&id=\" + id + \"&complete=\" + status;\r\n return apiReq(dataSend, 3);\r\n}", "static markDone(project, task) {\n const taskDoneBtn = document.querySelector(`#done-project${project.id}-task${task.id}`)\n if (taskDoneBtn) {\n taskDoneBtn.addEventListener('click', () => {\n task.updateDone();\n DomOutput.loadProjectList();\n DomOutput.loadTaskList(project);\n })\n }\n }", "handleToggleTask (id) {\n this.model.toggleTask(id);\n }", "function toggleCompleted(task, event)\n {\n event.stopPropagation();\n task.completed = !task.completed;\n }", "function setTaskValue() {\n const scopeText = document.getElementById('scope-value')\n const activeText = document.getElementById('active-value')\n const successfulText = document.getElementById('successful-value')\n\n scopeText.innerText = `${listTask.length}`\n let arrActive = []\n let arrCompleted = []\n listTask.map(el => {\n if (!el.completed) {\n arrActive.push(el)\n } else if (el.completed) {\n arrCompleted.push(el)\n } else return listTask\n })\n activeText.innerText = `${arrActive.length}`\n successfulText.innerText = `${arrCompleted.length}`\n }", "async function updateTaskStatus(pStatus) {\r\n await taskRef.update({status: pStatus});\r\n console.log(\"Status of \" + task + \"updated to \" + pStatus + \".\");\r\n}", "function setChangeStatus() {\n\n // update status of item\n $(\".item_status\").unbind().click(function() {\n\n var tr = $(this).parent();\n var itemId = tr.attr('id').substring(tr.attr('id').indexOf('-') + 1);\n var newItemStatus = (1 - itemsStatus[itemId]);\n\n $.ajax({\n type: \"PUT\",\n url: \"/item\",\n data: {id: itemId, value: undefined, status: newItemStatus },\n success: function (data)\n {\n if (data['status'] === 0 ) // only upon success we change status of item\n {\n\n var itemsStr;\n $(\"#errorMsg\").html(\"&nbsp;\");\n itemsStatus[itemId] = newItemStatus;\n\n tr.children(\"td:nth-child(1)\").toggleClass(\"item_completed_sign\");\n tr.children(\"td:nth-child(2)\").toggleClass(\"item_completed_content\");\n\n // update the number of total remaining completed and uncompleted tasks\n newItemStatus === 1 ? (++completedItems , --uncompletedItems) : (--completedItems , ++uncompletedItems);\n\n if (completedItems > 0 && uncompletedItems === 0) // all the items were completed\n {\n $('#change_all_statuses').prop('checked',true);\n $(\"#clear_completed\").html(\"Clear completed.\");\n $(\"#clear_completed\").show();\n }\n\n else\n {\n $('#change_all_statuses').prop('checked',false);\n if (completedItems > 0) {\n $(\"#clear_completed\").html(\"Clear completed.\");\n $(\"#clear_completed\").show();\n }\n else {\n $(\"#clear_completed\").hide();\n }\n }\n\n itemsStr = (uncompletedItems === 1) ? 'item left.' : 'items left.';\n $(\"#items_left\").html(\"<strong> \" + uncompletedItems + \" </strong>\" + itemsStr);\n }\n else // request failed\n {\n console.log(\"Unable to update item with id: \" + itemId + \". Reason: \" + data['msg']);\n $(\"#errorMsg\").text(\"Failed to change item status: \" + data['msg']);\n }\n },\n error: function ()\n {\n console.log(\"Unable to update item with id: \" + itemId + \".\");\n $(\"#errorMsg\").text(\"Failed to change item status\");\n }\n });\n });\n}", "function toggleTaskDone (req, res) {\n const { completed } = req.body; \n \n Task.findByIdAndUpdate(\n req.params.uid,\n { $set: { completed: !completed }},\n { new: true })\n .exec((err, task) => {\n if (err) {\n return res.send(`Task wasn\\'t updated`);\n }\n\n\n\n res.json({\n message: !completed ? `Task marked as completed` : `Task marked as incompleted`,\n task\n });\n });\n}", "updateTaskRunning() {\n this.taskRunning = !this.isEmpty;\n }", "function updateTask(task, id){\n API.updateTask(task, id)\n .then(()=>{\n getTasks();\n }).catch();\n }", "function addChecked(task){\n task.addEventListener(\"click\", function(ev){\n if (ev.target.tagName ===\"LI\"){\n ev.target.classList.toggle(\"checked\");\n moveTask(ev.target);\n }\n },false);\n}", "updateDB(task, newStatus) {\n const completedTaskKey = task.key;\n // Updated the task status property in that selected object\n task.taskStatus = newStatus;\n // Update that specific object in firebase\n const dbRefComplete = firebase.database().ref(`${this.props.userId}/${completedTaskKey}`);\n dbRefComplete.update(task);\n }", "function updateTaskList(list) {\n list.forEach(function(user) {\n addItemTask(user);\n });\n}", "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 }", "function isdone(un,bln) {\n let array = JSON.parse(localStorage.getItem(\"tasks\"));\n let arrayFind =array.find((val)=>val.id==un);\n let Idx= array.indexOf(arrayFind);\n array[Idx].isDone = bln;\n localStorage.setItem(\"tasks\",JSON.stringify(array))\n }", "function markTaskAsDone(taskList, index){\n if (index >= 0 && index < taskList.length) {\n taskList[index].done = true;\n }else {\n console.log('Invalid task number');\n }\n}", "toggleTaskVisibility() {\n this.state.task.isVisible = !this.state.task.isVisible;\n this.save();\n }", "function checkTask(e) {\r\n if (e.target.className == \"checkboxTask\") {\r\n\r\n let groupID = e.currentTarget.dataset[\"groupId\"];\r\n let taskID = e.target.parentNode.parentNode.dataset[\"taskId\"];\r\n\r\n // =========================================================\r\n\r\n getGroup(Number(groupID)).then((res) => {\r\n\r\n\r\n if (e.target.checked) {\r\n res.taskCheck(taskID, true)\r\n e.target.parentNode.parentNode.querySelector(\".task input[type='text']\").style.textDecoration = \"line-through\"\r\n\r\n } else {\r\n res.taskCheck(taskID, false)\r\n e.target.parentNode.parentNode.querySelector(\".task input[type='text']\").style.textDecoration = \"\"\r\n }\r\n\r\n updateGroup(res)\r\n rerenderGroupElement(res);\r\n\r\n })\r\n\r\n // =========================================================\r\n\r\n\r\n }\r\n\r\n}", "handleDoneTask_(event) {\n\t\tlet task = this.getTask(event.delegateTarget);\n\n\t\tthis.setState({\n\t\t\tlocked: true\n\t\t});\n\n\t\tWeDeploy.data(this.db.url).update(`${this.db.path}/${task.id}`, {\n\t\t\tdone: !task.done\n\t\t}).then(response => {\n\n\t\t\ttask.done = !task.done;\n\n\t\t\tthis.setState({\n\t\t\t\ttasks: this.tasks,\n\t\t\t\tlocked: false\n\t\t\t});\n\n\t\t\t//message\n\t\t\tthis.toast(this.language.done);\n\n\t\t}).catch(error => {\n\t\t\tconsole.error(error);\n\t\t});\n\t}", "function taskEditStatus(wfstr,wfstat,wfcomment,wfnote,pFlow,pProcess){\n\t//Needs isNull function\n\t//pProcess not coded yet\n\t//\n\tpFlow = isNull(pFlow,\"U\"); //If no flow control specified, flow is \"U\" (Unchanged)\n\tvar dispositionDate = aa.date.getCurrentDate();\n\n\tfor (i in wfObjArray)\n\t{\n \t\tif ( wfstr.equals(wfObjArray[i].getTaskDescription()) )\n\t\t\t{\n\t\t\tvar stepnumber = wfObjArray[i].getStepNumber();\n\t\t\taa.workflow.handleDisposition(capId,stepnumber,wfstat,dispositionDate, wfnote,wfcomment,systemUserObj,pFlow);\n\t\t\tlogDebug(\"Updating Workflow Task: \" + wfstr + \" with status \" + wfstat);\n\t\t\t}\n\t}\n}", "toggleTodoStatus(todoId) {\n TodoService.toggleTodoStatusAsync(todoId);\n\n }", "edit_task(task_id) {\n this.task_to_change = task_id;\n console.log(\"EDIT ? : \", task_id);\n }", "function toggleThisListItem() {\n $(this).toggleClass('completed');\n \n if($(this).hasClass('completed')){\n delCount();\n }else{\n addCount();\n }\n }", "function selectTask(id, listNumber) {\n if($('#check-' + id)[0].checked) {\n tasks.push(id);\n $('.action-btns').show();\n }\n else {\n tasks.splice(tasks.indexOf(id), 1);\n if(tasks.length == 0) $('.action-btns').hide();\n }\n var ids = '';\n tasks.forEach(function(id) {\n ids = ids + id + '_';\n });\n ids = ids.substring(0, ids.length - 1);\n $('#rank-up').attr(\"onclick\", \"rankUp(\" + listNumber + \");\");\n $('#rank-down').attr(\"onclick\", \"rankDown(\" + listNumber + \");\");\n $('#finish-btn').attr(\"href\", \"src/move_task.php?id=\" + ids + \"&list=3&prev=\" + listNumber);\n $('#postpone-btn').attr(\"href\", \"src/move_task.php?id=\" + ids + \"&list=1&prev=\" + listNumber);\n $('#resume-btn').attr(\"href\", \"src/move_task.php?id=\" + ids + \"&list=2&prev=\" + listNumber);\n $('#expire-btn').attr(\"href\", \"src/move_task.php?id=\" + ids + \"&list=4&prev=\" + listNumber); \n $('#delete-btn').attr(\"href\", \"src/delete_task.php?id=\" + ids); \n var userLists = $(\".user-list\");\n for(var i = 0; i < userLists.length; i++) {\n var list = userLists[i];\n var listId = list.id.split(\"-\")[1];\n $('#' + list.id).attr(\"href\", \"src/move_task.php?id=\" + ids + \"&list=\" + listId + \"&prev=\" + listNumber); \n }\n}", "function addToTaskList(name, date, status){\r\n let task = document.createElement('li');\r\n task.classList.add('task');\r\n\r\n let taskActions = document.createElement('div');\r\n taskActions.classList.add('taskActions');\r\n\r\n let editTask = document.createElement('button');\r\n editTask.classList.add('editTask');\r\n editTask.innerHTML = editTaskIcon;\r\n\r\n let removeTask = document.createElement('button');\r\n removeTask.classList.add('deleteTask');\r\n removeTask.innerHTML = removeTaskIcon;\r\n // On click remove task icon, remove task from task list \r\n removeTask.addEventListener('click', removeTaskItem);\r\n\r\n let checkComplete = document.createElement('label');\r\n // check the value of task status, and add checked attribute if needed \r\n (status == 1) ? status = 'checked' : '';\r\n checkComplete.classList.add('checkbox-container', 'taskStatus');\r\n checkComplete.innerHTML = `<input type=\"checkbox\" ${status}/><span class=\"checkmark\"></span>`;\r\n // On click, set taskStatus as completed(1)\r\n checkComplete.querySelector('input').addEventListener('click', setTaskStatus);\r\n\r\n let taskHeading = document.createElement('p');\r\n taskHeading.classList.add('taskName');\r\n taskHeading.innerText = name;\r\n\r\n let taskDescr = document.createElement('p');\r\n taskDescr.classList.add('taskDescr');\r\n //taskDescr.innerText = name;\r\n\r\n taskActions.appendChild(editTask);\r\n taskActions.appendChild(removeTask);\r\n\r\n task.appendChild(checkComplete);\r\n task.appendChild(taskHeading);\r\n task.appendChild(taskDescr);\r\n task.appendChild(taskActions);\r\n\r\n toDoList.appendChild(task);\r\n}", "function updateTaskStatus(src, status) {\n\n // console.log(src.id)\n // console.log(status)\n // console.log(taskid)\n var urlString = window.location.search\n var projectId = window.location.search.slice(1, urlString.length).split('&')[0].split('=')[1]\n\n \n if(!src) {\n console.log(\"Src taskbox not set correctly\")\n return\n }\n \n if(!status) {\n console.log(\"Status was not set correctly\")\n return \n }\n \n var taskid = src.id.split(\"-\")[1]\n\n if(!projectId) {\n console.log(\"ID was not set correctly\")\n return \n }\n\n $.ajax({\n type: 'POST', \n data: {\n 'projectid': projectId, \n 'taskStatus': status,\n 'taskID': taskid\n }, \n url: '../includes/update-task.php' \n })\n .done(function(data) {\n console.log(data)\n })\n .fail(function(data) {\n console.log(data)\n })\n}", "function checkedList() {\n const checkLabel = document.querySelectorAll('.custom-checkbox')\n checkLabel.forEach(label => {\n label.onchange = function (event) {\n event.path.forEach(el => {\n if (el.classList?.contains(listItemClass)) {\n let id = +el.id\n listTask = listTask.map(task => {\n if (task.id === id) {\n task.completed = event.target.checked\n el.remove()\n addTaskToDom(task, task.completed ? completeList : listBlock)\n }\n return task\n })\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n })\n }\n })\n }", "changeStatus(i) {\n const todos = this.state.todos.slice();\n todos[i].status = !todos[i].status;\n\n var checkButton = document.getElementById(i);\n\n if(todos[i].status === true) {\n checkButton.classList.remove(\"btn-success\");\n checkButton.classList.add(\"btn-secondary\");\n } else {\n checkButton.classList.remove(\"btn-secondary\");\n checkButton.classList.add(\"btn-success\");\n }\n\n this.setState({\n todos: todos,\n });\n }", "function updateTaskList(key, ref, old, nw, page) {\n const tasks = page.getViewById(\"tasks\");\n\n tasks.items = db.tasks();\n}", "function moveTask(task){\n if(task.classList.value === \"checked\"){\n myTaskList.completed.push(task);\n var index = myTaskList.incomplete.indexOf(task);\n myTaskList.incomplete.splice(index, 1);\n updateTaskList();\n }\n if(task.classList.value === \"\"){\n myTaskList.incomplete.push(task);\n var index = myTaskList.completed.indexOf(task);\n myTaskList.completed.splice(index, 1);\n updateTaskList();\n }\n}", "function setSubtaskCheck (element) {\n tasks.updateSubtaskCheck(element.closest('.card').prop('id'), element.parent().prop('id'), element.hasClass('check-checked'))\n}", "function bindTaskEvents(taskListItem)\n{\n var editButton = taskListItem.querySelector(\"button.edit\");\n var completeButton = taskListItem.querySelector(\"button.complete\");\n\n editButton.onclick = editTask;\n\n completeButton.onclick = CompleteTask;\n}", "function completeTask()\n {\n var butId=this.id;\n var child = this.parentNode.parentNode;\n var parent = child.parentNode;\n var ID = parent.id;\n var value = child.innerText;\n if (ID == \"taskList\")\n {\n // to move to completed\n obj.taskListArr.splice(obj.taskListArr.indexOf(value), 1);\n obj.taskCompletedArr.push(value);\n this.innerHTML=\"&#10227;\";\n }\n else \n {\n //to be sent to pending again\n obj.taskCompletedArr.splice(obj.taskCompletedArr.indexOf(value), 1);\n obj.taskListArr.push(value);\n this.innerHTML=\"&#10004\";\n }\n \n dataStorageUpdt();\n var target = (ID=='taskList')?document.getElementById('taskListCompleted'):document.getElementById('taskList');\n parent.removeChild(child);\n target.insertBefore(child, target.childNodes[0]);\n }", "'click .toggle-checked'() {\n // Set the checked property to the opposite of its current value\n Meteor.call('tasks.setChecked', this._id, !this.checked);\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 update(todoContent, newsts) {\n var newStatus;\n if(typeof(newsts) === 'undefined') { //set default status from current element\n newStatus = !$(todoContent).hasClass('done');\n }\n else {\n newStatus = newsts;\n }\n\n var id = $(todoContent).attr('id');\n updateStatus('/todo/' + id, newStatus);\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 toggleChecked(){\n \tif (this.checked === true){\n \tthis.parentElement.classList.toggle('checked');\n changeTaskStatus(this.id);\n\t }else{\n\t\tthis.parentElement.classList.remove('checked');\n\t\tchangeTaskStatus(this.id);\n\t }\n\t}", "function markCompletedOrDelete(event) {\r\n let item = event.target; //gets the element that is targeted\r\n\r\n if (item.classList[1] === 'fa-trash') { //if the targeted element is the delete button\r\n\r\n let todoItem = item.parentElement; //the parent div of the delete button which is the whole todo item\r\n\r\n if (todoItem.classList[1] === 'completed') { //if the task was marked completed\r\n completedTasks--; //we need to decrement the completed tasks\r\n completedItem.innerText = 'Completed Tasks : ' + completedTasks; //rendering the updated value\r\n } else { //if the task was not marked completed\r\n pendingTasks--; //we need to decrement the pending tasks\r\n incompleteItem.innerText = 'Pending Tasks : ' + pendingTasks; //rendering the updated value\r\n }\r\n\r\n todoItem.remove(); //finally we remove the item from the list\r\n }\r\n\r\n if (item.classList[0] === 'mark-completed-button') { //if the targeted element is the checkbox\r\n\r\n let todoText = item.parentElement; //this gets the wrapper div of the todo description\r\n let todoItem = item.parentElement.parentElement; //this gets the whole todo item\r\n\r\n todoText.style.textDecoration = 'line-through'; //striking throught the text to mark it completed\r\n todoText.style.color = 'grey'; //changing the font color of the text\r\n item.style.backgroundColor = '#673AB7'; //changing the background color of the checkbox\r\n\r\n pendingTasks--; //decrementing the pending tasks\r\n incompleteItem.innerText = 'Pending Tasks : ' + pendingTasks; //rendering the new value\r\n completedTasks++; //incrementing the completed tasks\r\n completedItem.innerText = 'Completed Tasks : ' + completedTasks; //rendering the new value\r\n\r\n todoItem.classList.add('completed'); //adding completed class to the todo item to mark it as completed\r\n }\r\n\r\n}", "function alterStatus(){\n\tthis.classList.toggle(\"done\");\n}", "changeAllSubTaskStatusWithId(subTaskId, status) {\n let realm = new Realm({schema: [TaskSchema, SubTaskSchema, NotesSchema]});\n const file = realm.objects('SUBTASK').filtered('taskId == $0', subTaskId);\n realm.write(() => {\n for (let i = 0; i < file.length; i++) {\n file[i].isDone = status;\n }\n });\n }", "function toggleComplete(id) {\n\t\tvar updatedComp = [...complete]\n\t\tvar updated = [...todo].map((current) => {\n\t\t\tif (current.id === id) {\n\t\t\t\tcurrent.completed = !current.completed //completes checkmark\n\n\t\t\t\tif (current.completed === true) { //adds completed item to complete list\n\t\t\t\t\tfetch('http://127.0.0.1:3010/completed', {\n\t\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\t\t\tbody: JSON.stringify({ id: current.id, text: current.text, completed: current.completed, tag: current.tag, lastMod: current.lastMod, displayDate: current.displayDate, outOfTime: current.outOfTime, alarm: current.alarm })\n\t\t\t\t\t}).then((resp) => resp.json())\n\t\t\t\t\t\t.then((data) => { console.log(data) });\n\n\t\t\t\t\twindow.location.reload()\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn current\n\t\t})\n\n\t\tupdated.map((item) => {\n\t\t\tif (item.completed === true) {\n\t\t\t\tfetch(`http://127.0.0.1:3010/tasks/${id}`, { //deletes completed item from todo list\n\n\t\t\t\t\tmethod: 'DELETE'\n\t\t\t\t})\n\t\t\t\twindow.location.reload()\n\t\t\t}\n\t\t})\n\t}" ]
[ "0.7744968", "0.76197976", "0.75789", "0.7467579", "0.73939073", "0.7386255", "0.7238165", "0.71934867", "0.71898896", "0.71831065", "0.71822727", "0.7014042", "0.6979668", "0.69684696", "0.6965662", "0.69301486", "0.69209826", "0.6884836", "0.68731713", "0.6864766", "0.6809955", "0.67906505", "0.6790017", "0.6770388", "0.67696977", "0.6747073", "0.67278725", "0.671506", "0.6692961", "0.6681473", "0.66576385", "0.6623897", "0.6601876", "0.659255", "0.65768766", "0.6570236", "0.6567805", "0.65446925", "0.652827", "0.6524663", "0.64974976", "0.64763296", "0.64727795", "0.64705086", "0.64508915", "0.6444147", "0.64425004", "0.64347506", "0.64224964", "0.6391405", "0.636633", "0.63604057", "0.63544786", "0.6343409", "0.63385046", "0.6335002", "0.6326207", "0.6322696", "0.6318933", "0.6307621", "0.63022965", "0.6294533", "0.62770724", "0.6272808", "0.62688994", "0.6261943", "0.6241615", "0.6241459", "0.62403107", "0.6234125", "0.62072223", "0.62014234", "0.6196074", "0.6193378", "0.61884236", "0.61782396", "0.6177347", "0.61616814", "0.61574054", "0.615675", "0.61426604", "0.6142335", "0.6122727", "0.6120497", "0.6115221", "0.61089957", "0.61073506", "0.60987973", "0.60935974", "0.60935545", "0.60676545", "0.6065812", "0.60599065", "0.6044166", "0.6025617", "0.60250986", "0.60235685", "0.6022291", "0.60191625", "0.6010309" ]
0.6825553
20
On Delete Task remove entry from taskList
function removeTask(object) { var task_index = Number(object.getAttribute('task_index')); let id = Math.abs((tasksList.length - 1) - task_index); tasksList = tasksList.filter((val, index) => index != id); const finalData = generateTasksList(); document.getElementById("divTasksList").innerHTML = finalData; console.log(tasksList); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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}", "deleteTask(id) {\n var index = this.list.map(i => i.id).indexOf(id);\n this.list.splice(index, 1);\n ls.deleteItem(id);\n }", "function deleteTask(currentTask) {\n console.log(\"Delete task\");\n console.log(\"---task to be deleted: \" + currentTask.task);\n\n setTasks(\n tasks.filter((task) => {\n // console.log(\"\")\n return task.id !== currentTask.id;\n })\n );\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 }", "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}", "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}", "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 deleteTask(event) {\n\n let idDelete = event.target.getAttribute('data-id')\n\n let keyId = listTask.findIndex(element => {\n if (element.id == idDelete) {\n return element\n }\n })\n\n if (keyId != -1) {\n listTask.splice(keyId, 1)\n saveData()\n }\n\n openModalDel()\n}", "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 }", "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 deleteTask(taskListIndex) {\n\n taskList.splice(taskListIndex, 1);\n\n\n listTasks()\n}", "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 }", "function deleteTask() {\n const buttonDelete = document.querySelectorAll('.button-delete')\n buttonDelete.forEach(button => {\n button.onclick = function (event) {\n event.path.forEach(el => {\n if (el.classList?.contains(listItemClass)) {\n let id = +el.id\n listTask = listTask.filter(task => {\n if (task.id === id) {\n el.remove()\n return false\n }\n return true\n })\n showInfoNoTask()\n }\n })\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n })\n }", "function deleteTask(event) {\n const taskListItem = this.parentNode.parentNode;\n const keyValue = taskListItem.querySelector('input').dataset.key\n taskListItem.parentNode.removeChild(taskListItem);\n\n\n manageTasksAjax(event, '', keyValue, 'delete')\n}", "function deleteTask() {\n this.parentNode.parentNode.removeChild(this.parentNode);\n }", "function deleteTask(id) {\n listTask = listTask.filter(function(item) {\n return item.id != id;\n });\n\n addToLocalStorage(listTask);\n}", "deleteTask(task) {\n const deleteItem = task.key;\n const deleteRef = firebase.database().ref(`${this.props.userId}/${deleteItem}`);\n deleteRef.remove();\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}", "deleteFromList(taskID) {\n let deleted = this.taskArr.find(task => task.id == taskID)\n this.taskArr = this.taskArr.filter(value => value != deleted)\n return this.taskArr\n }", "delete() { all = all.filter(task => task.id !== this.id) }", "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(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 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(id) {\n const updatedTasks = tasks.filter((task) => task.taskId !== id);\n setTasks(updatedTasks);\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 removeTask(elem) {\n elem.parentNode.parentNode.removeChild(elem.parentNode);\n LIST[elem.id].trash = true;\n}", "removeTask(taskId) {\n const dbRef = firebase.database().ref();\n dbRef.child(taskId).remove();\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}", "function deleteTask(tasks, uuid)\n {\n var i = 0;\n console.error('tasks', tasks);\n\n for (; i < tasks.length; i++)\n {\n if (uuid == tasks[i].uuid)\n {\n tasks.splice(i, 1);\n i--;\n }\n }\n return tasks;\n }", "deleteTask(taskId) {\n // Create an empty array and store it in a new variable, newTasks\n const newTasks = [];\n\n // Loop over the tasks\n for (let i = 0; i < this.tasks.length; i++) {\n // Get the current task in the loop\n const task = this.tasks[i];\n\n // Check if the task id is not the task id passed in as a parameter\n if (task.id !== taskId) {\n // Push the task to the newTasks array\n newTasks.push(task);\n }\n }\n\n // Set this.tasks to newTasks\n this.tasks = newTasks;\n }", "function deleteTask() {\n this.parentNode.parentNode.removeChild(this.parentNode);\n}", "function deleteTask(id) {\r\n let Note = document.getElementById(id); \r\n //removes note from page\r\n document.getElementById(\"shoeNotesFromLS\").removeChild(Note); \r\n let indexOfTaskToRemove = tasks.findIndex(task => task.id === id);\r\n //removes from array of tasks\r\n tasks.splice(indexOfTaskToRemove, 1);\r\n //removes from array in local storage\r\n if (tasks.length != 0) {\r\n localStorage.tasks = JSON.stringify(tasks);\r\n }\r\n else {\r\n localStorage.removeItem(\"tasks\");\r\n }\r\n \r\n}", "delete(id, item) {\n this.tasks = this.tasks.filter(task => task.id !== id);\n\n localStorage.setItem(this.storageList, JSON.stringify(this.tasks));\n item.remove();\n }", "function deleteTask(event) {\n //confirm action from used with confirmation alert\n var doDelete = confirm (\"Do you really want to remove selected task?\")\n //if user clicks \"ok\" this returns true and task is removed from the list\n if (doDelete === true) {\n this.parentElement.parentElement.removeChild(this.parentElement);\n } \n //Both done and todo are possible to be removed from list\n this.parentElement.removeEventListener(\"click\", markDone)\n this.parentElement.removeEventListener(\"click\", markTodo)\n //saved into local storage and taskCount is updated\n updateLocalStorage();\n taskCount();\n}", "function removeTask(e){\n // get the parent list item to remove\n var taskItem = e.target.parentElement;\n taskList.removeChild(taskItem);\n}", "function deleteTask(taskId) {\n return TaskModel.remove({_id: taskId});\n }", "function taskDeletor(idel) {\n\t\tconst currentTask = tasks.find( el => el.id == idel);\n\t\tlet taskIndex = tasks.indexOf(currentTask);\n\t\ttasks.splice(taskIndex, 1);;\n\t}", "function deleteTask(a,b) {\r\n taskList.splice(a,3)\r\n return taskList;\r\n\r\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 }", "deleteAllTasks () {\r\n this.eliminatedTask.splice(0, this.eliminatedTask.length);\r\n }", "function deleteTask(projectid, taskid) {\n data.projects[projectid].tasks.splice(taskid, 1);\n }", "function removeTask(task, taskList) {\n newArr = [];\n for (var i = 0; i < taskList.length; ++i) {\n if (task.eID === taskList[i].eID) {\n newArr = taskList.slice(i, i + 1);\n return newArr;\n }\n }\n}", "function removeTask(event) {\n\n let id = event.target.dataset.id;\n let tareaEliminar = event.target.parentNode;\n console.log(tareaEliminar);\n\n tareaEliminar.parentNode.removeChild(tareaEliminar)\n\n //buscar en el array la posicion\n let posicionBorrar = tasks.findIndex(task => {\n return task.titulo == id\n })\n\n console.log(posicionBorrar);\n tasks.splice(posicionBorrar, 1)\n}", "function deleteTask(id) {\n // Delete it in DB\n todoListService\n .deleteTask(id)\n .then((response) => console.log(response))\n .catch((error) => console.error(error));\n\n // Filter out the remaining Tasks based on the task Id\n const remainingTasks = tasks.filter((task) => id !== task.id);\n // Update the state\n setTasks(remainingTasks);\n }", "function deleteTask(task) {\n const params = new URLSearchParams();\n params.append('id', task.id);\n fetch('/delete-task', {method: 'POST', body: params});\n}", "'tasks.remove'(taskId) {\n check(taskId, String);\n\n const task = Tasks.findOne(taskId);\n if (task.private && task.owner !== this.userId) {\n // If the task is private, make sure only the owner can delete it\n throw new Meteor.Error('not-authorized');\n }\n\n Tasks.remove(taskId);\n }", "deleteSubtask(event) {\n\n let idToDelete = event.target.name;\n let subtasks = this.subtasks;\n let subtaskIndex;\n let recordIdToDelete;\n\n this.processing = true;\n\n for (let i = 0; i < subtasks.length; i++) {\n if (idToDelete === subtasks[i].id) {\n subtaskIndex = i;\n }\n }\n\n recordIdToDelete = subtasks[subtaskIndex].recordId;\n\n deleteSubtask({recordId: recordIdToDelete})\n .then(result => {\n if (result) {\n subtasks.splice(subtaskIndex, 1);\n } else {\n }\n })\n .catch(error => console.log(error))\n .finally(() => this.processing = false);\n this.subtasks = event.target.querySelector(refreshSubtaskList);\n }", "deleteTask(givenID){\n var index = this.list.findIndex(function (item) { return item.id === givenID;})\n var deletedTask = theTaskList.list.splice(index,1);\n if (deletedTask.length === 0){\n return -1;\n }\n else{\n return deletedTask[0];\n }\n }", "function removeTask(Event) {\n //Set animation to fade-out\n Event.path[2].style.animationName = \"fade-out\";\n\n //Remove task from the board after 1.6s\n setTimeout(function() {\n Event.path[2].remove();\n }, 1600);\n\n //Remove task from tasks array\n for (var i = 0; i < tasks.length; i++) {\n if (tasks[i].id == Event.target.id) {\n console.log(\n \"*REMOVED* task id: \" + tasks[i].id + \" task title: \" + tasks[i].title\n );\n tasks.splice(i, 1);\n }\n }\n\n //Update the local storage with the new tasks array\n localStorage.setItem(\"task\", JSON.stringify(tasks));\n}", "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 delete_task(e) {\n console.log('delete task btn pressed...');\n e.target.parentElement.remove();\n\n }", "function removeTask(lnk) {\n\tvar id = lnk.href.match(/task=(\\d+)\\&?/)[1];\n\n\tvar index = findId(id);\n\tif(index != -1) {\n\t\thideCurrentTask();\n\t\t\n\t\tvar new_tasks = [];\n\t\tfor(var i=0; i<tasks.length; i++) {\n\t\t\tif(i != index)//Delete the index'th item\n\t\t\t\tnew_tasks.push(tasks[i]);\n\t\t}\n\t\ttasks = new_tasks;\n\t\t\n\t\tif(!tasks.length) {\n\t\t\t$(\"controls\").innerHTML = t(\"There are no more tasks left\");\n\t\t\t\n\t\t} else {\n\t\t\tvar id = tasks[current_task];\n\t\t\tif(id) $(\"task-\"+id).className = \"active\";\n\t\t}\n\t}\n}", "function deleteTaskFromToDoList(event) {\n event.target.parentElement.remove();\n}", "function deleteTask(id){\r\n // Remove from DOM\r\n let item = document.getElementById(id);\r\n item.remove();\r\n\r\n // Remove from backend\r\n let dataSend = \"deleteTask=exec&id=\" + id;\r\n return apiReq(dataSend, 3);\r\n}", "function deleteTaskFromDatabase (taskKey) {\n firebase.database().ref('tasks/' + taskKey + '').remove()\n updateCount()\n}", "function deleteTask (taskId, callback) {\n var taskKey = datastore.key([\n 'Task',\n taskId\n ]);\n\n datastore.delete(taskKey, function (err) {\n if (err) {\n return callback(err);\n }\n\n console.log('Task %d deleted successfully.', taskId);\n return callback(null);\n });\n}", "deleteTask(taskId) {\n // Create an empty array and store it in a new variable, newTasks\n const newTasks = [];\n console.log( `taskId: ${taskId}` );\n\n // Loop over the tasks\n for (let i = 0; i < this.tasks.length; i++) {\n // Get the current task in the loop\n const task = this.tasks[i];\n\n // Check if the task id is not the task id passed in as a parameter\n if (task.id !== taskId) {\n // Push the task to the newTasks array\n newTasks.push(task);\n }\n }\n\n // Set this.tasks to newTasks\n this.tasks = newTasks;\n console.log(this.tasks);\n }", "function deleteTask(key) {\n //Getting task to delete\n let taskToDelete = firebase.database().ref(\"task/\" + key);\n taskToDelete.remove();\n //Calling Function To display Updated Data\n taskList.innerHTML = \"\";\n displayData();\n}", "function delete_task(task_id) {\n fetch(`delete/${task_id}`, {\n method: 'DELETE'\n })\n var task = document.getElementById(`${task_id}`);\n task.remove();\n }", "function deleteTask(e){\n const taskID = document.getElementById('id').value;\n http\n .delete(`http://localhost:3000/Tasks/${taskID}`)\n .then(task=>{\n //clearing field\n ui.clearFiled();\n //showing message\n ui.showAlertMessage('Task deleted','alert alert-warning');\n //getting task\n getTasks();\n })\n}", "function deleteTask(worker, taskId) {\n if (taskId) {\n datastore.deleteTask(taskId);\n worker.port.emit(\"TaskDeleted\", taskId);\n }\n}", "function deleteTask(deleteButton) {\n var task = deleteButton.closest(\"task\");\n var tasks = document.getElementsByTagName(\"task\");\n for (i = 0; i < tasks.length; i++) {\n var currentTask = tasks[i];\n if (currentTask === task) {\n localStorage.removeItem(i);\n task.parentNode.removeChild(task);\n }\n }\n }", "function deleteTask(del){\n\t$.delete(\"http:localhost:8080/deleteTask\",\n\t\tdel,\n\t\tfunction(data, status){\n\t\t});\n}", "function removeTask() {\n var result = confirm('Permanently delete this task?');\n if (result) {\n var values = {};\n values.id = $(this).data('id');\n console.log($(this).data('id'));\n\n $.ajax({\n type: 'POST',\n url: 'task/remove',\n data: values,\n success: function () {\n updateTaskList();\n }\n });\n }\n}", "function delTask(e) {\n e.parentNode.remove()\n}", "function deleteTask(id){\n API.deleteTask(id)\n .then(()=>{\n getTasks();\n }).catch();\n }", "function deleteLS(delItem){\n console.log(\"delete activated\");\n let task;\n if(localStorage.getItem('task') === null)\n {\n task=[];\n }\n else\n {\n task=JSON.parse(localStorage.getItem('task'));\n\n\n }\n\n \n task.forEach(function(tasks,index){\n \n if(delItem.innerHTML === tasks){\n \n\n \n \n task.splice(index,1);\n }\n })\n localStorage.setItem('task',JSON.stringify(task));\n}", "function deleteTask(task) {\n var index;\n index = myTaskArray.indexOf(task);\n if (index > -1) {\n myTaskArray.splice(index, 1);\n console.log(\"Item \" + task + \" has been deleted from the array\");\n }\n else {\n console.log(\"Item \" + task + \" is not in the array\");\n }\n return myTaskArray.length;\n}", "static async removeTask(id) {\n let result = await Task.findOneAndDelete({id}).exec()\n return result\n }", "function clearTasks(e){\n //taskList.innerHTML = '';\n while(taskList.firstChild){\n taskList.removeChild(taskList.firstChild);\n }\n let deletedTasks;\n \n deletedTasks = localStorage.getItem('tasks')\n \n localStorage.setItem('deletedTasks',deletedTasks)\n localStorage.removeItem('tasks')\n //localStorage.clear()\n e.preventDefault()\n}", "function deleteTodoTask(key) {\n const index = todoListArray.findIndex(item => item.id === Number(key));\n const delTodo = {\n deleted: true,\n ...todoListArray[index]\n }\n\n delTodo.deleted = true\n todoListArray = todoListArray.filter(item => item.id !== Number(key));\n showTodoList(delTodo);\n}", "function removeTask(e) {\n if (e.target.classList.contains('remove-task')) {\n e.target.parentElement.remove();\n }\n\n //Remove from Storage \n removeTaskLocalStorage(e.target.parentElement.textContent);\n}", "function deleteTask(task) {\n var index = myArray.indexOf[task];\n myArray.splice(index, 1);\n return myArray.length;\n}", "deleteByTaskId(id, callback) {\n try {\n id = new ObjectID(id)\n } catch (err) {\n callback(null)\n }\n collection.deleteMany({task: id}, callback)\n }", "function deleteTask(el) {\n\tel.parentNode.remove();\n}", "deleteTask(task) {\n const taskArray = [...this.state.tasks];\n const index = taskArray.map(t => t.text).indexOf(task);\n\n taskArray.splice(index, 1);\n\n this.setState({ tasks: taskArray });\n }", "function removeTaskLocalStorage(task) {\n //Get Tasks from storage\n let tasks = getTaskFromStorage();\n\n //Remove the X from the remove button\n\n const taskDelete = task.substring(0, task.length - 1);\n // console.log(taskDelete);\n\n //Look through the all tasks & delete them\n tasks.forEach(function (taskLS, index) {\n if (taskDelete === taskLS) {\n tasks.splice(index, 1);\n }\n });\n\n //Save the new array data to Local Storage\n localStorage.setItem('tasks', JSON.stringify(tasks));\n\n}", "function removeTask(e) {\n if (e.target.parentElement.classList.contains('delete-item')) {\n if (confirm('Are you sure?')) {\n e.target.parentElement.parentElement.remove();\n\n removeTaskFromLocalStorage(Number(e.target.parentElement.parentElement.id.substring(5)))\n }\n }\n}", "function deleteTask(key,element) {\n firebase.database().ref('todoList').child(key).remove();\n element.parentElement.parentElement.remove();\n}", "function removeTaskFromLs(taskItem){\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach((task, index) => {\n if(taskItem.textContent === task){\n tasks.splice(index, 1);\n }\n });\n\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function removeTask(e) {\n\tif (e.target.parentElement.classList.contains('delete-item')) {\n\t\tif (confirm('Are You Sure?')) {\n\t\t\te.target.parentElement.parentElement.remove();\n\t\t\t/*Ako parentElement ima klasu delete-item onda hocu da...*/\n\n\t\t\t//-Remove from LS-//\n\t\t\tremoveTasksFromLocalStorage(e.target.parentElement.parentElement);//Funkcija za brisanje iz LS\n\t\t}\n\t}\n}", "function clearTasks(){\n item.parentNode.removeChild(item);\n }", "function removeTask(e) {\n\te.target.parentElement.parentNode.removeChild(e.target.parentElement);\n}", "function removeTaskLocalStorage(taskItem){\n let taskArrayItem;\n if(localStorage.getItem('savedTasks') === null){\n taskArrayItem = [];\n } else {\n taskArrayItem = JSON.parse(localStorage.getItem('savedTasks'));\n }\n taskArrayItem.forEach(\n function(taskStored, index){\n if(taskStored.task === taskItem){\n taskArrayItem.splice(index, 1);\n // console.log(taskArrayItem);\n }\n }\n );\n\n localStorage.setItem('savedTasks', JSON.stringify(taskArrayItem));\n}", "removeTask(taskId) {\n var temp = this.state.taskArray;\n temp.splice(taskId, 1);\n this.setState({taskArray: temp})\n }", "function removeTask(req, res, next) {\r\n\r\n Task.remove({\r\n task: req.params.task,\r\n owner: owner\r\n }, function(err) {\r\n if (err) {\r\n req.log.warn(err,\r\n 'removeTask: unable to delete %s',\r\n req.params.task);\r\n next(err);\r\n } else {\r\n log.info('Deleted task:', req.params.task);\r\n res.send(204);\r\n next();\r\n }\r\n });\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 }", "handleDeleteTask (id) {\n this.model.deleteTask(id);\n }", "static removeTask(project, task) {\n const qSelector = `#delete-project${project.id}-task${task.id}`\n console.log(qSelector)\n const taskDeleteBtn = document.querySelector(qSelector)\n taskDeleteBtn.addEventListener('click', () => {\n project.removeTask(task);\n DomOutput.loadTaskList(project);\n })\n }", "function removeTask(e) {\n e.currentTarget.parentNode.remove();\n}", "function removeTaskFromStorage(taskItem){\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n tasks.forEach(function(task, i){\n if(taskItem.textContent === task){\n tasks.splice(i, 1);\n }\n })\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function deleteTask($scope, todoToDelete) {\n $http.delete(`/todos/${todoToDelete._id}`).success(response => {\n getLists($scope);\n });\n }", "function delTask(index) {\n let getLocalStorage = localStorage.getItem(\"New Todo\"); // Getting the localstorage\n listArr = JSON.parse(getLocalStorage);\n listArr.splice(index, 1);\n\n localStorage.setItem(\"New Todo\", JSON.stringify(listArr));\n showTasks();\n}", "function deleteTask(id,deleteIds) {\n const path = location.pathname+\"/\"+deleteIds;\n axios.delete(path)\n .then(res => {\n setTasks(prevNotes => {\n return prevNotes.filter((noteItem, index) => {\n return index !== id;\n });\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "deleteTask(task) {\n let containerCard = this.get('taskCard');\n let parentFunc = this.get('deleteTask');\n return parentFunc(task, containerCard);\n }", "function deleteToDo(itemDataKey) {\n var cleanDataKey = parseInt(itemDataKey)\n for (var i = 0; i < newToDoList.length; i++) {\n if (newToDoList[i].taskId === cleanDataKey) {\n newToDoList.splice(i, 1);\n break;\n }\n }\n}", "_onTempDelete(entry) {\n this._removeEntries([entry])\n }", "function remove(){ //removes task from array\n var id = this.getAttribute('id');\n var todos = getTodos();\n todos.splice(id,1);\n todos.pop(task); //removes from array\n localStorage.setItem('todo', JSON.stringify(todos));\n\n show(); //how to display a removed item on screen\n\n return false;\n\n}", "function removeTaskFromLocalStorage(taskItem) {\n // console.log(taskItem.textContent);\n let tasks;\n if (localStorage.getItem(\"tasks\") === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n\n tasks.forEach((task, index) => {\n if (taskItem.textContent === task) {\n tasks.splice(index, 1);\n }\n });\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n}", "deleteTaskById (id) {\n const taskListCopy = [...this.state.tasks];\n let tasksCompleted = this.state.tasksCompleted;\n\n taskListCopy.forEach((taskObj, index) => {\n if(taskObj.id === id) {\n taskListCopy.splice(index, 1);\n tasksCompleted--;\n }\n })\n this.setState( {tasks: taskListCopy, tasksCompleted} );\n }" ]
[ "0.7976981", "0.7909987", "0.788778", "0.7825424", "0.78162783", "0.77812", "0.7768622", "0.77619195", "0.7731133", "0.7730132", "0.772569", "0.7709987", "0.76829433", "0.76593316", "0.76538503", "0.7620478", "0.75577915", "0.7534472", "0.75315106", "0.7492437", "0.74846405", "0.74685365", "0.74558353", "0.7451609", "0.7367667", "0.7363655", "0.73507", "0.73335534", "0.7332866", "0.73316705", "0.73192513", "0.7292281", "0.7284116", "0.72650635", "0.7263747", "0.7213918", "0.72095096", "0.7190112", "0.7186092", "0.7177788", "0.7176332", "0.7154624", "0.714466", "0.713853", "0.71292406", "0.71143556", "0.71083415", "0.7107351", "0.71003205", "0.70937365", "0.7092048", "0.70646125", "0.7056748", "0.7041256", "0.7037661", "0.7032197", "0.70220095", "0.7019494", "0.70148474", "0.7013776", "0.700876", "0.70015126", "0.6986511", "0.69781697", "0.6970402", "0.6966537", "0.69635844", "0.69556904", "0.6938062", "0.69319004", "0.6920647", "0.69024664", "0.68948436", "0.6883783", "0.6876741", "0.68756974", "0.6873089", "0.6858627", "0.6857946", "0.68565345", "0.6853006", "0.6847882", "0.6841985", "0.68348104", "0.68177015", "0.68170094", "0.68165994", "0.68096524", "0.68089753", "0.67868155", "0.67856246", "0.6785348", "0.6760414", "0.67601234", "0.6758691", "0.67583", "0.67574686", "0.67533904", "0.67437375", "0.67428416" ]
0.7057204
52
Dynamically generate(Reverse Order) Todo Tasks List using todoList.
function generateTasksList() { var finalData = ""; if (tasksList.length === 0) { finalData += "<span class='item_list_empty'>No Data Found</span>"; } else { tasksList.slice(0).reverse().map((val, index) => { finalData += "<div class='item_container'>"; finalData += (val.complete) ? ("<input type='checkbox' task_index = '" + index + "' onclick = 'onClickTaskComplete(this);' checked></input>") : ("<input type='checkbox' task_index = '" + index + "' onclick = 'onClickTaskComplete(this);'></input>"); finalData += "<div class='item'>"; finalData += (val.complete) ? ("<label id ='task_label_" + index + "' class=' submited_task item_task' task_index = '" + index + "' >" + val.task + "</label>") : ("<label id ='task_label_" + index + "' class='item_task' task_index = '" + index + "' >" + val.task + "</label>"); finalData += "</div><button id='btn_delete_" + index + "' task_index = '" + index + "' class='btn btn-danger btn_circle' onclick='removeTask(this);'><i class='fa fa-remove'></i></button></div><br/>"; }) } return finalData; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderToDoList() {\n\tif (!data.openTasks.length && !data.doneTasks.length) return; \n\n\tfor (var i=0; i < data.openTasks.length; i++) {\n\t\tvar value = data.openTasks[i]; \n\t\tcreateListElement(value); \n\t}\n\n\tfor (var j=0; j < data.doneTasks.length; j++) {\n\t\tvar value = data.doneTasks[j]; \n\t\tcreateListElement(value, true); \n\t}\n}", "function ToDoList(name) {\n this.name = name;\n this.tasks = [];\n}", "function createListTasks(tasks) {\n const listTasks = document.getElementById(\"list-tasks\");\n for (const task of tasks) {\n const taskNode = createTaskNode(task);\n listTasks.appendChild(taskNode);\n }\n}", "function renderList(new_list = '') {\n let renderTasks = new_list || list;\n taskList.innerHTML = '';\n renderTasks = sortTasks(renderTasks);\n renderTasks.forEach((element) => {\n createElement(element.id, element.title, element.description, element.priority, element.done);\n });\n}", "function renderTasks(){\n todoList.innerHTML = ''\n\n tasks.forEach( task => {\n todoList.appendChild(generateTask(task))\n })\n}", "renderTaskWithList(list, taskName, taskIndex) {\n return <Task taskName={taskName} onDelete={() => list.deleteItem(taskIndex)} onMoveUp={() => list.moveItemUp(taskIndex)} onMoveDown={() => list.moveItemDown(taskIndex)} />\n }", "function archiveTask($scope, todo) {\n let reverse = 0;\n if(todo.isCompleted) {\n reverse = 0;\n }\n else {\n reverse = 1;\n }\n $http.put(`/todos/archive/${todo._id}`, {\n isCompleted: reverse\n }).success(response => {\n todo.isCompleted = reverse;\n getLists($scope);\n });\n }", "renderTaskList(tasks) {\n this.ulTaskList.innerHTML = '';\n this.tasks.tasks.forEach((task, index) => this.createNewLiTodoElementHTML(task, index))\n }", "function makeTodoList(initialTodos) {\n var todos = initialTodos;\n var archived= [];\n return {\n display: function() {\n tmpArray = [];\n for (var i = 0 ; i < initialTodos.length ; i++) {\n tmpArray[i] = displayTodo(initialTodos[i])\n }\n return tmpArray.join('\\n')\n },\n add: function(task, deadline) {\n todos.push(todoFactory(task,deadline));\n },\n complete: function(id){\n for (var i = 0 ; i < todos.length ; i++){\n if (todos[i].id === id){\n todos[i].complete = !todos[i].complete;\n }\n }\n },\n archive : function(){\n for (var i = 0 ; i < todos.length ; i++){\n if(todos[i].complete === true){\n archived.push(todos[i]);\n todos.splice(i,1);\n i--;\n }\n }\n },\n unarchive: function(id){\n var temp=[];\n for (var i in archived){\n if (archived[i].id === id){\n if(id===0){\n todos.unshift(archived[i])\n }else{\n for (var j = 0 ; j <= id ; j++){\n if(archived[i].id>todos[j].id && archived[i].id<todos[j+1].id){\n for (var k=todos.length ; k > j+1 ; k--){\n todos[k]=todos[k-1];\n }\n todos[j+1]= archived[i];\n break;\n }\n }\n }\n archived.splice(i,1);\n break;\n }\n }\n },\n displayArchived: function() {\n tmpArray = [];\n for (var i = 0 ; i < archived.length ; i++) {\n tmpArray[i] = displayTodo(archived[i])\n }\n return tmpArray.join('\\n')\n },\n clearArchived: function() {\n archived = []\n return \"archive cleared\"\n }\n };\n}", "function renderList(tasks){\r\n list.innerHTML=\"\"\r\n for (var i =0 ;i< tasks.length; i++) {\r\n if(tasks[i].isCompleted==false)\r\n list.insertAdjacentHTML(\"beforeend\",`<h3>&bull;${tasks[i].name}&nbsp;&nbsp;&nbsp;<button id=\"t${tasks[i].id}done\">DONE</button>&nbsp;&nbsp;&nbsp;<button id=\"t${tasks[i].id}delete\">DELETE</button></h3>`) \r\n else{\r\n list.insertAdjacentHTML(\"beforeend\",`<h3>&bull;${tasks[i].name}&nbsp;&nbsp;&nbsp;<button id=\"t${tasks[i].id}redo\"style=\"background-color: lightgreen;\">REDO</button>&nbsp;&nbsp;&nbsp;<button id=\"t${tasks[i].id}delete\">DELETE</button></h3>`) \r\n }\r\n }\r\n}", "function createTaskList(object) {\n\n\tfor( let i=0; i<object.length; i++ ) {\n\t\tlet navListItem =\n\t\t\t'<li>' +\n\t\t\t'<a href=\"single.html?task=' + object[i].id + '\">' +\n\t\t\t'<h2 class=\"task-title\">' + object[i].title.rendered + '</h2>' +\n\t\t\t'<div class=\"task-date\">' +\n\t\t\tgetDate(object[i]) +\n\t\t\t'</div>' +\n\t\t\t'<div class=\"task-status\">' + getStatus(object[i].task_status) + '</div>' +\n\t\t\t'</a>' +\n\t\t\t'</li>';\n\n\t\t$('.task-list ul').append(navListItem);\n\t}\n\t$('.main-area').append('<button class=\"more\">Load more tasks</button>');\n\tmorePostsTrigger();\n\n}", "function newInstance(todoList) {\n createTasks = [];\n todoList.forEach(function(todo) {\n var newList = new ToDoList(todo.id, todo.title, todo.urgent, todo.tasks);\n createTasks.push(newList);\n });\n}", "renderUndoneTask() {\n for (let i = 0; i < this.undoneTaskArr.length; i++) {\n const task = new Task(this.undoneTaskArr[i]);\n this.taskListUnDone.appendChild(task.createUndoneTask())\n\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}", "function createTask(event){\nconst li = document.createElement('li');\nconst inputBox = document.getElementById('new-task-description');\nconst list = document.getElementById('tasks');\nli.innerHTML = inputBox.value;\nlist.appendChild(li);\nevent.target.reset()\n}", "function render(typeOflist, typeOfArray) {\n postTandD.style.display = \"none\"\n removeTasks()\n let index = 0;\n let order = 0;\n\n typeOfArray.forEach(t => {\n let list = document.createElement(\"li\");\n list.className = 'list';\n list.setAttribute('data-index', order++);\n list.style.backgroundColor = `${t.color}`;\n let nameAndTrash = document.createElement(\"div\");\n nameAndTrash.className = 'nameAndTrash';\n\n let desc = document.createElement(\"p\");\n desc.setAttribute('onclick', \"updateTask(this)\");\n desc.className = 'desc';\n desc.appendChild(document.createTextNode(`${t.desc}`));\n\n let labelsAndCheck = document.createElement(\"div\");\n labelsAndCheck.className = 'labelsAndCheck';\n\n let nameOfTask = document.createElement(\"h1\");\n nameOfTask.className = 'nameOfTask';\n nameOfTask.appendChild(document.createTextNode(`${t.title}`));\n\n let trash = document.createElement(\"img\");\n trash.className = 'trash';\n trash.setAttribute(\"src\", \"../assets/trash.svg\");\n trash.setAttribute('data-index', index++);\n trash.addEventListener('click', deleteTask);\n\n nameAndTrash.appendChild(nameOfTask);\n nameAndTrash.appendChild(trash);\n\n let labels = document.createElement(\"div\");\n labels.className = 'labels';\n\n let checkbox = document.createElement(\"input\");\n checkbox.className = 'checkbox';\n checkbox.setAttribute(\"type\", \"checkbox\");\n checkbox.addEventListener('click', moveCheckedTask)\n if (typeOflist.getAttribute(\"id\") == \"listOfChecked\") {\n checkbox.setAttribute(\"checked\", \"\")\n checkbox.style.pointerEvents = \"none\"\n }\n\n labelsAndCheck.appendChild(labels);\n labelsAndCheck.appendChild(checkbox);\n\n let timeAndDate = document.createElement(\"div\");\n timeAndDate.className = 'label';\n\n let wordLabel = document.createElement(\"div\");\n wordLabel.className = 'label';\n\n labels.appendChild(timeAndDate);\n labels.appendChild(wordLabel);\n\n let alarm = document.createElement(\"img\");\n alarm.className = 'alarm';\n alarm.setAttribute(\"src\", \"../assets/alarmclock.svg\");\n\n let dataAndTime = document.createElement(\"span\");\n dataAndTime.className = 'dataAndTime';\n dataAndTime.className = 'word';\n dataAndTime.appendChild(document.createTextNode(`${t.date}` + ', ' + `${t.time}`));\n\n timeAndDate.appendChild(alarm);\n timeAndDate.appendChild(dataAndTime);\n\n let labelSpan = document.createElement(\"span\");\n labelSpan.className = 'labelSpan';\n labelSpan.className = 'word';\n labelSpan.appendChild(document.createTextNode(`${t.label}`));\n wordLabel.appendChild(labelSpan);\n\n list.appendChild(nameAndTrash);\n list.appendChild(desc);\n list.appendChild(labelsAndCheck);\n\n typeOflist.insertBefore(list, typeOflist.childNodes[0]);\n });\n\n let dark = Array.from(document.querySelectorAll(\".list , .label , .borderDark , input[checkbox] , .lineBelow , .below\"));\n let currentTheme = document.documentElement.getAttribute(\"data-theme\");\n if (currentTheme === \"dark\") {\n dark.forEach(el => {\n if (!el.classList.contains(\"noborder\"))\n el.classList.add(\"noborder\");\n })\n }\n\n if (Array.isArray(typeOfArray) && typeOfArray.length) {} else {\n createNoTasks()\n }\n}", "function list(toDoList) {\n return [...toDoList].sort(\n (item1, item2) => item1.isCompleted - item2.isCompleted\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 sortlist(ToDoArray) {\n\t\n\temptyList();\n\t\n\t//Sort the list by date\n\tToDoArray.sort(function(a, b) {\n\t\tvar temp1 = a.dueDate.split(\"-\")\n\t\tvar temp2 = b.dueDate.split(\"-\")\n\t\ta = temp1[2] + temp1[1] + temp1[0];\n \tb = temp2[2] + temp2[1] + temp2[0];\n \treturn a>b ? -1 : a<b ? 1 : 0;\n\t});\n\t\n\tToDoArray.reverse(); //reverse the order\n\n\t//Get current date:\n\tvar today = new Date();\n\tvar dd = today.getDate();\n\tvar mm = today.getMonth() + 1;\n\tvar yy = today.getFullYear();\n\n\t//Sort the list by date:\n\tfor (var i = 0; i < ToDoArray.length; i++) {\n\t\tvar temp = ToDoArray[i].dueDate.split(\"-\");\n\t\t\n\t\t//mark overdue todo's\n\t\tif (temp[2] < yy) {\n\t\t\tToDoArray[i].overDue = 1; //(true)\n\t\t} else if (temp[1] < mm && temp[2] == yy) {\n\t\t\tToDoArray[i].overDue = 1;\n\t\t} else if (temp[0] < dd && temp[1] == mm && temp[2] == yy) {\n\t\t\tToDoArray[i].overDue = 1;\n\t\t}\n\t\n\t\t//Fill the all-list\n\t\tvar allTemp = \"<li priority=\" + ToDoArray[i].priority + \" overDue=\" + ToDoArray[i].overDue + \" done=\" + ToDoArray[i].done + \">\" + tostring(ToDoArray[i]) + \"<section class = \\\"todoNO\" + i + \"\\\"><button id = \\\"todoNO\" + i + \"\\\">REMOVE</button></section>\" + \"<section class = \\\"todoDoneNO\" + i + \"\\\">\" + \"<button id = \\\"todoDoneNO\" + i + \"\\\">DONE</button></section>\" + \"<section class = \\\"todoEditNO\" + i + \"\\\">\" + \"<button id = \\\"todoEditNO\" + i + \"\\\">Edit</button></section>\" + \"</li>\"; \n\t\t$(\"#AllList\").append(allTemp);\n\n\t\t//Fill the today-list\n\t\tif (temp[0] == dd && temp[1] == mm && temp[2] == yy) //if day, month and year matches add to the todaylist\n\t\t{\n\t\t\tvar temp = \"<li priority=\" + ToDoArray[i].priority + \" overDue=\" + ToDoArray[i].overDue + \" done=\" + ToDoArray[i].done + \">\" + tostring(ToDoArray[i]) + \"<section class = \\\"todoNO\" + i + \"\\\"><button id = \\\"todoNO\" + i + \"\\\">REMOVE</button></section>\" + \"<section class = \\\"todoDoneNO\" + i + \"\\\">\" + \"<button id = \\\"todoDoneNO\" + i + \"\\\">DONE</button></section>\" + \"<section class = \\\"todoEditNO\" + i + \"\\\">\" + \"<button id = \\\"todoEditNO\" + i + \"\\\">Edit</button></section>\" + \"</li>\"; \n\n\t\t\t$(\"#TodayList\").append(temp);\n\t\t}\n\t\t//Fill the week-list\n\t\tif (temp[0] > dd && temp[0] < dd + 7 && temp[1] == mm && temp[2] == yy) \n\t\t{\n\t\t\tvar temp = \"<li priority=\" + ToDoArray[i].priority + \" overDue=\" + ToDoArray[i].overDue + \" done=\" + ToDoArray[i].done + \">\" + tostring(ToDoArray[i]) + \"<section class = \\\"todoNO\" + i + \"\\\"><button id = \\\"todoNO\" + i + \"\\\">REMOVE</button></section>\" + \"<section class = \\\"todoDoneNO\" + i + \"\\\">\" + \"<button id = \\\"todoDoneNO\" + i + \"\\\">DONE</button></section>\" + \"<section class = \\\"todoEditNO\" + i + \"\\\">\" + \"<button id = \\\"todoEditNO\" + i + \"\\\">Edit</button></section>\" + \"</li>\"; \n\t\t\t\n\t\t\t$(\"#WeekList\").append(temp);\n\t\t}\n\t\t//Fill the month-list\n\t\tif (temp[1] == mm && temp[2] == yy)//if month and year matches add to the monthlist\n\t\t{\n\t\t\tvar temp = \"<li priority=\" + ToDoArray[i].priority + \" overDue=\" + ToDoArray[i].overDue + \" done=\" + ToDoArray[i].done + \">\" + tostring(ToDoArray[i]) + \"<section class = \\\"todoNO\" + i + \"\\\"><button id = \\\"todoNO\" + i + \"\\\">REMOVE</button></section>\" + \"<section class = \\\"todoDoneNO\" + i + \"\\\">\" + \"<button id = \\\"todoDoneNO\" + i + \"\\\">DONE</button></section>\" + \"<section class = \\\"todoEditNO\" + i + \"\\\">\" + \"<button id = \\\"todoEditNO\" + i + \"\\\">Edit</button></section>\" + \"</li>\"; \n\t\t\t\n\t\t\t$(\"#MonthList\").append(temp);\n\t\t}\n\t\t\n\t\t//Dynamically add the onclick event functions for the remove buttons\n\t\tvar tempRemove = \".todoNO\" + i;\n\t\t$(tempRemove).on(\"click\", \"button\", function () {\n\t\t\tvar clickedBtnID = $(this).attr('id').replace(\"todoNO\", \"\"); //get the buttonID clicked so the correct todo can be deleted\n\t\t\tremoveTodo(ToDoArray[clickedBtnID]); //remove todo from server\n\t\t\tToDoArray.splice(clickedBtnID, 1); //remove todo from array\n\t\t\tsortlist(ToDoArray); //sort the list again\n\t\t});\n\t\t\n\t\t//Dynamically add the onclick event functions for the done buttons\n\t\tvar tempDone = \".todoDoneNO\" + i;\n\t\t$(tempDone).on(\"click\", \"button\", function () {\n\t\t\tvar clickedBtnID = $(this).attr('id').replace(\"todoDoneNO\", \"\"); //get the buttonID clicked\n\t\t\tToDoArray[clickedBtnID].done = 1; //set done field true\n\t\t\tsendTodo(ToDoArray[clickedBtnID]); //send updated todo to the server\n\t\t\tsortlist(ToDoArray); //sort the list again\n\t\t});\n\t\t\n\t\t//Dynamically add the onclick event functions for the edit buttons\n\t\tvar tempEdit = \".todoEditNO\" + i;\n\t\t$(tempEdit).on(\"click\", \"button\", function () {\n\t\t\tvar clickedBtnID = $(this).attr('id').replace(\"todoEditNO\", \"\"); //get the buttonID clicked\n\t\t\t\n\t\t\t//Fill the forms with the data of the to be edited todo\n\t\t\tvar desc = $(\"#TaskDescIn input\").val(ToDoArray[clickedBtnID].subject);\n\t\t\tvar ExInfo = $(\"#ExtraInfoIn input\").val(ToDoArray[clickedBtnID].extraInfo);\n\n\t\t\tvar da = $(\"#DateIn input\").val(ToDoArray[clickedBtnID].dueDate);\n\t\t\tvar remD = $(\"#ReminderIn input\").val(ToDoArray[clickedBtnID].reminderDate);\n\t\t\t\n\t\t\t//Set the correct priority button\n\t\t\tif(ToDoArray[clickedBtnID].priority==\"1\")\n\t\t\t{\n\t\t\t\t$(\"#Rood\").removeClass(\"down\");\n\t\t\t\t$(\"#Geel\").removeClass(\"down\");\n\t\t\t\t$(\"#Groen\").addClass(\"down\");\n\t\t\t\tprio = 1;\n\t\t\t}else if(ToDoArray[clickedBtnID].priority==\"2\")\n\t\t\t{\n\t\t\t\t$(\"#Groen\").removeClass(\"down\");\n\t\t\t\t$(\"#Rood\").removeClass(\"down\");\n\t\t\t\t$(\"#Geel\").addClass(\"down\");\n\t\t\t\tprio = 2;\t\t\t\n\t\t\t}else if(ToDoArray[clickedBtnID].priority==\"3\")\n\t\t\t{\n\t\t\t\t$(\"#Groen\").removeClass(\"down\");\n\t\t\t\t$(\"#Geel\").removeClass(\"down\");\n\t\t\t\t$(\"#Rood\").addClass(\"down\");\n\t\t\t\tprio = 3;\n\t\t\t}\n\t\t\t\n\t\t\ttempid = ToDoArray[clickedBtnID].id; //store the id of the to be edited todo\n\t\t\teditId=true; //indicates that editmode is enabled (used to keep track of right ID number)\n\t\t\t\n\t\t\tToDoArray.splice(clickedBtnID, 1); //remove todo from array\n\t\t});\n\t}\n}", "function buildTodoList(todos) {\n $(\"#todoList\").empty();\n var todo = {};\n for (var i = 0; i < todos.length; i++) {\n todo = todos[i];\n var formattedDate = formatDate(todo.due_date);\n var currStatus = todo.status_name;\n var string = '';\n var dueText = \"Due: \";\n if (currStatus === 'Closed') {\n string += '<div class=\"todo closedTodo\"';\n formattedDate = formatDate(todo.done_date);\n dueText = \"Completed: \";\n } else if (checkOverdue(formattedDate) === true) {\n // console.log(currStatus, checkOverdue(formattedDate));\n currStatus = 'Overdue';\n string += '<div class=\"todo overdueTodo\"';\n } else {\n string += '<div class=\"todo\"';\n }\n\n string += ' data-id=' + todo.id + '>';\n string += '<p>';\n string += '<span>' + currStatus + '</span>';\n string += ' \\- ';\n string += todo.description;\n string += '&nbsp-&nbsp' + dueText + '<span>' + formattedDate + '</span>';\n string += '<button type=\"button\" class=\"deleteButton\" name=\"deleteButton\"><i class=\"material-icons\">remove_circle_outline</i></button>';\n string += '<button type=\"button\" class=\"addTwoButton\" name=\"addTwoButton\"><i class=\"material-icons\">exposure_plus_2</i></button>';\n string += '<button type=\"button\" class=\"addOneButton\" name=\"addOneButton\"><i class=\"material-icons\">exposure_plus_1</i></button>';\n string += '<button type=\"button\" class=\"completeButton\" name=\"completeButton\"><i class=\"material-icons\">done</i></button>';\n string += '</p>';\n string += '</div>';\n $(\"#todoList\").append(string);\n\n // console.log('id: ', $(\"#todoList\").children().last().data('id'));\n }\n } // end function buildTodoList", "viewList(list) {\n let appModel=this.model\n if(appModel.getUndoSize()==0){\n document.getElementById('undo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('undo-button').classList.remove('add_list_disabled')\n }\n\n if(appModel.getRedoSize()==0){\n \n document.getElementById('redo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('redo-button').classList.remove('add_list_disabled')\n }\n // WE'LL BE ADDING THE LIST ITEMS TO OUR WORKSPACE\n let itemsListDiv = document.getElementById(\"todo-list-items-div\");\n \n // GET RID OF ALL THE ITEMS\n this.clearItemsList();\n for (let i = 0; i < list.items.length; i++) {\n // NOW BUILD ALL THE LIST ITEMS\n let listItem = list.items[i];\n \n let listItemElement = \"<div id='todo-list-item-\" + listItem.id + \"' class='list-item-card list-item-row'>\"\n + \"<div onclick='changeTodoDesc(\"+ listItem.id+\");' id='todo-list-desc-\"+listItem.id+ \"' class='task-col task-desc' > \" + listItem.description + \"</div>\"\n +\"<div id='todo-list-desc-input-\"+ listItem.id+\"' class='list-item-desc'><input type='text' id='tododescchange-\" + listItem.id + \"' class='list-item-desc-input'value='\"+listItem.description+\"'></input></div>\"\n \n + \"<div id='todo-list-date-\" + listItem.id + \"' class='due-date-col date-text' onclick='changeTodoDate(\"+listItem.id+\")'>\" + listItem.dueDate + \"</div>\"\n + \"<div style='margin-left:21%;display:none;' id='todo-list-date-input-\" + listItem.id + \"' class='due-date-col-input'><input type='date' class='list-item-date-input' value='\"+listItem.dueDate+\"'></input></div>\"\n \n + \"<div onclick='changeStatus(\"+ listItem.id+\");' id='todo-list-status-\" + listItem.id + \"' class='status-col status-text'>\" + listItem.status + \"</div>\"\n + \"<div id='status-col-selector-div-\" + listItem.id + \"' style='display:none;position:absolute;left:63%;margin-top:25px;'><select style='width:140%;background-color:rgb(64,69,78);color:white' id='status-col-selector-\" + listItem.id + \"' onclick='changeStatus(\"+listItem.id+\")''> <option value='complete'>complete</option> <option value='incomplete'>incomplete</option></select></div>\" \n\n + \"<div class='list-controls-col'>\"\n + \" <div id='todo-move-up-\"+ listItem.id + \"' style='margin-top:25px;' class='list-item-control material-icons'>keyboard_arrow_up</div>\"\n + \" <div id='todo-move-down-\"+ listItem.id + \"' style='margin-top:25px;' class='list-item-control material-icons'>keyboard_arrow_down</div>\"\n + \" <div id='todo-close-\"+ listItem.id + \"' style='margin-top:25px;' class='list-item-control material-icons'>close</div>\"\n + \" <div class='list-item-control'></div>\"\n + \" <div class='list-item-control'></div>\"\n + \"</div>\";\n \n itemsListDiv.innerHTML += listItemElement;\n \n }\n \n for (let j = 0; j < list.items.length; j++) {\n let listItem = list.items[j];\n \n document.getElementById('todo-move-up-'+listItem.id).addEventListener('click',function(){\n let item=document.getElementById('todo-list-item-'+listItem.id);\n let itemList=document.getElementsByClassName('list-item-card');\n let itemListArr=[...itemList]\n let prevIndex=itemListArr.indexOf(item)-1\n document.getElementById('add-list-button').classList.add('add_list_disabled')\n item.parentNode.insertBefore(item,itemListArr[prevIndex])\n let index=-1\n for(let i=0;i<list.items.length;i++){\n if(listItem.id==list.items[i].id){\n \n index=i\n break;\n }\n }\n \n appModel.changePositionTransaction(index,index-1,listItem.id)\n if(appModel.getUndoSize()==0){\n document.getElementById('undo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('undo-button').classList.remove('add_list_disabled')\n }\n if(appModel.getRedoSize()==0){\n document.getElementById('redo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('redo-button').classList.remove('add_list_disabled')\n }\n // let temp=list.items[index-1]\n // list.items[index-1]=listItem\n // list.items[index]=temp\n let firstRow=document.getElementsByClassName('list-item-card list-item-row')[0]\n let firstRowIcons=firstRow.getElementsByClassName('list-item-control material-icons')\n firstRowIcons[0].style.pointerEvents='none'\n firstRowIcons[0].style.color='rgb(53,58,68)'\n \n let allRows=document.getElementsByClassName('list-item-card list-item-row')\n for(let i=1;i<allRows.length;i++){\n let allRowIcons=allRows[i].getElementsByClassName('list-item-control material-icons')\n for(let x=0;x<allRowIcons.length;x++){\n allRowIcons[x].style.pointerEvents='all'\n allRowIcons[x].style.color='white'\n }\n }\n let lastRowIcons=document.getElementsByClassName('list-item-card list-item-row')[document.getElementsByClassName('list-item-card list-item-row').length-1].getElementsByClassName('list-item-control material-icons')\n lastRowIcons[1].style.pointerEvents='none'\n lastRowIcons[1].style.color='rgb(53,58,68)'\n })\n document.getElementById('todo-move-down-'+listItem.id).addEventListener('click',function(){\n document.getElementById('add-list-button').classList.add('add_list_disabled')\n let item=document.getElementById('todo-list-item-'+listItem.id);\n let itemList=document.getElementsByClassName('list-item-card');\n let itemListArr=[...itemList]\n let prevIndex=itemListArr.indexOf(item)+2\n item.parentNode.insertBefore(item,itemListArr[prevIndex])\n let index=-1\n for(let i=0;i<list.items.length;i++){\n if(listItem.id==list.items[i].id){\n \n index=i\n break;\n }\n }\n \n appModel.changePositionTransaction(index,index+1,listItem.id)\n if(appModel.getUndoSize()==0){\n document.getElementById('undo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('undo-button').classList.remove('add_list_disabled')\n }\n if(appModel.getRedoSize()==0){\n document.getElementById('redo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('redo-button').classList.remove('add_list_disabled')\n }\n // let temp=list.items[index+1]\n // list.items[index+1]=listItem\n // list.items[index]=temp\n\n let firstRow=document.getElementsByClassName('list-item-card list-item-row')[0]\n let firstRowIcons=firstRow.getElementsByClassName('list-item-control material-icons')\n firstRowIcons[0].style.pointerEvents='none'\n firstRowIcons[0].style.color='rgb(53,58,68)'\n let allRows=document.getElementsByClassName('list-item-card list-item-row')\n for(let i=1;i<allRows.length;i++){\n let allRowIcons=allRows[i].getElementsByClassName('list-item-control material-icons')\n for(let x=0;x<allRowIcons.length;x++){\n allRowIcons[x].style.pointerEvents='all'\n allRowIcons[x].style.color='white'\n }\n }\n let lastRowIcons=document.getElementsByClassName('list-item-card list-item-row')[document.getElementsByClassName('list-item-card list-item-row').length-1].getElementsByClassName('list-item-control material-icons')\n lastRowIcons[1].style.pointerEvents='none'\n lastRowIcons[1].style.color='rgb(53,58,68)'\n })\n document.getElementById('todo-close-'+listItem.id).addEventListener('click',function(){\n document.getElementById('add-list-button').classList.add('add_list_disabled')\n let item=document.getElementById('todo-close-'+listItem.id).parentNode.parentNode\n // let index=-1\n // for(let i=0;i<list.items.length;i++){\n // if(listItem.id==list.items[i].id){\n // index=i\n // break;\n // }\n // }\n \n appModel.removeOldItemTransaction(listItem)\n if(appModel.getUndoSize()==0){\n document.getElementById('undo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('undo-button').classList.remove('add_list_disabled')\n }\n if(appModel.getRedoSize()==0){\n document.getElementById('redo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('redo-button').classList.remove('add_list_disabled')\n }\n item.remove()\n // if list only has 1 item, disable both move up and down \n if(document.getElementsByClassName('list-item-card list-item-row').length==1){\n let firstRow=document.getElementsByClassName('list-item-card list-item-row')[0]\n let firstRowIcons=firstRow.getElementsByClassName('list-item-control material-icons')\n firstRowIcons[1].style.pointerEvents='none'\n firstRowIcons[1].style.color='rgb(53,58,68)'\n }\n let firstRow=document.getElementsByClassName('list-item-card list-item-row')[0]\n let firstRowIcons=firstRow.getElementsByClassName('list-item-control material-icons')\n firstRowIcons[0].style.pointerEvents='none'\n firstRowIcons[0].style.color='rgb(53,58,68)'\n let allRows=document.getElementsByClassName('list-item-card list-item-row')\n for(let i=1;i<allRows[i].length;i++){\n let allRowIcons=allRows[i].getElementsByClassName('list-item-control material-icons')\n for(let x=0;x<allRowIcons.length;x++){\n allRowIcons[x].style.pointerEvents='all'\n allRowIcons[x].style.color='white'\n }\n }\n let lastRowIcons=document.getElementsByClassName('list-item-card list-item-row')[document.getElementsByClassName('list-item-card list-item-row').length-1].getElementsByClassName('list-item-control material-icons')\n lastRowIcons[1].style.pointerEvents='none'\n lastRowIcons[1].style.color='rgb(53,58,68)'\n })\n document.getElementById('todo-list-desc-'+listItem.id).addEventListener('click',function(){\n // let temp= todoLists[0]\n // todoLists[0]=todoLists[index]\n // todoLists[index]=temp\n document.getElementById('add-list-button').classList.add('add_list_disabled') \n let lists=document.getElementById('todo-lists-list').getElementsByClassName('todo_button')\n \n let listsParent=lists[0].parentNode\n let index=-1\n for(let i=0;i<lists.length;i++){\n if(lists[i].id==('todo-list-'+list.id)){\n index=i\n }\n lists[i].style.color=\"rgb(233,237,229)\"\n }\n lists[index].style.color='rgb(255,200,25)'\n listsParent.insertBefore(lists[index],listsParent.firstChild)\n \n })\n document.getElementById('todo-list-desc-input-'+listItem.id).querySelector(\"input\").addEventListener('blur',function(){\n let val=document.getElementById('todo-list-desc-input-'+listItem.id).querySelector(\"input\").value\n if(listItem.description!=val){\n \n appModel.changeTaskTextTransaction(listItem.description,val,listItem.id)\n if(appModel.getUndoSize()==0){\n document.getElementById('undo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('undo-button').classList.remove('add_list_disabled')\n }\n if(appModel.getRedoSize()==0){\n document.getElementById('redo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('redo-button').classList.remove('add_list_disabled')\n }\n }\n listItem.description=val;\n let firstRow=document.getElementsByClassName('list-item-card list-item-row')[0]\n let firstRowIcons=firstRow.getElementsByClassName('list-item-control material-icons')\n firstRowIcons[0].style.pointerEvents='none'\n firstRowIcons[0].style.color='rgb(53,58,68)'\n let allRows=document.getElementsByClassName('list-item-card list-item-row')\n for(let i=1;i<allRows[i].length;i++){\n let allRowIcons=allRows[i].getElementsByClassName('list-item-control material-icons')\n for(let x=0;x<allRowIcons.length;x++){\n allRowIcons[x].style.pointerEvents='all'\n allRowIcons[x].style.color='white'\n }\n }\n let lastRowIcons=document.getElementsByClassName('list-item-card list-item-row')[document.getElementsByClassName('list-item-card list-item-row').length-1].getElementsByClassName('list-item-control material-icons')\n lastRowIcons[1].style.pointerEvents='none'\n lastRowIcons[1].style.color='rgb(53,58,68)'\n document.getElementById('todo-list-desc-'+listItem.id).innerHTML=val;\n document.getElementById('todo-list-desc-input-'+listItem.id).style.display='none';\n document.getElementById('todo-list-desc-'+listItem.id).style.visibility='visible'\n let lists=document.getElementById('todo-lists-list').getElementsByClassName('todo_button')\n let listsParent=lists[0].parentNode\n let index=-1\n for(let i=0;i<lists.length;i++){\n if(lists[i].id==('todo-list-'+list.id)){\n index=i\n }\n }\n \n listsParent.insertBefore(lists[index],listsParent.firstChild)\n });\n document.getElementById('todo-list-date-'+listItem.id).addEventListener('click',function(){\n document.getElementById('add-list-button').classList.add('add_list_disabled')\n let lists=document.getElementById('todo-lists-list').getElementsByClassName('todo_button')\n let listsParent=lists[0].parentNode\n let index=-1\n for(let i=0;i<lists.length;i++){\n if(lists[i].id==('todo-list-'+list.id)){\n \n index=i\n }\n lists[i].style.color=\"rgb(233,237,229)\"\n }\n lists[index].style.color='rgb(255,200,25)'\n listsParent.insertBefore(lists[index],listsParent.firstChild)\n })\n let date=document.getElementById('todo-list-date-input-'+listItem.id)\n date.querySelector('input').addEventListener('blur',function(){\n \n let newDate=date.querySelector(\"input\").value;\n if(listItem.dueDate!=newDate){\n \n appModel.changeDateTransaction(listItem.dueDate,newDate,listItem.id) \n if(appModel.getUndoSize()==0){\n document.getElementById('undo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('undo-button').classList.remove('add_list_disabled')\n }\n if(appModel.getRedoSize()==0){\n document.getElementById('redo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('redo-button').classList.remove('add_list_disabled')\n }\n }\n listItem.dueDate=newDate;\n document.getElementById('todo-list-date-'+listItem.id).innerHTML=newDate;\n document.getElementById('todo-list-date-'+listItem.id).style.visibility='visible';\n date.style.display='none';\n let firstRow=document.getElementsByClassName('list-item-card list-item-row')[0]\n let firstRowIcons=firstRow.getElementsByClassName('list-item-control material-icons')\n firstRowIcons[0].style.pointerEvents='none'\n firstRowIcons[0].style.color='rgb(53,58,68)'\n let allRows=document.getElementsByClassName('list-item-card list-item-row')\n for(let i=1;i<allRows[i].length;i++){\n let allRowIcons=allRows[i].getElementsByClassName('list-item-control material-icons')\n for(let x=0;x<allRowIcons.length;x++){\n allRowIcons[x].style.pointerEvents='all'\n allRowIcons[x].style.color='white'\n }\n }\n let lastRowIcons=document.getElementsByClassName('list-item-card list-item-row')[document.getElementsByClassName('list-item-card list-item-row').length-1].getElementsByClassName('list-item-control material-icons')\n lastRowIcons[1].style.pointerEvents='none'\n lastRowIcons[1].style.color='rgb(53,58,68)'\n });\n let statusSelect=document.getElementById('status-col-selector-'+listItem.id);\n \n for( let i=0;i<statusSelect.options.length;i++){\n \n if(statusSelect.options[i].value==listItem.status){\n statusSelect.selectedIndex=i;\n break;\n }\n }\n let status=document.getElementById('todo-list-status-'+listItem.id);\n \n if(status.innerHTML=='incomplete'){\n status.style.color='rgb(234,145,84)';\n }\n else{\n status.style.color='rgb(142,212,248)';\n }\n let statusDiv=document.getElementById('status-col-selector-div-'+listItem.id);\n status.addEventListener('click',function(){\n document.getElementById('add-list-button').classList.add('add_list_disabled')\n let lists=document.getElementById('todo-lists-list').getElementsByClassName('todo_button')\n let listsParent=lists[0].parentNode\n let index=-1\n for(let i=0;i<lists.length;i++){\n if(lists[i].id==('todo-list-'+list.id)){\n \n index=i\n }\n lists[i].style.color=\"rgb(233,237,229)\"\n }\n lists[index].style.color='rgb(255,200,25)'\n listsParent.insertBefore(lists[index],listsParent.firstChild)\n statusSelect.focus()\n })\n statusSelect.addEventListener('blur',function(){\n \n statusDiv.style.display='none'\n status.style.visibility='visible'\n if(status.innerHTML=='incomplete'){\n status.style.color='rgb(234,145,84)';\n }\n else{\n status.style.color='rgb(142,212,248)';\n }\n })\n statusSelect.addEventListener('click',function(){\n \n let newStatus=statusSelect.value;\n status.innerHTML=newStatus\n //status.style.visibility='visible'\n if(listItem.status!=newStatus){\n \n appModel.changeStatusTransaction(listItem.status,newStatus,listItem.id)\n if(appModel.getUndoSize()==0){\n document.getElementById('undo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('undo-button').classList.remove('add_list_disabled')\n }\n\n if(appModel.getRedoSize()==0){\n \n document.getElementById('redo-button').classList.add('add_list_disabled')\n }\n else{\n document.getElementById('redo-button').classList.remove('add_list_disabled')\n }\n }\n listItem.status=newStatus\n let firstRow=document.getElementsByClassName('list-item-card list-item-row')[0]\n let firstRowIcons=firstRow.getElementsByClassName('list-item-control material-icons')\n firstRowIcons[0].style.pointerEvents='none'\n firstRowIcons[0].style.color='rgb(53,58,68)'\n let allRows=document.getElementsByClassName('list-item-card list-item-row')\n for(let i=1;i<allRows[i].length;i++){\n let allRowIcons=allRows[i].getElementsByClassName('list-item-control material-icons')\n for(let x=0;x<allRowIcons.length;x++){\n allRowIcons[x].style.pointerEvents='all'\n allRowIcons[x].style.color='white'\n }\n }\n let lastRowIcons=document.getElementsByClassName('list-item-card list-item-row')[document.getElementsByClassName('list-item-card list-item-row').length-1].getElementsByClassName('list-item-control material-icons')\n lastRowIcons[1].style.pointerEvents='none'\n lastRowIcons[1].style.color='rgb(53,58,68)'\n })\n \n \n }\n \n }", "function render(todoItems) {\n // const sortedData = todoItems.sortby(['id'])\n const container = document.querySelector('.js-todolist');\n container.innerHTML = '';\n const todoItemsReverse = todoItems.reverse();\n // for (const todoItem of sortedData) {\n for (const todoItem of todoItemsReverse) {\n const div = document.createElement('div');\n div.innerHTML = `\n <article class=\"container box style1 right todoinput\">\n \t\t\t\t<img class=\"image fit\"src=\"images/${todoItem.data.image}\" alt=\"\" />\n \t\t\t\t<div class=\"inner\">\n \t\t\t\t\t<header>\n \t\t\t\t\t\t<h2><a href=\"#/post/${todoItem.id}\">${todoItem.data.title}</a></h2>\n \t\t\t\t\t</header>\n \t\t\t\t\t<p>${todoItem.data.todo}</p>\n \t\t\t\t</div>\n \t\t\t</article>\n\t\t\t `;\n container.appendChild(div);\n };\n }", "function getTaskLists() {\n\n}", "function renderList() {\n //use a for loop to render the list items\n var html = \"\"\n for (let i = 0; i < arr.length; i++) {\n\n if (arr[i].isCompleted) {\n html += `<li class=\"todo-list-item completed\" id=${i}>${arr[i].task}</li>`\n } else {\n html += `<li class=\"todo-list-item\" id=${i}>${arr[i].task}</li>`\n }\n }\n todoList.innerHTML = html\n}", "function todoCreator(todoText, completed) {\n uniqueCounter = uniqueCounter + 1;\n var todoId = 'todo' + uniqueCounter;\n return '<li class=\"list-group-item d-flex\">' +\n ' <div class=\"form-check\" style=\"flex: 1 1 auto;\" onchange=\"toggleComplete(this);maybeHideDeleteAll();\">' +\n ' <input type=\"checkbox\" class=\"form-check-input\" id=\"' + todoId + '\">' +\n ' <label class=\"form-check-label\" for=\"' + todoId + '\">' +\n (completed ? '<del>' + todoText + '</del>' : todoText) +\n ' </label>' +\n ' </div>' +\n ' <button onclick=\"deleteTodo(this);maybeHideDeleteAll();\" class=\"btn btn-secondary btn-sm\">Delete</button>' +\n '</li>';\n}", "function generateToDo (event) {\n event.preventDefault();\n\n const model = JSON.parse(localStorage.model);\n\n const description = document.getElementById('todo-desc').value;\n const priority = document.getElementById('selectbasic').value;\n const dateFromForm = document.getElementById('due-date').value;\n const dueDate = format(new Date(dateFromForm), 'd MMMM yyyy');\n const project = model.projectTracker;\n\n const newToDo = ToDoFactory(description, dueDate, priority, project);\n model.toDoArr.push(newToDo);\n localStorage.model = JSON.stringify(model);\n \n resetAll();\n}", "RenderTaskList() {\n const TaskListElem = document.getElementById('task-list');\n // Vaciamos la lista\n TaskListElem.innerHTML = '';\n this.CurrentProject.tareas.map((task, index) => {\n const taskElem = document.createElement('li');\n taskElem.style.listStyleImage = 'url(/admin-template/krusty-lab/images/handle.png)';\n taskElem.style.cursor = 'grab';\n taskElem.classList.add('m-2');\n\n // Acciones de las tareas\n taskElem.appendChild(this.TaskListActions(task));\n TaskListElem.appendChild(taskElem);\n });\n // Creamos una instancia Sortable\n const SortableTasks = this.Sortable.create(TaskListElem, {\n animation: 150\n });\n console.log(this.CurrentProject.tareas.map(t => t.orden));\n\n }", "function addToDoList(){\n var ulTaskList = document.getElementById(\"toDoTasks\"); \n ulTaskList.innerHTML = \"\";\n \n for (var i =0; i<taskList.length; i++){\n var taskItem = taskList[i];\n var liTaskItem = document.createElement(\"li\");\n \n //Concatenation of phrase//\n liTaskItem.innerHTML = taskItem.person + \" has to \" + taskItem.description + \" which is a/an \" + taskItem.difficulty +\" task\"; ulTaskList.appendChild(liTaskItem);\n \n }\n \n \n \n \n \n}", "reverse() {\n let currentnode = this.head;\n let prevnode = null;\n let nextnode;\n //swap the head and tail\n [this.head, this.tail] = [this.tail, this.head]\n //loop the process, length of list times \n for (let i = 0; i < this.length; i++) {\n //set next-node to current-node's next \n nextnode = currentnode.next;\n //set current-node's next to previous node \n currentnode.next = prevnode;\n //set previous-node to current-node\n prevnode = currentnode;\n // set current node to nextnode\n currentnode = nextnode;\n }\n //return list\n return this\n }", "function listAllTasks() {\n for (var ix = 0; ix < toDoList.length; ix++) {\n console.log(ix + 1 + \": \" + toDoList[ix]);\n }\n}", "createUndoneTask() {\n let taskUndoneItem = document.createElement(\"li\");\n taskUndoneItem.className = \"todo-list__item\";\n taskUndoneItem.innerHTML = `\n <input type=\"text\" class=\"todo-list__value\" disabled value=\"${this.value}\">\n \n <button class=\"todo-list__btn-edit\"><i class=\"far fa-edit\"></i></button>\n <button class=\"todo-list__btn-remove\"><i class=\"far fa-trash-alt\"></i></button>\n <form action=\"/action_page.php\">\n\t\t\t</form> `;\n\n return taskUndoneItem;\n }", "function makeTodoList(initialTodos) {\n todos = initialTodos;\n var new_str = '';\n var archived_arr = [];\n\n return {\n todos : todos,\n display: function() {\n // return reduce(todos,function(acc,element){\n // return acc + displayTodo(element.id) + ' ';\n // })\n var result = '';\n for(var i=0; i < todos.length; i++) {\n result = result + displayTodo(todos[i]['id']) + '\\n';\n } \n return result; \n },\n add: function(task) {\n var todo_adding = todoFactory(task);\n todos.push(todo_adding); \n },\n // complete: function (id){\n // for (var i = 0; i < todos.length; i++) {\n // if(id === todos[i].id){\n // todos[i].complete = true;\n // }\n // } \n // },\n toggleComplete: function (id){\n for (var i = 0; i < todos.length; i++) {\n if(id === todos[i].id){\n todos[i].complete = 'complete';\n }\n } \n },\n clear: function(){\n for (var i = 0; i < todos.length; i++) {\n if(todos[i].complete === 'complete'){\n todos.splice(i, 1);\n }\n } \n },\n archive: function(){\n for (var i = 0; i < todos.length; i++) {\n if(todos[i].complete === 'complete'){\n archived_arr.push(todos[i]);\n }\n } \n return archived_arr;\n },\n unarchive: function(){\n for (var i = 0; i < archived_arr.length; i++) {\n todos.push(archived_arr[i]);\n } \n return todos;\n },\n displayArchived: function(){\n var result = '';\n for (var i = 0; i < archived_arr.length; i++) {\n result = result + archived_arr[i].id+' '+archived_arr[i].task+' '+archived_arr[i].complete+ '\\n';\n } \n return result;\n },\n clearArchived: function(){\n archived_arr = [];\n return archived_arr;\n },\n move: function(from,to) {\n var new_arr = [];\n new_arr.push(todos.splice(from, 1));//[0];\n todos.splice(to, 0, new_arr[0][0]);\n },\n priority: function(){\n todos.sort(function(a, b){\n return b.priority-a.priority})\n }\n };\n}", "async run_todo_list(params){\n this.todolist || await this.instancieTodoList()\n\n const justOpen = !params[1]\n params.shift() // on enlève la commande\n const line = params.join(' ')\n\n // Dans tous les cas, pour le moment, on ouvre la liste des tâches\n this.todolist.open(() => {\n justOpen || this.todolist.createNewTask.call(this.todolist, line)\n })\n}", "function createTask($scope, params, list) {\n if (!list.todo) { return; }\n $http.post('/todos', {\n task: list.todo,\n todoColor: list.color,\n list: list,\n isCompleted: false,\n isEditing: false\n }).success(response => {\n getLists($scope);\n $scope.createTaskInput = '';\n });\n params.createHasInput = false;\n $scope.createTaskInput = '';\n }", "function makeStartingList(){\n for(var i = 0; i<1; i++){\n addListItem( {task: \"Make the list\"});\n addListItem( {task: \"Test the list\"});\n addListItem( {task: \"Pretend to do the list\"});\n }\n}", "function rebuild_to_be_done(data){\n $('#todo-list').empty();\n $('#completed-list').empty();\n // loops throught data to rebuild the todo-list and or completed-list\n for(item in data){\n var taskName = data[item][\"text\"];\n var taskHTML = '<li todo_id=' + data[item]['id']+ ' text=' + data[item][\"text\"] +'><span class=\"done\">%</span>';\n taskHTML += '<span class=\"delete\" todo_id='+ data[item]['id'] +'>x</span>';\n taskHTML += '<span class=\"task\"></span></li>';\n var $newTask = $(taskHTML);\n $newTask.find('.task').text(taskName);\n $newTask.hide();\n if (data[item]['complete'] == false){\n // todo item\n $('#todo-list').prepend($newTask);\n $newTask.show('clip',250).effect('highlight',1000);\n } else {\n // build complete items\n $('#completed-list').prepend($newTask);\n $newTask.show('clip',250).effect('highlight',1000);\n }\n }\n }", "function renderTaskList( lists ){\n // empty DOM to update after each input\n $('#viewList').empty();\n\n // loop through list for DB values\n for (let i = 0; i < lists.length; i++) {\n let list = lists[i];\n // append to DOM each task added to list\n $('#viewList').append(`\n <tr>\n <td>${list.task}</td>\n <td class=\"update\">\n ${list.completed}\n <button class=\"checkTask btn btn-success\" data-id=\"${list.id}\">Completed!</button>\n </td>\n <td><button class=\"deleteBtn btn btn-secondary\" data-id=\"${list.id}\">Delete</button></td>\n </tr>\n `);\n } // end for loop\n} // end renderTaskList", "function renderActiveToDos(list) {\n const toDoTarget = document.getElementById(\"to-do-target\");\n const template = document.getElementsByTagName(\"template\")[1];\n clearTarget(toDoTarget);\n\n list.forEach((obj, index) => {\n const clone = template.content.cloneNode(true);\n const done = clone.querySelector(\".done\");\n const listItem = clone.querySelector(\".list-item\");\n const flag = clone.querySelector(\".flag\");\n const deleteItem = clone.querySelector(\".delete\");\n\n toDoTarget.appendChild(clone);\n\n done.addEventListener(\"click\", (event) => {\n obj.done ? (obj.done = false) : (obj.done = true);\n listItem.classList.contains(\"strikethrough\")\n ? listItem.classList.remove(\"strikethrough\")\n : listItem.classList.add(\"strikethrough\");\n });\n\n listItem.textContent = list[index].name;\n if (obj.done) {\n listItem.classList.add(\"strikethrough\");\n }\n if (obj.flag) {\n listItem.classList.add(\"flagged\");\n }\n\n flag.addEventListener(\"click\", (event) => {\n event.preventDefault();\n obj.flag ? (obj.flag = false) : (obj.flag = true);\n listItem.classList.contains(\"flagged\")\n ? listItem.classList.remove(\"flagged\")\n : listItem.classList.add(\"flagged\");\n });\n\n deleteItem.addEventListener(\"click\", (event) => {\n event.preventDefault();\n list.splice(index, 1);\n renderActiveToDos(list);\n });\n\n const newListItem = toDoTarget.childNodes;\n });\n}", "function displayList() {\n // Variable to keep count of active tasks\n let actives = 0;\n\n // Make sure that toDos has values\n if(toDos !== null) {\n // Variable to hold list elements to be added\n let elements = \"\";\n\n // Loop through the array to create elements based on each object, also set the style\n // for text decoration if the task is completed.\n for (let i = 0; i < toDos.length; i++) {\n if (toDos[i].completed)\n elements += `<li id=\"${toDos[i].id}\" style=\"text-decoration: line-through;\">\n <input type=\"checkbox\" name=\"tasks\" checked/>${toDos[i].content} \n <button class=\"remove\">X</button></li>`;\n else\n elements += `<li id=\"${toDos[i].id}\"><input type=\"checkbox\" name=\"tasks\"/> \n ${toDos[i].content} <button class=\"remove\">X</button></li>`;\n actives++;\n }\n // Update the html with list items and # of active tasks\n document.querySelector(\"#list\").innerHTML = elements;\n document.querySelector('#tally').innerHTML = `&nbsp;|&nbsp;&nbsp;${actives} tasks left`;\n }\n else\n document.querySelector('#tally').innerHTML = `&nbsp;|&nbsp;&nbsp;0 tasks left`;\n}", "function renderTodoList () {\n if (!data.todo.length && !data.done.length) return;\n for (var i=0;i<data.todo.length;i++){\n addItemList(data.todo[i], 'todo');\n }\n for (var j=0;j<data.done.length;j++){\n addItemList(data.done[j], 'done');\n }\n\n}", "function renderTask(listTask) {\n ulList.innerHTML = '';\n\n listTask.forEach(function(item) {\n //check if the task is completed or not\n const checked = item.completed ? 'checked': null;\n\n const li = document.createElement('li');\n //set a class to the li\n li.setAttribute('class', 'task');\n //gives the li a id\n li.setAttribute('data-key', item.id);\n\n \n //it creates the li markup\n li.innerHTML = \n `<input type=\"checkbox\" class=\"checkbox\" ${checked}>\n <span>- ${item.name}</span>\n <i class=\"far fa-trash-alt delete-button\"></i>`;\n\n //if the task is completed, it add a line through\n if(item.completed === true) {\n li.children[1].classList.add('strike');\n }\n\n //add task inside ul\n ulList.append(li)\n\n });\n}", "function addToDo() {\n let tasks = document.getElementById('tasks')\n let newTask = document.createElement('li')\n let lastTask = tasks.appendChild(newTask)\n lastTask.innerHTML = document.getElementById('new-task-description').value;\n }", "function addToTaskList(name, date, status){\r\n let task = document.createElement('li');\r\n task.classList.add('task');\r\n\r\n let taskActions = document.createElement('div');\r\n taskActions.classList.add('taskActions');\r\n\r\n let editTask = document.createElement('button');\r\n editTask.classList.add('editTask');\r\n editTask.innerHTML = editTaskIcon;\r\n\r\n let removeTask = document.createElement('button');\r\n removeTask.classList.add('deleteTask');\r\n removeTask.innerHTML = removeTaskIcon;\r\n // On click remove task icon, remove task from task list \r\n removeTask.addEventListener('click', removeTaskItem);\r\n\r\n let checkComplete = document.createElement('label');\r\n // check the value of task status, and add checked attribute if needed \r\n (status == 1) ? status = 'checked' : '';\r\n checkComplete.classList.add('checkbox-container', 'taskStatus');\r\n checkComplete.innerHTML = `<input type=\"checkbox\" ${status}/><span class=\"checkmark\"></span>`;\r\n // On click, set taskStatus as completed(1)\r\n checkComplete.querySelector('input').addEventListener('click', setTaskStatus);\r\n\r\n let taskHeading = document.createElement('p');\r\n taskHeading.classList.add('taskName');\r\n taskHeading.innerText = name;\r\n\r\n let taskDescr = document.createElement('p');\r\n taskDescr.classList.add('taskDescr');\r\n //taskDescr.innerText = name;\r\n\r\n taskActions.appendChild(editTask);\r\n taskActions.appendChild(removeTask);\r\n\r\n task.appendChild(checkComplete);\r\n task.appendChild(taskHeading);\r\n task.appendChild(taskDescr);\r\n task.appendChild(taskActions);\r\n\r\n toDoList.appendChild(task);\r\n}", "function createTodoListItem(todo) {\n // var checkbox = document.createElement('input');\n // checkbox.className = 'toggle';\n // checkbox.type = 'checkbox';\n // checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var label = document.createElement('label');\n label.innerHTML = todo.title;\n //label.addEventListener('dblclick', todoDblClicked.bind(this, todo));\n\n // var deleteLink = document.createElement('button');\n // deleteLink.className = 'destroy';\n // deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n // divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n // divDisplay.appendChild(deleteLink);\n\n // var inputEditTodo = document.createElement('input');\n // inputEditTodo.id = 'input_' + todo._id;\n // inputEditTodo.className = 'edit';\n // inputEditTodo.value = todo.title;\n // inputEditTodo.addEventListener('keypress', todoKeyPressed.bind(this, todo));\n // inputEditTodo.addEventListener('blur', todoBlurred.bind(this, todo));\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n // li.appendChild(inputEditTodo);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n}", "static renderTasks(tasks) {\n const todoList = document.getElementById(\"taskList\");\n let view = \"\";\n\n tasks.forEach(t => {\n let checked = t.completed ? \"checked\" : \"\";\n let classDone = t.completed ? \"done\" : \"\";\n // console.log(t.id + ' checked: ' + checked + ' ' + t.completed);\n view += `<li id='${t.id}' class='show ${classDone}'>\n <input type='checkbox'\n id='cb_${t.id}' onclick='checkTask(this.id)'${checked}/>\n <p>${t.content}</p>\n <a id='a_${t.id}' href='#' onclick='deleteTask(this.id)'> X </a> \n </li>`;\n });\n todoList.innerHTML = view;\n }", "function showTasks(){\n let getLocalStorage = localStorage.getItem(\"New Todo\");\n if (localStorage == null) {\n listArr = [];\n }else{\n listArr = JSON.parse(getLocalStorage);\n }\n const pendingNumber = document.querySelector(\".pendingNumber\");\n pendingNumber.textContent = listArr.length // passing the length value in pendingNumber \n if (listArr.length > 0){ // if array length is greater than 0 \n deleteAllBtn.classList.add(\"active\"); // active the clear all button\n }else{\n deleteAllBtn.classList.remove(\"active\"); // unactive the clear all button\n }\n let newLiTag = '';\n listArr.forEach((element , index) => {\n newLiTag += `<li>${element}<span onclick = \"deleteTask(${index})\";><i class=\"fas fa-trash\"></i></span></li>`\n });\n\n todoList.innerHTML = newLiTag; // adding new li tag inside ul tag \n inputBox.value = \"\"; // once task added leave the input field balnk\n }", "function showTask() {\n let xyz = localStorage.getItem(\"completed\");\n if (xyz == null) {\n listArr1 = [];\n } else {\n listArr1 = JSON.parse(xyz);\n }\n let getLocalStorage = localStorage.getItem(\"New Todo\");\n if (getLocalStorage == null) {\n listArr = [];\n } else {\n listArr = JSON.parse(getLocalStorage);\n }\n const pendingTasksNumb = document.querySelector(\".pendingTasks\");\n pendingTasksNumb.textContent = listArr.length;\n if (listArr.length > 0 || listArr1.length > 0) {\n deleteAllbtn.classList.add(\"active\");\n } else {\n deleteAllbtn.classList.remove(\"active\");\n }\n let newLiTag = \"\";\n listArr.forEach((element, index) => {\n newLiTag += `<li> ${element}<button onclick=\"deleteTask(${index})\"><i class=\"fas fa-trash\"></i></button> \n <button onclick=\"Task(${index})\"><i class=\"fas fa-check\"></i></button></li>`;\n });\n let newLi = \"\";\n listArr1.forEach((element, index) => {\n newLi += `<li>${element}<button onclick=\"deleteTask1(${index})\"><i class=\"fas fa-trash\"></i></button></li>`\n });\n completed.innerHTML = newLi;\n todoList.innerHTML = newLiTag;\n inputBox.value = \"\";\n}", "renderDoneTask() {\n for (let i = 0; i < this.doneTaskArr.length; i++) {\n const task = new Task(this.doneTaskArr[i]);\n this.taskListDone.appendChild(task.createDoneTask());\n };\n }", "function getTasks() {\n let makeLi;\n if (localStorage.getItem('tasks') === null) {\n makeLi = []\n } else {\n makeLi = JSON.parse(localStorage.getItem('tasks'))\n }\n let item = ''\n for (let j = 0; j < makeLi.length; j++) {\n item = makeLi[j]\n let li = document.createElement('li')\n li.className = 'collection-item'\n let liT = document.createTextNode(item)\n let a = document.createElement('a')\n a.className = 'delete-item secondary-content'\n let i = document.createElement('i')\n i.className = 'fa fa-remove'\n li.appendChild(a)\n a.appendChild(i)\n li.appendChild(liT)\n taskList.appendChild(li)\n //intitialize task\n //check if there is any tasks in LS\n //if tasks === null then tasks = []\n //else tasks = the array from LS\n //loop in tasks array\n //for every item create list item\n //the text is the task\n }\n}", "function addTask(list) {\n console.log(task);\n createList(task).then((data) => {\n if (data.error) {\n console.log(data.error);\n } else {\n console.log(data.data);\n setItems((prevValues) => {\n return [...prevValues, data.data];\n });\n setTask('');\n }\n });\n }", "function getTaskList(indice) \n{\n RMPApplication.debug(\"begin getTaskList\");\n c_debug(dbug.task, \"=> getTaskList\");\n id_index.setValue(indice);\n var query = \"parent.number=\" + var_order_list[indice].wo_number;\n\n var options = {};\n var pattern = {\"wm_task_query\": query};\n c_debug(dbug.task, \"=> getTaskList: pattern = \", pattern);\n id_get_work_order_tasks_list_api.trigger(pattern, options, task_ok, task_ko);\n RMPApplication.debug(\"end getTaskList\");\n}", "function renderToDos() {\n// let toDos = loadFromLocalStorage();\n ul.innerHTML = \"\";\n for(todo of toDos){\n // Checkbox (when clicked will cross out the text)\n const newCheckBox = document.createElement(\"input\");\n newCheckBox.setAttribute(\"type\", \"checkbox\");\n // task\n const newLi = document.createElement(\"li\");\n // Remove Button (when clicked will remove entire todo)\n const newRemoveBtn = document.createElement(\"button\");\n\n // todo is the object within the array toDos, todo has a key(task) and status set to false\n newLi.innerText = todo.task;\n newRemoveBtn.innerText = \"x\";\n newRemoveBtn.setAttribute(\"id\",\"removeBtn\");\n\n newLi.prepend(newCheckBox);\n newLi.append(newRemoveBtn);\n ul.append(newLi);\n\n // monitor the status of each todo\n if (todo.done) {\n newCheckBox.checked = todo.done;\n newCheckBox.classList.add(\"crossOut\");\n }\n }\n}", "function renderTask(task) {\n // Create HTML elements\n let item1 = document.createElement(\"li\");\n item1.innerHTML = \"<p>\" + task.taskDescription + \"</p>\";\n tasklist.appendChild(item1);\n let item2 = document.createElement(\"li\");\n item2.innerHTML = \"<p>\" + task.dueDate + \"</p>\";\n tasklist.appendChild(item2);\n let item3 = document.createElement(\"li\");\n item3.innerHTML = \"<p>\" + task.estimatedTime + \"</p>\";\n tasklist.appendChild(item3);\n let item4 = document.createElement(\"li\");\n item4.innerHTML = \"<p>\" + task.priorityRating + \"</p>\";\n tasklist.appendChild(item4);\n let item5 = document.createElement(\"li\");\n tasklist.appendChild(item5);\n // Extra Task DOM elements\n let delButton = document.createElement(\"button\");\n let delButtonText = document.createTextNode(\"Delete Task\");\n delButton.appendChild(delButtonText);\n item5.appendChild(delButton);\n // Event Listeners for DOM elements\n delButton.addEventListener(\"click\", function(event) {\n event.preventDefault();\n item1.remove();\n item2.remove();\n item3.remove();\n item4.remove();\n item5.remove();\n delButton.remove();\n });\n // Clear the input form \n form.reset();\n}", "function getTasks(e) {\n let storedTasks;\n if (localStorage.getItem('tasks') != null) {\n taskList.innerHTML = '';\n storedTasks = JSON.parse(localStorage.getItem('tasks')).sort();\n storedTasks.forEach(function(task){\n // Generate new list item based on the task form input value\n // Class names are set according to the materializecss framework\n const listItem = document.createElement('li');\n listItem.className = 'collection-item';\n listItem.setAttribute('title', 'New Item');\n listItem.appendChild(document.createTextNode(task));\n\n // Create link element within the list item to facilitate its removal\n const listItemLink = document.createElement('a');\n listItemLink.className = 'delete-item secondary-content';\n listItemLink.setAttribute('href', '#');\n listItemLink.innerHTML = '<i class=\"fas fa-times\"></i>';\n listItem.appendChild(listItemLink);\n\n // Finally append the list element, complete with its link, to the list\n // so it is rendered by the browser. Also store the task in local storage\n taskList.appendChild(listItem);\n });\n }\n}", "function tasks()\r\n{\r\n let getLocalStorage = localStorage.getItem(\"New Todo\"); //getting local storage\r\n if(getLocalStorage == null) //if local storage is null\r\n {\r\n listArray = []; //create blank array\r\n }\r\n else\r\n {\r\n listArray = JSON.parse(getLocalStorage); //transforming json string into js object\r\n }\r\n const num_tasks = document.querySelector(\".num_tasks\");\r\n num_tasks.textContent = listArray.length; // passing length value of array to num_tasks \r\n let newLiID = '';\r\n // if array length is greater than 0 -> active deleteTasks button\r\n if(listArray.length > 0)\r\n {\r\n deleteTasksButton.classList.add(\"active\");\r\n }\r\n else\r\n {\r\n deleteTasksButton.classList.remove(\"active\");\r\n }\r\n listArray.forEach((element, index) => {\r\n newLiID += `<li> ${element} <span onclick = \"deleteTask(${index})\"; ><i class=\"fas fa-trash\"></i></span></li>`;\r\n \r\n });\r\n todolist.innerHTML = newLiID; // adding new li id inside ul\r\n inputBox.value = \"\"; //once task added -> leave input field blank \r\n}", "render() {\n var todoEntries = this.props.entries;\n var listItems = todoEntries.map(this.createTasks);\n\n return(\n <ul className=\"theList\">\n <FlipMove duration={250} easing=\"ease-out\">\n {listItems}\n </FlipMove>\n </ul>\n );\n }", "generateTasksLists() {\n switch (this.props.selectedTaskType) {\n case 'ongoing':\n return this.props.ongoingTaskList;\n case 'overdue':\n return this.props.overdueTaskList;\n case 'completed':\n return this.props.completedTaskList;\n default:\n return null;\n }\n }", "function showTasks() {\n let getLocalStorage = localStorage.getItem(\"New Todo\"); //getting local storage\n if (getLocalStorage === null) {\n listArr = [];\n } else {\n listArr = JSON.parse(getLocalStorage);\n }\n const pendingNumb = document.querySelector('.pendingNumb');\n if (listArr.length > 0) { //if array length is greater than 0\n deleteAllBtn.classList.add(\"active\"); //active clear button\n } else {\n deleteAllBtn.classList.remove(\"active\"); //unactive clear button\n }\n pendingNumb.textContent = listArr.length; //padding the length value in pending\n let newLiTag = '';\n listArr.forEach((element, index) => {\n newLiTag += `<li><b>${element}</b><span onclick=\"deleteTask(${index})\";><i class=\"fas fa-trash\"></i></span></li>`;\n });\n todoList.innerHTML = newLiTag; //adding new li tag inside ul \n inputBox.value = ''; //once added input field will be blank\n}", "function getTodos() {\n checksaveTodos();\n todos.forEach(function(todo) {\n var newList = document.createElement('li');\n newList.classList.add(\"list-item\");\n newList.innerHTML = `${todo}`;\n unList.append(newList);\n var icon = document.createElement('i');\n icon.setAttribute(\"class\", \"fas fa-trash\");\n newList.appendChild(icon);\n })\n pendingItem(todos);\n}", "function addHTMLTodos(todo) {\n\tincompleteTasksList.innerHTML = \"\";\n\tfor (let i = 0; i < todo.length; i++) {\n\t\tlet node = document.createElement(\"li\");\n\t\tnode.setAttribute(\"class\", `\"item\"`);\n\t\tnode.setAttribute(\"dataKey\", todo[i].id);\n\t\tnode.setAttribute(\"update-key\", `\"item${i}\"`);\n\t\tnode.innerHTML =\n\t\t\t`\n <input type=\"checkbox\" class=\"checkbox\" id=\"${i}\" onclick=completeTasks(` +\n\t\t\ttodo[i].id +\n\t\t\t`,` +\n\t\t\ti +\n\t\t\t`)>\n <small>Task Added: ${todo[i].date}</small>\n <span><input type=\"text\" id=\"item${i}\" class=\"myinput\" value=\"${todo[i].name}\" disabled \"/> </span>\n <button class=\"btn btn-warning updateBtn\" id=\"btn${i}\" onclick=editItem(` +\n\t\t\ti +\n\t\t\t`)>Edit</button>\n <button class=\"btn btn-danger deleteBtn\">Delete</button>\n <br/>\n <hr/>\n `;\n\t\t// Append the element to the DOM as the last child of the element\n\t\tincompleteTasksList.append(node);\n\t}\n}", "function addTaskToToDoList() {\n if (task.value.length > 0) {\n var newTask = document.createElement(\"li\");\n var finalTask = document.createElement(\"label\");\n var taskToBeAdded = void 0;\n if (isCat(task.value)) {\n taskToBeAdded = new CatTask(task.value, \"https://breakbrunch.com/wp-content/uploads/2019/06/cute-cat-with-big-eyes-041619-1.jpg\");\n var img = document.createElement(\"img\");\n img.src = taskToBeAdded.url;\n img.height = 30;\n img.width = 30;\n newTask.appendChild(img);\n }\n else {\n taskToBeAdded = new NormalTask(task.value, false);\n var checkbox = document.createElement(\"input\");\n checkbox.type = \"checkbox\";\n checkbox.className = \"todo-check\";\n checkbox.addEventListener(\"click\", tickDoneOnToDoList);\n newTask.appendChild(checkbox);\n }\n finalTask.appendChild(document.createTextNode(taskToBeAdded.text));\n finalTask.className = \"todo\";\n newTask.appendChild(finalTask);\n var newDeleteButton = document.createElement(\"button\");\n newDeleteButton.appendChild(document.createTextNode(\"delete\"));\n newDeleteButton.className = \"btn btn-outline-warning\";\n newDeleteButton.setAttribute(\"id\", \"delete\");\n newDeleteButton.addEventListener(\"click\", deleteTaskFromToDoList);\n newTask.appendChild(newDeleteButton);\n newTask.appendChild(document.createElement(\"BR\"));\n newTask.appendChild(document.createElement(\"BR\"));\n todoList.appendChild(newTask);\n task.value = \"\";\n }\n}", "function createTodoListItem(todo) {\n var checkbox = document.createElement('input');\n checkbox.className = 'toggle';\n checkbox.type = 'checkbox';\n checkbox.addEventListener('change', checkboxChanged.bind(this, todo));\n\n var label = document.createElement('label');\n label.appendChild( document.createTextNode(todo.title));\n label.addEventListener('dblclick', todoDblClicked.bind(this, todo));\n\n var deleteLink = document.createElement('button');\n deleteLink.className = 'destroy';\n deleteLink.addEventListener( 'click', deleteButtonPressed.bind(this, todo));\n\n var divDisplay = document.createElement('div');\n divDisplay.className = 'view';\n divDisplay.appendChild(checkbox);\n divDisplay.appendChild(label);\n divDisplay.appendChild(deleteLink);\n\n var inputEditTodo = document.createElement('input');\n inputEditTodo.id = 'input_' + todo._id;\n inputEditTodo.className = 'edit';\n inputEditTodo.value = todo.title;\n inputEditTodo.addEventListener('keypress', todoKeyPressed.bind(this, todo));\n inputEditTodo.addEventListener('blur', todoBlurred.bind(this, todo));\n\n var li = document.createElement('li');\n li.id = 'li_' + todo._id;\n li.appendChild(divDisplay);\n li.appendChild(inputEditTodo);\n\n if (todo.completed) {\n li.className += 'complete';\n checkbox.checked = true;\n }\n\n return li;\n }", "function generateTaskList(user) {\n\n var text = '';\n\n for (var t = 0; t < user.tasks.length; t++) {\n text = text + '> `' + (t + 1) + '`) ' + user.tasks[t] + '\\n';\n }\n\n return text;\n\n }", "function buildTaskList()\n{\n\tconst body = $(\"body\");\n const spoonTypes = body.data(\"spoonTypes\");\n const spoonEmoji = body.data(\"spoonEmoji\"); // will need this to account for emoji mode on page load\n const spoonDifficulties = body.data(\"spoonDifficulties\");\n\t// create the task list\n\tconst taskList = makeTable();\n\ttaskList.attr(\"id\",\"tasklist\");\n body.append(taskList);\n\t// make the header row and append to the table\n\tconst headerRow = makeTaskHeaderRow(\"tasklist\",spoonTypes); // will probably need header emojis later\n\ttaskList.append(headerRow);\n\t// make the new task row and append to the table\n\tconst newTaskRow = makeNewTaskRow(spoonTypes,spoonDifficulties);\n\ttaskList.append(newTaskRow);\n const spoons = $(newTaskRow.children().filter(\".spoon\"));\n\tspoons.outerWidth(setSpoonWidths(taskList));\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}", "function addTaskToList(task, list){\r\n //What is the task? @parameter task\r\n //Where is the task going? @List Parameter\r\n //What order / priority? lowest on the bottom(push)\r\n return list.push({\r\n text: task, completed: false\r\n });\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}", "function renderAllTasks(tasksList) {\n if (!tasksList) {\n console.error(\"Передайте список задач\");\n return;\n }\n\n const fragment = document.createDocumentFragment();\n Object.values(tasksList).forEach(task => {\n const li = listItemTemplate(task);\n fragment.appendChild(li);\n });\n listContainer.appendChild(fragment);\n }", "function ToDoList() {\n this.list = {};\n}", "function addTask(){\n var li = document.createElement(\"LI\");\n li.className = classNames[\"TODO_ITEM\"];\n \n chk = addCheck();\n lbl = addLabel();\n btn = addButton();\n \n li.appendChild(chk);\n li.appendChild(label);\n li.appendChild(btn);\n\n return li;\n}", "function reverseSublist(L, start, finish) {\n let dummyHead = (sublistHead = new ListNode(0, L));\n for (let i = 1; i < start; i++) {\n sublistHead = sublistHead.next;\n }\n\n const sublistIter = sublistHead.next;\n\n for (let i = 0; i < finish - start; i++) {\n let temp = sublistIter.next;\n sublistIter.next = temp.next;\n temp.next = sublistHead.next;\n sublistHead.next = temp;\n }\n\n return dummyHead.next;\n}", "function displayTasks() {\n\t$.each(allItems, function(i, v) {\n\t\t//Appends new task and separates with lines\n\t\tif(this != allItems[allItems.length - 1]) {\n\t\t\t$todoList.append(\"<li><b>\" + this.task + \"</b><span class='date'>\" + this.due.toDateString() + \"</span> <ul class='notes'> \" + this.desc + '</ul></li><hr class=\"inner\">');\n\t\t}\n\t\telse {\n\t\t\t$todoList.append(\"<li><b>\" + this.task + \"</b><span class='date'>\" + this.due.toDateString() + \"</span> <ul class='notes'> \" + this.desc + '</ul></li>');\n\t\t}\n\t});\n\n\tdueSoon();\n\tdueThisWeek();\n\tdueClear();\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 reorderList() {\n const data = Array.from(document.querySelectorAll('.value'));\n const orderOfTodos = data.map(cur => parseInt(cur.dataset.id, 10));\n\n todos.sort((a, b) => {\n const keyA = a.ID;\n const keyB = b.ID;\n\n return orderOfTodos.indexOf(keyA) > orderOfTodos.indexOf(keyB) ? 1 : -1;\n });\n\n populateTodo(todos, todoList);\n localStorage.setItem('todo', JSON.stringify(todos));\n }", "function addTask(task){\n var txt = document.createTextNode(task);\n var li = document.createElement(\"LI\");\n li.appendChild(txt);\n li.id=counter;\n counter++;\n myTaskList.incomplete.push(li);\n addCloseButton(li);\n addChecked(li);\n updateTaskList();\n}", "function _drawTodos() {\n let template = ''\n store.State.todos.forEach(item => {\n template += `<li class=\"action\">\n <div class =\"inline\"><input class=\"align-middle\" type=\"checkbox\" ${item.completed ? \"checked\" : \"\"}><div onclick=\"app.TodoController.toggleTodoStatus(${item._id})\">${item.description}</div></div><button class=\"btn btn-danger deleteBtn float-right\" onclick=\"app.TodoController.removeTodo(${item._id})\"></button></li>`\n });\n document.getElementById('list-items').innerHTML = template;\n // document.getElementById('task-count').innerText = \n}", "function redrawList ( ) {\n var task_list_db = configMap.todo_model.get_db();\n task_list_db().each( function _task_list_iterator (task, idx) {\n addTaskToDom(task);\n } );\n\n }", "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 addItemToDo(text) {\n let list = document.getElementById(\"pending-tasks\"); //getting the ul tag\n let item = document.createElement(\"li\"); // creating list items\n item.innerText = text;\n\n //creating buttons - a class of buttons to a div to contain the two buttons\n let buttons = document.createElement(\"div\");\n buttons.classList.add(\"buttons\");\n\n //creating buttons\n let complete = document.createElement(\"button\");\n complete.classList.add(\"fa\");\n complete.classList.add(\"fa-check\");\n complete.classList.add(\"complete\");\n\n complete.style.cursor = \"pointer\";\n complete.style.background = \"none\";\n complete.style.color = \"#5af542\";\n complete.style.border = \" 0\";\n // function deciding which tasks go where\n\n complete.addEventListener(\"click\", (event) => {\n const item = event.target.parentNode.parentNode;\n completeItem(item);\n completeLocalTodo(item);\n });\n\n let remove = document.createElement(\"button\");\n remove.classList.add(\"fa\");\n remove.classList.add(\"fa-trash\");\n remove.classList.add(\"remove\");\n\n remove.style.cursor = \"pointer\";\n remove.style.background = \"none\";\n remove.style.color = \"#ff0000\";\n remove.style.border = \" 0\";\n\n function removeItem() {\n let item = this.parentNode.parentNode;\n let parent = item.parentNode;\n\n const id = parent.id;\n console.log(id);\n\n const removeFrom =\n id === \"completed\" ? completedLocalStorageKey : pendingLocalStorageKey;\n console.log(removeFrom);\n console.log(item.innerText);\n console.log(getLocalToDos(removeFrom));\n localStorage.setItem(\n removeFrom,\n JSON.stringify(\n getLocalToDos(removeFrom).filter((item1) => item1 !== item.innerText)\n )\n );\n parent.removeChild(item);\n }\n\n remove.addEventListener(\"click\", removeItem);\n buttons.appendChild(complete);\n buttons.appendChild(remove);\n\n item.appendChild(buttons);\n\n list.insertBefore(item, list.childNodes[0]); //'li to the ul so tasks are added to top of the list\n return item;\n }", "function getTodo() {\n let tasks;\n if (localStorage.getItem('todo') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('todo'));\n }\n\n // Loop through task\n tasks.forEach(task => {\n // Create list item\n let todoItem = document.createElement('li');\n // Add class to List item\n todoItem.classList.add('todo-item');\n todoItem.appendChild(document.createTextNode(task));\n // Create New link\n let link = document.createElement('a');\n // Add class to link\n link.className = 'delete secondary-content';\n // set attribute\n link.href = '#';\n // Add content to link\n link.innerHTML = '<i class=\"fas fa-times\"></i>';\n // Append link to item\n todoItem.appendChild(link);\n // Append List item to list\n todoList.appendChild(todoItem);\n }); \n}", "function appendListItem(task) {\n const list = document.querySelector('ul');\n const template = document.querySelector('#template-task');\n const domFragment = template.content.cloneNode(true);\n\n domFragment.querySelector('li p').textContent = task;\n list.appendChild(domFragment);\n\n domUpdate();\n}", "function createTask(event) {\r\n event.preventDefault(); //prevents the form from submitting\r\n\r\n /* For every element in the array of tasks we need to add this, html code\r\n <li> \r\n <div class=\"tasks\">\r\n <div class=\"wrap\">\r\n <div id='mark-completed-button></div>\r\n \r\n <b>Add JavaScript to the Website!</b>\r\n </div>\r\n <i class=\"fas fa-trash\"></i>\r\n </div>\r\n </li>\r\n */\r\n\r\n pendingTasks++; //since new task is created pending task is increased by 1\r\n incompleteItem.innerText = 'Pending Tasks : ' + pendingTasks; //rendering the new value\r\n\r\n let listItem = document.createElement('li'); //creates the li tag\r\n let item = document.createElement('div'); //creates the outer div\r\n item.classList.add('tasks'); //adding tasks class to the div\r\n let subItem = document.createElement('div'); //creates the inner div\r\n subItem.classList.add('wrap'); //adding the wrap class to inner div\r\n let markCompletedBtn = document.createElement('div'); //creates the checkbox \r\n markCompletedBtn.classList.add('mark-completed-button'); //adds the radio button to the form\r\n let desc = document.createElement('b'); //creates the b tag\r\n desc.innerText = inputForm.value; //adds the description of the task to the b tag\r\n subItem.appendChild(markCompletedBtn); //appending form to inner div\r\n subItem.appendChild(desc); //appending b tag to inner div\r\n item.appendChild(subItem); //appending inner div to outer div\r\n let trash = document.createElement('i'); //creating an a tag\r\n trash.classList.add('fas'); //adding relevant class to the fa icon\r\n trash.classList.add('fa-trash'); //adding relevant class to the fa icon\r\n item.appendChild(trash); //appending the delete button to the outer div\r\n listItem.appendChild(item); //appending the outer div to li tag\r\n document.getElementById('tasks-list').appendChild(listItem); //appending li tag to the ul tag\r\n inputForm.value = \"\"; //setting the entered text of the form to empty after adding it\r\n}", "function get_Tasks() {\n let tasks;\n if (localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach(task => {\n let li = document.createElement('li');\n li.appendChild(document.createTextNode(task + \" \"));\n // taskInput.value = ''; // task input field khali kore ditesi\n\n\n let link = document.createElement('a');\n link.setAttribute('href', '#');\n link.innerHTML = 'X';\n li.appendChild(link);\n taskList.appendChild(li);\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 getToDoList() {\n $.ajax({\n type: 'GET',\n url: 'todo/get',\n success: onSuccess,\n dataType: 'json'\n });\n \n //PARSE the AJAX response\n function onSuccess(data) {\n //Build the HTML for the messsage list\n $('#listContainer').empty();\n for (let i = 0; i < data.length; i += 1) {\n let html = '<input id=\"' + data[i]._id + '\" value=\"' + data[i].todo + '\"></input><button id=\"' + i + '\">X</button><br>';\n $('#listContainer').append(html);\n $('#' + data[i]._id).keypress(function(e) {\n if (e.which === 13) {\n let id = data[i]._id;\n updateToDo(id);\n }\n });\n $('#' + i).click({ id: data[i]._id }, deleteToDo);\n\n }\n }\n }", "function getTasks()\n{\n let tasks\n if(localStorage.getItem('tasks') === null)\n {\n tasks=[]\n }\n else\n {\n tasks=JSON.parse(localStorage.getItem('tasks')) \n }\n tasks.forEach(function(task)\n {\n let li = document.createElement('li')\n li.className = 'list-item'\n li.innerText = task \n let link = document.createElement('a')\n link.className = 'item-link'\n let del = document.createElement('i')\n del.className = 'fa fa-remove delete-item'\n link.appendChild(del)\n li.appendChild(link)\n list.appendChild(li)\n\n })\n}", "reverse(){\n if(this.length < 1) return null;\n let node = this.head; // switches the head and tail\n this.head = this.tail;\n this.tail = node;\n let prev = null; // assigns prev to start as null\n let next;\n for(let i = 0; i < this.length; i++) {\n next = node.next; // updates next up to be the node.next, this is put at the start of the block, to prevent an extra loop\n node.next = prev; // redirects the next pointers to reverse the list.\n prev = node; // updates previous up to be the node\n node = next; // updates node up to be next\n }\n return list;\n }", "function displayTasks(date){\n $('.task-display').html('');\n var tasks = Goal.getTasksByDate(date);\n for(var x = 0; x < tasks.length; x++){\n console.log(tasks[x]);\n var task = $('<li></li>',{\n html: '<p>'+tasks[x].taskText+'</p><ul class=\"task-options\"><li class=\"edit-task\">Edit</li><li class=\"delete-task\">Delete</li></ul>',\n 'data-id':tasks[x].id\n }).appendTo('.task-display');\n task.on('click','.edit-task',function(){\n var _this = $(this).parent().parent();\n addTheTask(date,{\n edit:true,\n id: parseInt($(_this).attr('data-id'))\n });\n\n });\n\n task.on('click','.delete-task',function(){\n var _this = $(this).parent().parent();\n console.log($(_this).attr('data-id'));\n Goal.deleteTask(parseInt($(_this).attr('data-id')));\n task.remove();\n });\n }\n }", "function placeTasks(){\n let app = $(\"#current-tasks\");\n let taskList = document.createElement('ul');\n app.append(taskList);\n loadTasks().then((tasks)=>{\n tasks.forEach(task=>{\n newTask(task.name, task.id);\n });\n });\n }", "function getTask(){\r\n let tasks;\r\n\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];\r\n\r\n }else{\r\n tasks = JSON.parse(localStorage.getItem('tasks'))\r\n }\r\n tasks.forEach(function(task){\r\n const li =document.createElement('li');\r\n li.className='collection-item';\r\n li.appendChild(document.createTextNode(task));\r\n \r\n const link =document.createElement('a');\r\n link.className='delete-item secondary-content';\r\n link.innerText='X';\r\n link.href='#';\r\n \r\n // append\r\n \r\n li.append(link);\r\n ul.append(li);\r\n });\r\n\r\n}", "function createTaskList(array) {\n sortArray(array);\n // create one form per array entry\n // populate it from each entry as well\n if (array.length > 0) {\n for (i = 0; i < array.length; i++) {\n // clone form and give it an Id\n let formClone = document.getElementById('taskListHidden').cloneNode(true)\n let taskFormId = 'taskDisplay' + i.toString();\n formClone.id = taskFormId;\n // update its fields according to its Id\n formClone.childNodes[1].taskName.value = myTasks[i].name;\n formClone.childNodes[1].taskStatus.value = myTasks[i].status;\n formClone.childNodes[1].taskDate.value = myTasks[i].date;\n formClone.childNodes[1][3].addEventListener('click', saveTask);\n formClone.childNodes[1][4].addEventListener('click', deleteTask);\n // append it to the ul\n formClone.style.display = \"\";\n document.getElementById('taskListDisplay').appendChild(formClone);\n };\n }\n // once all other forms are set, modify id0\n}", "function getTask(){\n//define taskArr\n let taskArr;\n if (localStorage.getItem('taskArr') == null){\n taskArr = [];\n }\n else{\n //when some taskItem is already present in taskArr --> get that taskItem from taskArr\n taskArr = JSON.parse(localStorage.getItem('taskArr')); \n }\n//for each taskItem, create a li(with link) & append it to ui \ntaskArr.forEach(function(taskItem){\n //create li element\n const li = document.createElement('li');\n //Add class\n li.className = 'collection-item';\n // Create text node & append\n li.appendChild(document.createTextNode(taskItem));\n //create link element\n const link = document.createElement('a');\n //Add class\n link.className = \"delete-item secondary-content\";\n // Add icon html\n link.innerHTML = '<i class=\"fas fa-trash\"></i>';\n //append link to li\n li.appendChild(link);\n //append li to ul\n taskList.appendChild(li);\n})\n}", "function giveNewTodoList(newTodoListObj) {\n let todos = [];\n for (let newTodoOfList in newTodoListObj) {\n if (newTodoOfList === \"newTodo\" || newTodoOfList === \"addBtn\" || newTodoOfList === \"saveBtn\")\n continue;\n\n let isDone;\n if (newTodoListObj[newTodoOfList] === \"\") isDone = false;\n else isDone = true;\n\n todos.push({\n todoItem: newTodoOfList,\n isDone: isDone\n });\n }\n return todos;\n}", "function renderTodoList() {\n if (!data.todo.length && !data.completed.length) return;\n\n for (i = 0; i < data.todo.length; i++) {\n var value = data.todo[i];\n addItemToDOM(value);\n }\n for (j = 0; j < data.completed.length; j++) {\n var value = data.completed[j];\n addItemToDOM(value, true);\n }\n}", "function getTasks() {\r\n let tasks;//All Task Will Be Include//\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];//Checking local Storage If Tasks Exist Or Not//\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n\r\n }\r\n tasks.forEach(task => {\r\n //Tasks In li Element Part Copying//\r\n let li = document.createElement('li');\r\n\r\n li.appendChild(document.createTextNode(task + \" \"));//taskList.value Modifed by task//\r\n let link = document.createElement('a');\r\n link.setAttribute('href', '#');\r\n link.innerHTML = 'x';\r\n li.appendChild(link);\r\n taskList.appendChild(li);\r\n });\r\n\r\n}", "function showTasks () {\n let getLocalStorage = localStorage.getItem(\"New Todo\"); //getting localStorage\n\tif (getLocalStorage == null) {// if local storagenull\n\t\tlistArr = [];// creating blank array\n\t} else {\n\t\tlistArr = JSON.parse(getLocalStorage); // transforming json string into a js objcet\n\t}\n const pendingNum = document.querySelector(\".pendingNum\");\n pendingNum.textContent =listArr.length;//passing the length value in pendingNum\n\n if (listArr.length > 0) {\n\t\t//if array length is greater than 0\n\t\tdeleteAllBtn.classList.add(\"active\"); //active the delete button\n\t} else {\n\t\tdeleteAllBtn.classList.remove(\"active\"); //unactive the delete button\n\t}\n let newLiTag = ' ';\n listArr.forEach((element, index) => {\n\t\tnewLiTag += `<li>${element} <span onclick='deleteTask(${index})'><i class=\"fa fa-trash\"></i></span> </li>`;\n\t});\n todoList.innerHTML = newLiTag;\n inputBox.value = ' '; // once task added leave input feild blank\n}", "function AddTask() {\r\n\r\n // adding listitem in list\r\n let li = document.createElement(\"li\");\r\n mainList.prepend(li);\r\n\r\n // creating and adding requied attributes and listeners\r\n\r\n let input = document.createElement('input');\r\n input.setAttribute('type', 'checkbox');\r\n input.addEventListener('click', Complete);\r\n li.append(input);\r\n\r\n let p = document.createElement(\"p\");\r\n p.textContent = document.getElementById(\"input\").value;\r\n li.append(p);\r\n\r\n let button = document.createElement('button');\r\n button.textContent = 'Delete Task';\r\n button.addEventListener('click', Delete);\r\n li.append(button);\r\n\r\n\r\n // function to complete and uncomplete a task\r\n function Complete(ev) {\r\n if (ev.target.checked) {\r\n\r\n let selectedIndex = ev.target.parentNode;\r\n selectedIndex.querySelector('p').style.textDecoration = 'line-through';\r\n mainList.append(selectedIndex);\r\n } else {\r\n\r\n let selectedIndex = ev.target.parentNode;\r\n selectedIndex.querySelector('p').style.textDecoration = 'none';\r\n mainList.prepend(selectedIndex);\r\n }\r\n }\r\n // function to remove a task\r\n function Delete(ev) {\r\n mainList.remove(ev.target.parentNode);\r\n }\r\n}", "function showTask(){\n let getLocalStorage = localStorage.getItem(\"New Todo\");\n if(getLocalStorage == null){\n listArr = [];\n }else{\n listArr = JSON.parse(getLocalStorage);\n }\n const pendingNumb = document.querySelector(\".pendingNumb\");\n pendingNumb.textContent = listArr.length;\n // if(listArr.length > 0){\n // deleteAllBtn.classList.add(\"active\");\n // }else{\n // deleteAllBtn.classList.remove(\"active\");\n\n // }\n let newLiTag = '';\n listArr.forEach((element, index) => {\n newLiTag += `<li> ${element} <span onclick =\"deleteTask(${index})\"; ><i class=\"fa fa-trash\"></i></span></li>`;\n });\n todoList.innerHTML = newLiTag;\n inputBox.Value = \"\";\n}", "addNewItemToList(list, initDescription, initDueDate, initStatus) {\n let newItem = new ToDoListItem(this.nextListItemId++);\n newItem.setDescription(initDescription);\n newItem.setDueDate(initDueDate);\n newItem.setStatus(initStatus);\n list.addItem(newItem);\n if (this.currentList) {\n this.view.refreshList(list);\n }\n }", "async getTasklist(input = { tasklistId: '0' }) {\n\n return await this.request({\n name: 'tasklist.get',\n args: [input.tasklistId],\n page: Page.builder(input.pagination)\n });\n\n }" ]
[ "0.64874065", "0.64248204", "0.6282865", "0.62588745", "0.6252901", "0.6214843", "0.6179592", "0.61689544", "0.6135963", "0.61323", "0.61239034", "0.61134326", "0.60962015", "0.60582924", "0.60382116", "0.6036122", "0.60303396", "0.6019807", "0.6004692", "0.59897643", "0.59886855", "0.59769", "0.59585154", "0.5956729", "0.5950973", "0.59483945", "0.5930987", "0.5927984", "0.59233814", "0.5915551", "0.5911774", "0.5909203", "0.590774", "0.59020454", "0.5897746", "0.5895954", "0.58748597", "0.586258", "0.58516717", "0.5850675", "0.584673", "0.58403367", "0.5839058", "0.58381754", "0.5837146", "0.5831604", "0.5828728", "0.5825283", "0.5816886", "0.58151", "0.5813179", "0.5812524", "0.58090675", "0.5803041", "0.57988805", "0.57970273", "0.5791259", "0.57900673", "0.578184", "0.5777444", "0.57693124", "0.5758529", "0.57543105", "0.5739424", "0.57360935", "0.57327914", "0.5727841", "0.57201046", "0.5719076", "0.5712843", "0.571186", "0.5706884", "0.570659", "0.5697552", "0.5692852", "0.56908613", "0.56851774", "0.5681632", "0.56763226", "0.56667644", "0.56665266", "0.5666067", "0.5665129", "0.5657956", "0.56577456", "0.5653216", "0.5652551", "0.5647103", "0.5642129", "0.5631792", "0.5623821", "0.5617233", "0.5615808", "0.56143546", "0.5611442", "0.5611086", "0.5609872", "0.5608507", "0.5607456", "0.55973107" ]
0.70149136
0
On Button(Add New Task) click add new task in taskList.
function onclick_add_new_task() { insertNewTask(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "function addNewTask() {\n buttonAdd.onclick = function () {\n if (!newText.value || !newText.value.trim()) return alert('Please, input your text')\n newContainer.classList.add(hiddenClass)\n let id = listTask.length ? listTask[listTask.length - 1].id + 1 : 0\n let date = new Date().toJSON()\n const task = {\n id,\n text: newText.value.trim(),\n date,\n completed: false\n }\n listTask.push(task)\n addTaskToDom(task, listBlock)\n newText.value = ''\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n }", "addTask(e) {\n e.preventDefault();\n const value = this.addTaskForm.querySelector('input').value;\n if (value === '') return;\n this.tasks.createTask(new Task(value));\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\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 addTask () {\r\n tasks.setSelected(tasks.add())\r\n taskOverlay.hide()\r\n\r\n tabBar.updateAll()\r\n addTab()\r\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}", "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 addTask() {\r\n\r\n var taskId = \"task_\" + taskCount++;\r\n\r\n var task = createTask(taskId, \"\", \"\");\r\n taskList[taskId] = task;\r\n\r\n var domElement = createNewTaskDOMElement(task);\r\n taskListDOMElements[taskId] = domElement;\r\n\r\n showTaskDetail(task);\r\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 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}", "function addTask(newTask) {\n //create list element and set its class\n const newTaskItem = document.createElement('li');\n newTaskItem.setAttribute('class', 'task_item');\n\n // create checkbox element and set its type and class\n const newCheckBtn = document.createElement('div');\n newCheckBtn.setAttribute('class', 'task_check_btn');\n\n // create span element and set its class and add new task input\n const newTaskBio = document.createElement('span');\n newTaskBio.setAttribute('class', 'task_bio');\n\n // add input value to li\n newTaskBio.innerText = newTask;\n\n // insert li tag inside the ul tag\n taskList.appendChild(newTaskItem);\n\n // insert checkbox to li\n newTaskItem.appendChild(newCheckBtn);\n\n // insert newTask into li\n newTaskItem.appendChild(newTaskBio);\n\n // run Function when task is completed and checkbox is check.\n onTaskComplete(newCheckBtn);\n}", "function addTask(e) {\n\tvar inputEl = document.getElementById(\"input-task\");\n\t\n\tif (!inputEl.value.isNullOrWhitespace())\n\t{\n\t\t// Create a unique ID\n\t\tvar id = \"item-\" + tasks.length;\n\t\t\n\t\t// Create a new task\n\t\tvar task = new Task(id, inputEl.value, taskStatus.active);\n\t\t\n\t\t// Append the task to the DOM\n\t\taddTaskElement(task);\n\t\t\n\t\t// Reset input\n\t\tinputEl.value = \"\";\n\t}\n}", "addNewTask() {\n let task = new Task(this.newTaskName);\n task.id = new Date().getMilliseconds();\n this.tasks.push(task);\n }", "function addTask() {\n Task.addTask(info.newTask);\n info.newTask = \"\";\n }", "function addTask(event) {\n event.preventDefault();\n const taskDiv = document.createElement(\"div\");\n taskDiv.classList.add(\"task\");\n\n //List - append\n const newTask = document.createElement(\"li\");\n newTask.innerText = inpTask.value;\n newTask.classList.add(\"task-item\");\n taskDiv.appendChild(newTask);\n\n //Legg til i liste lokalt på pc\n\n saveLocalTasks(inpTask.value);\n\n\n //Done-button\n const doneBtn = document.createElement(\"button\");\n doneBtn.innerHTML = \"Done\";\n doneBtn.classList.add(\"done-btn\");\n taskDiv.appendChild(doneBtn);\n\n //Delete-button\n const deleteBtn = document.createElement(\"button\");\n deleteBtn.innerHTML = \"Delete\";\n deleteBtn.classList.add(\"del-btn\");\n taskDiv.appendChild(deleteBtn);\n\n //Add div to list\n taskList.appendChild(taskDiv);\n\n //Remove inp value\n inpTask.value = \"\";\n\n}", "function addListTask(data) {\n listTask.push(data)\n saveData()\n openModal()\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(task){\n var txt = document.createTextNode(task);\n var li = document.createElement(\"LI\");\n li.appendChild(txt);\n li.id=counter;\n counter++;\n myTaskList.incomplete.push(li);\n addCloseButton(li);\n addChecked(li);\n updateTaskList();\n}", "function addTask() {\n event.preventDefault();\n currentTask = {\n name: document.getElementById('newTaskForm').elements.taskName.value,\n status: document.getElementById('newTaskForm').elements.taskStatus.value,\n date: document.getElementById('newTaskForm').elements.taskDate.value,\n };\n // adding this object to the overall array\n console.log(currentTask);\n myTasks.push(currentTask);\n \n alert(\"Task added: \" + currentTask.name + \".\");\n document.getElementById('newTaskForm').reset();\n \n // updating/replacing the localStorage version.\n updateTasks();\n\n deleteDisplayList(-1);\n createTaskList(myTasks);\n \n // collapse the Property form\n document.getElementById('btnAddTaskCollapser').nextElementSibling.style.display = \"none\";\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}", "function AddTask() {\n const valid = validateForm()\n if (valid) {\n const newTaskInput = document.getElementById('newItem')\n const tagNameInput = document.getElementById('Tag')\n const tagColorInput = document.querySelector('input[name=\"inlineRadioOptions\"]:checked')\n\n const task = {\n title: newTaskInput.value,\n tag: {\n name: tagNameInput.value,\n color: tagColorInput.value\n },\n type: 'todo',\n state: false\n }\n\n list.items.push(task)\n localStorage.setItem('lists', JSON.stringify(allLists))\n resetForm()\n renderTasks()\n } else {\n const toast = new bootstrap.Toast(document.querySelector('.toast'))\n toast.show()\n }\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 addNewTask(task) {\n let uniqueID = timeStamp();\n let data = {\n text: task,\n isDone: false,\n idNum: uniqueID,\n };\n toDoList.push(data);\n addTask(data);\n commitToLocalStorage(toDoList);\n}", "function addTask() {\n values={};\n values.task=$('#task').val();\n\n $.ajax({\n type: 'POST',\n url: '/task',\n data: values,\n success: function(){\n updateTaskList();\n }\n });\n}", "function handleAddClick() {\n console.log('add button clicked');\n let newTask = {};\n //puts input fields into an object\n newTask.task = $('#taskIn').val();\n newTask.type = $('#homeOrWork').val();\n newTask.notes = $('#notesIn').val();\n addTask(newTask);\n $('#taskIn').val('');\n $('#notesIn').val('');\n}", "function addNewTask(e) {\n e.preventDefault();\n\n if (taskInput.value === '') {\n taskInput.style.borderColor = 'red';\n return;\n }\n\n const li = document.createElement('li');\n\n li.className = 'collection-item';\n\n li.appendChild(document.createTextNode(taskInput.value));\n\n const link = document.createElement('a');\n\n link.className = 'delete-item secondary-content';\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n\n li.appendChild(link);\n taskList.appendChild(li);\n taskInput.value = '';\n}", "function insertNewTask() {\n let newTask = document.getElementById(\"input_new_task\").value;\n let obj = {};\n obj['id'] = taskCount;\n obj['task'] = newTask;\n obj['complete'] = false;\n tasksList.push(obj);\n taskCount += 1;\n const finalData = generateTasksList();\n document.getElementById(\"divTasksList\").innerHTML = finalData;\n document.getElementById(\"input_new_task\").value = '';\n}", "function addTask(taskName) {\n // Use templateList.content.querySelector to select the component of the template.\n const taskElement = document.importNode(templateList.content.querySelector('.taskItem'), true);\n // Assign the class name\n taskElement.className = 'activeItem';\n // Select the components from the list.\n const activeItem = taskElement.querySelector('input');\n const activeIcon = taskElement.querySelector('label');\n // Change the icon and text.\n activeIcon.innerHTML = '&#10065';\n activeItem.value = taskName;\n // Append to ul\n taskList.appendChild(taskElement);\n}", "function addTask(list) {\n console.log(task);\n createList(task).then((data) => {\n if (data.error) {\n console.log(data.error);\n } else {\n console.log(data.data);\n setItems((prevValues) => {\n return [...prevValues, data.data];\n });\n setTask('');\n }\n });\n }", "function addEmptyTask() {\n $(\"#taskList\").append(\n \"<task class=\\\"task\\\">\" +\n \"<text class=\\\"action\\\"></text> \" +\n \"<date class=\\\"action\\\"></date> \" +\n \"<button onclick='model.editTask(this)'>Edit</button> \" +\n \"<button onclick='model.deleteTask(this)'>Delete</button> \" +\n \"<label for=\\\"action\\\">Done</label> \" +\n \"<input class=\\\"checkBox\\\" onclick='model.updateTask(this)' type=\\\"checkbox\\\">\" +\n \"<br>\" +\n \"</task>\"\n );\n }", "function addToDo() {\n let tasks = document.getElementById('tasks')\n let newTask = document.createElement('li')\n let lastTask = tasks.appendChild(newTask)\n lastTask.innerHTML = document.getElementById('new-task-description').value;\n }", "function newTask(e) {\n e.preventDefault();\n\n if(taskContent.trim() === \"\"){\n notifyError()\n return\n }\n\n const newTask = {\n content: taskContent,\n taskId: Math.random() * 10,\n checked: false,\n };\n\n setTasks([...tasks, newTask]);\n setTaskContent(\"\");\n }", "function addTask(e) {\n\tif (taskInput.value === '') {\n \t\talert('Add a task'); // Definisali smo dugme za submit\n \t} \n\n \t//// Create li element // Kreiranje list item-a\n \tconst li = document.createElement('li');// definisali li \n \t//// Add class\n \tli.className = 'collection-item'; // Definisali koju klasu dodajemo\n \t//// Create text node and append to li\n \tli.appendChild(document.createTextNode(taskInput.value));\n \t/* Sve sto se ukuca u form/loadEventListeners/addTask to upada u li */\n\n \t/*-------------------------------------------------------------------------------*/\n\n \t////Create New link element\n \tconst link = document.createElement('a');\n \t////Add class\n \tlink.className = 'delete-item secondary-content';// Definisali koju klasu dodajemo\n \t//// Add icon html\n \tlink.innerHTML = '<i class=\"fa fa-remove\"></i>';// Definisali element koji cemo dodati NE class vec ceo jedan element da se doda\n \t//// Append the link to li\n \tli.appendChild(link);\n \t/* Sve sto se ukuca u form/loadEventListeners/addTask to upada u li a on je definisan kako izgleda upravo preko document.createElement('a') */\n\n \t/*-------------------------------------------------------------------------------*/\n\n\t//// Appending li to ul (sve sto je do sada definisano treba ubaciti u ul)\n\ttaskList.appendChild(li); //tako je definisan UL gore na pocetku\n\n\t/*-------------------------------------------------------------------------------*/\n\n\t//// Stor in LS\n\tstoreTaskInLocalStorage(taskInput.value);// funkcija nije jos definisana a ubacujemo u tu funkciju\n\t/*Sve sto se otkuca ide u ovu funkciju*/\n\n\t/*-------------------------------------------------------------------------------*/\n\n\t//// Clear input\n\ttaskInput.value = ''; // Posle kucanja da je prazan input\n\n\te.preventDefault();\n}", "function addItem() {\n var contents = document.getElementById('newTask').value;\n var item = new listItem(Date.now(), contents, false);\n masterList.push(item);\n showList(masterList);\n saveList();\n}", "function addTask(taskID, task)\n{\n const table = $(\"#tasklist\");\n // create a new row\n const newRow = makeTasklistRow(taskID, task);\n // finally, stick the new row on the table\n const firstTask = tasksExist(\"tasklist\");\n if (firstTask)\n {\n firstTask.before(newRow);\n }\n else\n {\n table.append(newRow);\n }\n}", "function addTasks() {\n const text =\n document.getElementById('enter-task').value;\n if (text) {\n tasks.push(new Task(text)); // somehow connect the tasks to the list they are in (optional-ish)\n showTasks();\n }\n // window.localStorage.setItem(lists, JSON.stringify(text));\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 addTask()\n{\n //The month scales from 0-11 so we need to add one.\n var tempMonth = new Date().getMonth() + 1;\n\n var td = new Date().getFullYear() + \"-\" + tempMonth + \"-\" + new Date().getDate() + \"|\" + new Date().getHours() + \":\" + new Date().getMinutes() + \":\" + new Date().getSeconds();\n var taskDate = td.toString();\n\n var md = new Date();\n var mDate = md.getTime();\n\n //Adding the input values to the array\n taskArr.push({Name: taskTitle.value, Description: taskDetails.value, Date: taskDate, MDate: mDate});\n console.log(taskArr);\n\n //calling the for loop to create the elements.\n floop();\n\n //Adding the listed items to the incompleteTaskList.\n incompletetaskList.appendChild(listItem);\n\n //Calls the BindTaskEvents and passes in the buttons' function.\n bindTaskEvents(listItem);\n\n //Resets the values of the input field.\n taskTitle.value = \"\";\n taskDetails.value = \"\";\n}", "function handleAdd(){\n console.log('clicked on Submit button');\n\n let newTask = {\n task: $('#taskIn').val()\n }\n // run addTask with newTask variable\n addTask(newTask);\n\n // empty input task\n $('#taskIn').val('')\n} // end handleAdd", "function addTask(e) {\n e.preventDefault();\n\n if (taskDescription.value === '') {\n popup.classList.add('show');\n } else {\n popup.classList.remove('show');\n appendListItem(taskDescription.value);\n taskDescription.value = '';\n }\n}", "function createNewTask(){\n var item = document.createElement('li'),\n listContent = document.createTextNode(inputValue.value);\n item.appendChild(listContent);\n //Preventing the Creation of an Empty Task\n if(inputValue.value ===''){\n alert(\"Please ADD a Task\");\n }else{\n taskContainer.prepend(item);\n document.getElementById(\"taskContents\").value = \"\";\n item.className = 'newitem';\n }\n //Creating a Clear button to Clear ALL Tasks\n function clearTasks(){\n item.parentNode.removeChild(item);\n }\n deleteButton.addEventListener('click', clearTasks);\n //Adding the Finished Tasks to the CompletedTask section\n function completeTask(){\n completedTaskContainer.prepend(item);\n }\n item.addEventListener('click', completeTask);\n function clearcompleteTasks(){\n completedTaskContainer.removeChild(item);\n }\n //Creating a Clear button to Clear Completed Tasks only\n deletecompleteButton.addEventListener('click', clearcompleteTasks);\n}", "static newTaskSubmit() {\n const newTaskData = document.querySelector('#newTaskData').elements;\n const name = newTaskData[0].value;\n const dueDate = newTaskData[2].value;\n const priority = () => {\n const radioHigh = document.querySelector('#radioTaskHigh')\n const radioMed = document.querySelector('#radioTaskMed')\n const radioLow = document.querySelector('#radioTaskLow')\n if (radioHigh.checked) return 3;\n else if (radioMed.checked) return 2;\n else if (radioLow.checked) return 1;\n }\n const notes = newTaskData[1].value;\n const _currentTask = new Task(currentProject.id, currentTask.id, `${name}`, `${notes}`, `${dueDate}`, +priority(), false);\n const overlay2 = document.querySelector('#overlay2');\n overlay2.style.display = 'none';\n currentProject.addTask(_currentTask);\n ProjectLibrary.getSharedInstance().saveProject(currentProject);\n DomOutput.loadTaskList(currentProject);\n document.querySelector('#newTaskData').reset();\n }", "function addTask(e) {\n if (taskInput.value === \"\") {\n return alert(\"Add a task\");\n }\n //Create li elements\n const listElements = document.createElement(\"li\");\n //Add class\n listElements.className = \"collection-item\";\n //Create text node and append to li\n listElements.appendChild(document.createTextNode(taskInput.value));\n //Create New Link elements\n const link = document.createElement(\"a\");\n link.className = \"delete-item secondary-content\";\n //Add icon html\n link.innerText = `❌`;\n //Append the link to list Elements\n listElements.appendChild(link);\n // console.log(listElements);\n taskList.appendChild(listElements);\n //Remove Task\n link.addEventListener(\"click\", () => {\n if (confirm(\"Are you sure to delete this item ? \")) {\n removeTaskFromLS(listElements);\n listElements.remove();\n }\n });\n storeTaskInLocalStorage(taskInput.value);\n taskInput.value = \"\";\n e.preventDefault();\n}", "function addTask(e) {\r\n // console.log(e);\r\n\r\n // Check if there is actually any value\r\n if(taskInput.value === '') {\r\n alert('Task field is empty! Please, add a task.');\r\n }\r\n\r\n // If there is a value, we want to add the task to the list\r\n\r\n // Create li element\r\n const li = document.createElement('li');\r\n\r\n // Add a class 'collection-item' because in materialize css, li has 'collection-item' class\r\n li.className = 'collection-item';\r\n\r\n // Create a text node and append to li\r\n li.appendChild(document.createTextNode(taskInput.value));\r\n\r\n // Create a new link element\r\n const link = document.createElement('a');\r\n\r\n // Add class to link\r\n link.className = 'delete-item secondary-content';\r\n\r\n // Add icon html\r\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\r\n\r\n // Append the link to li\r\n li.appendChild(link);\r\n\r\n // console.log(li);\r\n\r\n //Append li to ul (taskList is collection of ul)\r\n taskList.appendChild(li);\r\n\r\n // Store in localStorage\r\n storeTaskInLocalStorage(taskInput.value);\r\n\r\n // Clear the input\r\n taskInput.value = '';\r\n\r\n e.preventDefault();\r\n}", "function addTask() {\n //criou um elemento item\n const tarefa = document.createElement('li')\n //adicionou o conteudo do input ao item\n tarefa.innerText = input.value\n //adicionou o item à div listaTarefas\n listaTarefas.appendChild(tarefa)\n }", "addTask(newTask){\n this.tasks.push(newTask);\n }", "function addTask(e){\n e.preventDefault();\n \n if(!taskInput.value) {\n alert('add a task')\n return\n }\n let li = document.createElement('li')\n li.className = 'collection-item'\n li.appendChild(document.createTextNode(taskInput.value))\n let a = document.createElement('a')\n a.className = 'delete-item secondary-content'\n let i = document.createElement('i')\n i.className = ' fa fa-remove'\n a.appendChild(i)\n li.appendChild(a)\n taskList.appendChild(li)\n taskInput.value = ''\n\n}", "function addTask(e){\n // 如果没有输入,提示请添加一个task;如果有输入,则添加到ul中\n if(taskInput.value === ''){\n alert('Add a task');\n } else{\n // 添加到ul中有以下步骤:\n // 1. 新建一个li标签,给li标签加class(美观)\n const li = document.createElement('li');\n li.className = 'collection-item';\n // 2. 新建一个text node在append to li\n li.appendChild(document.createTextNode(taskInput.value));\n // 3. 新建删除按钮,create new link element\n const link = document.createElement('a');\n link.className = 'delete-item secondary-content';\n // 4. a里面有个i的图标\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // 5. 把link挂到li上面\n li.appendChild(link);\n // 6. 把li挂到ul上\n ulTaskList.appendChild(li);\n\n // 把input的value存储到local storage\n storeTaskInLocalStorage(taskInput.value);\n // 7. clear 之前的input\n taskInput.value = '';\n }\n\n e.preventDefault(); // 防止跳转\n}", "function addTask(e) {\n e.preventDefault();\n if (taskInput.value === \"\") {\n swal(\"Task can't be Empty, Please add a Task!\");\n } else {\n let noTaskToShow = document.querySelector(\".noTask-Msg\");\n if (noTaskToShow) {\n noTaskToShow.remove();\n }\n \n let newTaskContainer = document.createElement(\"div\");\n newTaskContainer.classList =\n \"displayed-tasks padding-10px flex-elements width-65 border-Rad\";\n\n let newAddedTask = document.createElement(\"div\");\n newAddedTask.classList = \"added-task borderRad wow slideInLeft\";\n\n let newTaskText = document.createTextNode(taskInput.value);\n\n let taskDeleteButton = document.createElement(\"i\");\n taskDeleteButton.classList = \"fas fa-trash delete wow slideInRight\";\n\n newAddedTask.appendChild(newTaskText);\n newTaskContainer.appendChild(newAddedTask);\n newTaskContainer.appendChild(taskDeleteButton);\n container.appendChild(newTaskContainer);\n saveToLocalStorage(taskInput.value);\n taskInput.value = \"\";\n taskInput.focus();\n\n}\n}", "function addTask(e) {\r\n\r\n if (taskInput.value === '') {\r\n alert('Add a Task');\r\n } else {\r\n //Tasks In li Element//\r\n let li = document.createElement('li');\r\n\r\n li.appendChild(document.createTextNode(taskInput.value + \" \"));\r\n let link = document.createElement('a');\r\n link.setAttribute('href', '#');\r\n link.innerHTML = 'x';\r\n li.appendChild(link);\r\n taskList.appendChild(li);\r\n //Added local Storage Function//\r\n storeTaskInLocalStorage(taskInput.value);\r\n taskInput.value = '';\r\n }\r\n e.preventDefault();\r\n}", "function appendTaskClick() {\n\tvar value = document.getElementById(\"inputTask\").value; \n\tif (value) {\n\t\tdata.openTasks.push(value); //store in array \n\t \tdataObjectUpdated(); //update data storage \n\t \tcreateListElement(value); //display in DOM \n\t \ttask.value = \"\"; //clear input field \n\t}\n}", "addNewTask(newTaskName) {\n const tasks = this.state.tasks.slice();\n tasks.push(newTaskName);\n this.saveTasks(tasks);\n this.setState({tasks: tasks, newTaskName: \"\"});\n }", "function addTask(e){\n e.preventDefault();\n \n // 3. read what is inside the input / validate input\n const taskName = inputTask.value.trim();\n const taskDescr = inputDescription.value.trim();\n const taskDate = inputDate.value.trim();\n \n \n if (taskName.length > 0 && taskDescr.length > 0 && taskDate.length > 0) {\n const startBtn = el(\"button\", \"Start\", {className: \"green\"});\n const finishBtn = el(\"button\", \"Finish\", {className: \"orange\"});\n const deleteBtn = el(\"button\", \"Delete\", {className: \"red\"});\n \n const btnDiv = el(\"div\", [\n startBtn,\n deleteBtn,\n ], {className: \"flex\"});\n const task = el(\"article\", [\n el(\"h3\", taskName),\n el(\"p\", `description: ${taskDescr}`),\n el(\"p\", `Due Date: ${taskDate}`),\n btnDiv\n ])\n startBtn.addEventListener(\"click\", () => {\n progressDiv.appendChild(task);\n startBtn.remove();\n btnDiv.appendChild(finishBtn);\n })\n finishBtn.addEventListener(\"click\", () => {\n finishDiv.appendChild(task);\n btnDiv.remove();\n })\n deleteBtn.addEventListener(\"click\", () => {\n task.remove();\n })\n openDiv.appendChild(task);\n }\n }", "function addData(json) {\r\n\tvar tasks = json.tasks;\r\n\tfor(var i=0;i<tasks.length;i++)\r\n\t{\r\n\t\t// adding tasks\r\n\t\tdocument.getElementById('taskname').value = tasks[i];\r\n\t\tCreateListItem()\r\n\t}\r\n\t// clearing text field\r\n\tdocument.getElementById('taskname').value = \"\";\r\n}", "function addTask(isDone, text) {\n let listItem = document.createElement(\"li\");\n listItem.appendChild(createCheckbox(isDone));\n listItem.appendChild(createSpan(text));\n listItem.appendChild(createDeleteBtn());\n\n let taskList = document.getElementById(\"task-list\");\n taskList.appendChild(listItem);\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}", "function placeTasks(){\n let app = $(\"#current-tasks\");\n let taskList = document.createElement('ul');\n app.append(taskList);\n loadTasks().then((tasks)=>{\n tasks.forEach(task=>{\n newTask(task.name, task.id);\n });\n });\n }", "function addTask(newTask) {\n\n console.log('in addTask', newTask);\n $.ajax({\n type: 'POST',\n url: '/todo',\n data: newTask,\n }).then(function (response) {\n console.log('Response from server-side:', response);\n getList();\n }).catch(function (error) {\n console.log('Error in POST client side', error);\n });\n}", "function addToTaskList(name, date, status){\r\n let task = document.createElement('li');\r\n task.classList.add('task');\r\n\r\n let taskActions = document.createElement('div');\r\n taskActions.classList.add('taskActions');\r\n\r\n let editTask = document.createElement('button');\r\n editTask.classList.add('editTask');\r\n editTask.innerHTML = editTaskIcon;\r\n\r\n let removeTask = document.createElement('button');\r\n removeTask.classList.add('deleteTask');\r\n removeTask.innerHTML = removeTaskIcon;\r\n // On click remove task icon, remove task from task list \r\n removeTask.addEventListener('click', removeTaskItem);\r\n\r\n let checkComplete = document.createElement('label');\r\n // check the value of task status, and add checked attribute if needed \r\n (status == 1) ? status = 'checked' : '';\r\n checkComplete.classList.add('checkbox-container', 'taskStatus');\r\n checkComplete.innerHTML = `<input type=\"checkbox\" ${status}/><span class=\"checkmark\"></span>`;\r\n // On click, set taskStatus as completed(1)\r\n checkComplete.querySelector('input').addEventListener('click', setTaskStatus);\r\n\r\n let taskHeading = document.createElement('p');\r\n taskHeading.classList.add('taskName');\r\n taskHeading.innerText = name;\r\n\r\n let taskDescr = document.createElement('p');\r\n taskDescr.classList.add('taskDescr');\r\n //taskDescr.innerText = name;\r\n\r\n taskActions.appendChild(editTask);\r\n taskActions.appendChild(removeTask);\r\n\r\n task.appendChild(checkComplete);\r\n task.appendChild(taskHeading);\r\n task.appendChild(taskDescr);\r\n task.appendChild(taskActions);\r\n\r\n toDoList.appendChild(task);\r\n}", "function addToList() {\n if ($(\"#js--project1-input\").val() != \"\") {\n var taskDescription = $(\"#js--project1-input\").val();\n $(\"#list\").append(taskItem(taskDescription));\n $(\"#js--project1-input\").val(\"\");\n } else {\n alert (\"you need to write something!\");\n }\n }", "function createAddTaskHandler() {\n let btnAddTask = document.getElementById(\"add-task-button\");\n if (btnAddTask) {\n btnAddTask.addEventListener(\"click\", function () {\n AddTask();\n });\n }\n}", "function addTask() {\n\n // TODO: look javascript with the dom(document || javascript with html)\n let taskInput = document.getElementById(\"taskinput\");\n\n // TODO: look up conditionals if else\n if (taskInput.value === \"\") {\n alert(\"Invalid Value\")\n } else {\n taskList.push(taskInput.value)\n\n taskinput.value = \"\";\n }\n\n listTasks();\n\n // returns false for form so it doesn't reload\n return false;\n}", "addTaskButtonAction(elementId) {\n let content = this.get('newTaskContent');\n // If there is some content, add the task\n if(content !== null && content !== undefined && content.length > 0) {\n this.actions.createTask.bind(this)(content);\n }\n // If no content just focus or refocus the bar\n else {\n this.actions.focusBar.bind(this)(elementId);\n }\n }", "function quickAddTask() {\n withUniqueTag(\n document,\n 'button',\n matchingAttr('data-track', 'navigation|quick_add'),\n click,\n );\n }", "function addTask(e){\n //check if the Task Input is Empty\n //Create li element\n //Style the li\n //Create a Text Node append to li\n //Create new link element\n //Give the link a Style\n //Add an icon html\n //Append the lin to li\n //Append the li to ul\n if(!taskInput.value){\n alert('Add a Task');\n e.preventDefault();\n }else{\n \n const li = document.createElement('li');\n li.className = 'collection-item';\n li.appendChild(document.createTextNode(taskInput.value));\n const a = document.createElement('a');\n a.className = 'delete-item secondary-content';\n a.innerHTML = '<i class=\"fa fa-remove\"></i>';\n li.appendChild(a);\n li.index = taskList.children.length\n taskList.appendChild(li);\n e.preventDefault();\n storeTaskInLocalStorage(taskInput.value)\n taskInput.value = '';\n \n }\n}", "function addTask() {\n\t\t\tvm.totalTime = 0;\n\t\t\ttaskDo.service.addTask(vm).then(function (response) {\n\t\t\t\tvm.sample=\"vamsi\";\n\t\t\t});\n\t\t}", "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 addListAfterClick() {\n if (inputlength() > 0) {\n addTask();\n }\n}", "addTask(name, description, assignedTo, dueDate, status) {\n // increment id\n let id = this.currentId++;\n\n // push to tasks array\n this.tasks.push({\n id,\n name,\n description,\n assignedTo,\n dueDate,\n status,\n });\n }", "function addTaskFunc(inputValue)\n {\n var task=document.createElement('li');\n var taskDiv=document.createElement('div');\n taskDiv.innerText=inputValue;\n taskDiv.classList.add('taskDivClass')\n \n \n var buttonsCont = document.createElement('div');\n buttonsCont.classList.add('buttonContClass');\n \n var completed = document.createElement('button');\n completed.classList.add('completedButton')\n \n var edit = document.createElement('button');\n edit.classList.add('editButton')\n \n var deleteIt = document.createElement('button');\n deleteIt.classList.add('deleteButton')\n \n deleteIt.innerHTML=\"&#10006\";\n completed.innerHTML=\"&#10004\" ;\n edit.innerHTML=\"&#9998\";\n \n buttonsCont.appendChild(taskDiv);\n buttonsCont.appendChild(deleteIt);\n buttonsCont.appendChild(completed);\n buttonsCont.appendChild(edit);\n task.appendChild(buttonsCont);\n \n var list = document.getElementById(\"taskList\");\n list.insertBefore(task,list.childNodes[0]);\n document.getElementById(\"userInput\").focus();\n \n //eventlisteners for buttons\n deleteIt.addEventListener('click', deleteTask);\n completed.addEventListener('click', completeTask);\n edit.addEventListener('click', editTask);\n }", "function addTask(projectid) {\n const task_name = document.querySelector('.todo_name').value; //get input data from dom\n const task_description = document.querySelector('.todo_description').value;\n const task_date = document.querySelector('.todo_date').value;\n let task_priority = '';\n\n if (document.querySelector('.todo_priority1').checked)\n task_priority = '1';\n else if (document.querySelector('.todo_priority2').checked)\n task_priority = '2';\n else if (document.querySelector('.todo_priority3').checked)\n task_priority = '3';\n else if (document.querySelector('.todo_priority4').checked)\n task_priority = '4';\n\n if (task_name == '' || task_description == '' || task_date == '' || task_priority == '')\n return;\n\n data.projects[projectid].tasks.push(new task(task_name, task_description, task_date, task_priority)) //add new project with name and id to list\n\n }", "handleAddNewTask() {\n this.addNewTask(this.state.newTaskName);\n }", "function newTask() {\n td.addTask(document.getElementById(\"new-task-text\").value);\n document.getElementById(\"new-task-text\").value = \"\";\n}", "function addTask(id, taskManager, projectName) {\n \n //content HTML parent\n const content = document.getElementById(\"content\");\n\n //the container\n const addNewTaskDiv = document.createElement(\"div\");\n addNewTaskDiv.id = \"add-new\";\n \n //contains the form with display-none\n const hiddenContainer = document.createElement(\"div\");\n hiddenContainer.classList.add(\"hidden-container\");\n hiddenContainer.style.display = \"none\";\n \n //contains submit and cancel btns\n const hiddenButtons = document.createElement(\"div\");\n hiddenButtons.classList.add(\"hidden-buttons\");\n hiddenButtons.style.display = \"flex\";\n \n //the form where user inputs task info\n const form = formConstructor(\"add-task\");\n hiddenContainer.appendChild(form);\n \n //add task btn\n const addNewBtn = btnConstructor(\"add-new-btn\", \"+\", \"block\");\n \n //on click display hidden form and hide add task btn\n addNewBtn.addEventListener('click',() => {\n\n toogleVisibility(hiddenContainer, \"block\");\n toogleVisibility(addNewBtn, \"none\");\n });\n addNewTaskDiv.appendChild(addNewBtn);\n \n //submit btn\n const submitBtn = btnConstructor(\"submit-btn\", \"Submit\", \"block\");\n \n //on click event triggers task creation logic\n submitBtn.addEventListener(\"click\", () => {\n //gets values from the input fields and returns and array\n const valuesArray = getValuesForm(\"add-task\");\n //if input != empty\n if(formValidation(valuesArray)) {\n \n taskItem(id, projectName); //create the DOM element \n const taskObj = new Task (id, valuesArray[0], valuesArray[1], valuesArray[2], valuesArray[3]); //create the coresponding object\n taskManager.set(`task-${id}`, taskObj); //map() stores the obj\n localStorage.setItem(nameForLocalStorage(projectName), JSON.stringify(Array.from(taskManager.entries())));//localy store map() with the projects name\n id ++;\n localStorage.setItem(\"id\", id); //localy store id\n setTask(taskObj); //fills the DOM element with the taskobj values\n clearForm(\"add-task\"); //clears form\n toogleVisibility(hiddenContainer, \"none\");\n toogleVisibility(addNewBtn, \"block\");\n document.getElementById(\"all-required\").style.display = \"none\";\n\n }else {\n\n document.getElementById(\"all-required\").style.display = \"block\";\n }\n });\n hiddenButtons.appendChild(submitBtn);\n \n //cancel button\n const cancelBtn = btnConstructor(\"cancel-btn\", \"Cancel\", \"block\");\n \n //cancels the form and hides it\n cancelBtn.addEventListener(\"click\", () => {\n\n document.getElementById(\"all-required\").style.display = \"none\";\n toogleVisibility(hiddenContainer,\"none\");\n toogleVisibility(addNewBtn, \"block\");\n clearForm(\"add-task\");\n });\n hiddenButtons.appendChild(cancelBtn);\n \n //append all elements to the DOM element\n hiddenContainer.appendChild(hiddenButtons);\n addNewTaskDiv.appendChild(hiddenContainer);\n content.appendChild(addNewTaskDiv);\n}", "async addTask(input = { tasklistId: '0' }) {\n\n return await this.request({\n name: 'task.add',\n args: [input.tasklistId],\n params: {\n 'todo-item': input['todo-item']\n }\n });\n\n }", "function addTask(name) {\n // Construct the Object from the given name\n let newTask = { title: name, isCompleted: 0 };\n\n todoListService.addTask(newTask).then((response) => {\n newTask.id = response.data.data[\"insertId\"];\n // Update the state\n setTasks([...tasks, newTask]);\n });\n\n // Update the server\n }", "async function addTask() {\n\n // the next line is only for testing purposes\n allTasks = await getArrayFromBackend('allTasks');\n\n let task = getValues();\n allTasks.push(task);\n\n saveArrayToBackend('allTasks', allTasks);\n\n // the next line is only for testing purposes\n allTasks = await getArrayFromBackend('allTasks');\n\n clearFields();\n showSnackbar(\"Task pushed to backlog!\");\n\n //Show backlog page with new task added\n setTimeout(function () {\n document.location.href = \"../pages/backlog.html\";\n }, 3000);\n}", "push(task){\n task.id = this.list.length;\n this.list.push(task); \n }", "function addToTasks() {\n\n //get value of the task and the description...\n var task = document.getElementById('task').value;\n var description = document.getElementById('description').value;\n\n var li = document.createElement(\"li\");\n var inputValue = \" Task: \" + task + \"\\nDescription: \" + description;//\n // console.log(f);\n var t = document.createTextNode(inputValue);\n li.appendChild(t);\n if (inputValue === '') {\n alert(\"Please type in a task!\");\n } else {\n document.getElementById(\"mytasks\").appendChild(li);\n }\n \n document.getElementById(\"task\").value = \"\";\n document.getElementById(\"description\").value = \"\";\n\n //add task and description to the added tasks section\n \n \n //console.log(task,description);\n // var x = document.getElementById(\"taskinfo\").firstChild;\n // console.log(x);\n // x.remove();\n\n // var y = document.getElementById(\"doneButton\").firstChild;\n // console.log(y);\n // y.remove();\n\n}", "function addTask(e) {\n if (taskInput.value === '') {\n alert('Add Task');\n\n }\n //create an li item\n\n const li = document.createElement('li');\n li.className = 'collection-item';\n //create a textnode and append to li\n li.appendChild(document.createTextNode(taskInput.value));\n\n //create a new link\n const link = document.createElement('a');\n\n //add class name\n link.className = 'delete-item secondary-content';\n\n // add link icon\n link.innerHTML = '<i class=\"fa fa-remove\"></i>'\n\n //append link to li\n\n li.appendChild(link);\n\n\n\n //append the li to the ul\n ulUpdate.appendChild(li);\n\n //store item into localstorage\n\n storeTasktoLocalStorage(taskInput.value);\n\n //clear the input\n taskInput.value = '';\n\n e.preventDefault();\n}", "addNewItem() {\n\t \tlet task = this.state.task;\n\t \tlet updated_list = this.props.data;\n\t \t\n\t \tupdated_list = updated_list.concat(task);\n\t \tthis.props.onItemAdd(updated_list);\n\t \tthis.setState({task : ''});\n \t\n \t}", "function addTaskToDom({id, text, completed, date}, parent) {\n const newList = parent.appendChild(document.createElement('li'))\n newList.classList.add(listItemClass)\n newList.id = id\n newList.innerHTML = template\n .replace('@@text', text)\n .replace('@@date', new Date(date).toLocaleString('en-GB', {\n year: 'numeric',\n month: 'short',\n day: 'numeric'\n }))\n .replaceAll('@@id', id)\n .replace('@@checked', completed ? 'checked' : '')\n\n saveTask()\n checkedList()\n deleteTask()\n editTask()\n showInfoNoTask()\n }", "function addTask(){\n var li = document.createElement(\"LI\");\n li.className = classNames[\"TODO_ITEM\"];\n \n chk = addCheck();\n lbl = addLabel();\n btn = addButton();\n \n li.appendChild(chk);\n li.appendChild(label);\n li.appendChild(btn);\n\n return li;\n}", "function createNewTask(taskInput) {\n var newTask = document.createElement('li');\n var newTaskHeader = document.createElement('h1');\n var newTaskButtonDelete = document.createElement('button');\n var newTaskButtonComplete = document.createElement('button');\n\n newTaskButtonDelete.innerText = 'Delete';\n newTaskButtonDelete.classList.add('deleteTaskButton');\n newTaskButtonComplete.innerText = 'Complete';\n newTaskButtonComplete.classList.add('completeTaskButton');\n newTaskHeader.innerText = taskInput.value;\n newTask.appendChild(newTaskHeader);\n newTask.appendChild(newTaskButtonDelete);\n newTask.appendChild(newTaskButtonComplete);\n\n //cross out complete tasks on click of 'Complete' button\n newTaskButtonComplete.addEventListener('click',function(event) {\n\n //if it is not completed\n var taskText = this.parentElement.querySelector('h1');\n if (this.parentElement.className.indexOf('done') == -1) {\n taskText.style.textDecoration = 'line-through';\n taskText.style.color = 'grey';\n this.parentElement.classList.add('done');\n subtractCount();\n } else {\n taskText.style.textDecoration = 'none';\n taskText.style.color = 'initial';\n this.parentElement.classList.remove('done');\n addCount();\n }\n });\n\n //remove list item on click of 'Delete' button\n newTaskButtonDelete.addEventListener('click',function(event) {\n this.parentElement.parentElement.removeChild(this.parentElement);\n subtractCount();\n });\n\n addCount();\n\n return newTask;\n }", "function addTask(event) {\n if (event.which === 13) {\n addTaskToToDoList();\n }\n}", "addTasks(newTask)\n {\n this._tasks.push(newTask);\n }", "function addNewTask(e){\n if(taskInput.value === '')\n {\n taskInput.style.borderColor = 'red';\n return;\n }\n\n //rest of code\n //create a li element when the user adds a task\n const li = document.createElement('li');\n //add a class\n li.className = 'collection-item';\n //create text node and append it\n li.appendChild(document.createTextNode(taskInput.value));\n //create new element for link\n const link = document.createElement('a');\n //add class and the x marker for a\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n link.className = 'delete-item secondary-content';\n //append link to li\n li.appendChild(link);\n if (checkAscend) {\n //append to ul\n taskList.appendChild(li);\n } else {\n taskList.prepend(li);\n } \n\n taskInput.value = '';\n \n \n e.preventDefault(); //disable form submission\n}", "function addNewTask() {\r\n let textInput = document.querySelector(\"#taskInput\");\r\n let allTasksFromMemory = JSON.parse(localStorage.getItem(\"tasks\"));\r\n\r\n if (textInput.value == \"\") {\r\n return;\r\n }\r\n\r\n // dio za kreiranje novog taska:\r\n let newLi = document.createElement(\"li\");\r\n let textNode = document.createTextNode(\"\");\r\n newLi.appendChild(textNode);\r\n newLi.classList.add(\"task\", \"unfinished\");\r\n\r\n //dole je novo\r\n newLi.innerHTML =\r\n '<img class=\"emptyCircle\" src=\"SVG/empty-circle.svg\" onclick=\"completeTask(this)\"/><img class=\"tickedCircle\" src=\"SVG/ticked-circle.svg\"/><div class=\"textPartofTask\"><p class=\"taskText\">' +\r\n textInput.value +\r\n '</p><p class=\"taskDate\"></p></div><div class=\"right-task-buttons\"><img src=\"SVG/edit-circle.svg\" class=\"right-hidden-button editCircle\" onclick=\"footerVisibilitySwitch(\\'edit\\',this)\"/><img src=\"SVG/thrash-circle.svg\" class=\"right-hidden-button thrashCircle\" onclick=\"deleteTask(this)\"/><img src=\"SVG/date-circle.svg\" class=\"right-hidden-button dateCircle\" onclick=\"showCalendar(this)\"/><img src=\"SVG/options-circle.svg\" class=\"optionsCircle\" onclick=\"expandRightButton(this)\"/></div>';\r\n\r\n newLi.setAttribute(\"id\", taskCounter);\r\n document.querySelector(\".allTasksUl\").appendChild(newLi);\r\n\r\n let attrib;\r\n if (allTasksFromMemory) {\r\n attrib = {\r\n id: taskCounter,\r\n taskText: textInput.value,\r\n state: \"unfinished\",\r\n };\r\n } else {\r\n attrib = [\r\n {\r\n id: taskCounter,\r\n taskText: textInput.value,\r\n state: \"unfinished\",\r\n },\r\n ];\r\n }\r\n\r\n if (allTasksFromMemory) {\r\n allTasksFromMemory.push(attrib);\r\n localStorage.setItem(\"tasks\", JSON.stringify(allTasksFromMemory));\r\n } else {\r\n localStorage.setItem(\"tasks\", JSON.stringify(attrib));\r\n }\r\n\r\n //skrivanje footera i clear-anje input forme\r\n taskCounter++;\r\n localStorage.setItem(\"taskCounter\", taskCounter);\r\n textInput.value = \"\";\r\n footerVisibilitySwitch(\"default\");\r\n}", "function handleAddTask(e) {\n const taskName = taskNameRef.current.value\n if (taskName === '') return e.preventDefault()\n setTasks(prevTask => {\n return [...prevTask, { \n id: uuidv4(), \n name: taskName, \n complete: false\n }]\n })\n taskNameRef.current.value = null\n\n e.preventDefault()\n }", "function addTodo(){\n self.todoList.push({task: self.text, done: false});\n self.text = null;\n }", "function taskAddedToProject(data) {\n $(\".modal-form__member-select\").val('');\n\n var newTask = $(data.partial).hide();\n\n if ( isTaskMember(data) ) {\n newTask.prependTo(s.tasks);\n newTask.first().show(500);\n $('.no-assigned-tasks-message').remove();\n }\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 if ( isProjectAdmin() ) {\n newTask.prependTo(s.tasks);\n newTask.first().show(500);\n }\n\n $('.add-task-modal').modal('hide');\n\n $(\".modal-form__member-select\").select2();\n }", "function addTask() {\n 'use strict';\n\n // Get the task:\n var task = document.getElementById('task');\n\n // Reference to where the output goes:\n var output = document.getElementById('output');\n\n \n // For the output:\n var message = '';\n\n if (task.value) {\n \n // Add the item to the array:\n tasks.push(task.value);\n \n // Update the page:\n message = '<h2>To-Do</h2><ol>';\n for (var i = 0, count = tasks.length; i < count; i++) {\n message += '<li>' + tasks[i] + '</li>';\n }\n message += '</ol>';\n output.innerHTML = message;\n \n } // End of task.value IF.\n\n \n\n // Return false to prevent submission:\n return false;\n \n} // End of addTask() function.", "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 createTask(e) {\n /* the data that is stored in allTasks variable is updated here with the localstorage */\n allTasks = JSON.parse(localStorage.getItem('data'));\n if (allTasks === null) {\n allTasks = [];\n }\n const newTask = {\n description: '',\n completed: false,\n index: allTasks.length + 1,\n };\n newTask.description = e;\n /* This procedure here verify if input text value contains nothing. */\n if (newTask.description === '') {\n document.getElementById('task').placeholder = 'this field cannot be blank';\n } else {\n allTasks.push(newTask);\n updateTasks(allTasks);\n }\n}", "function addTask(task) {\n task.elapsed = task.elapsed.hours + \":\" + task.elapsed.minutes + \":\" + task.elapsed.seconds;\n task.color = task.color.replace('#', '');\n task.description = \"(No description)\";\n task._csrf = document.getElementById('csrf').value;\n delete task.color;\n var req = new XMLHttpRequest();\n req.open('post', '/tasks');\n req.setRequestHeader('Content-Type', 'application/json');\n req.setRequestHeader('csrfToken', task._csrf);\n req.send(JSON.stringify(task));\n var taskAmt = document.getElementById('task-amt');\n taskAmt.value = taskAmt.placeholder = document.getElementById('hidden-value').value; //Set the value and placeholder to the projects default value\n}", "function createTask($scope, params, list) {\n if (!list.todo) { return; }\n $http.post('/todos', {\n task: list.todo,\n todoColor: list.color,\n list: list,\n isCompleted: false,\n isEditing: false\n }).success(response => {\n getLists($scope);\n $scope.createTaskInput = '';\n });\n params.createHasInput = false;\n $scope.createTaskInput = '';\n }", "function addtask(task) {\n event.preventDefault()\n $.ajax({\n type: 'POST',\n url: '/tasks',\n data: task\n }).then(function(response){\n console.log('back from POST', response);\n $('#listedTasks').empty();\n getTask();\n task = {\n task: $('#nameTask').val(''),\n notes: $('#notes').val('')\n };\n }).catch(function(error) {\n console.log('error in POST', error)\n alert('cannot to add');\n });\n}", "addTask(taskObj) {\n\t\tconst todos = this.getAndParse('tasks');\n\t\ttodos.push(taskObj);\n\t\tthis.stringifyAndSet(todos, 'tasks');\n\t}", "function addTask(task){\n\ttasks.push(task);\n}", "async addTask(val){\n let newTask = await apiCalls.createTask(val);\n // Display new Task in page\n this.setState({tasks: [...this.state.tasks, newTask]});\n }" ]
[ "0.8337535", "0.79939234", "0.7958698", "0.7857301", "0.78377897", "0.7768781", "0.7712337", "0.77026224", "0.7657753", "0.7639688", "0.7626981", "0.7617909", "0.75667524", "0.7559644", "0.75445503", "0.752365", "0.7522109", "0.75170773", "0.7467777", "0.74600327", "0.73948735", "0.7337048", "0.7324552", "0.73224014", "0.73060745", "0.7290591", "0.7289578", "0.72867906", "0.7272163", "0.723297", "0.7230055", "0.71899086", "0.71669346", "0.71496785", "0.71464527", "0.71409625", "0.71278924", "0.7116789", "0.7112163", "0.7110751", "0.7102269", "0.7100194", "0.71000224", "0.70941037", "0.70920485", "0.7082773", "0.7079333", "0.7064169", "0.7061476", "0.70550156", "0.70498276", "0.70389956", "0.7034284", "0.70282984", "0.7025433", "0.70235926", "0.70152116", "0.70055455", "0.69928086", "0.699144", "0.6988659", "0.6977919", "0.6975824", "0.6970023", "0.6968855", "0.6961293", "0.6953623", "0.6949957", "0.6945771", "0.690426", "0.6887213", "0.6881222", "0.6877803", "0.6876904", "0.68710387", "0.6861627", "0.6858889", "0.6854063", "0.68458426", "0.6831406", "0.68303776", "0.68293875", "0.6828983", "0.68280256", "0.6822441", "0.68169075", "0.6816443", "0.68078303", "0.6807514", "0.6800258", "0.679916", "0.6789636", "0.6780636", "0.6778167", "0.6775819", "0.6773972", "0.6773206", "0.6768134", "0.6761634", "0.67565626" ]
0.8252214
1
importamos el modulo math de Node Funcion registro de usuario
function crearUsuario(req, res){ // Instanciar el objeto Usuario var usuario = new Usuario(); // Guardar el cuerpo de la petición para mejor acceso de los datos que el usuario esta enviando // parametros = {"nombre": "", "apellido": "", "correo": "", "contraseña": ""} var parametros = req.body; // usuario.nombre = parametros.nombre; usuario.apellido = parametros.apellido; usuario.correo = parametros.correo; usuario.contrasena = parametros.contrasena; usuario.rol = "usuario"; usuario.imagen = null; // Guardar y validar los datos // db.coleccion.insert() usuario.save((err, usuarioNuevo)=>{ if(err){ // El primner error a validar sera a nivel de servidor e infraestructura // para esto existen states o estados. res.status(500).send({ message: "Error en el servidor"}); } else { if(!usuarioNuevo){ // 404 -> Pagina no encontrada // 200 -> Ok pero con una alerta indicando que los datos invalidos res.status(200).send({message: "No fue posible realizar el registro"}); } else { res.status(200).send({usuario: usuarioNuevo}); } } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function miFuncion(x) {\n\n return this.numero + x;\n\n}", "function calcularModificador(atributoDoPersonagem) {\n switch(atributoDoPersonagem) {\n case 1:\n return -5;\n case 2:\n case 3:\n return -4;\n case 4:\n case 5:\n return -3;\n case 6:\n case 7:\n return -2;\n case 8:\n case 9:\n return -1;\n case 10:\n case 11:\n return 0;\n case 12:\n case 13:\n return 1;\n case 14:\n case 15:\n return 2;\n case 16:\n case 17:\n return 3;\n case 18:\n case 19:\n return 4;\n case 20:\n return 5;\n case 21:\n return 6;\n case 22:\n return 7;\n case 23:\n return 8;\n case 24:\n return 9\n case 25:\n return 10;\n }\n}", "function SacarResto()\n{\n\tvar numeroDividendo;\n\tvar numeroDivisor;\n\tvar resultado;\n\tvar resto = \"El resto es \";\n\n\tnumeroDividendo = document.getElementById('numeroDividendo').value;\n\tnumeroDivisor = document.getElementById('numeroDivisor').value;\n\tresultado = (parseInt(numeroDividendo) % parseInt(numeroDivisor));\n\talert(resto + resultado);\n}", "mod() {}", "mod() {}", "function pari(userNumero) {\n //creiamo una variabile random tra 0 e 5\n var pcNumero = random_1_to_5();\n alert(\"il pc ha scelto \" + pcNumero);\n var sum = pcNumero + userNumero;\n alert(sum)\n\n if (sum % 2 == 0) {\n return true;\n } else {\n return false;\n }\n}", "function modulus_Function(a, b) { //Function returns a and b\n return a % b;\n}", "function generarAleatorio(valor)\r\n{\r\n return numIdentificacion = Math.floor(Math.random() * ((valor+1) - 0) + 0); \r\n}", "function perimetroCuadrado(lado){\n return lado*4;\n}", "function mod(a, b){return ((a%b)+b)%b;}", "function elevar_al_cuadrado(numero)\n{\n return numero * numero;\n}", "function modul(x=null, y=null){\n\treturn x % y;\n}", "function User() {\n if (!userRank)\n var userRank = -8;\n\n if (!progress)\n var progress = 0;\n\n var levels = [-8,-7,-6,-5,-4,-3,-2,-1,1,2,3,4,5,6,7,8]; // Массив существующих уровней уровней\n if (!incLevel)\n var incLevel = 0;\n\n\n this.incProgress = function(taskRank) {\n console.log('Уровень задачи', taskRank);\n var n = 0;\n if (taskRank == userRank) { // Уровни задачи и юзера одинаковые\n progress += 3;\n }\n\n if (levels.indexOf(taskRank) - levels.indexOf(userRank) == -1) { // Уровень задачи меньше уровня юзера на один уровень\n progress += 1;\n }\n\n if (taskRank > userRank) { // Уровень задачи выше уровня юзера\n progress += (10 * Math.pow((levels.indexOf(taskRank) - levels.indexOf(userRank)) , 2));\n }\n\n if (progress >= 100) { // Расчет количества уровней, на сколько нужно прибавить userRank\n n = progress;\n progress = n%100; // Возвращаем прогресс в диапазон от 0 до 99\n n = (n - n%100) + '';\n var arr = n.split('');\n while (n % 10 == 0) {\n n = n/10; // В конце цикла n будет равен количеству скачков на новый уровень\n }\n console.log('Повышение на ', n, ' уровней');\n\n }\n incLevel = n;\n userRank = levels[levels.indexOf(userRank) + incLevel] || 8;\n if (userRank == 8)\n progress = 0;\n\n };\n\n\n\n this.rank = function() {\n return 'User rank = ' + userRank;\n };\n\n this.progress = function() {\n return 'Progress = ' + progress;\n };\n}", "function perimetroCuadrado(lado) {\n return lado * 4; \n}", "function perimetroCuadrado(lado){\n return lado * 4\n}", "function perimetroCuad(lado){\n return lado * 4;\n}", "function perimetro(lado2){\n return lado2*4;\n}", "function perimetroCuadradoFuncion(lado){\n return lado * 4\n }", "function perimetroCuadrado(lado) {\n return lado * 4; \n}", "function funcion() {\n return numeracion;\n}", "function remainder(){\n \n let multiply_result = multiply();\n \n let final_result = multiply_result % 15\n\nconsole.log(\"\\n\\nThe final result is \\t\"+ final_result) ;\n \n }", "function calcularResto() {\n valor1 = Number($(\"#txtValor1\").val());\n divisor = Number($(\"#txtDivisor\").val());\n resto = valor1 % divisor;\n\n $(\"#pResto\").html(\"El resto es: \" + (resto));\n}", "function perimetrocuadrado(lado) {\n return lado * 4;\n}", "function perimetroCuadrado(lado) {\n return lado * 4 ;\n}", "function getIdUsuario (){\n\treturn Math.round(Math.random() * 50) + 1;\n}", "function aleatorio(minimo, maximo){\n\tvar Numero= Math.floor(Math.random() * (maximo - minimo + 1) + minimo );\n\treturn Numero;\n}", "function controlModulo() {\n\n\treturn true;\n}", "function operacionResiduo(dividendo, divisor) {\n //inicializar variables\n var divid = Number(dividendo);\n var divis = Number(divisor);\n\n var contenido = ''; //inicializar variable que llevara el html de la tabla\n contenido += '<table><tr><th>Dividendo</th><th>Divisor</th><th>Número Generado</th></tr>'; //abrir tabla y agregar titulos\n\n var res = divid % divis; // calcular numero aleatorio con formula\n contenido += '<tr class=\"animated fadeInLeft\"><td>' + divid.toString() + '</td><td>' + divis.toString() + '</td><td><b>' + res + '</b></td></tr>'; //imprimir numero generado en tabla\n contenido += '</table>'; //cerrar tabla\n $('#residuo').empty(); //vaciar resultados anteriores\n $('#residuo').append(contenido); //vaciar resultados anteriores\n}", "function remainder(num1, num2){\n\n let modulo = num1 % num2;\n console.log(\"The remainder between \" + num1 + \" and \" + num2 + \" is \" + modulo);\n return modulo ;\n \n \n }", "function modulusFunction() {\n var x = 25%6;\n document.getElementById(\"mod\").innerHTML = \"25 / 6 has a remainder of: \" + x;\n}", "function dobro(numero) {\n return numero * 2;\n}", "function modulo10(string) {\n\n // Description of algorithm on\n // Postinance, Descrizione dei record, Servizi elettronici\n var modulo10Table = [\n [0, 9, 4, 6, 8, 2, 7, 1, 3, 5, \"0\"],\n [9, 4, 6, 8, 2, 7, 1, 3, 5, 0, \"9\"],\n [4, 6, 8, 2, 7, 1, 3, 5, 0, 9, \"8\"],\n [6, 8, 2, 7, 1, 3, 5, 0, 9, 4, \"7\"],\n [8, 2, 7, 1, 3, 5, 0, 9, 4, 6, \"6\"],\n [2, 7, 1, 3, 5, 0, 9, 4, 6, 8, \"5\"],\n [7, 1, 3, 5, 0, 9, 4, 6, 8, 2, \"4\"],\n [1, 3, 5, 0, 9, 4, 6, 8, 2, 7, \"3\"],\n [3, 5, 0, 9, 4, 6, 8, 2, 7, 1, \"2\"],\n [5, 0, 9, 4, 6, 8, 2, 7, 1, 3, \"1\"],\n ];\n\n var module10Report = 0;\n\n if (string) {\n for (var i = 0; i < string.length; i++) {\n switch (string[i]) {\n case \"0\":\n module10Report = modulo10Table[module10Report][0];\n break;\n case \"1\":\n module10Report = modulo10Table[module10Report][1];\n break;\n case \"2\":\n module10Report = modulo10Table[module10Report][2];\n break;\n case \"3\":\n module10Report = modulo10Table[module10Report][3];\n break;\n case \"4\":\n module10Report = modulo10Table[module10Report][4];\n break;\n case \"5\":\n module10Report = modulo10Table[module10Report][5];\n break;\n case \"6\":\n module10Report = modulo10Table[module10Report][6];\n break;\n case \"7\":\n module10Report = modulo10Table[module10Report][7];\n break;\n case \"8\":\n module10Report = modulo10Table[module10Report][8];\n break;\n case \"9\":\n module10Report = modulo10Table[module10Report][9];\n break;\n }\n }\n }\n\n return modulo10Table[module10Report][10];\n}", "function rolandoDoisDados(){\n let numero1 = Math.floor(Math.random() * 6) + 1;\n let numero2 = Math.floor(Math.random() * 6) + 1;\n let somaDados = numero1+numero2\n return somaDados;\n}", "function mod(input, div){\n return (input % div + div) % div;\n}", "function controlModuloUsuario() {\n\tmetodo = document.getElementById(\"metodo\").value;\n\tif (metodo == \"add\") {\n\t\tup = document.getElementById(\"password\");\n\t\tuser_password = TrimDerecha(TrimIzquierda(up.value));\n\t\tif (user_password == \"\") {\n\t\t\t//alert(\"Debe llenar este campo\");\n\t\t\t//up.focus();\n\t\t\treturn 'Debe llenar el password';\n\t\t}\n\t}\n\tif (metodo == \"modify\") {\n\t\tup = document.getElementById(\"password\");\n\t\tcambiar = document.getElementById(\"cambiar\").value;\n\t\tif (cambiar == \"yes\") {\n\t\t\tuser_password = TrimDerecha(TrimIzquierda(up.value));\n\t\t\tif (user_password == \"\") {\n\t\t\t\t// alert(\"Debe llenar este campo\");\n\t\t\t\t// up.focus();\n\t\t\t\t// return false;\n\t\t\t\treturn 'Debe Llenar el nuevo password';\n\t\t\t}\n\t\t}\n\t}\n\treturn true;\n}", "function mathModulo(n, d) {\n return ((n % d) + d) % d;\n}", "function controlModulo() {\n\n return true;\n}", "function modulo(r, l){\n\n return modulo(r-2, l);\n}", "function perimetroTriangulo(ladoTriangulo){\n return ladoTriangulo * 3;\n}", "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "function posModulo(x, divisor){\n return ((x % divisor) + divisor) % divisor;\n }", "function ejercicio04(user){\n console.log(user);\n adulto = 0;\n if (user.edad>18)\n {\n adulto = 1;\n }\n else\n {\n return \"El usuario \" + user.nombre + \" no es mayor de edad\";\n }\n\n if (adulto == 1)\n {\n return \"El usuario \" + user.nombre + \" es mayor de edad. Por lo tanto, le he creado un usuario con el correo \" + user.correo;\n }\n \n}", "static euclideanModulo (n, m) {\n\n return ( ( n % m ) + m ) % m;\n\n }", "function modulo (x,y){\nif( x< y){\n\treturn x;\n }\n\twhile(x >=0){\n x= x-y;\n }\n return y+x;\n\t}", "function perimetroCuadrado(ladoCuadrado){\n return ladoCuadrado * 4;\n}", "function remainder(x, y) {\nreturn x%y;\n}", "function resteDiv(a, b) {\n //% modulo divise a par b et donne le reste\n return a % b;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function fixedModulo(n, m) {\n return ((n % m) + m) % m;\n}", "function euclideanModulo(a, b) {\n return (a % b + b) % b;\n}", "function perimetroCuadrado(lado) {\n return lado * 4;\n}", "function checkNumSeguidores(node){\r\n return node.num_followers >= document.getElementById('num_followers').value;\r\n}", "function numeroAlCuadrado (numero) {\n var calculo;\n calculo = numero*numero;\n\n return calculo;\n}", "function modulo() {\n memory = document.getElementById(\"display\").value;\n document.getElementById(\"display\").value = \"\";\n teken = \"%\";\n}", "function euclideanModulo(a, b) {\n return (a % b + b) % b;\n}", "function euclideanModulo(a, b) {\n return (a % b + b) % b;\n}", "function remainder(n1, n2) {\n return n1 % n2;\n }", "function operacion(){\r\n if (numeros.segundo === null || numeros.segundo === \"\" || Number.isNaN(numeros.segundo)){ \r\n return raiz(); // Si hay un solo número, llamar a la funcion raiz\r\n } else {\r\n return aritmetica(); // Si hay dos a la función aritmética\r\n }\r\n }", "function MultiplicarPorDois(valor){\n return valor * 2;\n}", "function modulusOperator() {\n var modulus = 30 % 4;\n document.getElementById(\"Modulus\").innerHTML = \"When you divide 30 by 4 you have a remainder of: \" + modulus;\n}", "function mod(x, y) {\r\n\treturn (x%y + y)%y;\r\n}", "function alunofunc(nome, n1, n2) {\n this.nome = nome;\n this.n1 = n1;\n this.n2 = n2;\n\n this.media = () => {\n return (this.n1 + this.n2) / 2;\n }\n}", "function mod(a, b) {\n\treturn (a % b + b) % b\n}", "function numModNum(num1,num2){\n alert(num1%num2)\n}", "function utilizacionDeInstalacion(po, numServ, cadena){\n let cuerpo = po\n for(let i = 0; i < cadena.length; i++){\n let base = ((numServ - (i+1))/numServ) * cadena[i]\n cuerpo += base\n }\n return 1 - cuerpo\n}", "function fatorial(numero) {\n return 0\n}", "function mod(a, b) {\n return (a % b + b) % b\n}", "function AdelanteFact(dato,ciclo,ruta,num)\n{\n\t$(\"#btnAntFact\").attr(\"onClick\", \"validarLectAntFact()\");\n\tvar numero = parseInt(num);\n\tvar cantidad = dato;\n\tvar cic = ciclo;\n\tvar rut = ruta;\n\n\tif(numero != cantidad-1)\n\t{\n\t\tvar RegAnt = numero;\t\n\t\tvar RegSig = numero + 1;\n\t\tvar RegSigSig = numero + 2;\n\t\tdocument.getElementById('txtNumRegistro').value=RegSig;\n\t}\n\n\telse\n\t{\n\t\tdocument.getElementById('txtNumRegistro').value=numero;\n\t}\n\n \tdbShell.transaction(function(tx) \n\t{ \t\t\n\t\ttx.executeSql(\"select * from UsuariosServicios where Ciclo=? and Ruta=?\",[cic,rut], \n\t\tfunction(tx, result)\n\t\t{\n\t\t\t$(\"#btnAntFact span\").removeClass(\"disable\");\n\t\t\t$(\"#btnAntFact i\").removeClass(\"disable\");\n\n\t\t\tif(RegSig == cantidad-1)\n\t\t\t{\n\t\t\t\tdocument.getElementById('txtIdUsuarioLecturaSigFact').value = \" \";\n\t\t\t\t$(\"#btnSigFact i\").addClass(\"disable\");\n\t\t\t\t$(\"#btnSigFact span\").addClass(\"disable\");\n\t\t\t\t$(\"#btnSigFact\").attr(\"onClick\", \" \");\n\t\t\t}\n\n\t\t\tif(RegSig > 0 && RegSig <= cantidad-2)\n\t\t\t{\n\t\t\t\t$(\"#btnSigFact i\").removeClass(\"disable\");\n\t\t\t\t$(\"#btnSigFact span\").removeClass(\"disable\");\n\t\n\t\t\t\tvar ConsecSig = result.rows.item(RegSigSig)['Consecutivo'];\n\n\t\t\t\tdocument.getElementById('txtIdUsuarioLecturaSigFact').value = \"Sig.: \" + result.rows.item(RegSigSig)['IdUsuario'] + \"-\" + ciclo + \"-\" + ruta + \"-\" + ConsecSig;\n\t\t\t}\n\n\t\t\tvar ConsecAnt = result.rows.item(RegAnt)['Consecutivo'];\n\n\t\t\tdocument.getElementById('txtIdUsuarioLecturaAntFact').value = \"Ant.: \" + result.rows.item(RegAnt)['IdUsuario'] + \"-\" + ciclo + \"-\" + ruta + \"-\" + ConsecAnt;\n\n\n\t\t\tvar lecturaActual = result.rows.item(RegSig)['LecturaActual'];\n\t\t\tvar causalActual = result.rows.item(RegSig)['CausalActual'];\n\t\t\tvar impreso = result.rows.item(RegSig)['impreso'];\n\n\t\t\tvar idUsuario = result.rows.item(RegSig)['IdUsuario'];\n\t\t\tdocument.getElementById('txtIdUsuarioLecturaFact').value = idUsuario;\n\n\t\t\tif(impreso == \"si\")\n\t\t\t{\n\t\t\t\tactivarImpresionFact();\n\t\t\t\t$(\"#datos-entradaFact\").show();\n\t\t\t\t$(\"#datosGenerales\").show();\n\t\t\t\t$(\"#LecturaNoDiligenciada\").hide();\n\t\t\t\tdocument.getElementById('txtNumeroFact').value = result.rows.item(RegSig)['Numero'];\n\t\t\t\t\n\t\t\t\tdocument.getElementById('txtidUsuarioLecturaCtrl').value = idUsuario;\n\n\t\t\t\tvar Ciclotx = result.rows.item(RegSig)['Ciclo'];\n\t\t\t\tdocument.getElementById('txtCiclo2Fact').value = \"Ciclo: \" + Ciclotx;\n\n\t\t\t\tvar Rutatx = result.rows.item(RegSig)['Ruta'];\n\t\t\t\tdocument.getElementById('txtRuta2Fact').value = \"Ruta: \" + Rutatx;\n\t\t\t\t\n\t\t\t\tdocument.getElementById(\"txtImpresoFact\").value = impreso;\n\n\n\t\t\t\tvar nombreUsuario = result.rows.item(RegSig)['Suscriptor'];\n\t\t\t\tdocument.getElementById(\"txtIdNombreUsuarioFact\").innerHTML = \"ID:\" + \"<b>\" + idUsuario + \" - \" + nombreUsuario.toUpperCase() + \"</b>\";\n\t\t\t\t\n\t\t\t\tvar direccionUsuario = result.rows.item(RegSig)['Direccion'];\n\t\t\t\tdocument.getElementById('txtDireccionFact').innerHTML = \"Dirección: <b>\" + direccionUsuario.toUpperCase() + \"</b>\";\n\n\t\t\t\tdocument.getElementById('txtMedidorFact').innerHTML = \"MED.# <b>\" + result.rows.item(RegSig)['NumeroMedidor'] + \"</b>\";\n\n\t\t\t\tdocument.getElementById('txtConsumoFact').innerHTML = \"Consumo: <b>\" + result.rows.item(RegSig)['Consumo'] + \"</b>\";\n\n\n\t\t\t\tvar Uso;\n\t\t\t\tvar IdUsotx = result.rows.item(RegSig)['IdUso'];\n\t\t\t\tdocument.getElementById('txtUsoFact').value=IdUsotx;\n\n\t\t\t\tif(IdUsotx == 1)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>RESIDENCIAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(IdUsotx == 2)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>COMERCIAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(IdUsotx == 3)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>INDUSTRIAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(IdUsotx == 4)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>OFICIAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(IdUsotx == 5)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>ESPECIAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(IdUsotx == 6)\n\t\t\t\t{\n\t\t\t\t\tUso = \"Uso: <b>PROVISIONAL</b>\";\n\t\t\t\t}\n\n\t\t\t\tvar categoria = result.rows.item(RegSig)['IdCategoria'];\n\n\t\t\t\tdocument.getElementById(\"txtUsoCatFact\").innerHTML = Uso + \" Cat: <b>\" + categoria + \"</b>\";\n\n\t\t\t\tvar CtasAcR = parseInt(result.rows.item(RegSig)['CtasAcR']);\n\t\t\t\tvar CtasAcNR = parseInt(result.rows.item(RegSig)['CtasAcNR']);\n\t\t\t\tvar CtasAlR = parseInt(result.rows.item(RegSig)['CtasAlR']);\n\t\t\t\tvar CtasAlNR = parseInt(result.rows.item(RegSig)['CtasAlNR']);\n\t\t\t\tvar CtasAsR = parseInt(result.rows.item(RegSig)['CtasAsR']);\n\t\t\t\tvar CtasAsNR = parseInt(result.rows.item(RegSig)['CtasAsNR']);\n\n\t\t\t\tvar CuentasAcueducto;\n\t\t\t\tvar CuentasAlcantarillado;\n\t\t\t\tvar CuentasAseo;\n\t\t\t\tvar NumeroCuentasAcueducto = CtasAcR+CtasAcNR;\n\t\t\t\tvar NumeroCuentasAlcantarillado = CtasAlR+CtasAlNR;\n\t\t\t\tvar NumeroCuentasAseo = CtasAsR+CtasAsNR;\n\n\t\t\t\tif (CtasAcR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAcueducto = \"# Ctas Acued.: <b>\" + CtasAcR + \" (R)</b>\";\n\t\t\t\t}\n\n\t\t\t\tif (CtasAcNR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAcueducto = \"# Ctas Acued.: <b>\" + CtasAcR + \" (NR)</b>\";\n\t\t\t\t}\n\n\t\t\t\tif (CtasAlR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAlcantarillado = \"# Ctas Alcant.: <b>\" + CtasAlR + \" (R)</b>\";\n\t\t\t\t}\n\n\t\t\t\tif (CtasAlNR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAlcantarillado = \"# Ctas Alcant.: <b>\" + CtasAlNR + \" (NR)</b>\";\n\t\t\t\t}\n\n\t\t\t\tif (CtasAsR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAseo = \"# Ctas Aseo: <b>\" + CtasAsR + \" (R)</b>\";\n\t\t\t\t}\n\n\t\t\t\tif (CtasAsNR > 0) \n\t\t\t\t{\n\t\t\t\t\tCuentasAseo = \"# Ctas Aseo: <b>\" + CtasAsNR + \" (NR)</b>\";\n\t\t\t\t}\n\n\t\t\t\tdocument.getElementById(\"txtNumCuentasAcueductoFact\").innerHTML = CuentasAcueducto;\n\t\t\t\tdocument.getElementById(\"txtNumCuentasAlcantarilladoFact\").innerHTML = CuentasAlcantarillado;\n\t\t\t\tdocument.getElementById(\"txtNumCuentasAseoFact\").innerHTML = CuentasAseo;\n\n\t\t\t\tvar VolumenAseo = result.rows.item(RegSig)['VolumenAseo'];\n\n\t\t\t\tdocument.getElementById(\"txtToneladasProducidasFact\").innerHTML = \"Ton. de Basura Prod: <b>\" + VolumenAseo + \"</b>\";\n\n\t\t\t\tvar LecturaAnteriortx = document.getElementById('txtLecturaAnteriorFact');\n\n\t\t\t\tLecturaAnteriortx.innerHTML = \"Lectura Anterior: <b>\" + result.rows.item(RegSig)['LecturaAnterior'] + \"</b>\";\n\n\t\t\t\tvar ConsumoMediotx = document.getElementById('txtConsumoPromedioFact');\n\n\t\t\t\tConsumoMediotx.innerHTML = \"Consumo Promedio: <b>\" + result.rows.item(RegSig)['ConsumoMedio'] + \"</b>\";\n\n\t\t\t\tif (causalActual == 0)\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById('txtCausalFact').innerHTML = \"Sin Causal\";\n\t\t\t\t\tdocument.getElementById('txtLecturaActualFact').innerHTML = \"Lectura Actual: <b>\" + lecturaActual + \"</b>\";\n\t\t\t\t}\n\n\t\t\t\tif(causalActual > 0)\n\t\t\t\t{\n\t\t\t\t\tasignarCausalFact(causalActual);\t\n\t\t\t\t}\n\n\t\t\t\tvar observacionActual = result.rows.item(RegSig)['ObservacionActual'];\n\n\t\t\t\tif(observacionActual == 0)\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById('txtObservacionFact').innerHTML = \"Sin Observación\";\n\t\t\t\t}\n\n\t\t\t\tif(observacionActual > 0)\n\t\t\t\t{\n\t\t\t\t\tasignarObsFact(observacionActual);\n\t\t\t\t}\n\n\t\t\t\tvar fechaFactura = result.rows.item(RegSig)['fechaFactura'];\n\t\t\t\tvar fechaLimiteDePago = result.rows.item(RegSig)['fechaLimiteDePago'];\n\t\t\t\tvar numeroFactura = result.rows.item(RegSig)['numeroFactura'];\n\n\t\t\t\tif (fechaFactura == \"\") \n\t\t\t\t{\n\t\t\t\t\tsetFechaFactura();\n\t\t\t\t\tsetNumeroFactura();\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tdocument.getElementById('txtFechaFact').innerHTML = \"Fecha Facturación: <b>\" + fechaFactura + \"</b>\";\n\t\t\t\t\tdocument.getElementById('txtFechaFactura').value = fechaFactura;\n\n\t\t\t\t\tdocument.getElementById('txtFechaLimiteFact').innerHTML = \"Fecha Limite de Pago: <b>\" + fechaLimiteDePago + \"</b>\";\n\t\t\t\t\tdocument.getElementById('txtFechaLimiteDePagoFactura').value = fechaLimiteDePago;\n\n\t\t\t\t\tdocument.getElementById('txtNumeroFactReal').value = numeroFactura;\n\t\t\t\t\tdocument.getElementById('txtNumFact').innerHTML = \"Factura #: <b>\" + numeroFactura + \"</b>\";\n\t\t\t\t}\n\n\t\t\t\tcargarDatosEmpresaFact();\n\t\t\t\tcargarDatosPeriodoFact();\n\n\t\t\t\tvar ConsuMedio = result.rows.item(RegSig)['ConsumoMedio'];\n\t\t\t\tvar ConsumoMes = result.rows.item(RegSig)['Consumo'];\n\t\t\t\tvar EdadAcueducto = result.rows.item(RegSig)['EdadAcueducto'];\n\t\t\t\tdocument.getElementById('txtEdadAcueducto').value = EdadAcueducto;\n\t\t\t\tdocument.getElementById('txtEdadAcueductoFact').innerHTML = \"Facturas Pendientes: <b>\" + EdadAcueducto + \"</b>\";\n\n\t\t\t\tif (ConsumoMes > 0) \n\t\t\t\t{\n\t\t\t\t\tliquidacionFactura(ConsumoMes,VolumenAseo,IdUsotx,categoria,idUsuario,NumeroCuentasAcueducto,NumeroCuentasAlcantarillado,NumeroCuentasAseo,EdadAcueducto);\n\t\t\t\t}\n\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tliquidacionFactura(ConsuMedio,VolumenAseo,IdUsotx,categoria,idUsuario,NumeroCuentasAcueducto,NumeroCuentasAlcantarillado,NumeroCuentasAseo,EdadAcueducto);\n\t\t\t\t}\n\n\t\t\t\tvar fechaLectura = result.rows.item(RegSig)['Fecha'];\n\t\t\t\tdocument.getElementById('txtFechaFinalFact').innerHTML = \"Fecha de Lectura: <b>\" + fechaLectura + \"</b>\";\n\n\t\t\t\tvar fechaInicial = result.rows.item(RegSig)['UltimaFechaDeFacturacion'];\n\n\t\t\t\tdocument.getElementById('txtFechaInicialFact').innerHTML = \"Fecha Inicial: <b>\" + fechaInicial + \"</b>\";\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\tdesactivarImpresionFact();\n\t\t\t\t$(\"#datos-entradaFact\").hide();\n\t\t\t\t$(\"#datosGenerales\").hide();\n\t\t\t\t$(\"#LecturaNoDiligenciada\").show();\n\t\t\t}\n\t\t});\n\t});\n}", "mod(x, y) {\n return (x % y + y) % y;\n }", "function mod$1(dividend,divisor){return (dividend % divisor + divisor) % divisor;}", "function obtenerPuntaje(){\n var numeroUno = 2, numeroDos = 3;\n\nfunction agregar() {\n return nombre + \"puntaje\" + (numeroUno + numeroDos)\n }\n return agregar(); \n}", "function presionarNumero(numero){\n console.log(\"numero\",numero)\n\n calculadora.agregarNumero(numero)\n actualizarDisplay()\n}", "function determinaNumero( numero ){\n if( (numero % 2) == 1 ){\n console.log(\" El numero es impar \"+numero);\n }\n else if((numero%2) == 0){\n console.log(\"El numero es par \"+numero);\n }\n\n}", "function MD5ToMod(md5Value, mod) \n{\n //convert hex to dec\n var dec = parseInt(md5Value, 16);\n //return mod\n return dec % mod;\n}", "function aleatorio(menor, mayor) {\n let posibilidades = mayor - menor;\n let aleatorio = Math.random() * (posibilidades + 1);\n aleatorio = Math.floor(aleatorio);\n return menor + aleatorio;\n}", "function euclideanModulo( n, m ) {\n\n\treturn ( ( n % m ) + m ) % m;\n\n}", "function mod(x, y) {\n\treturn (x%y + y)%y;\n}", "function operacion(){\n valor=0;\n var incrementar = function(){\n return valor += 3;\n }\n return incrementar;\n}", "function mod(num1, num2){\n return num1%num2;\n}", "function modulus (x, y) {\n\treturn x % y;\n}", "function mod( a, b ){ let v = a % b; return ( v < 0 )? b+v : v; }", "function crear(numero) {\n return {\n porDos: function() {\n const resultado = numero * 2;\n console.log('el numero es', resultado);\n return resultado;\n }\n };\n}", "function remainder(x, y) {\n return x % y;\n }", "function fixedModulus(a, b) {\n return ((a % b) + b) % b;\n}", "function generarCola(usuario,permiso) {\n\tconsole.log(\"generamos cola\");\n\tlet tabla = {\n\t\t\"datos\":[\n\t\t\t{\n\t\t\t\t\"Estado\":\"Genera permiso\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdte. Autoriz. Permiso\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdtes. Justificante\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Pdte. Autoriz. Justificante\",\n\t\t\t\t\"Contador\":0\n\t\t\t},\n\t\t\t{\n\t\t\t\t\"Estado\":\"Ausencia finalizada\",\n\t\t\t\t\"Contador\":0\n\t\t\t}\n\t\t]\n\t};\n\tswitch (permiso) {\n\t\tcase \"Profesor\":\n\t\t\tpideDatos(\"peticion\",\"?usuario=\"+usuario,(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tbreak;\n\t\tcase \"Directivo\":\n\t\t\tpideDatos(\"peticion\",\"?\",\n\t\t\t\t(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\tif (dato[\"estado_proceso\"]===1 || dato[\"estado_proceso\"]===3){\n\t\t\t\t\t\t\tif (dato.usuario===usuario){\n\t\t\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t\t//json=JSON.parse(data);\n\t\t\t\t}\n\t\t\t);\n\n\n\t\t\tbreak;\n\t\tcase \"Admin\":\n\t\t\tpideDatos(\"peticion\",\"?\",\n\t\t\t\t(data) => {\n\t\t\t\t\t//Convertimos a JSON los datos obtenidos\n\t\t\t\t\tlet json = JSON.parse(data);\n\t\t\t\t\t//Colocamos cada permiso en su lugar\n\t\t\t\t\tfor(let dato of json){\n\t\t\t\t\t\ttabla.datos[dato[\"estado_proceso\"]-1].Contador++;\n\t\t\t\t\t}\n\t\t\t\t\tprintDatos(tabla,\"#cola\");\n\t\t\t\t\t//json=JSON.parse(data);\n\t\t\t\t}\n\t\t\t);\n\t\t\tbreak;\n\t}\n}", "getRating(){\n if(!this.user)\n return 0;\n const CRC32 = require('crc-32');\n let crc = CRC32.str(this.user.name + ' ' + this.user.surname);\n if(crc < 0)\n crc = -(crc+1);\n let r = crc%35;\n return 65 + r;\n }", "function calcular() {\r\n console.log(\"SUMA: \" + (6 + 6));\r\n console.log(\"RESTA: \" + (6 - 6));\r\n console.log(\"MULTIPLICACIÓN: \" + (6 * 6));\r\n console.log(\"DIVISIÓN: \" + (6 / 6));\r\n}", "function Multiplicar(valor){\n return valor * 2;\n}", "mod(n, m) {\n\t\treturn ((n % m) + m) % m;\n\t}", "mod(n, m) {\n\t\treturn ((n % m) + m) % m;\n\t}", "function euclideanModulo( n, m ) {\n\n\t\treturn ( ( n % m ) + m ) % m;\n\n\t}" ]
[ "0.5832369", "0.56464946", "0.5642811", "0.5607719", "0.5607719", "0.5573431", "0.5510408", "0.54982203", "0.54923147", "0.54798037", "0.54572386", "0.5440211", "0.54348415", "0.5391405", "0.5386858", "0.5377617", "0.53672373", "0.5365382", "0.53635323", "0.5362833", "0.5357882", "0.53517705", "0.5350907", "0.535043", "0.5341874", "0.5340768", "0.5340116", "0.53287935", "0.53265315", "0.53210896", "0.53182614", "0.53147376", "0.5310895", "0.5309631", "0.53050584", "0.5303128", "0.52997917", "0.5297669", "0.52957505", "0.5295062", "0.5295062", "0.5295062", "0.5295062", "0.5294628", "0.5294623", "0.5293355", "0.5293142", "0.5293009", "0.5272267", "0.5265935", "0.5260654", "0.5260654", "0.5260654", "0.5260654", "0.5260654", "0.5260654", "0.5260654", "0.5260654", "0.5260654", "0.52539116", "0.5253547", "0.5251023", "0.5241423", "0.52372634", "0.52347976", "0.52347976", "0.5234463", "0.52282345", "0.5221521", "0.5215749", "0.5206362", "0.5204369", "0.5202953", "0.5199068", "0.519616", "0.51949835", "0.5193908", "0.5183768", "0.51773244", "0.5175933", "0.51696116", "0.51640224", "0.51526475", "0.515036", "0.5145643", "0.5144417", "0.51431507", "0.5138407", "0.51341563", "0.5131549", "0.51271933", "0.5118809", "0.511438", "0.5101934", "0.51008666", "0.5088656", "0.50881463", "0.5087546", "0.5086699", "0.5086699", "0.5084761" ]
0.0
-1
QUERY HOOKS ============== Handle EINs entered in searchbox with a hyphen
function checkForEIN(query) { // Base Regex: /^[0-9]{2}\-\d{7}$/g; // Assume query is an EIN as soon as 2 digits entered after hyphen const regexEIN = /^[0-9]{2}\-\d{2}/g; const isEIN = regexEIN.test(query); if (query.includes('-') && isEIN) { // TODO Will remove hyphen if query ALSO includes prohibit string (e.g. -foo 12-3456789) // TODO Add toast - will assist with any confusion caused by routing:true setting... // ...which autoupdates the url withOUT the hyphen return query.replace('-', ''); } else { return query; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 onclickForSearchButton(event)\n{\n //console.log(event);\n \n var q = document.getElementById('search-query').value; //escape here?\n \n //some kanji searches are going to be legitimately only one char.\n //we need a trim() function instead...\n if(q.length < 1)\n {\n return;\n }\n \n buttonSpinnerVisible(true);\n \n var matches = doEdictQueryOn(q);\n}", "function searchThis(e) {\n $('#searchbox').val($(e).text());\n FJS.filter();\n}", "function glyphsMainSearchInput(searchSetID, str, e) {\n var searchset = document.getElementById(searchSetID);\n if(!searchset) { return; }\n \n var searchInput = document.getElementById(searchSetID + \"_inputID\");\n if(searchInput.show_default_message) { return; }\n\n if(!str) {\n if(searchInput) { str = searchInput.value; }\n }\n str = trim_string(str);\n if(!str) {\n eedbClearSearchResults(searchSetID);\n return;\n }\n\n if(gLyphsParseLocation(str)) { \n var charCode;\n if(e && e.which) charCode=e.which;\n else if(e) charCode = e.keyCode;\n if((charCode==13) || (e.button==0)) { \n gLyphsInitLocation(str);\n reloadRegion(); \n //dhtmlHistory.add(\"#config=\"+current_region.configUUID +\";loc=\"+current_region.asm+\"::\"+current_region.chrom+\":\"+current_region.start+\"..\"+current_region.end);\n gLyphsChangeDhtmlHistoryLocation();\n }\n eedbEmptySearchResults(searchSetID);\n return;\n }\n\n eedbEmptySearchResults(searchSetID);\n\n var searchDivs = allBrowserGetElementsByClassName(searchset,\"EEDBsearch\");\n for(i=0; i<searchDivs.length; i++) {\n var searchDiv = searchDivs[i];\n searchDiv.exact_match_autoclick = false;\n if(current_region.init_search_term) { searchDiv.exact_match_autoclick = true; }\n eedbSearchSpecificDB(searchSetID, str, e, searchDiv);\n }\n\n}", "handleSearchChange(event) {\n this.searchTerm = (event.target.value).replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n }", "function searchVenue(){\n\t\t$(\"#query\").click(function(){\n\t\t\t$(this).val(\"\");\n\t\t});\n\n\t\t$(\"#query\").blur(function(){\n\t\t\tif ($(this).val() == \"\") {\n\t\t\t\t$(this).val(\"Example: Ninja Japanese Restaurant\");\n\t\t\t}\n\t\t\n\t\t\tif ($(this).val() != \"Example: Ninja Japanese Restaurant\") {\n\t\t\t\t$(this).addClass(\"focus\");\n\t\t\t} else {\n\t\t\t\t$(this).removeClass(\"focus\");\n\t\t\t}\n\t\t});\n\n\t\t//Submit search query and call to getVenues\n\t\t$(\"#searchform\").submit(function(event){\n\t\t\tevent.preventDefault();\n\t\t\tif (!lat) {\n\t\t\t\tnavigator.geolocation.getCurrentPosition(getLocation);\n\t\t\t} else {\n\t\t\t\tgetVenues();\n\t\t\t}\t\t\n\t\t});\n\n\t}", "function onSearchInput(e){\n //event? Yes? Set querey to whats in the search box. No? Set querey to nothing\n e \n ? setSearchString(e.target.value)\n : setSearchString('');\n console.log(`search input detected`)\n\n }", "_handleInputSearch (event) {\n this.filterStringEdit(event);\n this.setState({\n query: event.target.value,\n })\n }", "function setQuery(e) {\n if (e.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function searchKeyPress(e) {\n\te = e || window.event;\n\tif (e.keyCode == 13) {\n\t\tparseCom(box.value);\n\t}\n\tif (e.keyCode == 9) {\n\t\tbox.blur();\n\t}\n}", "function handleSearch(inputElt) {\n\t\tvar query = encodeURIComponent($(inputElt).val());\n\t\t$.ajax({\n\t\t\ttype : \"GET\",\n\t\t\turl : \"http://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/\"+query+\".json\",\n\t\t\tdata : {\n\t\t\t\taccess_token: \"pk.eyJ1IjoibWFwcHktZGV2IiwiYSI6InhBOWRUVHcifQ.YK4jDqt9EXb-Q79QX3O_Mw\"\n\t\t\t},\n\t\t\tsuccess : function(result){\n\t\t\t\tvar best = result.features[0];\n\t\t\t\tmap.setView([best.center[1], best.center[0]], 15);\n\t\t\t},\n\t\t\terror : function(error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t});\n\t}", "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 }", "searchinputCallback(event) {\n const inputVal = this.locationInput;\n if (inputVal) {\n this.getListQuery(inputVal);\n }\n else {\n this.queryItems = [];\n if (this.userSelectedOption) {\n this.userQuerySubmit('false');\n }\n this.userSelectedOption = '';\n if (this.settings.showRecentSearch) {\n this.showRecentSearch();\n }\n else {\n this.dropdownOpen = false;\n }\n }\n }", "function manualSearch(e) {\n let term = document.querySelector(\"#searchTerm\").value;\n term = term.trim();\n if (term.length < 1) return;\n manualSearchData(term.toLowerCase());\n}", "function search(_event) {\r\n let inputName = document.getElementById(\"searchname\");\r\n let inputMatrikel = document.getElementById(\"searchmatrikel\");\r\n let query = \"command=search\";\r\n query += \"&nameSearch=\" + inputName.value;\r\n query += \"&matrikelSearch=\" + inputMatrikel.value;\r\n console.log(query);\r\n sendRequest(query, handleSearchResponse);\r\n }", "function handleSearch() {\n\n\tvar value = $(\"#searchBox\").val();\n\t\n\tif(value != null && value != \"\") {\n\t\tsearchStationForName(value);\n\t}\n\n}", "function searchTerm(){\n \n }", "function querySearchTerm(){ \n\t\tlocalStorage.clear(); //Clears storage for next request\n\t\t// get data from html value,\n\t\tvar inputValue = document.getElementById('btn-search').dataset.valinput; \n\t\tconsole.log(inputValue);\n\t\t\n\t\tif(inputValue == \"email\"){ \n\t\t\tvar email = $('input[type=\"text\"]').val().toLowerCase();\n\t\t\tsearchEmail(email)\n\t\t\treturn true;\n\t\t}else{\n var phone = $('input[type=\"text\"]').val().toLowerCase();\n\t\t\tvalidatePhoneNumber(phone)\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t\t\n }", "enterQuery($event) {\n // if enter pressed\n if ($event.which === keymap.enter) {\n if ($event.target.value !== '') {\n this.getQuery($event);\n }\n }\n }", "function searchSingleFarm(e) {\n setInput(e.target.textContent.toLowerCase());\n }", "searchHandler( event ) {\n const IntrokeyValue = \"Enter\"; \n \n if( event.key===IntrokeyValue ) {\n this.doSearch(event.target.value.trim());\n }\n }", "function getArticles(inputValue, e) {\n // Remove any enter presses or invalid length values\n if (\n inputValue.length < 1 ||\n //e.keyCode === 16 ||\n // e.keyCode === 8 ||\n //e.keyCode === 32 ||\n e.keyCode === 9 //||\n //e.keyCode === 13\n ) {\n return false;\n } else {\n var query = unescape(inputValue);\n\n // Send query to method for request\n return getArticlesFromApi(query, e);\n }\n }", "function keyboardHandler(e) {\n const key = String.fromCharCode( e.which || e.keyCode ).toLowerCase();\n //console.log( \"[%s] pressed\", key );\n let query = document.getElementById( \"searchBox\" ).value;\n query = query.replace( /[^0-9a-z ]+/g, \"\" )\n //console.log( \"query=[%s]\", query );\n searchElements( query.split( \" \" ), recipeIndex );\n}", "function getSearchBoxText(e) {\n e.preventDefault(); // Need this to prevent screen refresh ** READ UP ON TOPIC **\n //var queryStr = escape($(\"#search\").val());\n // var queryStr = $(\"#searchField\").serialize(); /* with serialize() */\n // var queryStr = {}\n //console.log(\"f:getSearchBoxText : \", queryStr);\n // queryOMDB1(queryStr);\n // queryOMDB2(queryStr);\n // uwQuery();\n $(\"#ajax_loader\").show();\n getLocation(); // bypass textbox input of location\n get_db_query();\n}", "function handleNormalSearch(query) {\n\tconsole.log(\"doing normal search with query: \" + query);\n\t// TODO: you should do normal search here\n}", "function handleSearch(event) {\n\t\tevent.preventDefault();\n\t\tlet userAddress = $userSearchTerm.val();\n\t\t//encode it right here, then pass it to getMaps\n\t\tlet encodedAddress = encodeURI(userAddress);\n\t\tgetMaps(encodedAddress);\n\t}", "function search(evt) {\n\tif(evt && evt.keyIdentifier && evt.keyIdentifier.indexOf(\"U\") == -1)\n\t\treturn;//this will narrow the keys that trigger this event \n\t\n\tvar showunE = \"false\";\n\tif(document.getElementById(\"showunemployed\") && document.getElementById(\"showunemployed\").checked)\n\t\tshowunE = \"true\";\n\tvar input = document.getElementById(\"searchBox\");\n\tvar cost_centre = document.getElementById(\"cost_centre\");\n\tvar sortBy = document.getElementById(\"sortby\");\n\tvar sortOrder = document.getElementById(\"sortorder\");\n\tajaxSendXMLtoPHP('valueList.php?field=users&by='+encodeURIComponent(sortBy.value)+'&dir='+encodeURIComponent(sortOrder.value)+'&showunemployed='+encodeURIComponent(showunE)+'&query='+encodeURIComponent(input.value)+'&cost_centre='+encodeURIComponent(cost_centre.value),\"\",startPopulateEmployeeList);\n clearSelected();\n\tdetailDisplay(null);\n}", "function doSearch( event ) {\n\tif ( typeof event == 'object' ) {\n\t\tif ( event.code == 'Escape' )\n\t\t\tsearchBox.value = '';\n\t}\n\telse\n\t\tsearchBox.value = event || '';\n\n\tlet [ field, value ] = searchBox.value.toLowerCase().split(':');\n\tif ( value === undefined )\n\t\t[ value, field ] = [ field, value ];\n\n\t// search only on the selected gallery - collection or wishlist\n\tconst target = collection.classList.contains('hide') ? wishlist : collection;\n\n\t// iterate over gallery items and hide those that don't match the search string\n\t// if search string is empty, \"unhide\" all items on both galleries\n\t( value === '' ? document : target).querySelectorAll('.item').forEach( item => {\n\t\tconst text = ( field ? item.dataset[ field ] : item.innerText ).toLowerCase();\n\t\titem.classList.toggle( 'hide', value.length && ! text.includes( value ) );\n\t});\n\n\t// show count for displayed items\n\tcount.innerText = target.querySelectorAll('.item:not(.hide)').length;\n}", "function searchKeywords() {\n if(searchString.toLowerCase().includes('unit')) {\n if(searchString.toLowerCase().includes('1')) {\n searchBox.value = 'Javascript DOM JQuery CSS function html flexbox arrays';\n } if(searchString.toLowerCase().includes('2')) {\n searchBox.value = 'middleware node express authorization authentication psql ejs fetch api cookies';\n } if(searchString.toLowerCase().includes('3')) {\n searchBox.value = 'react authorization authentication psql git fetch tokens'\n } if(searchString.toLowerCase().includes('4')) {\n searchBox.value = 'ruby rails psql'\n }\n }\n}", "function setQuery(event) {\n if (event.keyCode === 13) {\n getResults(searchbox.value);\n }\n}", "salesSearch(e){\n e.preventDefault();\n var _this = e.data.context,\n query = $.trim($(this).val()).toLowerCase(),\n wh_id = $.trim($(this).attr('data-warehouse'));\n\n _this.errors.clearErrors();\n\n if(e.which == 13){\n if(query.length){\n _this.getReceipts(wh_id, query);\n }else{\n _this.errors.add('Product name required!');\n _this.errors.appendErrorsToDOM();\n _this.errors.showErrorDOM();\n _this.showTransactionTable();\n _this.clearReceiptSearchResults();\n }\n }\n\n if(e.which == 27){\n $(this).val('');\n $(this).blur();\n _this.clearReceiptSearchResults();\n _this.errors.hideErrorDOM();\n _this.showReceiptsTable();\n }\n }", "getQuery($event) {\n $event.preventDefault();\n let query = $event.target.value.trim();\n if (query !== '') {\n this.tuberService.searchYouTube(query);\n $event.target.value !== '';\n }\n }", "function searchSuggest(searchBox) {\n var str = escape(document.getElementById(searchBox).value);\n API.GET\n}", "function searchDisease() {\n var enfermedad = document.getElementById(\"buscadorEnf\").value;\n if(correctInput(enfermedad)) {\n //alert(\"Entrada correcta\");\n var apiurl = ENTRYPOINT + 'disease/' + enfermedad;\n getDisease_db(apiurl);\n }\n else {\n personalAlert(\"ERROR \", \" -- Entrada incorrecta (FORMATO INCORRECTO)\", \"danger\", 2000, false);\n }\n}", "search(event){\n this.placeService.textSearch({\n query: `${event.target.value}`,\n type: 'airport'\n }, this.handleSuggestions);\n }", "function setQuery(evt) {\n if (evt.keyCode == 13) {\n getResults(searchBox.value);\n }\n}", "function userNormalSearch(e){\n\te.preventDefault();\n\tsearchTerm = $('#search').val().trim(); \n\tuserSearch();\n}", "function getQuery() {\n queryString = document.getElementById(\"query-input\").value;\n if (queryString != \"\")\n {\n saveQuery();\n displayQuery();\n }\n else\n {\n frontend.noInput();\n }\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 searchIssuer(event)\n{\n\tevent.preventDefault();\n\t\n\tvar issuerName=\"\";\n\tvar code='byName';\n\t\n\tissuerName=$(\"#issuerNameId\").val();\n\t\n\n\tif(issuerName === undefined || issuerName == null || \n\t\t\tissuerName.length <= 0 || issuerName=='')\n\t{\n\t\tvar code='all';\n\t\t\n\t\t$(\"#searchType\").val(code);\n\t\t$(\"#issuerForm\").attr('action','showAllIssuers');\n\t\t$(\"#issuerForm\").submit();\n\t}\t\n\telse\n\t{\n\t\t$(\"#searchType\").val(code);\n\t\t$(\"#issuerForm\").attr('action','searchIssuerByName');\n\t\t$(\"#issuerForm\").submit();\n\t}\t\n}", "function submithandler() {\n var text = $('#inptext').val();\n var query = $('#query').val();\n if (text !== null && text.length > 0) {\n loadText(text + '$');\n }\n if (query !== null && query.length > 0) {\n loadQuery(query);\n }\n}", "function getInput(event){\n event.preventDefault();\n var searchQuery;\n searchQuery = ($(searchBox).val());\n console.log(searchQuery);\n var ytUrl =`https://youtube.googleapis.com/youtube/v3/search?type=video&part=snippet&maxResults=25&q=${searchQuery}\\\\+'+travel'+'&key=AIzaSyDD9MbkIVSzT2a3sOv97OecaqhyGdF174c`;\n searchVideos(ytUrl);\n\n var key = `AIzaSyDWNMiooGhkXMAhnoTL8pudTR83im36YPo`;\n \n var bookUrl = `https://www.googleapis.com/books/v1/volumes?q=${searchQuery}\\\\+travel+guide&key=${key}`;\n searchBooks(bookUrl);\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 handleEnterKeyDownInSearchBox() {\n var value = $(idSearchBoxJQ).val();\n\n var item = isValueAMatchInLookupItems(value);\n\n //If it is match we select the item\n if (item !== null) {\n selectItem(item);\n\n } else {\n if (useAutoCompleteOnKeyPress == false) {\n populateResults();\n }\n\n }\n\n\n }", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function emitSearch(event){ if (event.which == 13) {addSearch();}}", "function dm_search(d_o1,ev,smId){var s=d_o1.value;d_ce=_dmvi(smId);var fromItem=null;if(ev.keyCode==13){fromItem=d_o1.prevItem;}if(!d_ce||s==\"-\"||d_o1.frase==s&&!fromItem){return;}_dmOOa(d_ce);d_o1.style.backgroundColor=\"\";d_o1.frase=s;if(!s){return;}d_iv=_dmlO(d_ce,s,dmSearch==2,fromItem);if(d_iv&&d_iv==fromItem){d_iv=_dmlO(d_ce,s,dmSearch==2,null);}if(d_iv){_dIO(d_iv);d_o1.prevItem=d_iv;}else{d_o1.style.backgroundColor=\"red\";d_o1.prevItem=null;}}", "function search() {\n\t\n}", "function onTextSearchInput(inputValue) {\n w3.filterHTML('#resultTable', '.item', inputValue);\n}", "function handleInput(e) {\n query.textContent = e.target.value;\n}", "function handleSearchPoiInput(e) {\n\t\t\tclearTimeout(typingTimerSearchPoi);\n\t\t\tif (e.keyIdentifier != 'Shift' && e.currentTarget.value.length != 0) {\n\t\t\t\ttypingTimerSearchPoi = setTimeout(function() {\n\t\t\t\t\t//empty search results\n\t\t\t\t\tvar resultContainer = document.getElementById('fnct_searchPoiResults');\n\t\t\t\t\twhile (resultContainer.hasChildNodes()) {\n\t\t\t\t\t\tresultContainer.removeChild(resultContainer.lastChild);\n\t\t\t\t\t}\n\t\t\t\t\tvar numResults = $('#zoomToPoiResults').get(0);\n\t\t\t\t\twhile (numResults.hasChildNodes()) {\n\t\t\t\t\t\tnumResults.removeChild(numResults.lastChild);\n\t\t\t\t\t}\n\n\t\t\t\t\tsearchPoiAtts[3] = e.currentTarget.value;\n\n\t\t\t\t\tvar lastSearchResults = $('#searchPoi').attr('data-search');\n\t\t\t\t\ttheInterface.emit('ui:searchPoiRequest', {\n\t\t\t\t\t\tquery : e.currentTarget.value,\n\t\t\t\t\t\tnearRoute : searchPoiAtts[0] && routeIsPresent,\n\t\t\t\t\t\tmaxDist : searchPoiAtts[1],\n\t\t\t\t\t\tdistUnit : searchPoiAtts[2],\n\t\t\t\t\t\tlastSearchResults : lastSearchResults\n\t\t\t\t\t});\n\t\t\t\t}, DONE_TYPING_INTERVAL);\n\t\t\t}\n\n\t\t}", "updateSearchTerm ( e ) {\n this.cardFetch( e.target.value );\n }", "onTextInput(event) {\r\n this.searchValue = event.target.value;\r\n if (this.searchValue.trim().length >= 1) {\r\n this.showSearchBoxList = true;\r\n const apiEndpoint = `${process.env.GOOGLE_PLACE_API_URL}${this.apiKey}&types=(${this.searchType})&language=${dxp.i18n.languages[0]}&input=${this.searchValue}`;\r\n this.getData(apiEndpoint).then(async (data) => {\r\n if (data) {\r\n this.filterItemsJson = data;\r\n if (this.filterItemsJson['predictions']) {\r\n this.filterItemsJson = this.filterItemsJson['predictions'];\r\n }\r\n if (this.filterItemsJson.length) {\r\n this.responseFlag = true;\r\n }\r\n }\r\n });\r\n }\r\n if (this.showSearchBoxList === false) {\r\n this.showSearchBoxList = !this.showSearchBoxList;\r\n }\r\n }", "function handleQueryInput() {\n const value = queryInput.value;\n if (value.length > 2) {\n // debounce text entry\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n doSearch(value);\n }, DEBOUNCE_DELAY);\n }\n}", "function setQuery(event) {\n if(event.keyCode === 13) {\n handleGetArtist(value);\n }\n}", "function searchQueryValidate(){\n\tfor (var i = 0; i < suburbs.length; i++){\n\n\t\tsuburbs[i] = suburbs[i].replace(\"&#39;\", \"'\");\n\t\tif (searchbarInput.value.toUpperCase() == suburbs[i].toUpperCase()){\n\t\t\treturn true;\n\t\t}\n\t}\t\n\tfor (var i = 0; i < parkNames.length; i++){\n\t\t\tparkNames[i] = parkNames[i].replace(\"&#39;\", \"'\");\n\t\tif (searchbarInput.value.toUpperCase() == parkNames[i].toUpperCase()){\n\t\t\treturn true;\n\t\t}\n\t}\n\tsearchbarInput.style.color = \"red\";\n\tsearchbarInput.value = \"Invalid Search Request\";\n\tsearchbarButton.disabled = true;\n return false;\n}", "onQueryFilterSearch(e) {\n LitUtils.dispatchCustomEvent(this, \"querySearch\", undefined, {\n query: e.detail.query,\n });\n }", "function searchProduct(){\r\n \r\n var go = \"Thing(?i)\";\r\n \r\n submitProduct(go); \r\n \r\n }", "function searchpagevalidate(ref) {\r\n\t// search box is called \"search\", not keyword\r\n\tif (ref.search.value.search('^[ A-Za-z0-9_\\\\.-]+$') !=-1)\r\n\t{\r\n\t \treturn true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\talert('Need a valid keyword to \\nsearch on!');\r\n\t\treturn false;\t\t\t\r\n\t}\r\n}", "function run_search() {\n var q = $(elem).val();\n if (!/\\S/.test(q)) {\n // Empty / all whitespace.\n show_results({ result_groups: [] });\n } else {\n // Run AJAX query.\n closure[\"working\"] = true;\n $.ajax({\n url: \"/search/_autocomplete\",\n data: {\n q: q\n },\n success: function(res) {\n closure[\"working\"] = false;\n show_results(res);\n }, error: function() {\n closure[\"working\"] = false;\n }\n })\n }\n }", "function handleInputValue (e) {\n var query = a.input.val();\n if (a.params.source) {\n a.params.source(a, query, function (items) {\n var itemsHTML = '';\n var limit = a.params.limit ? Math.min(a.params.limit, items.length) : items.length;\n a.items = items;\n var i, j, regExp;\n if (a.params.highlightMatches) {\n query = query.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n regExp = new RegExp('('+query+')', 'i');\n }\n \n for (i = 0; i < limit; i++) {\n var itemValue = typeof items[i] === 'object' ? items[i][a.params.valueProperty] : items[i];\n var itemText = typeof items[i] !== 'object' ? items[i] : items[i][a.params.textProperty];\n itemsHTML += a.dropdownItemTemplate({\n value: itemValue,\n text: a.params.highlightMatches ? itemText.replace(regExp, '<b>$1</b>') : itemText\n });\n }\n if (itemsHTML === '' && query === '' && a.params.dropdownPlaceholderText) {\n itemsHTML += a.dropdownPlaceholderTemplate({\n text: a.params.dropdownPlaceholderText,\n });\n }\n a.dropdown.find('ul').html(itemsHTML);\n });\n }\n }", "function onKeyUp( e ){\n \n //get value of key up\n\tvar searchFieldValue = $(\"#searchField\").val();\n\t\n\t//if the value of the query has changed\n\tif( currentSearchString != searchFieldValue ){\n\t \n\t //save it, then use that to perform the search\n\t\tcurrentSearchString = searchFieldValue;\n\t\tsearch( currentSearchString );\n\t}\n}", "function handleSearch() {\n triggerSearch({}); // need empty braces here\n }", "_handleChange(e){let root=this;root._getSearchText(root.$.input.value);root.resultCount=0;root.resultPointer=0;root.dispatchEvent(new CustomEvent(\"simple-search\",{detail:{search:root,content:e}}))}", "function search_word(){ \n\t\t\t\tif( $('input[name=\"accountno\"]').attr('value')==''){\n\t\t\t\t\t$('#resulta').remove();\n\t\t\t\t } \n\t\t\tvar search_me = $('input[name=\"accountno\"]').attr('value');\n\t\t\t$.getJSON('testing_jquery.php?search_me=' + search_me ,show_results);\n\t\t}", "function searching() {\n $('.searchboxfield').on('input', function () { // connect to the div named searchboxfield\n var $targets = $('.urbacard'); // \n $targets.show();\n //debugger;\n var text = $(this).val().toLowerCase();\n if (text) {\n $targets.filter(':visible').each(function () {\n //debugger;\n mylog(mylogdiv, text);\n var $target = $(this);\n var $matches = 0;\n // Search only in targeted element\n $target.find('h2, h3, h4, p').add($target).each(function () {\n tmp = $(this).text().toLowerCase().indexOf(\"\" + text + \"\");\n //debugger;\n if ($(this).text().toLowerCase().indexOf(\"\" + text + \"\") !== -1) {\n // debugger;\n $matches++;\n }\n });\n if ($matches === 0) {\n // debugger;\n $target.hide();\n }\n });\n }\n\n });\n\n\n}", "function searchBarHander(e) {\n let inputText = e.target.value.toLowerCase();\n // Filtering the list based on user's input in Search bar\n toDoList.filter(function (task) {\n let taskText = task.text;\n let taskId = task.idNum;\n let element = document.querySelector(\n \"[data-task-id=\" + CSS.escape(taskId) + \"]\"\n );\n // if the user's input was found in the list, show that, and hide others\n if (taskText.toLowerCase().indexOf(inputText) != -1) {\n element.style.display = \"grid\";\n } else {\n element.style.display = \"none\";\n }\n });\n}", "function search(operation) {\n\tvar input_search = document.getElementById(\"search_input\");\n\t\n\tif(input_search.value === \"\"){\n\t\t\n\t//no hay nada, no hago nada\n\t\t\n\t}\telse if(/[^a-zA-Z]/.test(input_search.value)){\n\t\t//habria q mostrar error\n\t\t//var msg = document.getElementById('msg_error_search');\n\t\t//msg.innerHTML = 'Wrong format'; //Tal vez habria que permitir otras cosas en el formato pero chequear ojo con sql injection\n\t\t//msg.style.display = \"block\";\n\t} else {\n\t\t\n\t\t//document.getElementById(\"link\").href=\"./list?input=\" + input_search.value + \"&operation=\" + operation;\n\t\twindow.location.href = \"./list?input=\" + input_search.value + \"&operation=\" + operation;\n\t}\n}", "function searchInput() {\n \t\t\tvar i,\n \t\t\t item,\n \t\t\t searchText = moduleSearch.value.toLowerCase(),\n \t\t\t listItems = dropDownList.children;\n\n \t\t\tfor (i = 0; i < listItems.length; i++) {\n \t\t\t\titem = listItems[i];\n \t\t\t\tif (!searchText || item.textContent.toLowerCase().indexOf(searchText) > -1) {\n \t\t\t\t\titem.style.display = \"\";\n \t\t\t\t} else {\n \t\t\t\t\titem.style.display = \"none\";\n \t\t\t\t}\n \t\t\t}\n \t\t}", "loadSearchBoxInputEventListeners(dataCtrl,uiCtrl){\n const searchBoxesId = uiCtrl.returnIds().searchInputs\n const searchFieldsOjb = {\n acrdPaj: null,\n unicoOld: null,\n mci: null,\n unicoNew: null,\n sistema: null,\n prefixo: null,\n npj: null, \n vinculo: null,\n entradaBase: null,\n fluxoEstoque: null\n }\n for(const inputID in searchBoxesId){\n document.getElementById(inputID).addEventListener('focus',(e)=> {\n this.appState = this.listStates._SEARCHING\n if(e.keyCode===13){\n e.preventDefault() \n }\n })\n document.getElementById(inputID).addEventListener('input',(e)=> {\n switch (inputID) {\n case searchBoxesId.acrdPaj:\n e.target.value = e.target.value.replace(/[\\d]/,'')\n searchFieldsOjb.acrdPaj = e.target.value === '' ? null : e.target.value\n break;v\n case searchBoxesId.sistema:\n e.target.value = e.target.value.replace(/[\\d]/,'')\n searchFieldsOjb.sistema = e.target.value === '' ? null : e.target.value\n break;\n case searchBoxesId.fluxoEstoque:\n e.target.value = e.target.value.replace(/[\\d]/,'')\n searchFieldsOjb.fluxoEstoque = e.target.value === '' ? null : e.target.value \n break;\n case searchBoxesId.vinculo:\n e.target.value = e.target.value.replace(/[\\d]/,'')\n searchFieldsOjb.vinculo = e.target.value === '' ? null : e.target.value\n break;\n case searchBoxesId.entradaBase:\n e.target.value = e.target.value.replace(/[a-zA-Z]/,'')\n searchFieldsOjb.entradaBase = e.target.value === '' ? null : e.target.value\n break;\n case searchBoxesId.npj:\n e.target.value = e.target.value.replace(/[\\D]/,'')\n searchFieldsOjb.npj = e.target.value === '' ? null : e.target.value\n break;\n case searchBoxesId.prefixo:\n e.target.value = e.target.value.replace(/[\\D]/,'')\n searchFieldsOjb.prefixo = e.target.value === '' ? null : e.target.value\n break;\n case searchBoxesId.mci:\n e.target.value = e.target.value.replace(/[\\D]/,'')\n searchFieldsOjb.mci = e.target.value === '' ? null : e.target.value\n break;\n case searchBoxesId.unicoNew:\n e.target.value = e.target.value.replace(/[\\D]/,'')\n searchFieldsOjb.unicoNew = e.target.value === '' ? null : e.target.value = '' ? null : e.target.value\n break;\n case searchBoxesId.unicoOld:\n e.target.value = e.target.value.replace(/[\\D]/,'')\n searchFieldsOjb.unicoOld = e.target.value === '' ? null : e.target.value\n break;\n default: \n break;\n }\n dataCtrl.addSelectedValues(searchFieldsOjb)\n uiCtrl.showHideSpinner2('show')\n setTimeout(() => {\n if(e.target.value==null||e.target.value===''){\n var hasValues = false\n for(const value in dataCtrl.returnData('searchValues')){\n if(dataCtrl.returnData('searchValues')[value]!=null){hasValues=true }\n }\n if(!hasValues){\n e.target.value = null\n this.appState = this.listStates._FILTERED\n }\n }\n uiCtrl.updateUserInterfaceAccordingToAppState(dataCtrl,this)\n !hasValues ? this.loadRegistraAnaliseLimpaSelecionadosEventListeners(dataCtrl,uiCtrl) : null\n uiCtrl.updateButtonTextValue(dataCtrl.returnData('selectedRow').length)\n }, 0);\n })\n }\n }", "queryChanged(newValue){\n let searchedItems = _.filter(this.items, i => {\n return i.text.toLowerCase().indexOf(newValue.toLowerCase()) != -1 ||\n i.fullText.toLowerCase().indexOf(newValue.toLowerCase()) != -1;\n });\n\n console.log(searchedItems);\n this.fetchMarkers(searchedItems, self.map);\n }", "function setQuery(event){ // If enter is press store value in getResults()\n if(event.keyCode == 13){\n getResults(searchBox.value);\n }\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 searchEmployees(input) {\n let searchTerm = input.toLowerCase();\n let $employees = $('p:contains(' + searchTerm + ')').closest('li');\n $('li').hide();\n $employees.show();\n}", "search(e) {\n //NOTE You dont need to change this method\n e.preventDefault();\n try {\n songService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "search(e) {\n //NOTE You dont need to change this method\n e.preventDefault();\n try {\n SongsService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "function searchTerm() {\n return $.trim(o.term.val());\n }", "function search() {\n\tconsole.log(\"Googling \\\"\" + box.value + \"\\\"\");\n\tconsole.log(\"Encoded query: \\n\" + encodeURIComponent(box.value));\n\tdocument.location.href = \"https://www.google.com/?gws_rd=ssl#safe=off&q=\" + encodeURIComponent(box.value);\n}", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "function search( input ){\n // select chat list -> contacts -> each( user name ? search input )\n $('.chat-list .contact').each( function() {\n //var filter = this.innerText; // < - You, Me , I ( for log user )\n //var _val = input[0].value.toUpperCase();\n\n if ( this.innerText.indexOf( input[0].value.toUpperCase() ) > -1)\n this.style.display = \"\";\n else this.style.display = \"none\";\n\n });\n\n}", "function searchEngineAjax()\n{\n\t// Prepare Values\n\tvar siteURL = \"http://search.unifaction.com\";\n\tvar query = document.getElementById(\"searchInputID\").value;\n\t\n\t// Change the behavior if the first character is different\n\tif(query.charAt(0) == \"#\")\n\t{\n\t\tsiteURL = \"http://hashtag.unifaction.com\";\n\t}\n\telse if(query.charAt(0) == \"@\")\n\t{\n\t\tsiteURL = \"http://auth.unifaction.com\";\n\t}\n\t\n\t// Run the Search\n\tsearchAjax(siteURL, \"search\", \"searchHoverID\", \"searchInputID\", query);\n}", "function handleInputValue (e) {\n var query = a.input.val();\n if (a.params.source) {\n a.params.source(a, query, function (items) {\n var itemsHTML = '';\n var limit = a.params.limit ? Math.min(a.params.limit, items.length) : items.length;\n a.items = items;\n var i, j, regExp;\n if (a.params.highlightMatches) {\n query = query.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n regExp = new RegExp('('+query+')', 'i');\n }\n\n for (i = 0; i < limit; i++) {\n var itemValue = typeof items[i] === 'object' ? items[i][a.params.valueProperty] : items[i];\n var itemText = typeof items[i] !== 'object' ? items[i] : items[i][a.params.textProperty];\n itemsHTML += a.dropdownItemTemplate({\n value: itemValue,\n text: a.params.highlightMatches ? itemText.replace(regExp, '<b>$1</b>') : itemText\n });\n }\n if (itemsHTML === '' && query === '' && a.params.dropdownPlaceholderText) {\n itemsHTML += a.dropdownPlaceholderTemplate({\n text: a.params.dropdownPlaceholderText,\n });\n }\n a.dropdown.find('ul').html(itemsHTML);\n });\n }\n }", "function search() {\n var input = document.getElementById('query');\n if (input.value) {\n filter = new RegExp(input.value, 'gi');\n } else {\n filter = null;\n }\n socket.json.send({'search': input.value});\n}", "function getInput() {\n\t\t\tsearchBtn.addEventListener('click', () => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tsearchTerm = searchValue.value.toLowerCase();\n\t\t\t\tconsole.log(searchTerm);\n\t\t\t\tresults.innerHTML = ''; // clear page for new results\n\t\t\t\tgetData(searchTerm); // run w/ searchTerm\n\t\t\t\tformContainer.reset();\n\t\t\t});\n\t\t}", "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 handleSearch(e) {\n const { value } = e.target;\n setSearch(value);\n if (!value) dispatch(searchContent({ val: null, type: \"all\" }));\n if (value.length < 3) return \"\";\n return debouncedSearch({ ...sorter, type: \"search\", search: value });\n }", "function filter() {\n\t\t//trim and lowercase the value of the input\n\t\tvar query = this.value.trim().toLowerCase();\n\t\t//run throug all the events in the cache\n\t\tcache.forEach(function(thing) {\n\t\t//make the index variable here for scope\n\t\tvar index = 0;\n\t\t//get the index of the query in the name of the event, returns -1 if not found\n\t\tindex = thing.text.indexOf(query);\n\t\t//set the style of the element according to whether or not a match was found\n\t\tthing.element.style.display = index === -1 ? 'none' : '';\n\t});\n\t}", "customFilter(option, searchText) {\n if (\n option.data.artistName.toLowerCase().includes(searchText.toLowerCase())\n ) {\n return true;\n } else {\n return false;\n }\n }", "searchUser(){\r\n let userQueryRegex = /.*\\S.*/; // Input cannot be blank\r\n let userQuery = read.question(\"Search Quiz User: (-1 to exit)\\n>> \", {limit: userQueryRegex, limitMessage: \"Type something!\"});\r\n\r\n if(userQuery == -1) this.searchAQuiz();\r\n else this.searchUserFuzzy(userQuery);\r\n }", "function searchAll() {\n clearAllButAvatars();\n document.getElementById(\"terms\").innerHTML = \"\";\n var input = document.querySelector(\"#queryfield\").value;\n var tokens = input.split(\" \");\n for (var i = 0; i < tokens.length; i++) {\n var token = tokens[i];\n var formattedToken = token.replace(/\\W/g, '')\n if (formattedToken.trim() !== '') {\n addSearchButton(formattedToken);\n }\n }\n}", "function todoQueryFilter(evt){\n if(evt.shiftKey || evt.altKey)\n {\n var clickedElem = evt.target\n var clickedElemText = clickedElem.innerText\n clickedElemText = clickedElemText.toLowerCase()\n\n if(clickedElemText.includes(\"query:\") || clickedElemText.includes(\"[[query]]:\"))\n {\n var querySyntax = clickedElemText\n var startOfBetween = querySyntax.indexOf('between:')\n if(startOfBetween < 0){return;} //Exit function as no between query parameter\n var hiddenCtr = 0;\n\n var phToday = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate())\n var phTomorrow = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()+1)\n var phNextWeek = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()+7)\n var phNextMonth = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()+31)\n var phYesterday = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()-1)\n var phLastWeek = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()-7)\n var phLastMonth = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()-31)\n\n //Find \"between\"\n var afterBetween = querySyntax.substring(startOfBetween + 8)\n var endOfBetween = afterBetween.indexOf('}')\n var dateRangeStr = afterBetween.substring(0,endOfBetween).trim()\n var startDateStr = dateRangeStr.substring(0,dateRangeStr.indexOf(' [[')).trim().split(\"[\").join(\"\").split(\"]\").join(\"\")\n var endDateStr = dateRangeStr.substring(dateRangeStr.indexOf(' [[')).trim().split(\"[\").join(\"\").split(\"]\").join(\"\")\n var startDate\n var endDate\n\n //console.log(startDateStr)\n //console.log(endDateStr)\n\n switch(startDateStr)\n {\n case 'today':\n startDate = Date.parse(phToday)\n break;\n case 'tomorrow':\n startDate = Date.parse(phTomorrow)\n break;\n case 'next week':\n startDate = Date.parse(phNextWeek)\n break;\n case 'next month':\n startDate = Date.parse(phNextMonth)\n break;\n case 'yesterday':\n startDate = Date.parse(phYesterday)\n break;\n case 'last week':\n startDate = Date.parse(phLastWeek)\n break;\n case 'last month':\n startDate = Date.parse(phLastMonth)\n break;\n default:\n startDateStr = startDateStr.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\")\n startDate = Date.parse(startDateStr)\n }\n\n switch(endDateStr)\n {\n case 'today':\n endDate = Date.parse(phToday)\n break;\n case 'tomorrow':\n endDate = Date.parse(phTomorrow)\n break;\n case 'next week':\n endDate = Date.parse(phNextWeek)\n break;\n case 'next month':\n endDate = Date.parse(phNextMonth)\n break;\n case 'yesterday':\n endDate = Date.parse(phYesterday)\n break;\n case 'last week':\n endDate = Date.parse(phLastWeek)\n break;\n case 'last month':\n endDate = Date.parse(phLastMonth)\n break;\n default:\n endDateStr = endDateStr.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\")\n endDate = Date.parse(endDateStr)\n }\n\n if(endDate < startDate)\n {\n var tmpEndDate = endDate\n endDate = startDate\n startDate = tmpEndDate\n }\n\n var queryParent = clickedElem.parentElement\n var queryResults = queryParent.getElementsByClassName(\"rm-mentions refs-by-page-view\");\n queryResults = queryResults[0]\n var childrenResult = queryResults.children;\n\n //Loop through each page that has query results\n for (var i = 0; i < childrenResult.length; i++)\n {\n //LOOPING THROUGH EACH \"PAGE\" that has query results under it\n\n var eachChild = childrenResult[i];\n var pageTitle = eachChild.getElementsByClassName(\"rm-ref-page-view-title\");\n pageTitle = pageTitle[0]\n var pageTitleStr = pageTitle.innerText\n //Check if page title is a date\n //Don't actually use this part for anything but leaving in for future\n pageTitleStr = pageTitleStr.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\")\n var pgDateTimeValue = Date.parse(pageTitleStr)\n if(isNaN(pgDateTimeValue))\n {\n //console.log(\"PAGE is Not a date\")\n }\n else\n {\n //console.log(\"PAGE is a date\")\n }\n\n var childSections = eachChild.getElementsByClassName(\"rm-reference-item\");\n for (var j = 0; j < childSections.length; j++)\n {\n //LOOPING THROUGH EACH \"SECTION\" (nested location of the blocks) THAT HAS BLOCK RESULTS FOR QUERY\n\n eachSection = childSections[j]\n\n //console.log('*******************************')\n //console.log(eachSection.innerText)\n //console.log('*******************************')\n\n //Look for any dates in the \"parent\" blocks which are called \"zoom mentions\" in Roam html\n var zoomMentions = eachSection.getElementsByClassName(\"rm-zoom zoom-mentions-view\");\n zoomMentions = zoomMentions[0]\n //Find all page links / tags to see if are dates\n var parentDateLinks = zoomMentions.querySelectorAll('[data-link-title], [data-tag]')\n //Counting how many dates found in parent blocks inside the between range and also in future outside between range\n var parDatesFound = 0\n var parDatesIn = 0\n var parDatesFuture = 0\n\n for (var y = 0; y < parentDateLinks.length; y++)\n {\n //LOOPING THROUGH EACH PAGE/TAG TO SEE IF IT IS A DATE\n eachTag2 = parentDateLinks[y]\n\n if(eachTag2 !== null && eachTag2 !== 'undefined' && typeof eachTag2 !== 'undefined')\n {\n var startingDate2 = eachTag2.innerText\n //console.log(startingDate2)\n startingDate2 = startingDate2.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\").replace(\"#\",\"\")\n var dateTimeValue2 = Date.parse(startingDate2)\n if(isNaN(dateTimeValue2))\n {\n //console.log(\"Not a date...\")\n }\n else\n {\n parDatesFound = parDatesFound + 1\n if(dateTimeValue2 >= startDate && dateTimeValue2 <= endDate)\n {\n parDatesIn = parDatesIn + 1\n //console.log(\"Date FOUND in range!\")\n }\n else\n {\n //console.log(\"Date FOUND, but OUTSIDE range...\")\n //Check if future date (as opposed to before the between range)\n if(dateTimeValue2 > endDate)\n {\n //If future date then we want to hide because it really isn't \"past due\"\n parDatesFuture = parDatesFuture + 1\n }\n }\n }\n }\n else\n {\n //No pages/tags in block\n //console.log(\"No pages/tags found in parents\")\n }\n }\n\n var foundCtr = 0\n var childBlocks = eachSection.getElementsByClassName(\"roam-block dont-unfocus-block hoverparent rm-block-text\");\n for (var k = 0; k < childBlocks.length; k++)\n {\n //LOOPING THROUGH EACH BLOCK THAT IS RESULT OF QUERY\n\n eachBlock = childBlocks[k]\n //console.log(eachBlock.innerText)\n var dateLinks = eachBlock.querySelectorAll('[data-link-title], [data-tag]')\n var foundDates = 0\n var foundDateInRange = 0\n var foundDateInFuture = 0\n for (var x = 0; x < dateLinks.length; x++)\n {\n //LOOPING THROUGH EACH PAGE/TAG TO SEE IF IT IS A DATE\n\n eachTag = dateLinks[x]\n\n if(eachTag !== null && eachTag !== 'undefined' && typeof eachTag !== 'undefined')\n {\n //console.log(eachTag.innerText)\n var startingDate = eachTag.innerText\n startingDate = startingDate.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\").replace(\"#\",\"\")\n var dateTimeValue = Date.parse(startingDate)\n if(isNaN(dateTimeValue))\n {\n //console.log(\"Not a date...\")\n }\n else\n {\n foundDates = foundDates + 1\n if(dateTimeValue >= startDate && dateTimeValue <= endDate)\n {\n foundDateInRange = foundDateInRange + 1\n //console.log(\"Date FOUND!\")\n //console.log(dateTimeValue)\n }\n else\n {\n //console.log(\"Date FOUND, but OUTSIDE between range...\")\n //Check if future date (as opposed to before the between range)\n if(dateTimeValue > endDate)\n {\n //If future date then we want to hide because it really isn't \"past due\"\n foundDateInFuture = foundDateInFuture + 1\n }\n }\n }\n }\n else\n {\n //No pages/tags in block\n }\n }\n\n if(foundDates > 0)\n {\n //Date(s) in child/TODO block\n if(foundDateInFuture > 0)\n {\n //Hide block as there is a future date in TODO block (not past due)\n eachBlock.style.display = \"none\"\n hiddenCtr = hiddenCtr + 1\n }\n else\n {\n //Keep showing block\n foundCtr = foundCtr + 1\n }\n }\n else if(parDatesFound > 0)\n {\n //Date(s) in parent block(s)\n if(parDatesFuture > 0)\n {\n //Hide block as no dates in child/TODO and there is a future date in parent block (not past due)\n eachBlock.style.display = \"none\"\n hiddenCtr = hiddenCtr + 1\n }\n else\n {\n //Keep showing block\n foundCtr = foundCtr + 1\n }\n }\n else\n {\n //No dates found in child/TODO or Parent blocks\n //Since it is showing up in query results, then the page its on must be a daily notes page within between range\n foundCtr = foundCtr + 1\n }\n }\n\n //Checks to see if any child/TODO block(s) were left shown, if so, do NOT hide the SECTION\n if(foundCtr == 0)\n {\n //console.log(\"Hiding this section...\")\n //console.log(eachSection)\n eachSection.style.display = \"none\"\n }\n }\n }\n console.log(hiddenCtr + \" items hidden\")\n }\n }\n}", "addQuery(text) {}", "function search() {\n\tvar query = $(\".searchfield\").val();\n\tif (query == \"\") {\n\t\tdisplaySearchResults(\"\", data, data);\n\t}\n\telse {\n\t\tvar results = idx.search(query);\n\t\tdisplaySearchResults(query, results, data);\n\t\tga('send', 'event', 'Search', 'submit', query);\n\t}\n}", "function search() {\n var query_value = $('input#searchbar').val();\n $('b#search-string').html(query_value);\n if(query_value !== ''){\n $.ajax({\n type: \"POST\",\n url: \"/g5quality_2.0/search.php\",\n data: { query: query_value },\n cache: false,\n success: function(html){\n $(\"ul#results\").html(html);\n }\n });\n }return false;\n }", "searchByQuery() {\n if(this.queryStr.q) {\n const qu = this.queryStr.q.split('-').join(' ');\n this.query = this.query.find({$text: {$search: \"\\\"\"+ qu +\"\\\"\"}});\n }\n\n return this;\n }", "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function do_search() {\n var query = input_box.val().toLowerCase();\n\n if(query && query.length) {\n if(selected_token) {\n deselect_token($(selected_token), POSITION.AFTER);\n }\n\n if(query.length >= settings.minChars) {\n show_dropdown_searching();\n clearTimeout(timeout);\n\n timeout = setTimeout(function(){\n run_search(query);\n }, settings.searchDelay);\n } else {\n hide_dropdown();\n }\n }\n }", "function searchByCase() {\n // Prompts the user to enter a search query, captures their response\n var ui = SpreadsheetApp.getUi();\n var response = ui.prompt(\"⚖️ Enter your case style search\", \"Your search query must match the Case Style in Column F\\nof the Schedule a depo Sheet exactly\\n\\n✅ Tim Duncan v. Michael Jordan\\n\\n\", ui.ButtonSet.OK);\n if (response.getSelectedButton() == ui.Button.OK) {\n var query = response.getResponseText();\n };\n \n // Store the search query in the \"Infrastructure\" Sheet\n SpreadsheetApp.getActive().getSheetByName('Infrastructure').getRange(9, 2).setValue(query);\n \n displayCaseSearch();\n}", "function search_input() {\n\tlet list = scraper.data[schedule.AYTerm];\n\n\t// It's completely empty. Nothing to filter. No need to continue.\n\tif (!list)\n\t\treturn;\n\n\t// Separate the input from the spaces.\n\tlet txt = div.search_input.value.toUpperCase().match(/\\S+/g) || [\"\"];\n\n\t// Check if the user is trying to check via slot ID.\n\tif (!isNaN(Number(txt[0]))) for (let name in list)\n\t\tif (typeof(list[name]) === \"object\" && list[name].slots[txt[0]]) {\n\t\t\t// Redirect to the course's name with the ID.\n\t\t\ttxt = [name, txt[0]];\n\n\t\t\t// Hide any tables if the slot is from another course.\n\t\t\tif (course_scope && course_scope[0] != name)\n\t\t\t\tlist[course_scope[0]].table.style.display = \"none\";\n\n\t\t\tbreak;\n\t\t}\n\n\t// See if there's a match on the user's input.\n\tif (list[txt[0]]) {\n\t\t// Found a match in the searched courses.\n\t\tlet slots = list[txt[0]].slots;\n\n\t\tif (!course_scope || course_scope[0] != txt[0])\n\t\t\t// Make the table visible when the names match.\n\t\t\tlist[txt[0]].table.style.display = \"\";\n\n\t\t/* See if the user is trying to filter out the slots. Also\n\t\t only update if there is a difference from before.\n\t\t*/\n\t\tif (!course_scope ||\n\t\t\tcourse_scope.toString() != txt.toString()) {\n\t\t\t// This will help reduce lag by minimizing the effort.\n\t\t\tif (txt.length > 1) {\n\t\t\t\tlet id;\n\n\t\t\t\t// Iterate through each slot.\n\t\t\t\tfor (let n in slots) {\n\t\t\t\t\tslots[n].tr.style.display = \"\"; // Set it visible first.\n\n\t\t\t\t\t// See if an existing ID is found in the filters.\n\t\t\t\t\tif (id == null) {\n\t\t\t\t\t\t// Iterate through each filter except the 1st one.\n\t\t\t\t\t\tfor (let i = 1; i < txt.length; i++) {\n\t\t\t\t\t\t\t// See if the selected filter is an ID.\n\t\t\t\t\t\t\tif (slots[txt[i]]) {\n\t\t\t\t\t\t\t\t/* Set the ID so we don't have to iterate\n\t\t\t\t\t\t\t\t again.\n\t\t\t\t\t\t\t\t*/\n\t\t\t\t\t\t\t\tid = txt[i];\n\n\t\t\t\t\t\t\t\t// Hide it if it doesnt match with the ID.\n\t\t\t\t\t\t\t\tif (id != n)\n\t\t\t\t\t\t\t\t\tslots[n].tr.style.display = \"none\";\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t} else if (slots[n].literal\n\t\t\t\t\t\t\t.search(txt[i]) == -1) {\n\t\t\t\t\t\t\t\t/* Hide anything that doesn't match with\n\t\t\t\t\t\t\t\t all of the filters.\n\t\t\t\t\t\t\t\t*/ \n\t\t\t\t\t\t\t\tslots[n].tr.style.display = \"none\";\n\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (id != n)\n\t\t\t\t\t\t/* Since an ID was found, we no longer need to\n\t\t\t\t\t\t iterate through the filters, and only need\n\t\t\t\t\t\t to see if it has a matching ID.\n\t\t\t\t\t\t*/\n\t\t\t\t\t\tslots[n].tr.style.display = \"none\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// User wants to see the entire output.\n\t\t\t\tfor (let i in slots)\n\t\t\t\t\tslots[i].tr.style.display = \"\";\n\t\t\t}\n\t\t}\n\n\t\tdiv.dump.style.display = \"none\";\n\t\tcourse_scope = txt;\n\n\t\treturn;\n\t}\n\t/* No match found. Try to find a similar name in the\n\t 'recently-searched' view.\n\t*/\n\n\tif (course_scope) {\n\t\t// Hide the course view if visible.\n\t\tlist[course_scope[0]].table.style.display = \"none\";\n\n\t\tcourse_scope = null;\n\t}\n\n\t// Make 'recently-searched' view visible.\n\tdiv.dump.style.display = \"block\";\n\n\t/* Find matches in the scraper's 'dumped' entry, which is just a long\n\t string containing all the searched course names.\n\t*/\n\tlet res = list.dump.match(\n\t\tnew RegExp(course_dump_pre + txt[0] + course_dump_suf, \"g\")\n\t);\n\n\tfor (let name in list) if (typeof(list[name]) === \"object\") {\n\t\tif (res !== null &&\n\t\t\tres.indexOf(course_dump_sep + name) > -1) {\n\t\t\t// Found a match. Make it visible.\n\n\t\t\tif (list[name].word.style.display)\n\t\t\t\tlist[name].word.style.display = \"\";\n\t\t} else if (!list[name].word.style.display)\n\t\t\t// Text in the search input doesn't match. Hide it.\n\t\t\tlist[name].word.style.display = \"none\";\n\t}\n}" ]
[ "0.6322071", "0.621991", "0.6169624", "0.6051427", "0.6011501", "0.6002951", "0.5973564", "0.5969841", "0.59556997", "0.5943398", "0.5936501", "0.5934831", "0.5934831", "0.5934475", "0.593071", "0.59167784", "0.5892831", "0.5891771", "0.587088", "0.58456606", "0.5842515", "0.5837218", "0.5811608", "0.5798966", "0.5786496", "0.57862276", "0.5777398", "0.577314", "0.57633084", "0.5761403", "0.57512504", "0.5750285", "0.5744059", "0.57429904", "0.57379377", "0.5732489", "0.571192", "0.57107085", "0.57089365", "0.5708167", "0.5705254", "0.5702529", "0.5682911", "0.56638503", "0.5659041", "0.565739", "0.56528634", "0.56521976", "0.5648119", "0.5638731", "0.56342137", "0.5623243", "0.5617884", "0.56056195", "0.5594526", "0.55903536", "0.5579422", "0.55762935", "0.5571499", "0.5564288", "0.55513936", "0.5550127", "0.55461735", "0.55421835", "0.55377287", "0.55368227", "0.553061", "0.5530271", "0.5524293", "0.550787", "0.55075175", "0.5505053", "0.55013674", "0.5499836", "0.5493545", "0.5492047", "0.548953", "0.54845065", "0.5470012", "0.546807", "0.54662544", "0.54633343", "0.5462187", "0.54618746", "0.5458461", "0.54528815", "0.544826", "0.54446757", "0.54410034", "0.5440013", "0.54346895", "0.5434206", "0.5431039", "0.5428508", "0.5426961", "0.54269075", "0.54250324", "0.54250324", "0.5424412", "0.542311" ]
0.76369286
0
Scroll to top of results upon input change
function readyToSearchScrollPosition() { window.scrollTo({ 'top': scrollAnchor.offsetTop, 'left': 0, 'behavior': 'auto', }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "prev(){\n // if is something in search input use search items array\n if (this.searchInput.select) {\n this.page.curSearch--\n this.searchItems()\n // else use discover items array\n } else {\n this.page.cur--\n this.discoverItems()\n }\n // scroll to top\n this.scrollToTop(300)\n }", "function scrollToTop(value) {\n\t\tvar elmnt = document.getElementById(value);\n\t\telmnt.scrollIntoView();\n\t}", "function scrollToBottomOfResults() {\n terminalResultsDiv.scrollTop = terminalResultsDiv.scrollHeight;\n}", "function scrollUpToTop() {\n \t\tdocument.body.scrollTop = 0;\n\t\tdocument.documentElement.scrollTop = 0;\n\t\tcreate_search_api();\n\t}", "scrollToTop () {\n window.scroll({\n top: 0\n });\n if (this.resultsColumn) {\n this.resultsColumn.scrollTop = 0;\n }\n }", "listNext() {\n document.body.scroll({ top: 0, left: 0, behavior: 'smooth' });\n this.listPage++;\n if (this.searchInput) {\n var input = document.getElementById(\"searchInput\").value;\n if (input.length != 0) {\n this.main.class().filter(input, this.listPage, this.listOrder, this.listDesc);\n return;\n }\n }\n this.main.class().list(this.listPage, this.listOrder, this.listDesc);\n }", "function scrollToTop() {\n Reporter_1.Reporter.debug('Scroll to the top of the page');\n scrollToPoint(0, 0);\n }", "componentDidUpdate() {\n scrollToComponent(this.results, { offset: 0, align: \"top\", duration: 500, ease: \"out-circ\" });\n }", "scrollToTop() {\n this.scrollLines(-this._bufferService.buffer.ydisp);\n }", "listPrev() {\n document.body.scroll({ top: 0, left: 0, behavior: 'smooth' });\n this.listPage--;\n if (this.listPage < 1) this.listPage = 1;\n if (this.searchInput) {\n var input = document.getElementById(\"searchInput\").value;\n if (input.length != 0) {\n this.main.class().filter(input, this.listPage, this.listOrder, this.listDesc);\n return;\n }\n }\n this.main.class().list(this.listPage, this.listOrder, this.listDesc);\n }", "function topFunction() {\n document.body.scrollTop = 0; // For Safari\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n var elmntr = document.getElementById(\"quiz_cont\");\n elmntr.scrollTo(0, 0);\n }", "function readyToSearchScrollPosition() {\n window.scrollTo({\n top: scrollAnchor.offsetTop,\n left: 0,\n behavior: 'auto',\n });\n }", "function scrollToTop() {\n\troot.scrollTo({\n\t\ttop: 0,\n\t\tbehavior: \"smooth\"\n\t});\n}", "function scrollToObject() {\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\tsetFocus();\n\t\t}", "function scrollToObject() {\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\t//setFocus();\n\t\t}", "scrollHitIntoView() {\n this.requestUpdate().then(() => {\n const selected = this.renderRoot.querySelector(\n '.web-search-popout__link--active',\n );\n selected.scrollIntoView({block: 'nearest'});\n this.dispatchEvent(new CustomEvent('resultselect', {detail: {selected}}));\n });\n }", "function showChoise(){\n jQuery(\"#output-choise\").css(\"display\", \"inline\");\n\n // Keep the scroll bar in the end\n jQuery('body,html').animate({\n scrollTop: jQuery(document).height()\n }, 0);\n jQuery(\".input-choise\").css(\"display\", \"inline\").focus();\n}", "function scrollToTop() {\n\t\tcurrentLocation.hash = '#main';\n\t\twindow.scrollTo(0, this.offSetTop);\n\t}", "function scrollfix() {\n $('#output').scrollTop($('#output')[0].scrollHeight);\n\t$(\"#input-text\").focus();\n}", "function doScroll(to) {\n autoScrolled = true;\n\n if (to > -1) {\n var pos = $suggestionBox.find('li:eq(' + to + ')').position().top -\n $suggestionBox.find('li:eq(0)').position().top;\n }\n\n // find scroll position at to and set scroll bars to it\n var scrollTo = (to > -1) ? pos : 0;\n $suggestionBox.scrollTop(scrollTo);\n }", "function scrollToResults() {\n $([document.documentElement, document.body]).animate({\n scrollTop: $(\"#results\").offset().top\n }, 700);\n}", "function scrollToTop() {\n let friends = document.getElementById(\"friends\");\n friends.scroll({\n top: 0,\n left: 0,\n behavior: \"smooth\",\n });\n}", "function syncResultScroll() {\n var textarea = $(srcClass),\n lineHeight = parseFloat(textarea.css('line-height')),\n lineNo, posTo;\n\n lineNo = Math.floor(textarea.scrollTop() / lineHeight);\n if (!scrollMap) { scrollMap = buildScrollMap(); }\n posTo = scrollMap[lineNo];\n $(resultClass).stop(true).animate({\n scrollTop: posTo\n }, 100, 'linear');\n}", "function onScrollToTop() {\n ScrollToTop();\n}", "returnToTop() {\n const me = this;\n me.topIndex = 0;\n me.lastScrollTop = 0;\n\n if (me.topRow) {\n me.topRow.dataIndex = 0; // Force the top row to the top of the scroll range\n\n me.topRow.setTop(0, true);\n }\n\n me.refresh(); // Rows rendered from top, make sure grid is scrolled to top also\n\n me.grid.scrollable.y = 0;\n }", "returnToTop() {\n const me = this;\n\n me.topIndex = 0;\n me.lastScrollTop = 0;\n me.topRow.dataIndex = 0;\n\n // Force the top row to the top of the scroll range\n me.topRow.setTop(0);\n\n me.refresh();\n\n // Rows rendered from top, make sure grid is scrolled to top also\n me.grid.scrollable.y = 0;\n }", "function scrollToInput() {\n var pageContent = smartSelect.parents('.page-content');\n if (pageContent.length === 0) return;\n var paddingTop = parseInt(pageContent.css('padding-top'), 10),\n paddingBottom = parseInt(pageContent.css('padding-bottom'), 10),\n pageHeight = pageContent[0].offsetHeight - paddingTop - picker.height(),\n pageScrollHeight = pageContent[0].scrollHeight - paddingTop - picker.height(),\n newPaddingBottom;\n var inputTop = smartSelect.offset().top - paddingTop + smartSelect[0].offsetHeight;\n if (inputTop > pageHeight) {\n var scrollTop = pageContent.scrollTop() + inputTop - pageHeight;\n if (scrollTop + pageHeight > pageScrollHeight) {\n newPaddingBottom = scrollTop + pageHeight - pageScrollHeight + paddingBottom;\n if (pageHeight === pageScrollHeight) {\n newPaddingBottom = picker.height();\n }\n pageContent.css({'padding-bottom': (newPaddingBottom) + 'px'});\n }\n pageContent.scrollTop(scrollTop, 300);\n }\n }", "scrollToTop() {\n scroll.scrollToTop();\n }", "function gotoTop() {\n $anchorScroll('add-new-student-button');\n }", "goBackToTop() {\n //TODO: Add animation\n scrollTo(undefined, 0);\n }", "function scrollToBottomOfResults() {\n\tvar terminalResultsDiv = document.getElementById('chats');\n\tterminalResultsDiv.scrollTop = terminalResultsDiv.scrollHeight;\n}", "function scrollToInput() {\n\t var pageContent = smartSelect.parents('.page-content');\n\t if (pageContent.length === 0) return;\n\t var paddingTop = parseInt(pageContent.css('padding-top'), 10),\n\t paddingBottom = parseInt(pageContent.css('padding-bottom'), 10),\n\t pageHeight = pageContent[0].offsetHeight - paddingTop - picker.height(),\n\t pageScrollHeight = pageContent[0].scrollHeight - paddingTop - picker.height(),\n\t newPaddingBottom;\n\t var inputTop = smartSelect.offset().top - paddingTop + smartSelect[0].offsetHeight;\n\t if (inputTop > pageHeight) {\n\t var scrollTop = pageContent.scrollTop() + inputTop - pageHeight;\n\t if (scrollTop + pageHeight > pageScrollHeight) {\n\t newPaddingBottom = scrollTop + pageHeight - pageScrollHeight + paddingBottom;\n\t if (pageHeight === pageScrollHeight) {\n\t newPaddingBottom = picker.height();\n\t }\n\t pageContent.css({'padding-bottom': (newPaddingBottom) + 'px'});\n\t }\n\t pageContent.scrollTop(scrollTop, 300);\n\t }\n\t }", "function jumpTo() {\r\n if (results.length) {\r\n let position,\r\n $current = results.eq(currentIndex);\r\n results.removeClass(\"current\");\r\n if ($current.length) {\r\n $current.addClass(\"current\");\r\n let currentMarkResult = $('.markresults.current');\r\n let parent = currentMarkResult.parent();\r\n while (!parent.is('div')) {\r\n parent = parent.parent();\r\n }\r\n\r\n /* not animated page scroll */\r\n $('html, body').scrollTop(\r\n $(parent).offset().top\r\n );\r\n\r\n /* not animated scroll */\r\n parent.scrollTop(\r\n currentMarkResult.offset().top - parent.offset().top + parent.scrollTop()\r\n );\r\n }\r\n }\r\n}", "function returnToTop(){\n window.scroll({ top:0, behavior: \"smooth\" })\n}", "function scrollToTop() {\n window.scrollTo({\n top: 0,\n behavior: \"smooth\",\n });\n}", "function scrollToTheTop() {\r\n window.scrollTo({\r\n top: 0,\r\n behavior: 'smooth'\r\n });\r\n}", "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "function scroll() {\n\t\t\tslotScroller.scrollTop(top);\n\t\t}", "scrollToTheTopOfPage() {\r\n browser.executeScript('window.scrollTo(0,0);').then(function () {\r\n logger.Log().debug('++++++SCROLLED UP+++++');\r\n });\r\n }", "navigateDown(event) {\n if (this.visible && this.resultsAvailable) {\n event.preventDefault(); // stop window from scrolling\n if ( document.activeElement == this.element_input) { this.top_result.firstElementChild.focus(); } // if the currently focused element is the main input --> focus the first <li>\n else if ( document.activeElement.parentElement == this.bottom_result ) { this.bottom_result.firstElementChild.focus(); } // if we're at the bottom, stay there\n else { document.activeElement.parentElement.nextSibling.firstElementChild.focus(); } // otherwise select the next search result\n }\n }", "set _scrollTop(top){this.$.table.scrollTop=top}", "function topFunction() {\r\n const topsy = document.querySelector(\"#section1\");\r\n topsy.scrollIntoView({ behavior: \"smooth\" });\r\n}", "function scrollToTop() {\n window.scrollTo({\n top: 0,\n behavior: \"smooth\",\n });\n}", "function topFunction() {\n \n elementStorer.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n}", "function scrollToTopBookNow() {\n\t\t\t//$(window).scrollTop($('.scrolltobooknow').offset().top);\n\t\t\tdocument.getElementById('scrolltobooknow').scrollIntoView(true);\n\t\t}", "function scrollTo(what, posId) {\n if (what != \"0\") \n document.getElementById(what).scrollTop = document.getElementById(posId).value;\n \n\n}", "scrollToTop() {\n document.documentElement.scrollTop = 500;\n }", "function scrollToStartHandler() {\n scrollTo({top: 0, behavior: 'smooth'});\n}", "function showInput(){\n jQuery(\"#input\").show();\n\n // Keep the scroll bar in the end\n jQuery('body,html').animate({\n scrollTop: jQuery(document).height()\n }, 0);\n jQuery(\".input-text\").focus();\n}", "toTop() {\n window.scrollTo(0,0);\n }", "function topFct(){\r\n window.scrollTo(0, 0);\r\n }", "function scrollToBottom () {\n console.log(\"scrolling\")\n let scroll = document.querySelector(\"#results\");\n scroll.scrollTop = scroll.scrollHeight - scroll.clientHeight;\n }", "function topFunction() {\n let element = document.getElementById(\"topScroll\");\n element.scrollIntoView({behavior: \"smooth\"});\n}", "function formCorrect() {\n\n var heightVal = $('#msgBox').height();\n\n $('#msgBox').scrollTop($('#msgBox').scrollTop() + heightVal);\n\n}", "navigateUp(event) {\n if (this.visible && this.resultsAvailable) {\n event.preventDefault(); // stop window from scrolling\n if ( document.activeElement == this.element_input) { this.element_input.focus(); } // If we're in the input box, do nothing\n else if ( document.activeElement.parentElement == this.top_result) { this.element_input.focus(); } // If we're at the first item, go to input box\n else { document.activeElement.parentElement.previousSibling.firstElementChild.focus(); } // Otherwise, select the search result above the current active one\n }\n }", "function scrollToObject() {\n\t\t\tconsole.log(\"scrollToObject()\");\n\t\t\t$q.all([\n\t\t\t FindElement.byId(\"resultTableWrapper\"),\n\t\t\t FindElement.byQuery(\"#resultsTable .selectedRow\")\n\t\t\t ]).then(function(elements) {\n\t\t\t\t var table = angular.element(elements[0]);\n\t\t\t\t var selected = angular.element(elements[1]);\n\t\t\t\t var offset = 30;\n\t\t\t\t table.scrollToElement(selected, offset, 0);\n\t\t\t });\n\t\t\tsetFocus();\n\t\t}", "function scrollToTop() {\n window.scrollTo(0, 0);\n}", "function scrollToTop() {\n window.scrollTo({\n top: 0, // could be negative value\n left: 0,\n behavior: 'smooth'\n });\n}", "function topFunction() {\n document.body.scrollTo(0, 3000);\n document.documentElement.scrollTo(0, 3000);\n }", "function scrollToTop() {\n window.scroll({\n top: 100,\n left: 100,\n behavior: 'smooth'\n});\n}", "function topOfPage() {\n window.scrollTo(0, 0);\n }", "function toTop(){\n\t$.mobile.silentScroll(0);\n}", "function goToTop(){\n\tdocument.documentElement.scrollTop = 0;\n}", "function scrollToTop() {\n window.scroll({top: 0, left: 0, behavior: 'smooth'});\n}", "function scrollDown(base) {\n window.scrollTo(0, base);\n $(\"#entry\").focus();\n}", "function scrollDown(base) {\n window.scrollTo(0, base);\n $(\"#entry\").focus();\n}", "function scrollTop() {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n}", "async prevResultsPage() {\n let newOffset = this.state.searchOffset - 10;\n\n if (newOffset < 0) {\n this.setState({ searchOffset: 0 });\n } else {\n this.setState({ searchOffset: newOffset });\n }\n\n const rez = await this.search();\n\n this.setState({ searchResults: rez });\n }", "function gotoAtop () {\n later ( ( () => {\n let t = $ (\"#highUp\").offset ().top;\n scrollTo (null, t);\n //scrollTo (null, 66);\n }), 3999);\n}", "function scrollToBottom () {\n console.log(\"scrolling\") //make sure the function works \n let scroll = document.querySelector(\"#results\");\n scroll.scrollTop = scroll.scrollHeight - scroll.clientHeight;\n }", "function toTheTopButton() {\n window.scrollTo({\n top: 0,\n behavior: \"smooth\",\n });\n }", "function scroll() {\n\t\telement.scrollIntoView({behavior: \"smooth\"});\n\t\t\n\t}", "function scrollToTop() {\n\n $('body,html').animate({\n scrollTop: 0\n });\n return false;\n }", "function toTheTop() {\n\t\t$('#tothetop').click(function(e){\n\t\t\te.preventDefault();\n\t\t\t$(\"html, body\").animate({ scrollTop: 0 }, 800);\n\t\t});\n\t}", "function showAndScrollToLatestArticles() {\n shownArticlesCount = 0;\n $(\"#articleKeywordCategoryId\").val(\"\"); //get all articles of all categories\n $(\"#latestArticles\").hide(1000);\n $(\"#latestArticles\").html(\"\");\n showLatestArticles();\n $([document.documentElement, document.body]).animate({\n scrollTop: $(\"#latestArticlesSection\").offset().top\n }, 1000);\n}", "function toTop() {\n window.scrollTo({\n top: 0,\n left: 0,\n behavior: \"smooth\"\n });\n}", "scrollToTop () {\n this.scrollView(Infinity);\n }", "function updateScroll(){\n var element = instance.$(\"#commentinput\");\n element.scrollTop = element.scrollHeight;\n }", "function updateScroll(){if(!elements.li[0])return;var height=elements.li[0].offsetHeight,top=height*ctrl.index,bot=top+height,hgt=elements.scroller.clientHeight,scrollTop=elements.scroller.scrollTop;if(top<scrollTop){scrollTo(top);}else if(bot>scrollTop+hgt){scrollTo(bot-hgt);}}", "function scrolTop(){\n window.scrollTo(0, 0);\n}", "ScrollToTop() {\n /** The user is scrolled to the top of the page */\n document.body.scrollTop = 0;\n document.documentElement.scrollTo({\n top: '0',\n behavior: 'smooth',\n });\n }", "function scroll(output) {\n $(\".repl\").animate({\n scrollTop: output.height(),\n },\n 50\n );\n }", "function work() {\n var scrollPos = $(\".case-studies\").offset().top - 80;\n TweenLite.to(window, 2, {scrollTo: {y: scrollPos}, ease: Power2.easeOut});\n }", "function toTop(){\n document.body.scrollTop=0\n }", "function scrollTop() {\n\n}", "goTop() {\n refs.galleryList.scrollIntoView({\n block: \"start\",\n behavior: \"smooth\",\n });\n }", "function scrollToTop() {\n msgInbox.scrollTop = msgInbox.scrollHeight; \n}", "function updateScroll() {\n\n var element = document.getElementById(\"history\");\n element.scrollTop = element.scrollHeight;\n\n }", "function scrollTop() {\n window.scrollTo(0, 0);\n}", "function forceTop() {\n $('html, body').animate({\n scrollTop: $('body').offset().top,\n }, 200);\n}", "function topFunction() {\n window.scrollTo({top: 0, behavior: 'smooth'});\n //document.documentElement.scrollTop = 0;\n }", "scrollToTop() {\n window.scrollTo({\n top: 0,\n behavior: 'smooth',\n });\n }", "function scrollToTheTop() {\n\t// https://stackoverflow.com/questions/1144805/scroll-to-the-top-of-the-page-using-javascript-jquery\n\tvar scrollToTop = window.setInterval(function() {\n\t\t\tvar pos = window.pageYOffset;\n\t\t\tif ( pos > 0 ) {\n\t\t\t\twindow.scrollTo( 0, pos - 20 ); // how far to scroll on each step\n\t\t\t} else {\n\t\t\t\twindow.clearInterval( scrollToTop );\n\t\t\t}\n\t\t}, 16); // how fast to scroll (this equals roughly 60 fps)\n}", "searchPrev(){\n this.searchIndex--;\n this.searchMovie();\n this.$nextTick(function(){\n scrollRight(\"search_display\");\n });\n }", "function _focusSearch() {\n setTimeout(function() {\n _$search.focus();\n }, CFG.TIME.DELAY);\n }", "function topFunction() {\n document.documentElement.scrollTop = 3200;\n}", "function responsive_autocomplete() {\n if(is_device.any()) {\n $('.search-bar input').on('focusin', function() {\n $('html, body').animate({ scrollTop: $('.search-bar').offset().top }, 'slow');\n });\n } else {\n $('.search-bar input').off('focusin');\n }\n}" ]
[ "0.7245843", "0.6939738", "0.69197553", "0.68943894", "0.6888375", "0.6706393", "0.66839665", "0.6676499", "0.66613805", "0.66533077", "0.66514295", "0.6613817", "0.6611374", "0.6609914", "0.6606437", "0.6604138", "0.6599643", "0.6581915", "0.6562748", "0.6522661", "0.65201396", "0.64847136", "0.64789003", "0.64619476", "0.6428319", "0.64239585", "0.6416106", "0.63784975", "0.63663423", "0.63627064", "0.6345891", "0.63345134", "0.6327352", "0.63151956", "0.6297037", "0.6296962", "0.62875247", "0.62875247", "0.62875247", "0.62875247", "0.62875247", "0.62805253", "0.6276247", "0.6253945", "0.62418556", "0.62386036", "0.6236644", "0.62309986", "0.62303424", "0.62108123", "0.6208316", "0.62054664", "0.6204256", "0.61944205", "0.61901885", "0.617646", "0.6165539", "0.6157223", "0.6145178", "0.61407703", "0.61403733", "0.61250794", "0.6123359", "0.61176234", "0.6113385", "0.6104534", "0.61033255", "0.6096409", "0.6096409", "0.6092322", "0.6088514", "0.6082229", "0.60780823", "0.6077363", "0.60621315", "0.60554075", "0.60265875", "0.6025728", "0.60174584", "0.6016711", "0.6016483", "0.6013653", "0.60084635", "0.6004231", "0.5991173", "0.597823", "0.5976281", "0.59707886", "0.59674835", "0.5960126", "0.59590894", "0.5956912", "0.5954876", "0.5941417", "0.5938264", "0.5934329", "0.5917166", "0.5915927", "0.5910473", "0.59083915" ]
0.66537535
9
MISC HELPER FUNCTIONS ==============
function addOrRemoveSearchableAttributes(array, value) { const tmpArr = array; let index = array.indexOf(value); if (index === -1) { array.push(value); } else { array.splice(index, 1); } // Ensure at least one item is checked if (array.length < 2) { // grantee_state will always be there return tmpArr; } else { return array; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Utils() {}", "function Utils() {}", "function Utils(){}", "function DWRUtil() { }", "function Helper() {}", "function Util() {}", "function _____SHARED_functions_____(){}", "function AeUtil() {}", "private public function m246() {}", "function Utils() {\n}", "private internal function m248() {}", "protected internal function m252() {}", "static private internal function m121() {}", "function AppUtils() {}", "function customHandling() { }", "static private protected internal function m118() {}", "transient private protected internal function m182() {}", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "function FunctionUtils() {}", "transient protected internal function m189() {}", "getRequestInfoUtils() {\n return {\n createResponse$: this.createResponse$.bind(this),\n findById: this.findById.bind(this),\n isCollectionIdNumeric: this.isCollectionIdNumeric.bind(this),\n getConfig: () => this.config,\n getDb: () => this.db,\n getJsonBody: this.getJsonBody.bind(this),\n getLocation: this.getLocation.bind(this),\n getPassThruBackend: this.getPassThruBackend.bind(this),\n parseRequestUrl: this.parseRequestUrl.bind(this),\n };\n }", "static final private internal function m106() {}", "function FAADataHelper() {\n}", "function BookDataHelper() { }", "static transient private protected internal function m55() {}", "static protected internal function m125() {}", "[registerBuiltInHelpers]() {\n this.registerHelper(\"set\", function(...args) {\n var obj, name, val, data, dot;\n\n //(1) arguments\n if (args.length >= 3) [name, val, data] = args;\n\n //(2) prepare environment\n data = data.data.root;\n\n\n if ((dot = name.indexOf(\".\")) >= 0) {\n obj = name.slice(0, dot);\n name = name.slice(dot+1);\n }\n\n //(2) set value\n if (obj) data[obj][name] = val;\n else data[name] = val;\n });\n\n this.registerHelper(\"and\", function(...args) {\n var res;\n\n //(1) check\n res = false;\n\n for (let value of args.slice(0, args.length-1)) {\n res = !!value;\n if (!res) break;\n }\n\n //(2) return\n return res;\n });\n\n this.registerHelper(\"or\", function(...args) {\n var res;\n\n //(1) check\n res = false;\n\n for (let value of args.slice(0, args.length-1)) {\n res = !!value;\n if (res) break;\n }\n\n //(2) return\n return res;\n });\n\n this.registerHelper(\"like\", function(value, pattern) {\n if (!(pattern instanceof RegExp)) pattern = new RegExp(pattern);\n return pattern.test(value);\n });\n\n this.registerHelper(\"length\", function(coll) {\n return coll.length;\n });\n\n this.registerHelper(\"contain\", function(coll, item) {\n var res = false;\n if (coll) res = (coll.indexOf(item) >= 0);\n return res;\n });\n\n this.registerHelper(\"esc\", function(text) {\n return text;\n });\n\n this.registerHelper(\"lowercase\", function(text) {\n return (text ? text.toString().toLowerCase() : \"\");\n });\n\n this.registerHelper(\"uppercase\", function(text) {\n return (text ? text.toString().toUpperCase() : \"\");\n });\n\n this.registerHelper(\"capitalize\", function(text) {\n return (text ? text[0].toUpperCase() + text.slice(1) : \"\");\n });\n\n this.registerHelper(\"decapitalize\", function(text) {\n return (text ? text[0].toLowerCase() + text.slice(1) : \"\");\n });\n\n this.registerHelper(\"concat\", function(...args) {\n return args.slice(0, args.length-1).join(\"\");\n });\n\n this.registerHelper(\"replace\", function(...args) {\n return args[0].replace(args[1], (typeof(args[2]) == \"string\" ? args[2] : \"\"));\n });\n\n this.registerHelper(\"http\", function(url) {\n if (!url) return \"\";\n else if (/^http[s]?:/.test(url)) return url;\n else return \"http://\" + url;\n });\n\n this.registerHelper(\"true\", function(x) {\n return ([true, \"true\", \"yes\"].indexOf(x) >= 0);\n });\n\n this.registerHelper(\"false\", function(x) {\n return ([false, \"false\", \"no\"].indexOf(x) >= 0);\n });\n\n this.registerHelper(\"eq\", function(x, y) {\n return (x == y);\n });\n\n this.registerHelper(\"ne\", function(x, y) {\n return (x != y);\n });\n\n this.registerHelper(\"lt\", function(x, y) {\n return (x < y);\n });\n\n this.registerHelper(\"le\", function(x, y) {\n return (x <= y);\n });\n\n this.registerHelper(\"gt\", function(x, y) {\n return (x > y);\n });\n\n this.registerHelper(\"ge\", function(x, y) {\n return (x >= y);\n });\n\n this.registerHelper(\"in\", function(value, ...rest) {\n var coll;\n\n //(1) get collection\n if (rest.length == 2) coll = rest[0];\n else coll = rest.slice(0, -1);\n\n //(2) check\n return coll.indexOf(value) >= 0;\n });\n\n this.registerHelper(\"nin\", function(value, ...rest) {\n var coll;\n\n //(1) get collection\n if (rest.length == 2) coll = rest[0];\n else coll = rest.slice(0, -1);\n\n //(2) check\n return coll.indexOf(value) < 0;\n });\n\n this.registerHelper(\"iif\", function(cond, tr, fls) {\n return cond ? tr : fls;\n });\n\n this.registerHelper(\"coalesce\", function(args) {\n var res;\n\n //(1) check\n for (let arg of args) {\n if (arg !== undefined && arg !== null) {\n res = arg;\n break;\n }\n }\n\n //(2) return\n return res;\n });\n }", "function TMP(){return;}", "function TMP(){return;}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "function eUtil() {\n\n //Get URL Parameters by name\n function getUrlParam(name){\n if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))\n return decodeURIComponent(name[1]);\n }\n\n}", "static getHelpers() {}", "function DCKBVCommonUtils() {\n // purely static object at the moment, nothing in the instances.\n }", "function Common(){}", "function Kutility() {\n\n}", "function Kutility() {\n\n}", "function TMP(){}", "function TMP(){}", "static transient private protected public internal function m54() {}", "function TMP() {\n return;\n }", "function CCUtility() {}", "function Common() {}", "expected(_utils) {\n return 'nothing';\n }", "prepare() {}", "obtain(){}", "function URLUtils() {}", "function SigV4Utils() { }", "static private protected public internal function m117() {}", "function ExtraMethods() {}", "function HelperConstructor() {}", "static transient final protected internal function m47() {}", "static transient final private internal function m43() {}", "static transient final protected public internal function m46() {}", "function WebIdUtils () {\n}", "function Tools(){}", "function Utils() {\n // All of the normal singleton code goes here.\n }", "function HTTPUtil() {\n}", "function __it() {}", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function baseLodash(){}// No operation performed.", "function helper() {\n debug(\"helper in helper-slcsp.js\");\n}", "static final private protected internal function m103() {}", "static transient private internal function m58() {}", "function DataTypesUtils() {}", "function FileHelper() {\n\n}", "transient private protected public internal function m181() {}", "function baseLodash() {\n }", "function MapDataUtils(){\n\t\t\n\t\t/**\n\t\t * Extracts path-coord. from polyline.\n\t\t * @param polyline : PolylineHolder\n\t\t * @return [google.maps.LatLng]\n\t\t */\n\t\tthis.extractPath = function(polyline){\t\t\t\n\t\t\tthrow new Error('This is abstract');\n\t\t};\n\t\t\n\t\t/**\n\t\t * Request for geocoding of the given address.\n\t\t * @param args : {address : string} or string\n\t\t * @param callback : function(err, {latitude: integer, longitude: integer, noResult: boolean})\n\t\t */\n\t\tthis.findCoordFromAddress = function(args, callback){\n\t\t\tthrow new Error('This is abstract');\n\t\t};\n\t}", "function __func(){}", "static final private protected public internal function m102() {}", "function ea(){}", "function oi(){}", "static transient final private protected internal function m40() {}", "static final private public function m104() {}", "function baseLodash() {}", "function baseLodash() {}", "function baseLodash() {}", "function baseLodash() {}", "function baseLodash() {}", "function SelectionUtil() {\n}", "function wa(){}", "_validate() {\n\t}", "function baseLodash() {// No operation performed.\n }", "function fCommonFunctionalities () {\n\n }", "function Constr() {}", "function FileHelper()\n{\n}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function userinfo_dispatcher_routines() {\n\n\n}", "static transient private public function m56() {}", "function DCCalUtils() {\n // purely static object at the moment, nothing in the instances.\n }", "function ArrayUtils() {}", "function baseLodash() {// No operation performed.\n }" ]
[ "0.66913146", "0.66913146", "0.664309", "0.65058887", "0.6456344", "0.6429516", "0.6410632", "0.6331179", "0.6216189", "0.61430305", "0.61326295", "0.61154604", "0.6034693", "0.6007874", "0.59845966", "0.5828076", "0.58019143", "0.5797007", "0.5756064", "0.5749839", "0.5737963", "0.5726827", "0.5718276", "0.5602468", "0.55965614", "0.5568298", "0.55564433", "0.55543655", "0.55543655", "0.5526925", "0.55062926", "0.5491442", "0.5463304", "0.54441404", "0.54397", "0.54386747", "0.54386747", "0.5437176", "0.5437176", "0.5435282", "0.54309046", "0.5428255", "0.5391364", "0.53860086", "0.5385712", "0.53814983", "0.53556013", "0.53515565", "0.53422046", "0.53365594", "0.53329533", "0.5321067", "0.53123695", "0.5300596", "0.5295914", "0.52705836", "0.5268365", "0.52563566", "0.52503407", "0.5245436", "0.5245436", "0.5245436", "0.5245436", "0.5245436", "0.5245436", "0.5245436", "0.5245436", "0.5228481", "0.522676", "0.5217706", "0.5215996", "0.52006084", "0.51979387", "0.5193456", "0.51817083", "0.5170606", "0.51573145", "0.51566595", "0.5153983", "0.515198", "0.51409334", "0.5135018", "0.5135018", "0.5135018", "0.5135018", "0.5135018", "0.5129401", "0.5111281", "0.51063716", "0.5094745", "0.50943667", "0.5092594", "0.5090683", "0.508275", "0.508275", "0.508275", "0.50822765", "0.5081933", "0.507042", "0.5068772", "0.50634336" ]
0.0
-1
Lazy Load Iubenda script =======================================================
function createIubendaObserver() { let observer; let anchor = document.querySelector('footer'); let config = { 'rootMargin': '0px 0px', 'threshold': 0.01, }; // Initiate observer using Footer as anchor observer = new IntersectionObserver(enableIubenda, config); observer.observe(anchor); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initScripts() {\n breakpoint();\n lazyload();\n heroSlider();\n categoriesMobile();\n asideLeftMobile();\n scrollRevealInit();\n seoSpoiler();\n mobileMenuOverflowScroll();\n}", "function main() {\r\n\t// Init the myGM functions.\r\n\tmyGM.init();\r\n\r\n\t// If the script was already executed, do nothing.\r\n\tif(myGM.$('#' + myGM.prefix + 'alreadyExecutedScript'))\treturn;\r\n\r\n\t// Add the hint, that the script was already executed.\r\n\tvar alreadyExecuted\t\t= myGM.addElement('input', myGM.$('#container'), 'alreadyExecutedScript');\r\n\talreadyExecuted.type\t= 'hidden';\r\n\r\n\t// Init the language.\r\n\tLanguage.init();\r\n\r\n\t// Init the script.\r\n\tGeneral.init();\r\n\r\n\t// Call the function to check for updates.\r\n\tUpdater.init();\r\n\r\n\t// Call the function to enhance the view.\r\n\tEnhancedView.init();\r\n}", "function initScript(){\n getMunTorreviejaData();\n insertImagesInCalendar();\n }", "init() {\n this.addAdditionnalScripts();\n }", "function startinteractive () \n{\n\tcorporal.on('load', corporal.loop);\n}", "static loadScript() {\n //Si notre script n'est pas en train de charger\n if (!Video.scriptIsLoading) {\n Video.scriptIsLoading = true; //Charger le script\n\n const script = document.createElement('script'); //Crée la balise script\n script.src = 'https://www.youtube.com/iframe_api'; //Changer sa propriété src pour celui du youtube\n document.body.appendChild(script); //Injecter la balise script dans le body\n }\n }", "function loadScripts(){\n renderer.setIPC();\n inject.uglifyScripts();\n inject.injectScripts();\n}", "function getAstronaut() {\n\tvar script = document.createElement('script');\n\tscript.src = 'http://api.open-notify.org/astros.json?callback=inSpace'\n\tdocument.head.appendChild(script);\n\tconsole.log(\"Astronaut script Loaded\");\n\tscript.parentNode.removeChild(script);\n\tconsole.log(\"Astronaut script cleared\");\n}", "async function loadScripts() {\n await getDisplayData();\n}", "function load()\n{\n setupParts();\n\tbgn();\n}", "function loadScripts() {\r\n\t\t\t\twindow._sf_endpt = (new Date()).getTime();\r\n\t\t\t\tvar cbDomain = ((\"https:\"==document.location.protocol)?\"https://a248.e.akamai.net/chartbeat.download.akamai.com/102508/\":\"http://static.chartbeat.com/\");\r\n\t\t\t\tif(loadPubJS) {\r\n\t\t\t\t\t$.getScript(cbDomain+\"js/chartbeat_pub.js\");\r\n\t\t\t\t}\r\n\t\t\t\tif((loadVidJS) || (typeof StrategyInterface !== 'undefined' && (espn && espn.video))) {\r\n\t\t\t\t\t$.getScript(cbDomain+\"js/chartbeat_video.js\");\r\n\t\t\t\t}\r\n\t\t\t\t// load default chartbeat js others are disabled\r\n\t\t\t\tif(!loadVidJS && !loadPubJS) {\r\n\t\t\t\t\t$.getScript(cbDomain+\"js/chartbeat.js\");\r\n\t\t\t\t}\r\n\t\t\t}", "function scriptLoader()\n{\n addJavascript(\"phoneticMapper.js\", \"head\");\n addJavascript(\"vedatype.js\", \"head\");\n addJavascript(\"slp01.js\", \"head\"); \n}", "initScript() {\n if (!this.element.dataset.scripturl) {\n return;\n }\n\n const cachebuster = new Date().getTime();\n const url = `${this.element.dataset.scripturl}?component_id=${this.id}#${cachebuster}`\n const newScriptTag = document.createElement('script');\n newScriptTag.setAttribute('defer', '');\n newScriptTag.setAttribute('type', 'module');\n newScriptTag.setAttribute('src', url);\n \n\n this.script = document.head.appendChild(newScriptTag);\n }", "function loadUp(){\n\tif (globalDebug) {console.group(\"LoadUp\");}\n\n\t//load web fonts\n\t//loadWebFonts();\n\n\t// always\n\tniceScrollInit();\n\n\troyalSliderInit();\n\n\tisotopeInit();\n\n\tif($(\".classic-infinitescroll-wrapper\").length) classicInfiniteScrollingInit($(\".classic-infinitescroll-wrapper\"));\n\n\tprogressbarInit();\n\tmenusHover();\n\n\n\tmagnificPopupInit();\n\n\tinitVideos();\n\tresizeVideos();\n\n\tsearchTrigger();\n\t// sidebarHeight();\n\n\t//Set textarea from contact page to autoresize\n\tif($(\"textarea\").length) { $(\"textarea\").autosize(); }\n\n\t$(\".pixcode--tabs\").organicTabs();\n\n\tif (globalDebug) {console.groupEnd();}\n}", "function iabLoadStart(event) {\n \n }", "function init_oas() {\n\tif (window.jQuery) {\n\t\tjQuery(document).ready(function() {\n\t\t\tOUP_Advert.AddScript(oas_tag.url + '/om/' + oas_tag.version + '.js');\n\t\t});\n\t} else {\n\t\tsetTimeout(init_oas, 100);\n\t}\n}", "function init()\n\t{\n\t\tvar scripts = document.getElementsByTagName('script');\n\t\tfor(var i = 0; i < scripts.length; ++i)\n\t\t{\n\t\t\tif(scripts[i].hasAttribute('main'))\n\t\t\t{\n\t\t\t\tif(scripts[i].hasAttribute('root'))\n\t\t\t\t{\n\t\t\t\t\tPoof.importRoot = scripts[i].getAttribute('root');\n\t\t\t\t}\n\n\t\t\t\tif(scripts[i].hasAttribute('suffix'))\n\t\t\t\t{\n\t\t\t\t\tPoof.importSuffix = scripts[i].getAttribute('suffix');\n\t\t\t\t}\n\n\t\t\t\tif(scripts[i].hasAttribute('concatenated'))\n\t\t\t\t{\n\t\t\t\t\tPoof.concatenated = scripts[i].getAttribute('concatenated');\n\t\t\t\t}\n\n\t\t\t\tif(scripts[i].hasAttribute('debug'))\n\t\t\t\t{\n\t\t\t\t\tPoof.debug = scripts[i].getAttribute('debug') === 'true';\n\t\t\t\t}\n\n\t\t\t\tcompatibilityFixes.applyAll();\n\t\t\t\tImport(scripts[i].getAttribute('main')).execute(onMainClassRady);\n\t\t\t}\n\t\t}\n\t}", "async function loadExtraScripts() {\n}", "function scriptLoadHandler() {\n // Restore jQuery and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n PlannTo.jQuery = jQuery;\n\n // Call our main function\n\n main();\n }", "function alwaysRunOnload () {\n\t\t// Placeholder/Future use.\n\t}", "function asiCallOnload(){\n var SDM_noasci = ['meinauto'];\n var asi_p = 'IpZElE,Rdkg7V,NkqpjZ,acWaVx,RmJKxA,BnG7vD,oeu2b6,foY3mB'; //Produktion\n var asiPqTag = false; //Initialisierung, Antwort setzt auf true\n try {\n if ((sdm_vers >= 1) && !SDM_head.isinarray(SDM_noasci, SDM_resource)) {\n fXm_Head.create.twin(escape('//pq-direct.revsci.net/pql?placementIdList=' + asi_p), SDM_head.prep.asigmd, true);\n }\n } catch (ignore) {}\n\n // Audience Science Data Sharing\n if (!SDM_head.isinarray(SDM_noasci, SDM_resource)) {\n fXm_Head.create.script('//js.revsci.net/gateway/gw.js?csid=F09828&auto=t&bpid=Stroer');\n }\n}", "function setup() {\n return new Promise(function(resolve,reject){\n let script = document.createElement('script');\n script.onload = resolve;\n script.setAttribute('src','https://unpkg.com/lunr/lunr.js');\n script.id = \"lunr\";\n document.head.appendChild(script); \n });\n }", "function load()\n{\n\tsetupParts();\n\t\n\tmain();\n}", "createScript() {\n if (this.htmlElementsDom.getElementsByClassName(\"microfrontend_script\") != null) {\n\n for (let el of this.htmlElementsDom.getElementsByClassName(\"microfrontend_script\")) {\n let script = document.createElement(\"script\")\n script.setAttribute(\"type\", 'module');\n script.src = el.src;\n this.appendChild(script);\n }\n }\n\n }", "function init() { \n SP.SOD.notifyScriptLoadedAndExecuteWaitingJobs('domTools.js');\n }", "function loadScript(idx) {\r\n console.log(\"Loading \", requiredResources[idx]);\r\n jQuery.getScript(requiredResources[idx], function () {\r\n if ((idx + 1) < requiredResources.length) {\r\n loadScript(idx + 1);\r\n } else {\r\n initExp();\r\n }\r\n });\r\n }", "function loadScript() {\n\t\tvar googleScriptElement = document.getElementById('google-map');\n\t\tvar script = document.createElement('script');\n\t\tscript.id = 'route-boxer';\n\t\tscript.src = 'js/RouteBoxer.js';\n\t\tgoogleScriptElement.parentNode.insertBefore(script, googleScriptElement.nextSibling);\n\t\t//document.body.appendChild(script);\n\t\tdeferred.resolve();\n\t}", "async onLoad() {}", "function callScripts() {\n\t\"use strict\";\n\tjsReady = true;\n\tsetTotalSlides();\n\tsetPreviousSlideNumber();\n\tsetCurrentSceneNumber();\n\tsetCurrentSceneSlideNumber();\n\tsetCurrentSlideNumber();\n}", "function mainFn () {\n logFn( prefixStr + 'Start' );\n xhiObj.npmObj.load( xhiObj.fqPkgFilename, onLoadFn );\n }", "function Script() {}", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function load()\n{\n dashcode.setupParts();\n}", "function forceLoad() {}", "function autoInit () {\n\t\tif (!IBM.common.module.canadanotice && IBM.common.meta.page.pageInfo.ibm.cc === \"ca\" && (IBM.common.meta.page.pageInfo.ibm.lc === \"en\" || IBM.common.meta.page.pageInfo.ibm.lc === \"fr\")) {\n\t\t\t$.ajax({\n\t\t\t\turl: IBM.common.util.config.get(\"jsFilesUrl\") + \"canada-notice.js\",\n\t\t\t\tdataType: \"script\",\n\t\t\t\tcache: true\n\t\t\t});\n\t\t}\n\t}", "function initializeScript()\r\n{\r\n host.diagnostics.debugLog(\"***> initializeScript called \\n\");\r\n}", "async function initVendaPadraoScript() {\n initVendaPadraoHTML();\n await setVendaPadraoQuadroTop();\n await setVendaPadraoTopVendedores();\n await setVendaPadraoTopCidade();\n await getVendaPadraoGraficoSemestral();\n}", "_onScriptLoad() {\n const JitsiMeetExternalAPI = window.JitsiMeetExternalAPI;\n\n const api = new JitsiMeetExternalAPI(config.defaultDomain);\n const iframe = api.getIFrame();\n\n setupScreenSharingForWindow(iframe);\n new RemoteControl(iframe); // eslint-disable-line no-new\n setupAlwaysOnTopRender(api);\n setupWiFiStats(iframe);\n }", "function loadJS(u) {\n var r = document.getElementsByTagName(\"script\")[0], s = document.createElement(\"script\");\n s.src = u;\n r.parentNode.insertBefore(s, r);\n}", "function iabLoadStart(event) {\n\n}", "function loadInpage() {\n // check if already initialized - just in case these scripts were loaded multiple times\n var bootstrapper = new _bootstrap_bootstrap__WEBPACK_IMPORTED_MODULE_0__[\"BootstrapInPage\"]();\n bootstrapper.initialize();\n _quick_edit_quick_e__WEBPACK_IMPORTED_MODULE_8__[\"QuickE\"].start();\n /** this enhances the $2sxc client controller with stuff only needed when logged in */\n if (!_interfaces_window_in_page__WEBPACK_IMPORTED_MODULE_6__[\"windowInPage\"].$2sxc.system)\n _interfaces_window_in_page__WEBPACK_IMPORTED_MODULE_6__[\"windowInPage\"].$2sxc.system = new _system__WEBPACK_IMPORTED_MODULE_9__[\"SystemUpgrader\"]();\n /** Connect DNN action mapper to this module instance */\n _interfaces_window_in_page__WEBPACK_IMPORTED_MODULE_6__[\"windowInPage\"].$2sxcActionMenuMapper = function (moduleId) {\n return new _dnn__WEBPACK_IMPORTED_MODULE_3__[\"DnnActionMenu\"](moduleId);\n };\n}", "function runScript(){\n\tregisterTab();\t\n\tcurrentQueuePoll();\n\tregisterMsgListener();\n\tinsertAddToQueueOptionOnVideos();\n\tinsertQTubeMastHead();\n\tload(false);\n}", "function loadScript() {\n var scriptRichmarker = document.createElement('script');\n scriptRichmarker.type = 'text/javascript'; \n scriptRichmarker.src = window.location.href + '/Scripts/mapscripts/richmarker.js';\n document.body.appendChild(scriptRichmarker);\n }", "_startUp()\n {\n // Check debug.\n if (RodanClientCore.config.DEBUG)\n {\n Radio.tuneIn('rodan');\n }\n\n this._initializeRadio();\n this._initializeControllers();\n this._initializeBehaviors();\n this._initializeDateTimeFormatter();\n this.addRegions({regionMaster: '#region-master'});\n this._initializeViews();\n require('./.plugins');\n }", "function initPysijs() {\n Physijs.scripts.worker = '/lib/physijs_worker.js'\n Physijs.scripts.ammo = '/lib/ammo.js';\n}", "function defineScript() {\n\t\tif (window.SLM === undefined) {\n\t\t\tconsole.log(\n\t\t\t\t'scripts by\\n' +\n\t\t\t\t' _____ _ _ ______ \\n' + \n\t\t\t\t'/ ___| (_) | ___ \\\\ \\n' + \n\t\t\t\t'\\\\ \\`--.| |_ _ __ ___ | |_/ / _ _ __ _ __ ___ _ __ \\n' + \n\t\t\t\t' \\`--. \\\\ | | \\'_ \\` _ \\\\| / | | | \\'_ \\\\| \\'_ \\\\ / _ \\\\ \\'__|\\n' + \n\t\t\t\t'/\\\\__/ / | | | | | | | |\\\\ \\\\ |_| | | | | | | | __/ | \\n' + \n\t\t\t\t'\\\\____/|_|_|_| |_| |_\\\\_| \\\\_\\\\__,_|_| |_|_| |_|\\\\___|_| \\n'\n\t\t\t);\n\t\t\t\n\t\t\twindow.SLM = Object.assign({}, {\n\t\t\t\tmessages: [],\n\t\t\t\tscripts: [GM_info.script.name],\n\t\t\t\t\n\t\t\t\tprintMsgQueue: function() {\n\t\t\t\t\twhile (this.printMessage()) { }\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tprintMessage: function() {\n\t\t\t\t\tif (this.messages.length === 0) return false;\n\t\t\t\t\tlet msg = this.messages.shift();\n\t\t\t\t\tconsole[msg.type](...msg.args);\n\t\t\t\t\treturn this.messages.length !== 0;\n\t\t\t\t},\n\t\t\t\t\n\t\t\t\tpushMessage: function(type, ...msgArgs) {\n\t\t\t\t\tthis.messages.push({\n\t\t\t\t\t\ttype: type,\n\t\t\t\t\t\targs: msgArgs\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tObject.defineProperties(window.SLM, {\n\t\t\t\tMESSAGE_DELAY : {\n\t\t\t\t\tvalue: 500,\n\t\t\t\t\twritable: false,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true\n\t\t\t\t},\n\t\t\t\tATTEMPTS_LIMIT : {\n\t\t\t\t\tvalue: 50,\n\t\t\t\t\twritable: false,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true\n\t\t\t\t},\n\t\t\t\tATTEMPTS_DELAY : {\n\t\t\t\t\tvalue: 200,\n\t\t\t\t\twritable: false,\n\t\t\t\t\tenumerable: true,\n\t\t\t\t\tconfigurable: true\n\t\t\t\t}\n\t\t\t});\n\t\t} else {\n\t\t\twindow.SLM.scripts.push(GM_info.script.name);\n\t\t}\n\t}", "function ap(sr , ol) {\r\n\t\t var e = document.createElement('script'); \r\n\t e.src = sr;\r\n\t e.async = true;\r\n\t if (ol) {\r\n\t \te.onload = e.onerror = function() { if (!this.loaded) { ol(); this.loaded = true; } };\r\n\t\t\te.onreadystatechange = function() { if (this.readyState === 'complete' || this.readyState === 'loaded') { this.onload(); } };\r\n\t }\r\n\t var s = document.getElementsByTagName('script')[0];\r\n\t\t s.parentNode.insertBefore( e , s);\r\n\t}", "async load () {}", "function Init() {\n loader = new createjs.LoadQueue(); // load container\n loader.on(\"complete\", Start); // call start when finished loading\n loader.loadManifest([\n { id: \"treesharksLogo\", src: \"../../Assets/images/TSIcon.svg\" }\n ]);\n }", "function loadAutoWoot() {\n\tif(window.location.hostname === \"plug.dj\") { \n\t\t// Get jQuery\n\t\t$.getScript(jQuery).done(function(){\n\t\t\t// Run the script\n\t\t\trunAutoWoot();\n\t\t});\n\t} else {\n\t\talert('This script can only run on Plug.DJs website.');\n\t}\n}", "function loadScript() {\n var tag = document.createElement('script');\n\n tag.src = \"https://www.youtube.com/iframe_api\";\n var firstScriptTag = document.getElementsByTagName('script')[0];\n firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n }", "function boot()\n {\n\t// scriptweeder ui's iframe, don't run in there !\n\tif (in_iframe() && window.name == 'scriptweeder_iframe')\t// TODO better way of id ?\n\t return;\n\tif (location.hostname == \"\")\t// bad url, opera's error page. \n\t return;\n\tassert(typeof GM_getValue == 'undefined', // userjs_only\n\t \"needs to run as native opera UserJS, won't work as GreaseMonkey script.\");\n\tif (window.opera.scriptweeder && window.opera.scriptweeder.version_type == 'extension')\t\t// userjs_only\n\t{\n\t my_alert(\"ScriptWeeder extension detected. Currently it has precedence, so UserJS version is not needed.\");\n\t return;\n\t}\n\t\n\tsetup_event_handlers();\n\twindow.opera.scriptweeder = new Object();\t// external api\n\twindow.opera.scriptweeder.version = version_number;\n\twindow.opera.scriptweeder.version_type = version_type;\t\n\tdebug_log(\"start\");\t\n }", "function loadNext() {\n if (scripts.length === 0) {\n return;\n }\n var nextScript = scripts.shift();\n var script = document.createElement('script');\n script.src = nextScript;\n script.onload = loadNext;\n document.body.appendChild(script);\n }", "function downloadJSAtOnload(){var e=document.createElement(\"script\");e.src=\"https://cdn.rawgit.com/Arlina-Design/quasar/23207858/arlinablock.js\",document.body.appendChild(e)}", "loadAllScripts() {\n\t\tthis._scripts.forEach( function( scriptPlugin ) {\n\t\t\tif ( false === scriptPlugin._ranInline ) {\n\t\t\t\tscriptPlugin.theScript();\n\t\t\t}\n\t\t\tscriptPlugin.createScript();\n\t\t});\n\t}", "function alwaysRunOnload () {\n\t\n\t}", "function loadScript() {\n\t\tvar csScriptElement = document.getElementById('cs-script');\n\t\tvar script = document.createElement('script');\n\t\tscript.id = 'google-map';\n\t\tscript.src = 'http://maps.googleapis.com/maps/api/js?key=AIzaSyAG4XtFABY3BR_-Mph6PVuqT6Re6KTUyMA&v=3.31&libraries=places&language='+$translate.use()+'&callback=initMap';\n\t\tcsScriptElement.parentNode.insertBefore(script, csScriptElement.nextSibling);\n\t\t//document.body.appendChild(script);\n\t}", "load() {}", "load() {}", "load() {\r\n\r\n }", "function preload() {\n\n // loading font\n headlineFont = loadFont('fonts/Poppins-Bold.ttf');\n bodyFont = loadFont('fonts/Poppins-Regular.ttf');\n\n // loading images\n stressSymbol = loadImage(\"assets/Stress.png\");\n\n // loading clickable and adventure managers\n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n adventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableLayout.csv');\n}", "function finish_load(){\n\twindow.ubm_loadedids = {};\n\twindow.ubm_incompScripts = new Set([]);\n\t//Get current url\n\tvar thisurl = new URL(window.location.href);\n\tvar hostname = thisurl.hostname;\n\tvar s = ubm_db[hostname];\n\tif (s) {\n\t\tvar keys = s.getKeys();\n\t\tfor (let baseurl of keys) {\n\t\t\tloadScript(baseurl + hostname + \".js\", `scriptfail(this, function(){console.log('Could not load script from site: ` + baseurl + `!')})`, `exeScript(\\`` + baseurl + `\\`, function(){loadAlwaysCheck(0, \"` + baseurl + `\");})`);\n\t\t}\n\t} else {\n\t\tloadAlwaysCheck(0, hostname);\n\t}\n}", "function preLoad() {\n return;\n}", "function AutoSaveLoad() {}", "load() {\n\n }", "function startScript(){\n // Update when script starts.\n updateProductInfo();\n updateLocalInfo();\n // Wait for the product analysis to be set.\n setTimeout(setRecyclability, 1000);\n}", "function loadPlayScript() {\n\n try {\n\n var coffeescript = require(\"coffee-script\");\n console.log(\"Full file path: \" + fullUserScriptsPath);\n var source = fs.readFileSync(fullUserScriptsPath, \"utf8\");\n\n coffeescript.compile(source);\n\n var myscript = require(fullUserScriptsPath);\n\n // note: this loads the actual script\n myscript(robot);\n\n $('#script-error').hide();\n\n }\n catch(error) {\n $('#script-error').show();\n console.log(\"Caught an exception: Unable to load \" + fullUserScriptsPath + \": \" + error.stack);\n }\n}", "function loadNextScript() {\n var scriptTagOne = $document[0].createElement('script');\n scriptTagOne.type = 'text/javascript';\n scriptTagOne.async = true;\n scriptTagOne.src = 'http://d3js.org/d3.hexbin.v0.min.js';\n scriptTagOne.onreadystatechange = function() {\n if(this.readyState == 'complete') onScriptLoad();\n }\n var s = $document[0].getElementsByTagName('body')[0];\n s.appendChild(scriptTagOne);\n }", "function scriptOnLoad() { \n if (script.readyState && script.readyState !== \"loaded\" && \n script.readyState !== \"complete\") { return; }\n script.onreadystatechange = script.onload = null;\n // next iteration\n if (thisObj.scriptConcatenatorURL) {\n loadNext();\n } else {\n thisObj.loadScript(srcSetObj, iteration);\n }\n }", "function loadStart() {\n // Prepare the screen and load new content\n collapseHeader(false);\n wipeContents();\n loadHTML('#info-content', 'ajax/info.html');\n loadHTML('#upper-content', 'ajax/texts.html #welcome-text');\n loadHTML('#burger-container', 'ajax/burger-background.html #burger-flags', function() {\n loadScript(\"js/flag-events.js\");\n });\n}", "async initialize() {\n const { headless } = this.options\n const { log } = this\n try {\n // load script content from `script` folder\n this.scriptContent = await genScriptContent()\n // Launch the browser\n this.browser = await puppeteer.launch({ headless })\n } catch (err) {\n log(err)\n }\n }", "static initialize() {\n\t\tconsole.log(whereami() + \" script initializing\");\n\n\t}", "function preload() {\n\n // headlineFont = loadFont('fonts/AstroSpace-0Wl3o.otf');\n headlineFont = loadFont('fonts/continuum/contm.ttf');\n bodyFont = loadFont('fonts/Ubuntu-Regular.ttf');\n endFont = loadFont('fonts/continuum/contb.ttf');\n\n // load all images\n angerImage = loadImage(\"assets/anger_emoji.png\");\n \n //allocateCharacters();\n\n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n adventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableLayout.csv');\n}", "function Start ()\n{\n\tGetScripts();\n\tWindage();\n}", "function startLoading() {\n logger.debug('Starting runtime init')\n\n if(!Module['preRun']) Module['preRun'] = [];\n\n Module['locateFile'] = () => {\n return './vendor/pocketsphinx.wasm';\n };\n\n Module['onRuntimeInitialized'] = () => {\n var SUCCESS = Module.ReturnType.SUCCESS,\n BAD_STATE = Module.ReturnType.BAD_STATE,\n BAD_ARGUMENT = Module.ReturnType.BAD_ARGUMENT,\n RUNTIME_ERROR = Module.ReturnType.RUNTIME_ERROR;\n RETURNTYPES = {\n SUCCESS : 'SUCCESS',\n BAD_STATE: 'BAD_STATE',\n BAD_ARGUMENT: 'BAD_ARGUMENT',\n RUNTIME_ERROR: 'RUNTIME_ERROR'\n }\n\n logger.debug('Runtime initialized')\n dispatch({success: true})\n };\n\n importScripts('./vendor/pocketsphinx.js');\n}", "function loadJQuery() {\n\n\t\tvar onigiriScript = document.getElementById('onigiri-script');\n\t\tvar script = document.createElement('script');\n\t\tscript.type = \"text/javascript\";\n\t\tscript.id = \"box-window-JQuery\";\n\t\tscript.src = \"https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js\";\n\n\t\tonigiriScript.parentNode.insertBefore(script,onigiriScript)\n\n\t}", "function loadScript() {\n var script = document.createElement(\"script\");\n script.type = \"text/javascript\";\n script.src = \"http://ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=7.0&onScriptLoad=initialise\";\n document.body.appendChild(script);\n}", "function loadJQ() {\r\n\t var script = document.createElement(\"script\");\r\n\t script.setAttribute(\"src\", \"http://plaku.com/bytui/jquery.min.js\");\r\n\t script.addEventListener('load', function() {\r\n\t\tvar script = document.createElement(\"script\");\r\n\t\tloadJQCookie();\r\n\t\tdocument.body.appendChild(script);\r\n\t }, false);\r\n\t document.body.appendChild(script);\r\n\t}", "function preload() {\n\tclickablesManager = new ClickableManager('data/clickableLayout.csv');\n\tadventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableLayout.csv');\n}", "function preLoad() {\n // load something and continue on only when finished\n}", "static async load()\n {\n await RPM.settings.read();\n await RPM.datasGame.read();\n RPM.gameStack.pushTitleScreen();\n RPM.datasGame.loaded = true;\n RPM.requestPaintHUD = true;\n }", "function preload() {\n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n adventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableLayout.csv');\n}", "function jUIInit() {\r\n if (!Lazy.load(_fdk.load.ui, jUIInit)) return;\r\n datePickerInit();\r\n ckedInit();\r\n fajaxInit();\r\n fconfirmInit();\r\n gooMapiInit();\r\n fuupInit();\r\n slimboxInit();\r\n GaleryEdit.init();\r\n $(\".expand\").autogrow();\r\n}", "function initHypoPage() {\n // this starts the preloader queue loading\n // when complete the assetsLoadingComplete callback is triggered\n loadAssets();\n}", "function firstCall()\r\n{\r\n loadUSNavy();\r\n}", "function loadLibs(){\t\n\t$(function() {\n\t\tlog(\"loading libraries\");\n\t\tyepnope([{\n\t\t\tload: scripts,\n\t\t\tcallback: function (url, result, key) {\n\t\t\t\tprogress(\"loaded: \" + url);\n\t\t\t\tlog(\"loaded \" + url)\n\t\t\t},\n\t\t\tcomplete: function(){\n\t\t\t\tlog(\"yepnope complete\"); \n\t\t\t\tloadAnims();\t\t\n\t\t\t}\n\t\t}]);\n\t});\n}", "function obtenerScriptsConexion() {\n $.getScript(CentralConexionUrl + \"Scripts/SignalrGeneral/Adaptador.js\", function () {\n $.getScript(CentralConexionUrl + \"Scripts/jquery.signalR-2.2.1.js\", function () {\n $.getScript(CentralConexionUrl + \"signalr/hubs\", function () {\n $.getScript(CentralConexionUrl + \"Scripts/SignalrGeneral/ConfiguracionConexion.js\", function () {\n $.getScript(CentralConexionUrl + \"Scripts/SignalrClientes/PormedPacienteSignalr.js\", function () {\n \n });\n });\n });\n });\n });\n}", "onLoad() {}", "function init() {\n var js = document.createElement('script');\n js.setAttribute('type', 'text/javascript');\n js.setAttribute('src', url);\n document.getElementsByTagName('head').item(0).appendChild(js);\n}", "function loadScript() {\n\t\t\t// Use global document since Angular's $document is weak\n\t\t\tvar script = document.createElement('script');\n\t\t\tscript.src = 'https://maps.googleapis.com/maps/api/js?key=AIzaSyCaGn_prtaPYfOnh3Tf7uNCHspM9__uYl4&libraries=places&callback=initMap';\n\n\t\t\tdocument.body.appendChild(script);\n\t\t}", "function loadScript() {\n\t if (typeof(YT) == 'undefined' || typeof(YT.Player) == 'undefined') {\n\t var tag = document.createElement('script');\n\t tag.src = \"https://www.youtube.com/iframe_api\";\n\t var firstScriptTag = document.getElementsByTagName('script')[0];\n\t firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);\n\t }\n\t}", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function scriptLoadHandler() {\n // Restore $ and window.jQuery to their previous values and store the\n // new jQuery in our local jQuery variable\n jQuery = window.jQuery.noConflict(true);\n // Call our main function\n main();\n }", "function loadScript() {\n var script = document.createElement('script');\n script.src = \"https://maps.googleapis.com/maps/api/js?key=AIzaSyAg67S7m3vG4o51-RyozMWZ1mtmzSIS-1o&callback=scriptLoaded\";\n\n document.head.appendChild(script);\n }", "function loadingInterface(index) {\n\tif (owl != null) {\n\t\towl.jumpTo(0);\n\t}\n // trigger storytelling\n changeStorytelling();\n // record epoch time here - uncommento once function recordTime() is ready\n recordTime();\n\tsetTimeout(\n\t\tfunction() {\n\t\t\t$('.pt-page-' + index + ' .loading-page').css({\"opacity\" : \"0\"}).delay(500).css({\"visibility\" : \"hidden\"});\n\t\t}\n\t,waiting_time);\n}", "function scriptMain() {\n pageSetup();\n\n}", "function loaded() {\n // Variables have to be created for each instrument and be linked to a sample which was previously declared\n const kick = blip.clip().sample('kick')\n const snare = blip.clip().sample('snare')\n const hihat = blip.clip().sample('hihat')\n\n // Creating a loop for the kick which takes the beats per minute for the right speed and it takes the randomly generated kick pattern\n kickBeat = blip.loop()\n .tempo(beatsPerMinute)\n .data(randomKickPattern)\n .tick(function (t, d) {\n if (d) {\n kick.play(t)\n }\n })\n\n // Creating a loop for the snaredrum which takes the beats per minute for the right speed and it takes the randomly generated snare pattern\n snareBeat = blip.loop()\n .tempo(beatsPerMinute)\n .data(randomSnarePattern)\n .tick(function (t, d) {\n if (d) {\n snare.play(t)\n }\n })\n\n // Creating a loop for the hihat which only takes the beats per minute for the right speed\n hihatBeat = blip.loop()\n .tempo(beatsPerMinute)\n .tick(function (t) {\n hihat.play(t)\n })\n\n // Starts all the loops at once to make them play together\n kickBeat.start()\n snareBeat.start()\n hihatBeat.start()\n\n // Adds a class to the lighting effect on the page. This will trigger the right animation in CSS\n lighting.classList.add('default')\n blade.classList.add('defaultBlade')\n }", "function preinit() {\n const head = document.getElementsByTagName('head')[0];\n for (let i = 0; i < additionalScripts.length; i++) {\n const newScript = document.createElement('script');\n newScript.src = additionalScripts[i].url;\n newScript.type = 'text/javascript';\n if (additionalScripts[i].nowait) {\n numInit++;\n } else {\n newScript.onload = handleScriptLoad;\n }\n head.appendChild(newScript);\n }\n }", "function load()\n{\n dashcode.setupParts();\n loadVersionString();\n loadUserAppKey();\n}", "function preload() {}" ]
[ "0.66469276", "0.6499904", "0.6403356", "0.6391777", "0.63895315", "0.6373584", "0.6310782", "0.62787026", "0.62380725", "0.6224486", "0.61772996", "0.61707455", "0.6166367", "0.60873365", "0.607238", "0.6067699", "0.6046247", "0.6029225", "0.60228837", "0.60069245", "0.60013175", "0.5991171", "0.5980996", "0.5978468", "0.5977437", "0.59696776", "0.5935308", "0.59003663", "0.5897873", "0.5873401", "0.5873126", "0.5865458", "0.5865458", "0.5865458", "0.58579075", "0.58494484", "0.58415866", "0.58364165", "0.58290577", "0.5828371", "0.5813886", "0.5813067", "0.5782591", "0.57775927", "0.57714456", "0.5770222", "0.5767028", "0.5745767", "0.57394177", "0.57355094", "0.5735359", "0.57327914", "0.57307893", "0.5726103", "0.5724068", "0.57175654", "0.57169694", "0.5715261", "0.5713555", "0.5713555", "0.57122713", "0.5708285", "0.5706516", "0.57052195", "0.569404", "0.56907064", "0.5689036", "0.56826085", "0.56787705", "0.5675901", "0.5675311", "0.5673003", "0.56724745", "0.5672097", "0.56710315", "0.5668215", "0.56593734", "0.5653817", "0.56515735", "0.56508255", "0.56453013", "0.5637945", "0.56303036", "0.56232977", "0.5614515", "0.5606531", "0.55995923", "0.559795", "0.55969334", "0.55965567", "0.55882037", "0.5588114", "0.5584875", "0.5584875", "0.55807585", "0.5578892", "0.55752534", "0.55729246", "0.5563813", "0.5543767", "0.55429286" ]
0.0
-1
Score Variable shuffle cards array and set shuffled array
function shuffle() { shuffleCards = cards.sort(function(a,b){return 0.5 - Math.random()}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shuffleCards() {\n let random = 0;\n let temp = 0;\n for (i = 1; i < game.cards.length; i++) {\n random = Math.round(Math.random() * i);\n temp = game.cards[i];\n game.cards[i] = game.cards[random];\n game.cards[random] = temp;\n }\n game.assignData();\n \n }", "function shuffleCards(cardsArray){\n shuffle(cards);\n}", "function shuffleCards() {\n\t\t\tvar curr_index = cards.length, \n\t\t\t\ttemp_value, \n\t\t\t\trand_index;\n\t\t\twhile (0 !== curr_index){\n\t\t\t\t// Pick random value\n\t\t\t\trand_index = Math.floor(Math.random() * curr_index);\n\t\t\t\tcurr_index--;\n\t\t\t\t// Swap the randomly picked value with the current one\n\t\t\t\ttemp_value = cards[curr_index];\n\t\t\t\tcards[curr_index] = cards[rand_index];\n\t\t\t\tcards[rand_index] = temp_value;\n\t\t\t}\n\t\t}", "randomShuffle() {\n const shuffled = [];\n const unshuffled = this.cards.slice();\n\n while (unshuffled.length > 0) {\n const randomCard = Math.floor(Math.random() * unshuffled.length);\n shuffled.push(unshuffled.splice(randomCard, 1)[0]);\n }\n\n this.cards = shuffled;\n }", "shuffleCards() {\n\n \t\tfor(var i = 0; i < this.cards.length; i++) {\n \t\t\tvar randomIndex = Math.floor(Math.random() * this.cards.length);\n \t\tvar temp = this.cards[i];\n \t\t\n \t\tthis.cards[i] = this.cards[randomIndex];\n \t\tthis.cards[randomIndex] = temp;\n \t\t}\n\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}", "function shuffle (cards){\n let random = 0; \n let temp = 0;\n for(let i=0;i<cards.length ;i++){\n random = Math.round(Math.random()*i) ;\n //console.log(random);\n temp = cards[i];\n cards[i] = cards[random];\n cards[random] = temp;\n }\n console.log(cards);\n }", "function cardShuffle() {\n // Create a temporary array (cardsToShuffle) to fill with the cards\n // in the cards array.\n let cardsToShuffle = cards.slice(0);\n // Create a new array (shuffledCards) filled with the shuffled cards.\n // This is the array that players interact with. The temporary array\n // (cardsToShuffle) is destroyed in this process.\n let i = 0;\n while (i < cards.length) {\n let randomIndex = Math.floor(Math.random()*cardsToShuffle.length)\n shuffledCards[i] = cardsToShuffle[randomIndex];\n cardsToShuffle.splice(randomIndex, 1);\n i++;\n }\n}", "shuffle() {\n for (let i = this.cards.length - 1; i > 1; i--) {\n let x = Math.floor(Math.random() * i);\n let temp = this.cards[i];\n this.cards[i] = this.cards[x];\n this.cards[x] = (temp);\n }\n }", "reset(shuffle = true){\n this.cards = [];\n for (var i = 0; i <= 12; i++) {\n for (var j = 0; j <= 3; j++) {\n let card = new Card(values[i], suits[j]);\n this.cards.push(card);\n }\n }\n if (shuffle){ this.shuffle(); }\n this.dealtIndex = 0;\n }", "function shuffle(cards)\n{\n\t// for loop???\n\t \n}", "function shuffleCards() {\n for (var i = 0; i < 52; i++) {\n var randIndex = getRand();\n if (i == 0) {\n deckCards.arrayOfCards[i] = randIndex;\n } else {\n while (deckCards.arrayOfCards.indexOf(randIndex) != -1) {\n randIndex = getRand();\n }\n deckCards.arrayOfCards[i] = randIndex;\n }\n }\n}", "shuffle() {\n // -- To shuffle an array a of n elements (indices 0..n-1):\n // for i from n−1 downto 1 do\n // j ← random integer such that 0 ≤ j ≤ i\n // exchange a[j] and a[i]\n for (let n = this.cards.length - 1; n > 0; --n)\n {\n //Step 2: Randomly pick a card which has not been shuffled\n let k = Math.floor(Math.random() * (n + 1));\n\n //Step 3: Swap the selected item with the last \"unselected\" card in the collection\n let temp = this.cards[n];\n this.cards[n] = this.cards[k];\n this.cards[k] = temp;\n }\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 }", "shuffleCards() {\n for (var i = cards.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1))\n var temp = cards[i]\n cards[i] = cards[j]\n cards[j] = temp\n }\n }", "shuffle() {\n for (let i = this.cards.length - 1; i > 0; i--) {\n const newIndex = Math.floor(Math.random() * (i + 1)); //get random index before the current card to swap with\n const oldValue = this.cards[newIndex];\n this.cards[newIndex] = this.cards[i];\n this.cards[i] = oldValue;\n //Looping through all of our cards and swapping them with another card to get a random shuffle\n }\n }", "shuffle() {\n for(let x = 0; x < 2; x++) { \n for (let i = this.cards.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1)); // random index from 0 to i\n [this.cards[i], this.cards[j]] = [this.cards[j], this.cards[i]]; // swap elements\n }\n }\n }", "function shuffle() {\n // for 1000 turns\n // switch the values of two random cards\n for (let i = 0; i < 1000; i++) {\n let location1 = Math.floor(Math.random() * cards.length);\n let location2 = Math.floor(Math.random() * cards.length);\n let tmp = cards[location1];\n\n cards[location1] = cards[location2];\n cards[location2] = tmp;\n }\n\n // console.log(cards);\n}", "function shuffle(cards)\n{\n\tvar rVariable = 0;\n\tvar firstArray = [];\n\tvar chosenArray = [];\n\t\n\tfor (var i = 0; i <= cards - 1; i++) \n\t{\n\t\tdo\n\t\t{\n\t\t\trVariable = Math.floor(Math.random() * cards);\n\t\t}\n\t\twhile(IfChosen(rVariable,chosenArray) == 1);\n\t\t\n\t\n\t\tfirstArray.unshift(rVariable);\n\t\tchosenArray.unshift(rVariable);\n\t}\n\n\treturn firstArray;\n\t\n}", "function ShuffleCards(array){\n let currentIndex = array.length, tempValue, randIndex;\n\n while(currentIndex != 0){\n randIndex = Math.floor(Math.random() * currentIndex); // Get random card\n currentIndex -= 1; // Decrement counter\n tempValue = array[currentIndex]; //Save known card\n array[currentIndex] = array[randIndex]; //Set known card to random card\n array[randIndex] = tempValue; //Set index of random card to known card\n }\n return array;\n}", "function shuffleCards() {\n draw = shuffle(cards);\n\n // shuffle :: [a] -> [a]\n function shuffle(a) {\n var choice,\n choices = a.slice(0),\n shuffled = [];\n\n // While there are choices, choose and remove a random element from the array.\n while (choices.length > 0) {\n choice = choices.splice(Math.ceil(Math.random() * choices.length) - 1, 1)[0];\n shuffled.push(choice);\n }\n\n return shuffled;\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 setBoard() {\n const cards = $('.card');\n\n const shuffledCards = shuffle(cards);\n\n for (let i = 0; i < shuffledCards.length; i++) {\n $('.deck').append(shuffledCards[i]);\n }\n}", "cardsShuffle() {\n for(let i = this.cardsArray.length - 1; i > 0; i--) {\n let randomInt = Math.floor(Math.random() * (i + 1));\n this.cardsArray[randomInt].style.order = i;\n this.cardsArray[i].style.order = randomInt;\n }\n }", "function shuffle(){\n Array.from(cards).forEach(card => {\n let randomPos = 0;\n randomPos = Math.floor(Math.random() * 20); \n card.style.order = randomPos;\n });\n}", "shuffle() {\n const { cards } = this;\n for (let i = cards.length - 1; i > 0; i--) {\n // Find a random number in index\n // Assign to variable \"swapIndex,\" \n // Add new card every loop to this index\n const swapIndex = Math.floor(Math.random() * (i + 1)); \n // In this case, i+1 is 52 for cards in the deck\n // Locate current place in array\n const currentCard = this.cards[i];\n // Moves the chosen cards to the front of the array\n // Then swaps with remaining cards\n // Chooses a card from remaining array\n const cardToSwap = this.cards[swapIndex];\n this.cards[i] = cardToSwap;\n this.cards[swapIndex] = currentCard;\n };\n return this;\n }", "shuffleCards(cardArray) {\n for (let i = cardArray.length - 1; i > 0; i--) {\n let randIndex = Math.floor(Math.random() * (i + 1));\n cardArray[randIndex].style.order = i;\n cardArray[i].style.order = randIndex;\n }\n }", "function shuffle()\n{\n var vurr_cards=document.getElementsByClassName(\"card\")\n quak_c=0\n startp1=10\n // hand_shake()\n for(var t in vurr_cards)\n {\n var mod_by=100\n var mult=Math.floor(Math.random()*10)\n var rule=[-5,-4,-3,3,4,5]\n var x_random=rule[Math.floor(Math.random()*rule.length)]\n var y_random=rule[Math.floor(Math.random()*rule.length)]\n slide(id_array[t], xpositions[t], (xpositions[t]+x_random*mult)%mod_by, ypositions[t], (ypositions[t]+y_random*mult)%mod_by);\n\n ypositions[t]=(ypositions[t]+y_random*mult)%mod_by\n xpositions[t]=(xpositions[t]+x_random*mult)%mod_by\n document.getElementById(\"output\").innerHTML=total+\" on turn \"+times_dealt+\" x:\"+x_random+ \"y: \"+y_random\n }\n}", "shuffle() {\n let remainingCardTobeShuffled = this.deck.length, randomCardSwapIndex;\n\n // Swaps 52 times\n while (remainingCardTobeShuffled) {\n\n // Create a random index to be swapped\n randomCardSwapIndex = Math.floor(Math.random() * remainingCardTobeShuffled--);\n\n // Shortcut in js to swap two elements\n [this.deck[remainingCardTobeShuffled], this.deck[randomCardSwapIndex]] = [this.deck[randomCardSwapIndex], this.deck[remainingCardTobeShuffled]];\n }\n\n }", "function shuffle(cardsArray) {\n var j\n var x\n var i\n for (i = cardsArray.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = cardsArray[i].id;\n cardsArray[i].id = cardsArray[j].id;\n cardsArray[j].id = x;\n }\n return cardsArray;\n}", "function shuffleCard(cards){\n return cards[Math.floor(Math.random() * cards.length)];\n }", "shuffle(){\n let randomInt = Math.floor(Math.random() * (this.cards.length));\n return randomInt;\n }", "function shuffleArray(){\n let counter = cardObjArr.length;\n while(counter > 0){\n const randomIndex = Math.floor(Math.random() * cardObjArr.length);\n counter--;\n const temp = cardObjArr[counter];\n cardObjArr[counter] = cardObjArr[randomIndex];\n cardObjArr[randomIndex] = temp;\n }\n }", "function shuffle(cardarray) {\n let currentIndex = cardarray.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = cardarray[currentIndex];\n cardarray[currentIndex] = cardarray[randomIndex];\n cardarray[randomIndex] = temporaryValue;\n }\n\n return deck;\n}", "function shuffleCards(cards) {\n var i, j, k;\n for (i = cards.length -1; i > 0; i--) {\n j = Math.floor(Math.random() * i)\n k = cards[i]\n cards[i] = cards[j]\n cards[j] = k\n }\n\n return cards\n\n}", "function applyShuffle (array) {\n const deck = document.querySelector('.deck');\n removeElements(array, deck);\n for(const index of array) {\n deck.appendChild(index)\n }\n}", "selectCards() {\n this.cardsInSet = [];\n // shuffle all arrays\n for (let i=0; i<5; i++) {\n this.shuffleArray(this.matrix[i]);\n }\n // select random cards to fill this.cardsInSet\n this.randomSelect();\n }", "initCards() {\n let allCards = [\n { value: \"A\", matched: false},\n { value: \"A\", matched: false},\n { value: \"B\", matched: false},\n { value: \"B\", matched: false},\n { value: \"C\", matched: false},\n { value: \"C\", matched: false},\n { value: \"D\", matched: false},\n { value: \"D\", matched: false},\n { value: \"E\", matched: false},\n { value: \"E\", matched: false},\n { value: \"F\", matched: false},\n { value: \"F\", matched: false},\n { value: \"G\", matched: false},\n { value: \"G\", matched: false},\n { value: \"H\", matched: false},\n { value: \"H\", matched: false}\n ];\n this.shuffle(allCards);\n return allCards;\n }", "function createDeck()\n{\n var suits = [\"clubs\",\"diamonds\",\"hearts\",\"spades\"];\n \n for (i = 0; i<4;i++)\n {\n for (j = 2; j<15; j++)\n {\n cards.push({\n suit:suits[i],\n value:j \n });\n }\n }\n\n //shuffles the array\n shuffleArray(cards);\n}", "function shuffleCards() {\r\n shuffle(cardsOrig);\r\n cardsTop = cardsOrig.slice(0);\r\n shuffle(cardsOrig);\r\n cardsBottom = cardsOrig.slice(0);\r\n cards = cardsTop.concat(cardsBottom);\r\n shuffle(cards);\r\n console.log(cards);\r\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}", "shuffle() {\n for (let i = 0; i < 1000; i++) {\n let location1 = Math.floor((Math.random() * this.cards.length));\n let location2 = Math.floor((Math.random() * this.cards.length));\n let tmp = this.cards[location1];\n\n this.cards[location1] = this.cards[location2];\n this.cards[location2] = tmp;\n };\n return this.cards\n }", "function _shuffleCard(shuffleArray){\n var currentIndex = shuffleArray.length, temporaryValue, randomIndex; //Make a Index\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 // And swap it with the current element.\n temporaryValue = shuffleArray[currentIndex];\n shuffleArray[currentIndex] = shuffleArray[randomIndex];\n shuffleArray[randomIndex] = temporaryValue;\n }\n}", "shuffle(cards) {\n for (let i = cards.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1));\n [cards[i], cards[j]] = [cards[j], cards[i]];\n }\n return cards;\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 const { cards } = this;\n for (let i = cards.length - 1; i > 0; i--) {\n const swapIndex = Math.floor(Math.random() * (i + 1)); \n const currentCard = this.cards[i];\n const cardToSwap = this.cards[swapIndex];\n this.cards[i] = cardToSwap;\n this.cards[swapIndex] = currentCard;\n };\n return this;\n }", "function shuffleCards(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 console.log(array);\n return array;\n}", "function shuffle() {\n cards.forEach(card=> {\n let randomPos = Math.floor(Math.random() * 16);\n card.style.order = randomPos;\n })\n}", "function shuffle () {\n for(let i=setDeck.length-1; i >= 0; i--){\n let j = Math.floor(Math.random() * i)\n let temp = setDeck[i]\n setDeck[i] = setDeck[j]\n setDeck[j] = temp\n }\n}", "shuffle() {\n //One array contains indexes, the other the objects themselves\n let available = [];\n let tempCards = [];\n for (let i = 0; i < this.cards.length; i++) {\n available[i] = i;\n tempCards[i] = this.cards[i];\n tempCards[i].pos.y += random(-100, 100);\n }\n\n //for each temporary card, put it somewhere in the deck and remove\n //that index from the array so no other card can go there.\n tempCards.forEach((card) => {\n let random = Math.floor(Math.random() * available.length);\n let index = available[random];\n this.cards[index] = card;\n available.splice(random, 1);\n });\n console.log(\"Deck is shuffled\");\n }", "function shuffleCards(cardsArray) { \n for (let i = cardsArray.length - 1; i > 0; i--) {\n let randIndex = Math.floor(Math.random() * (i + 1));\n cardsArray[randIndex].style.order = i;\n cardsArray[i].style.order = randIndex;\n }\n}", "reshuffle() {\n this._deck = [];\n for(var i = 0; i < 52; i++) {\n\t\t\tthis._deck.push(i);\n\t\t}\n \n this.shuffle();\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 shuffleCards()\n{\n var i = 0;\n var j = 0;\n var temp = null;\n\n for (i = cards.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1));\n temp = cards[i];\n cards[i] = cards[j];\n cards[j] = temp;\n }\n}", "function shuffleCards()\n{\n var i = 0;\n var j = 0;\n var temp = null;\n\n for (i = cards.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1));\n temp = cards[i];\n cards[i] = cards[j];\n cards[j] = temp;\n }\n}", "function initCardShuffle() {\n // Shuffle cards, then reset their states and move them in the shuffled order. \n [...memoryGrid.querySelectorAll('.card')]\n\n .sort(function () {\n return 0.5 - Math.random();\n })\n .forEach(function (elem) {\n\n resetCard(elem);\n\n memoryGrid.appendChild(elem);\n });\n }", "function shuffleCards() {\n const shuffle = cards;\n let d = shuffle.length;\n let n;\n while (d) {\n n = Math.floor(Math.random() * (d -= 1));\n [shuffle[d], shuffle[n]] = [shuffle[n], shuffle[d]];\n }\n\n // For each dataObject, replace the previous card and append it to the DOM\n shuffle.forEach((card, i) => {\n const positionFromLeft = i * 30;\n const shuffledCards = document.createElement('div');\n shuffledCards.setAttribute('data-value', card.value);\n shuffledCards.classList.add('card', `${card.suit}-${card.value}`);\n shuffledCards.style.left = `${positionFromLeft}px`;\n cardsWrapper.replaceChild(shuffledCards, cardsWrapper.children[i]);\n });\n}", "shuffle() {\n if(this.deck.length <= 1) { return; }\n \n for(let idx = 0; idx < this.deck.length - 1; idx++) {\n let idx_random = this.randomIndex(idx, this.deck.length - 1);\n \n if(idx_random !== idx) {\n let swap = this.deck[idx];\n this.deck[idx] = this.deck[idx_random];\n this.deck[idx_random] = swap;\n }\n }\n }", "function shuffle(quiz) {\n\n\t var currentIndex = quiz.length;\n\t var temporaryValue;\n\t var randomIndex;\n\t while (0 !== currentIndex) {\n\n\t randomIndex = Math.floor(Math.random() * currentIndex);\n\t currentIndex -= 1;\n\t temporaryValue = quiz[currentIndex];\n\t quiz[currentIndex] = quiz[randomIndex];\n\t quiz[randomIndex] = temporaryValue;\n\t }\n\n\t \n\t }", "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 setupCards() {\n let shuffledCards = shuffle(listOfCards);\n for(let i = 0; i < deckSize; i++) {\n deck[i].firstElementChild.className = shuffledCards[i];\n }\n}", "function shuffle() {\n cards.forEach((card) => {\n let randomPos = Math.floor(Math.random() * 7);\n card.style.order = randomPos;\n });\n}", "function shuffleit() {\n list_cards = shuffle(list_cards);\n shuffle_cards(list_cards);\n}", "shuffle(){\n // reset\n let cards = [\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"10\",\"JACK\",\"QUEEN\",\"KING\",\"ACE\"]\n let jokers = [\"JOKER\",\"JOKER\",\"JOKER\",\"JOKER\"]\n let result = []\n result.push(...jokers)\n for(let i =0; i<8; i++) {\n result.push(...cards)\n }\n\n // shuffle cards Durstenfeld Shuffle\n // https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array\n\n for (let i = result.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n [result[i], result[j]] = [result[j], result[i]];\n }\n\n this.deck = result\n return this.deck;\n }", "function shuffleCards(cards) {\n var j, x, i;\n for (i=cards.length-1 ; i>0 ; i--){\n j = Math.floor(Math.random() * (i + 1));\n x = cards[i];\n cards[i] = cards[j];\n cards[j] = x;\n }\n\n return cards;\n}", "resetCards() {\n let cards = this.cards.map((card) => {\n card.is_open = false;\n return card;\n });\n\n this.shuffle(cards.length);\n\n this.setState({\n current_selection: [],\n selected_pairs: [],\n cards: cards\n });\n\n this.SCORE = 0;\n this.fail = 0;\n this.message = \"\";\n }", "shuffleCards() {\n this.cards.forEach(card => {\n let randomPos = Math.floor(Math.random() * 12);\n card.style.order = randomPos;\n });\n }", "function shuffle(cards) {\n cards.forEach(card => {\n let randomize = Math.floor(Math.random() * 10);\n card.style.order = randomize;\n });\n}", "realShuffle() {\n const shuffled = [];\n\n const {half1, half2} = this.halveDeck();\n\n let onHalf1 = true;\n let counter = 0;\n \n while (half1.length > 0 || half2.length > 0) {\n\n if (onHalf1) {\n\n if (!half1.length) {\n onHalf1 = !onHalf1;\n counter = 0;\n continue;\n }\n\n shuffled.unshift(half1.pop());\n counter++;\n\n if (counter >= 4 || !percentRoll(80)) {\n onHalf1 = !onHalf1;\n counter = 0;\n continue;\n }\n\n } else {\n\n if (!half2.length) {\n onHalf1 = !onHalf1;\n counter = 0;\n continue;\n }\n\n shuffled.unshift(half2.pop());\n counter++;\n\n if (counter >= 4 || !percentRoll(80)) {\n onHalf1 = !onHalf1;\n counter = 0;\n continue;\n }\n\n }\n\n }\n\n this.cards = shuffled;\n }", "shuffle() {\n _deck.set(this, shuffleArray(_deck.get(this)));\n }", "function shuffleBoard(array) {\n this.clearBoards()\n boardItems.sort(() => Math.random() - 0.5);\n screenView()\n}", "shuffleDeck() {\n let n = this.deck.length;\n for (let i = 0; i < n; i++) {\n var r = Math.floor(Math.random() * n);\n this.shuffledCards.push(this.deck[r]);\n this.deck[r] = this.deck[n - 1];\n n--;\n }\n }", "shuffle() {\n let len = this.cards.length;\n while(len) {\n // randomly choose a card and move it to the end\n // of the deck\n this.cards.push(\n this.cards.splice( Math.floor( Math.random() * len ), 1 )[0]\n )\n len -= 1\n }\n }", "shuffle(){\n if (this.nameValue.value % 2 !== 0) {\n alert('please enter the even number');\n } else {\n this.timerCount = true;\n this.numOfClick = 0;\n this.preIndex = 0;\n this.preKey = 0;\n this.matchNum = 0;\n this.score = 0;\n let list1=[];\n let list2=[];\n for (let i = 0; i < this.nameValue.value * this.nameValue.value / 2; i++) {\n list1[i] = i + 1;\n list2[i] = i + 1;\n }\n list1= list1.sort(function(){ return 0.5 - Math.random() })\n list2= list2.sort(function(){ return 0.5 - Math.random() })\n let tempBoard = [];\n let swift = 0;\n for (let i = 0; i < this.nameValue.value; i++) {\n tempBoard[i] = [];\n for (let j = 0; j < this.nameValue.value; j++) {\n if (swift%2 === 0) {\n tempBoard[i][j] = {'value': list1[Math.floor(swift / 2)], 'hidden': true, 'color': 'reddiv', 'locked' : false};\n swift ++;\n } else {\n tempBoard[i][j] = {'value': list2[Math.floor(swift / 2)], 'hidden': true, 'color': 'reddiv', 'locked' : false};\n swift ++;\n }\n }\n }\n this.stateOfGame = 'Please click and match all the pairs of the cards with the same number';\n this.setState({\n board:tempBoard,\n secondsElapsed : 0,\n player:[\n {\n name: \"player1\",\n score: 0,\n second: 0\n },\n {\n name: \"player2\",\n score: 0,\n second: 0\n }\n ]\n });\n}\n }", "newShuffle(){\n this.drawPile = shuffle(this.newDeck());\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 setCards() {\n const newArray = initialCards.concat(initialCards);\n const initialCards2 = shuffle(newArray);\n\n initialCards2.forEach((element) => {\n const cardData = {\n name: element.name,\n link: element.link,\n id: i,\n };\n\n const makeCard = createCard(cardData);\n // addCard(makeCard);\n i++;\n });\n}", "function shuffle() {\n cards.forEach(card => {\n let randomPos = Math.floor(Math.random() * 12);\n card.style.order = randomPos;\n });\n}", "function shuffle() {\n // Loop through cards\n cards.forEach(function(card) {\n // Define the random numper genrates with compniation of the math Functions as a varible\n let randomais = Math.floor(Math.random() * 12);\n //And give evry card a randome number between 1:12\n //And set it to its order property\n card.style.order = randomais;\n });\n}", "function randomizeCards() {\n\tconsole.log('\\nrandomizeCards - CALLED');\n\n\t// SIMPLE RANDOMIZE: \n\t// Just randomized cards... The right permutation of cards is possible...\n\t// =======================================\n\t// for (var n in jsonData.category) { \n\t// \tvar randArr = ShuffelArray(jsonData.category[n].samfundstype);\n\t// \tjsonData.category[n].samfundstype = randArr;\n\t// }\n\n\t// ADVANCED RANDOMIZE: \n\t// The teachers (FR) does not want the right permutation of cards to be possible. Therefor this algorithm randomizes all cards, and \n\t// checks to see if the first card is supposed to go in the first position - if it is, then the algorithm iterate through all cards to find \n\t// a cards that does NOT go in the first position: it then place this card in the first position. \n\t// =======================================\n\tfor (var n in jsonData.category) { \n\t\tvar randArr = ShuffelArray(jsonData.category[n].samfundstype);\n\t\tconsole.log('randomizeCards - n: ' + n);\n\t\tif (elementInArray(randArr[0].correctColumn, 0)) {\n\t\t\tconsole.log('randomizeCards - n: ' + n + ' randArr 1: ' + JSON.stringify(randArr));\n\t\t\tvar len = randArr.length;\n\t\t\tfor (var i = 0; i < len; i++) {\n\t\t\t\tif (!elementInArray(randArr[i].correctColumn, 0)) {\n\t\t\t\t\tconsole.log('randomizeCards - i: ' + i + ', ' + JSON.stringify(randArr[i].correctColumn));\n\t\t\t\t\tvar elem = randArr.splice(i, 1)[0];\n\t\t\t\t\trandArr.unshift(elem);\n\t\t\t\t\tbreak;\n\t\t\t\t} \n\t\t\t}\n\t\t\tconsole.log('randomizeCards - n: ' + n + ' - randArr 2: ' + JSON.stringify(randArr));\n\t\t}\n\t\tjsonData.category[n].samfundstype = randArr;\t\t\t\t\t\t\n\t}\n\n\tconsole.log('randomizeCards - jsonData 2: ' + JSON.stringify(jsonData));\n}", "shuffle(cards) {\n var i,\n j,\n temp;\n for (i = cards.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n temp = cards[i];\n cards[i] = cards[j];\n cards[j] = temp;\n }\n return cards;\n }", "function shuffle() {\n cards.forEach(card => {\n let randomCards = Math.floor(Math.random() * 12);\n card.style.order = randomCards;\n });\n}", "deckOfCards() {\n try {\n var suits = [\"Clubs\", \"Diamonds\", \"Hearts\", \"Spades\"];\n var ranks = [\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"10\",\n \"Jack\",\n \"Queen\",\n \"King\",\n \"Ace\"\n ];\n /**\n * To calculate total number of cards\n */\n var totalCards = suits.length * ranks.length;\n /**\n * To create a deck of array\n */\n var cardArray = [];\n for (let currentSuit = 0; currentSuit < suits.length; currentSuit++) {\n for (let currentRank = 0; currentRank < ranks.length; currentRank++) {\n var temp = \"\";\n cardArray.push(temp + ranks[currentRank] + suits[currentSuit]);\n }\n }\n /**\n * To shuffle the deck\n */\n for (let shuffle = 0; shuffle < totalCards; shuffle++) {\n var num = Math.floor(Math.random() * totalCards);\n /**\n * Performing swapping\n */\n var temp = cardArray[shuffle];\n cardArray[shuffle] = cardArray[num];\n cardArray[num] = temp;\n \n }\n return cardArray;\n } catch (error) {\n console.log(error.message);\n }\n }", "function shuffleCards() {\n\n\tpairCards = 0;\n\tscore = 50;\n\tcounter = 0;\n\tpreviousCard = null;\n\tcurrentCard = null;\n\tinterval = null;\n\n\t//Shuffle array of cards\n\tcards.sort(function() { return Math.random() - 0.5;});\n\n\t//Get back div of cards\n\tvar elements = $(\".card\");\n\n\t//Assignment initial values and events\n\tfor (var i = 0; i < elements.length; i++) {\n\n\t\telements[i].style.transition = \"none\";\n\t\telements[i].style.backgroundImage = reverse;\n\t\telements[i].addEventListener(\"click\", clickCard, true);\n\t\telements[i].style.visibility = \"visible\";\n\t\t//console.log(\"Event asociated to \" + elements[i].id);\n\t}\n\n\t//Enable delay's trainsition effect to avoid show the cards\n\tsetTimeout(enableTransition, 500);\n\n\t//Show the initial score\n\tshowScore();\n\tdocument.getElementById(\"clock\").innerHTML = \"00:0\";\n}", "function shuffleCards() {\n cards.forEach(card => {\n let randomCard = Math.floor(Math.random()*18);\n card.style.order = randomCard;\n });\n}", "function shuffleDeck(decks)\n{\n for(let j=1; j<=_numberOfDecks; j++)\n {\n for(let i=0; i<=suits.length-1; i++)\n {\n for(let n=0; n<=card.length-1; n++)\n {\n if(card[n]===\"2\" || card[n]===\"3\" || card[n]===\"4\" || card[n]===\"5\" || card[n]===\"6\" || card[n]===\"7\" || card[n]===\"8\" || card[n]===\"9\")\n {\n decks.push({suit: suits[i], cardValue: card[n], numValue: n+1});\n }\n else if(card[n]===\"jack\" || card[n]===\"queen\" || card[n]===\"king\" || card[n]===\"10\")\n {\n decks.push({suit: suits[i], cardValue: card[n], numValue: 10});\n }\n else\n {\n decks.push({suit: suits[i], cardValue: card[n], numValue: 11});\n }\n }\n }\n }\n let arrLength = decks.length;\n for(let i=0; i<arrLength; i++)\n {\n if(decks[i].suit === 'hearts' || decks.suit === 'diamonds')\n {\n decks[i].color = \"red\";\n }\n else\n {\n decks[i].color = \"black\";\n }\n }\n function shuffleCard(decks)\n {\n let i = 0, j = 0, temp = null;\n\n for (i = decks.length - 1; i > 0; i--)\n {\n j = Math.floor(Math.random() * (decks.length));\n temp = decks[i];\n decks[i] = decks[j];\n decks[j] = temp;\n }\n }\n shuffleCard(decks);\n return decks; \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 shuffleCards() {\n cards.forEach(card => {\n let randomNumber = Math.floor(Math.random() * 12);\n card.style.order = randomNumber;\n });\n}", "function shuffleDeck() {\n // for 1000 turns\n // switch the values of two random cards\n for (var i = 0; i < 1000; i++) {\n var location1 = Math.floor(Math.random() * deck.length);\n var location2 = Math.floor(Math.random() * deck.length);\n var tmp = deck[location1];\n\n deck[location1] = deck[location2];\n deck[location2] = tmp;\n }\n}", "function setCards(numberOfCards){\n\nvar numberOfMatches = numberOfCards / 2;\n\nshuffle(cardObjects);\n\n // ensure that there are only as many card objects as nessasary\n while(cardObjects.length > numberOfMatches){\n cardObjects.pop();\n }\n\n shuffle(cardObjects);\n\n}", "function shuffle(){\n\tvar pArray = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15];\n\tfor (var i=mypuzzle.length; i>0; i){\n\t\tvar j = Math.floor(Math.random() * i);\n\t\tvar x = pArray[--i];\n\t\tvar test = pArray[j];\n\t\tif(test == \"0\") { \n\t\t\tmypuzzle[i].addClassName(\"puzzlepiece\");\n\t \t\tblankPiece(mypuzzle[i]);\n\t \t\tmypuzzle[i].innerHTML = \"\";\n\t\t\t\t\t}\n\t\telse{\n \t\t\tmypuzzle[i].innerHTML = pArray[j];\n \t\t\tregularP(mypuzzle[i]);\n \t\t\tbackgroundPos(mypuzzle[i], test);\n }\n\t\t\tpArray[j] = x;\n }\n \tmoveable();\n }", "function setQuestionBank() {\n for (let val of fixedQuestionBank) {\n questionBank.push(val);\n }\n console.log(questionBank);\n shuffle(questionBank);\n}", "function shuffleCards() {\n let shuffledCards = shuffle(cardsArray);\n\n for (let i = 0; i < shuffledCards.length; i++) {\n [].forEach.call(shuffledCards, function(item) {\n deck.appendChild(item);\n });\n }\n}", "function shuffle() {\n cards.forEach(card => {\n let randomPos = Math.floor(Math.random() * 12); \n card.style.order = randomPos; \n });\n}", "function shuffleDeck(){\n for(let i=0;i<deck.length;i++ ){\n swapIdx=Math.trunc( Math.random() * deck.length);\n let temp =deck[swapIdx];\n deck[swapIdx]=deck[i];\n deck[i]=temp;\n }\n}", "function shuffleAndDeck(){\n\tshuffledDeck = listOfCards();\n\n\tfor (var i = 0; i<shuffledDeck.length; i++){\n\t\tif (i % 2 == 1){\n\t\t\tdeck1.push(new Card(shuffledDeck[i]).value);\n\t\t}else{\n\t\t\tdeck2.push(new Card(shuffledDeck[i]).value);\n\t\t}\n\t}\n\n}", "function shuffle(deck) {\n\n for (var i = 0; i < deck.length; i++) {\n new_i = Math.round(Math.random() * deck.length);\n tmp = deck[new_i];\n deck[new_i] = deck[i];\n deck[i] = tmp;\n }\n}", "function shuffle(cards) { \n\t\n\t// Create shuffled array\n\tvar shuffleDeck = [];\n\n\t// While there are still cards in original deck\n\twhile (cards.length > 0) {\n\t\tvar index = getRandomDeck();\n\t\tshuffleDeck.push(cards[index]);\n\t\t// Remove from deck\n\t\tcards.splice(index, 1);\n\t}\n\t\n\t// Helper function to select random\n\tfunction getRandomDeck() {\n\t\tvar answer = Math.random() * cards.length;\n\t\t// Change to valid index\n\t\tanswer = Math.floor(answer);\n\t\treturn answer;\n\t}\n\n\t//\tReturn: randomly ordered array of objects\n\treturn shuffleDeck;\n\n}", "shuffleCards() { \n for (let i = cardsArray.length - 1; i > 0; i--) {\n let randomIndex = Math.floor(Math.random() * (i + 1));\n cardsArray[randomIndex].style.order = i;\n cardsArray[i].style.order = randomIndex; \n }\n}", "deckOfCards() {\n try {\n var suits = [\"♣\", \"♦\", \"♥\", \"♠\"];\n var ranks = [\n \"2\",\n \"3\",\n \"4\",\n \"5\",\n \"6\",\n \"7\",\n \"8\",\n \"9\",\n \"10\",\n \"Jack\",\n \"Queen\",\n \"King\",\n \"Ace\"\n ];\n /**\n * To calculate total number of cards\n */\n var totalCards = suits.length * ranks.length;\n /**\n * To create a deck of array\n */\n var cardArray = [];\n for (let currentSuit = 0; currentSuit < suits.length; currentSuit++) {\n for (let currentRank = 0; currentRank < ranks.length; currentRank++) {\n var temp = \"\";\n cardArray.push(temp + ranks[currentRank] + suits[currentSuit]);\n }\n }\n /**\n * To shuffle the deck\n */\n for (let shuffle = 0; shuffle < totalCards; shuffle++) {\n var num = Math.floor(Math.random() * totalCards);\n /**\n * Performing swapping\n */\n var temp = cardArray[shuffle];\n cardArray[shuffle] = cardArray[num];\n cardArray[num] = temp;\n }\n return cardArray;\n } catch (error) {\n console.log(error.message);\n }\n }" ]
[ "0.781474", "0.7580647", "0.7545311", "0.7463803", "0.74239177", "0.73819745", "0.7297277", "0.7278385", "0.72592473", "0.72563887", "0.72246885", "0.721764", "0.7212266", "0.7189208", "0.7169882", "0.7162499", "0.7146707", "0.70534694", "0.7052814", "0.704237", "0.7040915", "0.7028587", "0.7015207", "0.70137507", "0.70024705", "0.69961774", "0.69903207", "0.6978646", "0.6975984", "0.6964375", "0.69634986", "0.69493973", "0.69485915", "0.6945976", "0.69446063", "0.6934525", "0.69312966", "0.6925587", "0.69254065", "0.6921202", "0.6919221", "0.69181067", "0.6911226", "0.6883939", "0.6883539", "0.6879185", "0.6857824", "0.68555856", "0.6844234", "0.6841401", "0.6814372", "0.68106234", "0.6806851", "0.6801853", "0.6801853", "0.6801622", "0.6800513", "0.6798999", "0.6798451", "0.6793587", "0.67868114", "0.6769082", "0.6765448", "0.6756224", "0.6754979", "0.67519796", "0.67507446", "0.67455417", "0.6743842", "0.6740056", "0.6736735", "0.67322874", "0.67319506", "0.6726128", "0.6712811", "0.67066985", "0.6706368", "0.66996646", "0.6691902", "0.6687316", "0.66862535", "0.66703945", "0.6668595", "0.6648994", "0.66412485", "0.66287184", "0.66266346", "0.66223866", "0.6621526", "0.6619201", "0.6615044", "0.6613747", "0.66137147", "0.6611271", "0.6606615", "0.66055286", "0.6596721", "0.6590956", "0.6587798", "0.6581824" ]
0.73780113
6
function that checks for a match and adds to score
function checkForMatch() { if (cardsInPlay.length === 2) { if (cardsInPlay[0] === cardsInPlay[1]) { alert("You found a Match!"); score++; document.getElementById('score').textContent = score; } else { alert("Sorry, try again."); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function match(known_value, search_term) {\r\n\t// reset a few important variables to zero\r\n\traw_spedis_score = 0; spedis_score = 0; lev_score = 1;\r\n\tsxscore1 = \"\"; sxscore2 = \"\"; sxmatch = 0; matchscore = 0;\r\n\t// check if they exactly match, in which case skip the calculations!\r\n\tif (known_value == search_term) {\r\n\t\t matchscore = 100;\r\n\t} else {\r\n\t\traw_spedis_score = spedis(known_value, search_term);\r\n\t\tspedis_score = (-0.01*raw_spedis_score*raw_spedis_score)-(1.05*raw_spedis_score)+100\r\n\t\tlev_score = levenshtein2(known_value, search_term) * 100;\r\n\t\tsxscore1 = soundex(known_value);\r\n\t\tsxscore2 = soundex(search_term);\r\n\r\n\t\t// combine the raw soundex scores into a matching criteria\r\n\t\t// this system was developed by the author and applies an additive, non-exclusive percentage matching system\r\n\t\tif (sxscore1.charAt(0) == sxscore2.charAt(0)) { sxmatch = sxmatch + 40; };\r\n\t\tif (sxscore1.charAt(1) == sxscore2.charAt(1)) { sxmatch = sxmatch + 25; };\r\n\t\tif (sxscore1.charAt(2) == sxscore2.charAt(2)) { sxmatch = sxmatch + 10; };\r\n\t\tif (sxscore1.charAt(3) == sxscore2.charAt(3)) {\r\n\t\t\tif (sxscore1.length == 4 && sxscore2.length == 4) {\r\n\t\t\t\tif (sxmatch != 0) { sxmatch = sxmatch + 25; };\r\n\t\t\t} else {\r\n\t\t\t\tif (sxmatch != 0) { sxmatch = sxmatch + 10; };\r\n\t\t\t};\r\n\t\t};\r\n\t\tif (Math.min(sxscore1.length,sxscore2.length) > 4) {\r\n\t\t\tfor (n=4;n<=Math.min(sxscore1.length,sxscore2.length)-1;n++) {\r\n\t\t\t\tif (sxscore1.charAt(n) == sxscore2.charAt(n)) { sxmatch = sxmatch + (15/(Math.max(sxscore1.length,sxscore2.length)-4)); };\r\n\t\t\t};\r\n\t\t};\r\n\r\n\t\t// pull all the scores together\r\n\t\t// if they do not meet even a basic criteria, set the match to zero\r\n\t\tif (spedis_score < 20 || lev_score < 45) { matchscore = 0; } else {\r\n\t\t\tmatchscore = (((spedis_score + lev_score)/2) - 10) + (10 * (sxmatch/100));\r\n\t\t};\r\n\t};\r\n\treturn matchscore;\r\n}", "function addMatch(player) {\n if (player === 'player1') {\n game.player1.matchScore++;\n game.gameScoreCollection[gameScoreIndex].winner = \"player1\";\n game.gameScoreCollection[gameScoreIndex].winScore = game.player1.gameScore;\n game.gameScoreCollection[gameScoreIndex].loser = \"player2\";\n game.gameScoreCollection[gameScoreIndex].lossScore = game.player2.gameScore;\n // game.gameScoreCollection.push(pushArr);\n } else if (player === \"player2\") {\n game.player2.matchScore++;\n game.gameScoreCollection[gameScoreIndex].winner = \"player2\";\n game.gameScoreCollection[gameScoreIndex].winScore = game.player2.gameScore;\n game.gameScoreCollection[gameScoreIndex].loser = \"player1\";\n game.gameScoreCollection[gameScoreIndex].lossScore = game.player1.gameScore;\n // game.gameScoreCollection.push(pushArr);\n }\n\n//decide on match winner\n // if(game.player1.matchScore > (game.selectMatch-(game.selectMatch%2)-1)){\n if(game.player1.matchScore > (game.selectMatch/2)){\n game.matchWinner = \"player1\";\n game.matchLoser = \"player2\";\n return matchFinished();\n }\n\n // if(game.player2.matchScore > (game.selectMatch-(game.selectMatch%2)-1)){\n if(game.player2.matchScore > (game.selectMatch/2)){\n game.matchWinner = \"player2\";\n game.matchLoser = \"player1\";\n return matchFinished();\n }\n resetGame();\n let pushArr = {winner:null, winScore:0, loser:null, lossScore:0, tracker:[]};\n game.player1.pointsWon.push([]);\n game.player1.pointsLoss.push([]);\n game.player2.pointsWon.push([]);\n game.player2.pointsLoss.push([]);\n game.gameScoreCollection.push(pushArr);\n }", "function exactMatchs(p) {\n let oldScore = parseInt(document.getElementById('matchs').innerText);\n if (p === 10) {\n document.getElementById('matchs').innerText = oldScore + 1;\n }\n}", "function bonusScore () {\n // Currently, we have two kinds of bonus: Match and Phrase\n var bonus = 0;\n\n // TODO: Yeah, I know we can fail faster here, but it's 3 in the morning\n var firstWord = formWord(state.words[0]);\n var secondWord = formWord(state.words[1]);\n\n // Check for a Match Bonus, where both words are the same\n if (firstWord.toUpperCase() === secondWord.toUpperCase()) {\n bonus += 2 * getWordValue(state.words[0].toUpperCase());\n }\n\n // Check for a Phrase Bonus\n var phrase = firstWord.toLowerCase() + \" \" + secondWord.toLowerCase();\n if (bonusPhrases[phrase]) {\n bonus += config.phraseBonus;\n }\n console.log(\"The phrase bonus result is: \" + bonus);\n return bonus;\n}", "function checkForMatch() {\n if (cardsInPlay[0] === cardsInPlay[1]) {\n\talert(\"You found a match!\");\n\tscore += 1;\n\tupdateScore(score);\n }\n else if (cardsInPlay[0] !== cardsInPlay[1]){\n\t//if they don't match\n\talert(\"Sorry, try again.\");\n }\n}", "function matchCheck(){\n return (points == match);\n }", "function scoreCheck() {\n for (var i=0; i<mediaInfo.length; i++) {\n mediaInfo[i][9] = getScore(mediaInfo[i][7], mediaInfo[i][8]);\n }\n}", "function scoring() {\n\tif (inRow === 3) {\n\t\tscore += 30;\n\t} else if (inRow === 2) {\n\t\tscore += 20;\n\t} else if (inRow === 1) {\n\t\tscore += 10;\n\t}\n}", "function match() {\n\n\tpairs++;\n\tcount = 0;\n\tdisableCards();\n\tresetCards();\n\tscoreKeeper();\n\n}", "function calculateMatchResult(gameId){\n\n}", "function updateScore(result) {\n\tif (result === 'won') {\n\t\t++totalWins;\n\t} else if (result === 'lose') {\n\t\t++totalLost;\n\t} else {\n\t\t++totalDraw;\n\t}\n\n\t++totalMatches;\n\n\tupdateBoard(totalMatches, totalWins, totalLost, totalDraw);\n}", "function isMatch () {\n\n\tif(cardsInPlay[0] === cardsInPlay[1])\n\t\t{\n\t\talert('You found a match');\n\t\tscore=score+1;\n\t\tnumberOfLives=numberOfLives-1;\n\t\tupdateLives();\n\t\tupdateScore(score);\n\t\tsetTimeout(clearCard(),10000);\n\t\t\n\t\t}\n\telse {\n\t\talert('Sorry Try Again');\n\t\tsetTimeout(clearCard(),10000);\n\t\tnumberOfLives=numberOfLives-1;\n\t\tupdateLives();\n\t\t\n\t\t}\n\t\t\n\t\t\n\t}", "addCardsByScore() { \n const score = this.getTotal();\n if (score.strong/score.total >= 0.7) {\n this.addNewCards(score.total);\n }\n }", "function incrementMatchCount() {\n matchCount += 2;\n}", "function calculateScore(match) {\n let score = 0;\n // cross line\n if (match[\"Start\"][\"Cross Line\"] == \"1\") {\n score += 3;\n } else if (match[\"Start\"][\"Cross Line\"] == \"2\") {\n score += 6;\n }\n let climb_score = 0;\n // platform\n if (match[\"Endgame\"][\"Platform\"] == \"level 1\") {\n climb_score += 3;\n } else if (match[\"Endgame\"][\"Platform\"] == \"level 2\") {\n climb_score += 6;\n } else if (match[\"Endgame\"][\"Platform\"] == \"level 3\") {\n climb_score += 12;\n }\n if (match[\"Endgame\"][\"Assistance\"] == \"received\") {\n climb_score = 0;\n } else if (match[\"Endgame\"][\"Assistance\"] == \"gave 1\") {\n climb_score *= 2;\n } else if (match[\"Endgame\"][\"Assistance\"] == \"gave 2\") {\n climb_score *= 3;\n }\n score += climb_score;\n // hatch\n let hatch_vals = [\"Hatch Ship\", \"Hatch Low\", \"Hatch Mid\", \"Hatch High\"];\n for (let i in hatch_vals) {\n score += (parseInt(match[\"Teleop\"][hatch_vals[i]]) * 2);\n\n }\n // cargo\n let cargo_vals = [\"Cargo Ship\", \"Cargo Low\", \"Cargo Mid\", \"Cargo High\"];\n for (let i in cargo_vals) {\n score += (parseInt(match[\"Teleop\"][cargo_vals[i]]) * 3);\n }\n return score;\n}", "function addScore(answer) {\n _scores[answer[0]] = answer[1];\n}", "function updateScore(time) {\n score = Math.floor((matches * matches / (time + 1) / (misses + 1)) * 10000);\n $('#score').text('Score: ' + score);\n return score;\n }", "function hit(){\n score += 10;\n updateScore();\n}", "function add_Total_Points(normalized_score, original_score)\n{\n\n if (normalized_score >= 90) {\n if (original_score > street_raw_keywords[0]) {\n street_raw_keywords[0] = original_score;\n }\n return;\n } else if (normalized_score >= 70) {\n if (original_score > street_raw_keywords[1]) {\n street_raw_keywords[1] = original_score;\n }\n return;\n } else if (normalized_score >= 50) {\n if (original_score > street_raw_keywords[2]) {\n street_raw_keywords[2] = original_score;\n }\n return;\n } else if (normalized_score >= 30) {\n if (original_score > street_raw_keywords[3]) {\n street_raw_keywords[3] = original_score;\n }\n return;\n } else {\n if (original_score > street_raw_keywords[4]) {\n street_raw_keywords[4] = original_score;\n }\n return;\n }\n}", "function scoreAnswers(){}", "function scoreSolution(solution) {\n\n}", "function scoreCheck() {\n\t$(\"#score\").text(score);\n\tif (score == goal) {\n\t\twins++;\n\t\t$(\"#wins\").text(wins);\n\n\t\treset();\n\t} else if (score > goal) {\n\t\tlosses++;\n\t\t$(\"#losses\").text(losses);\n\t\treset();\n\t} else {\n\n\t}\n}", "function checkForMatch(e){\n\n\n\t\tclickedImageId = $(this).find(\"img\").attr(\"id\");\n\t\t\t\t\t\t\n\t\tif(clickedImageId == pokemonToFindName){ \n\t\t\tconsole.log(\"they match\"); \n\t\t\tscore ++;\n\t\t\t$(this).removeClass(\"shadow\");\n\t\t\t$(this).addClass(\"active\");\n\t\t\tpokemonNamesArray.splice(pokemonToFindIndex,1);\n\t\t}\n\t\t\t\t\t\t\t\n\t\t$('.score').html(\"Score: \"+ score);\n\t\tselectRandomName();\n\t}", "function checkScore() {\n if (userTotal == numtoMatch) {\n alert(\"You've Won!\");\n wins++;\n start();\n } else if (userTotal > numtoMatch) {\n alert(\"You Lost!\");\n losses++;\n start();\n }\n}", "function matchOpinions(){\n //Er word door de subjects en de partijen geloopd\n subjects.forEach(subject => {\n parties.forEach(function(party, partyIndex){\n //Daarna word er gekeen of de mening van de partijen overeenkomt met jou mening\n if(subject.myOpinion == subject.parties[partyIndex].position){\n var scoreParty = parties.find(party => party.name == subject.parties[partyIndex].name);\n //Er word gekeken of de vraag belangrijk is en daarna worden de punten opgeteld \n if(subject.weight == false){\n scoreParty.points += 1;\n }else{\n scoreParty.points += 2;\n }\n }\n })\n })\n showSelectPartiePage();\n}", "function afterMatchFound(result, ctx) {\n\n if(ctx.friendlies.indexOf(result.user.toLowerCase()) > -1) {\n result.relevance += ((1.0 - result.relevance) * 0.5); // up the relevance because it comes from a friendly\n }\n\n if(result.tags.length > 0) { // result.relevance\n console.debug(\"Found relevant match\" + (result.volatile ? \" [VOLATILE]\" : \"\") + \".\");\n console.debug(result.tweetid + \" [\"+result.relevance+\"]: \" + JSON.stringify(result.tags));\n // send through to InfluxDB\n saveTweetToInflux(result)\n } else {\n console.debug(\"Event not found to be relevant.\");\n }\n}", "function addScore(value) {\n total += value;\n}", "function getScore(str1,str2,v1,v2,v3){\n\t\t\t\t\t\t\tvar r = 0;\n\t\t\t\t\t\t\tstr1 = str1.toUpperCase();\n\t\t\t\t\t\t\tstr2 = str2.toUpperCase();\n\t\t\t\t\t\t\tif(str1.indexOf(str2)==0) r += (v1||3);\n\t\t\t\t\t\t\tif(str1.indexOf(str2)>0) r += (v2||1);\n\t\t\t\t\t\t\tif(str1==str2) r += (v3||4);\n\t\t\t\t\t\t\treturn r;\n\t\t\t\t\t\t}", "function checkScore()\n{\n\tfor(var i = 0; i < boundaries.length; i ++)\n\t{\n\t\tif(boundaries.overlap(player, Scored)) \n\t\t{\n\t\t}\n\t\t\n\t}\n\n}", "function outputResults(score) {\n\n\n}", "function wordScore(word, scoreList){\n\tif (word[0] == undefined){\n\t\treturn 0;\n\t} else if (word[0] == scoreList[0][0]){\n\t\treturn (scoreList[0][1]) + wordScore(word.slice(1), scoreList);\n\t} else {\n\t\treturn wordScore(word, scoreList.slice(1).concat([scoreList[0]]));\n\t}\n}", "calculateScore(playerSelection, botSelection, player1, bot1){\n //console.log(\"\\n\");\n \n if(playerSelection == botSelection){\n console.log(\"Tie!, no points awarded to either player\"); \n }\n\n if(playerSelection == \"rock\"){\n if((botSelection == \"scissors\") || (botSelection == \"lizard\")){\n console.log(playerSelection + \" beats \" + botSelection + \" !\\n+1 for \"+ player1.getName());\n player1.setScore(1);\n }\n else if((botSelection == \"spock\") || (botSelection == \"paper\")){\n console.log(botSelection + \" beats \" + playerSelection + \" !\\n+1 for \"+ bot1.getName());\n bot1.setScore(1);\n }\n }\n\n if(playerSelection == \"scissors\"){\n if((botSelection == \"paper\") || (botSelection == \"lizard\")){\n console.log(playerSelection + \" beats \" + botSelection + \" !\\n+1 for \"+ player1.getName());\n player1.setScore(1);\n }\n \n else if((botSelection == \"spock\") || (botSelection == \"rock\" )){\n console.log(botSelection + \" beats \" + playerSelection + \" !\\n+1 for \"+ bot1.getName());\n bot1.setScore(1);\n }\n }\n\n if(playerSelection == \"lizard\"){\n if((botSelection == \"spock\") || (botSelection == \"paper\")){\n console.log(playerSelection + \" beats \" + botSelection + \" !\\n+1 for \"+ player1.getName());\n player1.setScore(1);\n }\n else if((botSelection == \"rock\") || (botSelection == \"scissors\" )){\n console.log(botSelection + \" beats \" + playerSelection + \" !\\n+1 for \"+ bot1.getName());\n bot1.setScore(1);\n }\n }\n if(playerSelection == \"spock\"){\n if((botSelection == \"scissors\") || (botSelection == \"rock\")){\n console.log(playerSelection + \" beats \" + botSelection + \" !\\n+1 for \"+ player1.getName());\n player1.setScore(1);\n }\n else if((botSelection == \"paper\") || (botSelection == \"lizard\" )){\n console.log(botSelection + \" beats \" + playerSelection + \" !\\n+1 for \"+ bot1.getName());\n bot1.setScore(1);\n }\n }\n\n if(playerSelection == \"paper\"){\n if((botSelection == \"rock\") || (botSelection == \"spock\")){\n console.log(playerSelection + \" beats \" + botSelection + \" !\\n+1 for \"+ player1.getName());\n player1.setScore(1);\n }\n else if((botSelection == \"scissors\") || (botSelection == \"lizard\" )){\n console.log(botSelection + \" beats \" + playerSelection + \" !\\n+1 for \"+ bot1.getName());\n bot1.setScore(1);\n }\n }\n //console.log(\"\\n\");\n}", "function simpleScore() {\n return simpleScrabbleScorer(userWord);\n}", "function calculateScore() {\n\tscore = winCount * 100 + loseCount * -50 + (coveredTileCount * 2) + (100 - time) + (50 - moves) * 2 + (bonus * 15);\n}", "AddScore(score) {\n this.m_score += score;\n }", "function updateResult(activePlayer, card) {\n if (card === 'AH') {\n if ((activePlayer['score'] + BlackJack['cardValue'][card][1]) <= 21) {\n activePlayer['score'] += BlackJack['cardValue'][card][1];\n\n } else {\n\n activePlayer['score'] += BlackJack['cardValue'][card][0];\n }\n } else {\n\n activePlayer['score'] += BlackJack['cardValue'][card];\n }\n\n\n}", "function isCorrect(){\n score++;\n setScore();\n}", "function updateScore(){\n score++\n if(score === 10){\n result.textContent = 'Wow! 10/10 You are the snake genius!'\n } else if(score === 9 ){\n result.textContent= '9/10 Amazing!'\n } else if( score === 8){\n result.textContent = '8/10 Great job!'\n } else if( score === 7){\n result.textContent= '7/10 Good job!'\n }else if(score === 6){\n result.textContent = '6/10 Good Job!'\n }else if(score === 5){\n result.textContent = '5/10 Looks like you need to learn!'\n }else if(score === 4){\n result.textContent = '4/10 Looks like you need to learn!'\n }else if(score === 3){\n result.textContent = '3/10 Looks like you need to learn!'\n }else if(score === 2){\n result.textContent= '2/10 Looks like you need to learn!'\n }else if(score === 1){\n result.textContent = '1/10 Looks like you need to learn!'\n }else if(score === 0){\n result.textContent = '0/10 FAIL!'\n }\n}", "function checkScore(){\r\n\t\r\n\tif(((checkScore1 + 2) == score1 || (checkScore2 + 2) == score2 || ((checkScore1 + 1) == score1 && (checkScore2 + 1) == score2)) && (score1 != 0 || score2 != 0)){\r\n\t\tcheckScore1 = score1;\r\n\t\tcheckScore2 = score2;\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "function calculateScoreTries(board) {\n\t\tif (board == \"boardEasy\" && openedPairs < 10) {\n\t\t\tscore += 20;\n\t\t} else if (board == \"boardEasy\" && openedPairs < 15) {\n\t\t\tscore += 10;\t\t\n\t\t} else if (board == \"boardNormal\" && openedPairs < 15) {\n\t\t\tscore += 40;\t\t\n\t\t} else if (board == \"boardNormal\" && openedPairs < 20) {\n\t\t\tscore += 20;\t\t\n\t\t} else if (board == \"boardAdvanced\" && openedPairs < 20) {\n\t\t\tscore += 50;\t\t\n\t\t} else if (board == \"boardAdvanced\" && openedPairs < 25) {\n\t\t\tscore += 30;\t\t\n\t\t} else if (board == \"boardDifficult\" && openedPairs < 30) {\n\t\t\tscore += 60;\t\t\n\t\t} else if (board == \"boardDifficult\" && openedPairs < 40) {\n\t\t\tscore += 40;\t\t\n\t\t}\n\t}", "function checkForCardMatch(){\r\n\r\n //CHECK TO SEE IF CARDS MATCH VIA MATCHING DATASETS\r\n let isCardMatch = firstCard.dataset.carmaker === secondCard.dataset.carmaker;\r\n\r\n //ADD SCORE TO PLAYERS\r\n if( isCardMatch === true ){\r\n matchedCards.push(firstCard,secondCard);\r\n checkTurn();\r\n disableCards();\r\n return updateScore();\r\n } else if ( isCardMatch !== true ){\r\n //IF CARDS DO NOT MATCH RUN UNCLIPCARD FUNCTION\r\n checkTurn();\r\n return unflipCards();\r\n } \r\n \r\n gameFinished();\r\n\r\n}", "function yourScore() {\n return fname + ' scored ' + (mid + final);\n }", "function getScore(str1,str2,v1,v2,v3){\n\t\tvar r = 0;\n\t\tstr1 = str1.toUpperCase();\n\t\tstr2 = str2.toUpperCase();\n\t\tif(str1.indexOf(str2)==0) r += (v1||3);\n\t\tif(str1.indexOf(str2)>0) r += (v2||1);\n\t\tif(str1==str2) r += (v3||4);\n\t\treturn r;\n\t}", "function plusEqualValue(){\n\t for(let i=0 ; i< 4 ; i++){\n\t \t for(let j=0; j<3; j++)\n\t \t if(resultTemp[i][j]==resultTemp[i][j+1]){\n\t \t \t// add to score\n\t \t \t scoreTemp += resultTemp[i][j];\n\n\t \t \t resultTemp[i][j]*=2;\n\t \t \t resultTemp[i][j+1]=0;\n\t \t }\n\t }\n}", "function updateScore() {\n score++;\n}", "function match(a, b) {\n score = 0;\n // console.log(a.length, b.length);\n for (i = 0; i < 32; i++) {\n for (j = 0; j < 30; j++) {\n if (a[i][j] === b[i][j]) {\n score = score + 1;\n }\n }\n }\n return score;\n}", "function trackScore() {\n if (totalScore === goalNum) {\n wins++;\n console.log(\"wins\");\n award();\n reset();\n\n\n }\n else if (totalScore > goalNum) {\n losses++;\n console.log(\"losses\");\n award();\n reset();\n \n }\n }", "function addToScore () {\n score += questionInfo[correspondingQuestion].points\n document.querySelector('#score').innerHTML = `Score: ${score}`\n numberOfCorrectAnswers++\n}", "cardMatch(card1, card2) {\n this.matchedCards.push(card1);\n this.matchedCards.push(card2);\n card1.classList.add('matched');\n card2.classList.add('matched');\n this.calculateScore();\n if (this.matchedCards.length === this.cardArray.length)\n this.victory();\n }", "function checkScore() {\n if (score === targetNumber) {\n wins += 1;\n score = 0;\n $(\"#score\").html(\"Your score is: \" + score);\n $(\"#wins\").html(\"Wins: \" + wins);\n reset();\n } else if (score > targetNumber) {\n losses += 1;\n score = 0;\n $(\"#score\").html(\"Your score is: \" + score);\n $(\"#losses\").html(\"Losses: \" + losses);\n reset();\n }\n }", "function updateScore (winner) {\n if (winner === 'human' ){\n humanScore++;\n } else if ( winner === 'computer' ){\n computerScore++;\n }\n}", "function calculateScore(hotelToScore) {\n\t//console.log(\"calculateScore has been called with \" + hotelToScore.name);\n\tvar score = 0;\n\tvar roomScore = hotelToScore.totalRooms / 100;\n\tvar hasGym = hotelToScore.hasGym;\n\tvar hasSwimmingPool = hotelToScore.hasSwimmingPool;\n\tvar arrayHotelsWithPoolsAndGyms = [];\n\t//console.log(\"Hotel has a swimming pool \" + hotelToScore.hasSwimmingPool);\n\t//console.log(\"Hotel has a swimming pool \" + hasSwimmingPool);\n\t//console.log(\"Hotel has a gym \" + hotelToScore.hasGym);\n\t//console.log(\"Hotel has a gym \" + hasGym);\n\t//console.log(\"The hotels room score \" + roomScore);\n\tif (hasSwimmingPool == true && hasGym == true) {\n\t\t//console.log(\"first if has been reached\");\n\t\tscore = score + roomScore + 5;\n\t\t//console.log(score);\n\t\tarrayHotelsWithPoolsAndGyms.push(hotelToScore);\n\t\t//console.table(arrayHotelsWithPoolsAndGyms);\n\t} else if (hasGym == true) {\n\t\t//console.log(\"first else if has been reached\");\n\t\tscore = score + roomScore + 2;\n\t\t//console.log(score);\n\t} else if (hasSwimmingPool == true) {\n\t\t//console.log(\"second else if has been reached\");\n\t\tscore = score + roomScore + 3;\n\t\t//console.log(score);\n\t} else {\n\t\t//console.log(\"first else has been reached\");\n\t\tscore = score + roomScore;\n\t\t//console.log(score);\n\t}\n\t//return array\n\treturn score;\n}", "function uefaEuro2016(teams, score){\r\n if (score[0]>score[1]) {\r\n console.log( \"At match \" + teams[0] + \"-\" + teams[1] + \",\" + teams[0] + \" won!\")\r\n } else if (score[1]> score[0]){\r\n console.log( \"At match \" + teams[0] + \"-\" + teams[1] +\",\" + teams[1] + \" won!\")\r\n } else {\r\n console.log(\"At match \" + teams[0] + \"-\" + teams[1] + \",\" + \"teams played draw\")\r\n }\r\n}", "function addToScore () {\n userScore++;\n}", "function change_score(round_score) {\n num_correct += round_score;\n num_total += 1;\n }", "function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length,\n proximity = Math.abs(loc - x);\n\n if (!Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy;\n }\n return accuracy + (proximity / Match_Distance);\n }", "function updateScore(winner) {\n if (winner === 'human') {\n humanScore += 1;\n } else if (winner === 'computer'){\n computerScore += 1;\n }\n}", "function checkForMatch(){\n\n\tif (cardsInPlay.length === 2) {\n\t\tif (cardsInPlay[0] === cardsInPlay[1]) {\n\t\t\tconsole.log(\"You found a match!\"); // display match found message\n\t\t\tmessageBoard.innerText = \"You found a match!\\n\" + \"Current Score: \" + counter + \" points\";\n\t\t}\n\t\telse {\n\t\t\tconsole.log(\"Sorry, try again.\");\t// display match not found\n\t\t\tcountAttempts(); // updating score\n\t\t\tresetBoard(); // deselect cards and flip cards back down\n\t\t\tmessageBoard.innerText = \"Wrong card, try again.\\n\" + \"Current Score: \" + counter + \" points\";\n\t\t\t// move cards back to cards[] array\n\t\t}\n\t\tconsole.log(cardsInPlay);\n\t}\n\n\t// Once all cards have been flipped, trigger Game Over\n\t// NEED UPDATE SCORE FUNCTION\n\telse if (cardsInPlay.length === 4) {\n\t// test alert\n\t// alert(\"game over!\");\n\t\tgameOverStatus = true;\n\t\tcountAttempts();\n\t\tgameOver();\n\n\t}\n}", "function correct() {\n score += 20;\n next();\n \n}", "function correct() {\nscore = score + 10;\nnext();\n}", "function updateScoreboard(p) {\n totalPoints(p);\n exactMatchs(p);\n within5(p);\n within10(p);\n attempts();\n}", "function addScroe() {\n var totalScore = 0;\n var temp = 0;\n var bonusWord = 0;\n var bonusLetter = false;\n var bonusStop = false;\n for (i = 0; i < 15; i++) {\n var current = $.grep(boardObj, function(e) {return e.boardPos === i}); // gets the current element position\n if (current.length == 1) { // for the current element\n if (bonusStop == false) { // checks if letters are chained together\n bonusStop == true;\n }\n if (i == 0 || i == 7 || i == 14) { // Bonus words are taken care of\n bonusWord++;\n } else if (i == 3 || i == 11) { // Bonus letters are taken care of\n bonusLetter = true;\n }\n temp += letterValueGetter(current[0].charVal); // store the each letter score into the temp\n if (bonusLetter) { // so if there is a bonus letter score, increase the score for that letter\n temp += letterValueGetter(current[0].charVal);\n bonusLetter = false;\n }\n } else if (bonusStop) { // if there is a gap between words\n if (bonusWord > 0) { // bonus word are considered\n temp = temp * bonusWord * 3;\n bonusWord = 0;\n }\n bonusStop = false; // set bonusStop\n totalScore += temp; // adds up the score\n temp = 0; // and reset the temp score since there is a stop\n } else {\n if (bonusWord > 0) { // reset the bonus scoring\n temp = temp * bonusWord * 3;\n bonusWord = 0;\n }\n totalScore += temp; // calculate the total score when the bonus stops\n temp = 0;\n }\n }\n if (bonusWord > 0) { // final check for any bonus\n temp = temp * bonusWord * 3;\n totalScore += temp;\n }\n return totalScore;\n}", "scoreCalculation(cardsonHands) {\n let totalScore = 0;\n let totalScoreAce = 0;\n let trueScore = 0;\n if (cardsonHands.includes(\"A\")) {\n for (let i = 0; i < cardsonHands.length; i++) {\n totalScoreAce += this.engtoNum(cardsonHands[i])\n }\n totalScoreAce += 10\n }\n for (let i = 0; i < cardsonHands.length; i++) {\n totalScore += this.engtoNum(cardsonHands[i])\n }\n if (totalScoreAce < 22 && totalScoreAce > totalScore) {\n trueScore = totalScoreAce\n } else {\n trueScore = totalScore\n }\n return trueScore;\n }", "function updateScore() {\n if (board_static[pacman.i][pacman.j] === 5 ){\n score+=5;\n board_static[pacman.i][pacman.j] =0;\n playSound(eat_points_sound);\n ball_count--;\n }\n if (board_static[pacman.i][pacman.j] === 15 ){\n score+=15;\n board_static[pacman.i][pacman.j] =0;\n playSound(eat_points_sound);\n ball_count--;\n }\n if (board_static[pacman.i][pacman.j] === 25 ){\n score+=25;\n board_static[pacman.i][pacman.j] =0;\n playSound(eat_points_sound);\n ball_count--;\n }\n\n if (ball_count === 0){\n endGame(timesUp);\n }\n}", "function addOneToScore () {\n STORE.score++;\n}", "function correct() {\n score += 20;\n next();\n}", "function correct() {\n score += 20;\n next();\n}", "function correct() {\n score += 20;\n next();\n}", "function updateScore(result) {\n // result one of \"won\" or \"tied\" or \"lost\"\n if (result === \"won\") {\n wins = wins + 1;\n document.getElementById(\"wins\").innerHTML = wins;\n }\n if (result === \"tied\") {\n ties = ties + 1;\n document.getElementById(\"ties\").innerHTML = ties;\n }\n if (result === \"lost\") {\n losses = losses + 1;\n document.getElementById(\"losses\").innerHTML = losses;\n }\n}", "function calcscore() {\n var id;\n var scoreofWord = 0;\n var isDoublescoreofWord = false;\n\n $(\"#board div img\").each(function (index) {\n //loops through each tile on board\n id = this.id;\n\n if ($(this).parent().attr(\"id\") == \"spot2\") {\n //spot2 is a double word score\n scoreofWord += ScrabbleTiles[id].value;\n isDoublescoreofWord = true;\n } else if ($(this).parent().attr(\"id\") == \"spot6\") {\n //spot6 is a triple letter score\n scoreofWord += ScrabbleTiles[id].value * 3;\n } else {\n scoreofWord += ScrabbleTiles[id].value;\n }\n });\n //double word tile\n if (isDoublescoreofWord) {\n scoreofWord = scoreofWord * 2;\n }\n\n return scoreofWord;\n}", "function getScore(p1, p2) {\r\n if (p1 === p2) {\r\n return 0;\r\n } else if (p1 === 0) {\r\n if (p2 === 1) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else if (p1 === 1) {\r\n if (p2 === 2) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else if (p1 === 2) {\r\n if (p2 === 0) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }\r\n}", "function calculateScore() { // Compare card values of pack1 to pack2 and add one to score if higher than pack2\n for (i = 0; i < pack1.length; ++i) {\n if (cardRank.indexOf(pack1[i]) < cardRank.indexOf(pack2[i])) {\n ++scorePlayer2;\n } else if (cardRank.indexOf(pack1[i]) > cardRank.indexOf(pack2[i])) {\n ++scorePlayer1;\n }\n }\n\n if (pack1.length > 1) { // If the pack1 has more than one card, continue to compare\n if (cardRank.indexOf(pack1[1]) < cardRank.indexOf(pack2[1])) {\n ++scorePlayer2;\n } else if (cardRank.indexOf(pack1[1]) > cardRank.indexOf(pack2[1])) {\n ++scorePlayer1;\n }\n };\n }", "increaseScore() {\n if (this.startCombo < 2) {\n this.startScore = this.startScore + this.addScore;\n } else if (this.startCombo === 2) {\n this.startScore += this.addScore * 2;\n this.startHP += 10;\n } else if (this.startCombo > 2) {\n this.startScore += this.addScore * 3;\n this.startHP += 10;\n }\n }", "function Score() { }", "function correct() {\n score += 20;\n next();\n }", "function check() {\n if ($(\"this\").val() == questions[i].answer) {\n score++; \n } else {\n score--;\n } \n }", "function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length,\n proximity = Math.abs(loc - x)\n\n if (!Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy\n }\n return accuracy + proximity / Match_Distance\n }", "function findMatch() {\n\n var sums = [];\n var values = 0;\n var calcResult = calc(scores);\n\n function getSum(total, num) {\n return total + num;\n }\n\n for (var i = 0; i < calc(scores).length; i++) {\n\n values = (calcResult[i].reduce(getSum));\n sums.push(values);\n }\n\n return sums;\n }", "function isAGoodScore(score) {\n if (score >= 50) {\n return \"That is a good score!\";\n } else {\n return \"Keet training..\";\n }\n}", "function goalScored() {\n if (puckPosX + radius < 0) {\n awayScore += 1;\n document.getElementById(\"away\").innerHTML = \"AWAY \" + awayScore;\n return true;\n } else if (puckPosX - radius > c.width) {\n homeScore += 1;\n document.getElementById(\"home\").innerHTML = \"HOME \" + homeScore; \n document.getElementById(\"away\").innerHTML = \"AWAY \" + awayScore;\n return true;\n }\n }", "function scrabbleScore(word) {\n word = word.toUpperCase();\n let letterScore = 0;\n\n for (let i = 0; i < word.length; i++) {\n\t for (const pointValue in newPointStructure) {\n \n if (pointValue.includes(word[i])) {\n letterScore += Number(newPointStructure[pointValue]) \n }\n \n\t }\n\t}\n // console.log({letterPoints}); //for testing\n\treturn letterScore;\n\n}", "function updateScore (winner) {\n if (winner === 'human') {\n humanScore += 1;\n }\n else {\n computerScore += 1;\n }\n}", "function checkScore() {\n if (score === targetScore) {\n alert(\"You Win!\")\n wins++\n reset()\n }\n if (score > targetScore) {\n alert(\"You lose!\")\n losses++\n reset()\n }\n\n \n}", "score(args) {\n\n }", "function checkWin() {\n if (userScore === numToMatch) {\n wins++;\n $(\"#wins\").text(\"Success: \" + wins);\n reset();\n } else if (userScore > numToMatch) {\n losses++\n $(\"#losses\").text(\"Fails: \" + losses);\n reset();\n }\n }", "function determineWinner(matches) {\n // loop through each map\n for (let i=0; i<matches.length; i++) {\n // find each player and return points\n let playerOneStrength= locateStrength(matches[i].playerOne)/totalGames;\n let playerTwoStrength= locateStrength(matches[i].playerTwo)/totalGames;\n let relativeStrengthDifferential = (playerOneStrength - playerTwoStrength)/2;\n let playerOneResult = (Math.random()*100);\n // give win to winner of game\n if (playerOneResult + relativeStrengthDifferential >= 50) {\n locateAndAdd(matches[i].playerOne) //\n } else \n locateAndAdd(matches[i].playerTwo)\n }\n}", "function compare(userChoice){\r\n let robotChoice = roboChoice();\r\n let score;\r\n\r\n if(userChoice == robotChoice){\r\n score = 2;\r\n }\r\n else if(userChoice == \"rock\" && robotChoice == \"scissors\"){\r\n score = 1;\r\n }\r\n else if(userChoice == \"scissors\" && robotChoice == \"rock\"){\r\n score = 0;\r\n }\r\n else if(userChoice == \"paper\" && robotChoice == \"rock\"){\r\n score = 1;\r\n }\r\n else if(userChoice == \"rock\" && robotChoice == \"paper\"){\r\n score = 0;\r\n }\r\n else if(userChoice == \"paper\" && robotChoice == \"scissors\"){\r\n score = 0;\r\n }\r\n else if(userChoice == \"scissors\" && robotChoice == \"paper\"){\r\n score = 1;\r\n }\r\n else{\r\n score = 2;\r\n } \r\n\r\n return score;\r\n\r\n}", "function simpleScore(word) {\n\tword = word.toUpperCase();\n word = word.trim();\n\tlet simplePoints = 0;\n simplePoints = Number(simplePoints);\n \n\tfor (let i = 0; i < word.length; i++) {\n \n\t for (const pointValue in oldPointStructure) {\n \n\t\t if (oldPointStructure[pointValue].includes(word[i])) {\n\t\t\tsimplePoints += 1\n\t\t }\n \n\t }\n\t}\n\treturn simplePoints;\n }", "function calculateScore(qAnswers, uAnswers) {\n var score = 0;\n for (i = 0; i <= numberOfQuestions - 1; i++) {\n \n if(qAnswers[i][4] === uAnswers[i]){\n score = score + 1; \n } else {\n continue;\n }\n }\n return score; \n}", "function createScore (score, playerId){\n pos.board.map(function(boar){\n if ( playerId == boar.id ){\n boar.points += score;\n if (score === 1.0){\n boar.won += 1;\n } else if (score === 0.0){\n boar.lost += 1;\n } else if (score === 0.5){\n boar.tied += 1;\n }\n \n }\n })\n}", "function raiseScore() {\r\n\tscore += 1;\r\n}", "function scoreChecker(usersScore, targetNumber){\n if (userScore > targetNumber){\n losses++\n renderGame();\n } else if (userScore === targetNumber){\n wins++;\n renderGame();\n }\n}", "function compareNums(results, guesses){\n var numMatches = 0;\n for (i=0; i < 4; i++){\n var guess = guesses[i];\n\t\tif (results.indexOf(guess) != -1) {\n\t\t\tnumMatches += 1;\n\t\t}\n }\n console.log(\"Your matches: \" + numMatches);\n console.log(x);\n calcMoney(numMatches); \n}", "function checkMatchedNums(){\n parseValues();\n\n Array.prototype.diff = function(arr2) {\n var ret = [];\n arr2.sort();\n for(var i = 0; i < this.length; i += 1) {\n if(arr2.indexOf(this[i]) > -1){\n ret.push(this[i]);\n }\n }\n return ret;\n };\n\n countMatches = randNumArr.diff(usersGuessesParsed);\n countTotalMatches = randNumArr.diff(usersGuessesParsed).length;\n\n displayResults(countMatches, countTotalMatches);\n\n\tif(countTotalMatches == gameLevel){\n\t\treset();\n\t\tremoveFields();\n\t\tgameLevel++;\n\t\tconsole.log(\"Game Level: \" + gameLevel);\n\t\tguessIds = repopulateGuessIds();\n\t\tidArr = repolulateOtherIds();\n\n\t\tif(gameLevel > maxSize && gameLevel == countTotalMatches){\n\t\t\tdocument.getElementById(\"totalCount\").innerHTML = \"You Completed All \" + maxSize + \" Levels!, Well Done!\";\n\t\t\tgameLevel = 1;\n\t\t}\n\t\telse{\n\t\t\tstartGame();\n\t\t}\n\t}\n\telse {\n\t\tdocument.getElementById(\"totalCount\").innerText = \"GAME OVER!\\nYou Reached level :\" + gameLevel;\n\t\tremoveFields();\n\t\tgameLevel = 1;\n\t}\n}", "function updateScore(card, activePlayer) {\r\n if (card === 'A') {\r\n if ((activePlayer['score'] + BJGame['cardsMap'][card][1]) <= 21) {\r\n activePlayer['score'] += BJGame['cardsMap'][card][1];\r\n } else {\r\n activePlayer['score'] += BJGame['cardsMap'][card][0];\r\n }\r\n } else {\r\n activePlayer['score'] += BJGame['cardsMap'][card];\r\n }\r\n}", "scoreToDisplay() {\n let score = '';\n\n if (this.P1point === this.P2point && this.P1point < 3) {\n if (this.P1point === 0)\n score = 'Love';\n if (this.P1point === 1)\n score = 'Fifteen';\n if (this.P1point === 2)\n score = 'Thirty';\n score += '-All';\n }\n if (this.P1point === this.P2point && this.P1point > 2)\n score = 'Deuce';\n\n if (this.P1point > 0 && this.P2point === 0) {\n if (this.P1point === 1)\n this.P1res = 'Fifteen';\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n if (this.P1point === 3)\n this.P1res = 'Forty';\n\n this.P2res = 'Love';\n score = this.P1res + '-' + this.P2res;\n }\n if (this.P2point > 0 && this.P1point === 0) {\n if (this.P2point === 1)\n this.P2res = 'Fifteen';\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n if (this.P2point === 3)\n this.P2res = 'Forty';\n\n this.P1res = 'Love';\n score = this.P1res + '-' + this.P2res;\n }\n\n if (this.P1point > this.P2point && this.P1point < 4) {\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n if (this.P1point === 3)\n this.P1res = 'Forty';\n if (this.P2point === 1)\n this.P2res = 'Fifteen';\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n score = this.P1res + '-' + this.P2res;\n }\n if (this.P2point > this.P1point && this.P2point < 4) {\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n if (this.P2point === 3)\n this.P2res = 'Forty';\n if (this.P1point === 1)\n this.P1res = 'Fifteen';\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n score = this.P1res + '-' + this.P2res;\n }\n\n if (this.P1point > this.P2point && this.P2point >= 3) {\n score = 'Advantage ' + this.player1Name;\n }\n\n if (this.P2point > this.P1point && this.P1point >= 3) {\n score = 'Advantage ' + this.player2Name;\n }\n\n if (this.P1point >= 4 && this.P2point >= 0 && (this.P1point - this.P2point) >= 2) {\n score = 'Win for ' + this.player1Name;\n }\n if (this.P2point >= 4 && this.P1point >= 0 && (this.P2point - this.P1point) >= 2) {\n score = 'Win for ' + this.player2Name;\n }\n return score;\n }", "function matchSuccess() {\n matchCard1.addClass(\"animated pulse matched\");\n matchCard2.addClass(\"animated pulse matched\");\n matches++;\n if (matches === pairs) {\n setTimeout(gameOver, 500);\n }\n }", "function playerScore () {\n\n if (playerCardValue < 21) {\n playerScoreSpan.textContent = playerCardValue;\n playerOption.classList.add('show');\n playerOption.textContent = 'Hit?';\n \n }else if (playerCardValue >= 22) {\n playerScoreSpan.textContent = playerCardValue;\n playerOption.classList.add('show');\n playerOption.classList.add('bust');\n playerOption.textContent = 'Bust!';\n dealerWins.textContent = `Wins: ${dealerWinScore++}`;\n\n playerMove = 2;\n\n }else if (playerCardValue === 21) {\n playerScoreSpan.textContent = playerCardValue;\n playerOption.classList.add('show');\n playerOption.classList.add('blackjack');\n playerOption.textContent = 'BLACK JACK';\n playerWins.textContent = `Wins: ${playerWinScore++}`;\n\n playerMove = 2;\n };\n\n compareScore();\n return playerCardValue;\n}", "function addPoints() {\n score += 10;\n}", "function score(sequence1, sequence2, scoringMatrix)\r\n{\r\n\tvar score = 0;\r\n\tvar nucleotideIndex1; //indeks w macierzy podobienstwa nukleotydu z pierwszej sekwencji\r\n\tvar nucleotideIndex2; //indeks w macierzy podobienstwa nukleotydu z drugiej sekwencji\r\n\tfor(i = 0; i < sequence1.length; i++)\r\n\t{\r\n\t\tnucleotideIndex1 = getNucletideIndex(sequence1[i]);\r\n\t\tnucleotideIndex2 = getNucletideIndex(sequence2[i]);\r\n\t\tscore = score + parseInt(scoringMatrix[nucleotideIndex1][nucleotideIndex2]);\r\n\t}\r\n\treturn score;\r\n}" ]
[ "0.72660726", "0.687104", "0.6863067", "0.6853576", "0.676838", "0.6693016", "0.6663896", "0.661513", "0.65731484", "0.6540277", "0.6520258", "0.6513545", "0.6493525", "0.649186", "0.64914566", "0.64897853", "0.6485571", "0.6471018", "0.6463342", "0.64352846", "0.64035124", "0.6388364", "0.6387338", "0.6382207", "0.6380952", "0.6380316", "0.6344773", "0.6343894", "0.6334951", "0.63082707", "0.6307168", "0.6305983", "0.63042367", "0.6293899", "0.6278799", "0.62701875", "0.6268089", "0.62619066", "0.6256645", "0.62535405", "0.62505805", "0.624892", "0.62395066", "0.6237009", "0.6231639", "0.6208877", "0.62087375", "0.6208382", "0.6205315", "0.61991763", "0.61978894", "0.6183606", "0.6181421", "0.6177046", "0.61702406", "0.6167092", "0.6166344", "0.6158615", "0.6146951", "0.61429226", "0.61369365", "0.61301374", "0.6129649", "0.61274636", "0.61252797", "0.6121378", "0.6121378", "0.6121378", "0.61132103", "0.61127603", "0.61105144", "0.6108647", "0.6104245", "0.610262", "0.6099138", "0.6096345", "0.60955423", "0.60898453", "0.6089027", "0.60845745", "0.60796374", "0.6073098", "0.6071509", "0.6070216", "0.6069973", "0.6068874", "0.60642445", "0.6062963", "0.6062905", "0.6060382", "0.6058293", "0.6055834", "0.6047802", "0.6047175", "0.6044758", "0.6040531", "0.60386115", "0.6032792", "0.60291", "0.60284394" ]
0.6810238
4
function that relates the cardId to an index in the shuffled array, sets the image and funs the match check
function flipCard() { var cardId = this.getAttribute('data-id'); /* Debug -------- console.log("You flipped " + shuffleCards[cardId].rank + "."); console.log(shuffleCards[cardId].suit); console.log(shuffleCards[cardId].cardImage); */ cardsInPlay.push(shuffleCards[cardId].rank); this.setAttribute('src', shuffleCards[cardId].cardImage); checkForMatch(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cardFlip () {\n //this.classList.add('flipped') //give class to keep CSS\n const cardId = this.getAttribute('Id') //get id # to set bottom card/match\n console.log(cardId)\n //need id of getId to find matching id from array (element position)\n this.setAttribute('src', `./images/card${cardId}.png`)\n selectedCards.push(this)\n if (selectedCards.length == 2) {\n setTimeout(checkMatch, 500) //fire checkMatch with short delay \n }\n if (paired.length === 12) {\n alert('You won the game!')\n }\n}", "function cardImg(index) {\n\tvar cardNewImg = randomIntFromInterval(2,10);\n if (images[index] !== undefined) \n {\n images[index] = -1;\n }\n\t/*if (images.filter(function(element){\n\t\treturn element == cardNewImg\n\t})) {\n\t\tif (cardNewImg==3) {\n\t\t\tcardNewImg\n\t\t} cardNewImg++\n\t}*/ \t\n\twhile (images.indexOf(cardNewImg)!= -1){\n\t\tcardNewImg = randomIntFromInterval(2,11); \n\t} \n\timages[index] = cardNewImg;\n}", "function checkCard()\n{\n startTimer();\n let allCard = document.querySelectorAll(\"img\");\n let card1 = cardPickId[0];\n \n let card2 = cardPickId[1];\n \n\n if(pickedCard[0]===pickedCard[1] && card1 != card2)\n {\n \n allCard[card1].setAttribute(\"src\",\"/images/check.png\");\n allCard[card2].setAttribute(\"src\",\"/images/check.png\");\n allCard[card1].removeEventListener(\"click\", flipped);\n allCard[card2].removeEventListener(\"click\", flipped);\n cardMatch.push(pickedCard);\n cardMove.push(pickedCard);\n }\n else if(card1 == card2)\n {\n allCard[card1].setAttribute(\"src\",\"/images/default.png\");\n allCard[card2].setAttribute(\"src\",\"/images/default.png\");\n \n }\n else\n {\n allCard[card1].setAttribute(\"src\",\"/images/default.png\");\n allCard[card1].classList.replace(\"front\",\"back\");\n allCard[card2].setAttribute(\"src\",\"/images/default.png\");\n allCard[card2].classList.replace(\"front\",\"back\");\n cardMove.push(pickedCard);\n \n \n }\n pickedCard = [];\n cardPickId = [];\n \n \n //update the move and match on html\n score.textContent = cardMatch.length;\n move.textContent = cardMove.length\n\n //if all pair is found, call other function,stop timer, reset div,\n //replace the current div with new game div\n //save rank and update scorboard\n if(cardMatch.length === cardsArr.length/2)\n {\n stopTimer();\n reset();\n let getTime = timer.innerText;\n newGame();\n saveRank();\n updateTable();\n \n \n \n }\n}", "function checkMatch () {\n if (selectedCards[0].getAttribute('id') == selectedCards[1].getAttribute('id')) {\n console.log('found a pair')\n paired.push(selectedCards[0]) //push into new array to use in win argument\n paired.push(selectedCards[1])\n selectedCards.shift(); //reset array\n selectedCards.shift();\n } else {\n console.log('this is not a match')\n selectedCards[0].setAttribute('src', './images/cardBack.png'); //set cards back down\n selectedCards[1].setAttribute('src', './images/cardBack.png');\n selectedCards.shift(); //remove from 'selectedCards' array\n selectedCards.shift();\n }\n}", "function is_matched(k, v) {\n $('.restart').attr(\"disabled\", false);\n counter += 1;\n if (counter == 1) {\n timer();\n }\n $('.moves').html(counter);\n if (matched_cards.length < 2) {\n // change front img with img to compare\n $('#' + k.id).children().attr('src', 'img/' + v + '.png');\n if (matched_cards.length == 0) {\n matched_cards.push(v);\n memory.push(k.id);\n }\n else if (matched_cards.length == 1) {\n matched_cards.push(v);\n memory.push(k.id);\n if (matched_cards[0] == matched_cards[1]) {\n no_of_matches += 2;\n matched_cards = [];\n memory = [];\n // if all cards are flipped\n if (no_of_matches == cards.length) {\n rating();\n $('.modal').fadeIn().show();\n $('.overlay').show();\n clearInterval(interval);\n }\n }\n //if 2 cards unmatched\n else {\n $('#' + k.id).children().attr('src', 'img/' + matched_cards[1] + '.png');\n setTimeout(rest_unmatched, 1000);\n }\n }\n \n }\n console.log(no_of_matches);\n console.log(counter);\n}", "function checkForMatch() {\n const cards = document.querySelectorAll('img')\n\n const optionOneId = cardsChosenId[0]\n const optionTwoId = cardsChosenId[1]\n\n if(optionOneId === optionTwoId) {\n cards[optionOneId].setAttribute('src', 'images/pokeball.png')\n cards[optionTwoId].setAttribute('src', 'images/pokeball.png')\n alert('You have clicked the same image!')\n }else if (cardsChosen[0] === cardsChosen[1]) {\n alert('You caught ' + cardArray[optionOneId].name + ' ! ')\n cards[optionOneId].setAttribute('src', 'images/white.png') //changing the image to white - so we cannot see the card\n cards[optionTwoId].setAttribute('src', 'images/white.png')\n\n cards[optionOneId].removeEventListener('click', flipCard) // so we cannot flip them again to get more points and cheat\n cards[optionTwoId].removeEventListener('click', flipCard)\n\n cardsWon.push(cardsChosen)\n } else {\n cards[optionOneId].setAttribute('src', 'images/pokeball.png') //flipping back the cards\n cards[optionTwoId].setAttribute('src', 'images/pokeball.png')\n alert('Sorry, try again')\n }\n\n cardsChosen = [] //important to empty these two arrays\n cardsChosenId = []\n\n resultDisplay.textContent = cardsWon.length\n if(cardsWon.length === cardArray.length / 2) {\n resultDisplay.textContent = 'Congratulations! You caught them all'\n }\n\n }", "function checkMatch(clickedCard) {\n if (openedCards[0].firstElementChild.HTMLImageElement.src === openedCards[1].firstElementChild.HTMLImageElement.src) {\n makeMatch(openedCards);\n } else {\n clearOpened(openedCards);\n };\n}", "function doCardsMatch(){\n if (firstCard === secondCard) {\n console.log(\"they match\");\n //create function\n firstCard = \"\";\n secondCard = \"\";\n firstCardIndex = 0;\n secondCardIndex = 0;\n } else {\n //create function\n $($(\"img\")[firstCardIndex]).css({\"height\": \"100%\", \"width\": \"100%\"});\n $($(\"p\")[firstCardIndex]).css(\"visibility\", \"hidden\");\n $($(\"img\")[secondCardIndex]).css({\"height\": \"100%\", \"width\": \"100%\"});\n $($(\"p\")[secondCardIndex]).css(\"visibility\", \"hidden\");\n firstCard = \"\";\n secondCard = \"\";\n firstCardIndex = 0;\n secondCardIndex = 0;\n }\n }", "function checkMatch(){\n let cards=document.querySelectorAll('img')\n const optionOne = cardsChosenId[0];\n const optionTwo = cardsChosenId[1];\n if(cardIDs[0]===cardIDs[1]){\n alert('You must pick a different card');\n cardsPicked.pop();\n cardsChosenId.pop();\n cardIDs.pop();\n //\"Gotcha 1\"this piece of code prevents picking the same card as counting as a match, leaves the card face up, and allows user to pick another card\n } else if(optionOne ===optionTwo){\n cardsWon.push(cardsPicked);\n // alert('You got a match!');\n matches++\n guesses++\n scoreDisplay.innerText=`${matches} of ${(CARDS.length/2)}`;\n guessesNum.innerText=guesses;\n if(matches===CARDS.length/2){\n //this happens when you win the game;\n let finalTime=document.querySelector('#thisTime').innerText\n alert(`You Found All the Matches in ${finalTime} seconds`);\n confetti.start(3000); \n let restartDiv=document.createElement('div');\n restartDiv.setAttribute('id', 'restart')\n scores.append(restartDiv)\n restartDiv.append(restartButton);\n matches=0;\n guesses=0;\n cardsPicked=[];\n cardsChosenId=[];\n cardIDs=[];\n cardsWon=[];\n \n }\n cardsPicked=[];\n cardsChosenId=[];\n cardIDs=[];\n \n } else{\n cardsPicked[0].setAttribute('src', '100px/question-mark.jpg');\n cardsPicked[1].setAttribute('src', '100px/question-mark.jpg');\n guesses++\n guessesNum.innerText=guesses;\n\n cardsPicked=[];\n cardsChosenId=[];\n cardIDs=[];\n \n }\n \n}", "function shuffleCards(){\n\tmemoryCards = shuffle(memoryCards);\n\tfor (var i=0; i < 12; i++){\n\t\tvar item = document.getElementById(i);\n\t\titem.src = card;\n\t}\n}", "function matched(){\r\n\r\n /* Get Cards from numId Array */\r\n let i = document.getElementById(numId[0]);\r\n let x = document.getElementById(numId[1]);\r\n\r\n /* If Flipped Cards Match */\r\n if(cardIDs[0] === cardIDs[1]){\r\n /* Change First Card to Matched */\r\n i.parentElement.classList.add('matched');\r\n i.parentElement.children[1].style.backgroundColor = `#46B1C9`;\r\n i.parentElement.children[1].style.boxShadow = `inset 3px 3px 6px black`;\r\n /* Change Second Card to Matched */\r\n x.parentElement.classList.add('matched');\r\n x.parentElement.children[1].style.backgroundColor = `#46B1C9`;\r\n x.parentElement.children[1].style.boxShadow = `inset 3px 3px 6px black`;\r\n /* Add to Paired Count */\r\n paired++;\r\n /* Check if Won */\r\n setTimeout(won, 500);\r\n }\r\n\r\n /* If Not */\r\n else {\r\n i.parentElement.classList.toggle('is-flipped');\r\n x.parentElement.classList.toggle('is-flipped');\r\n starRating();\r\n }\r\n\r\n /* Reset Variables to Check */\r\n cardFlip = 0;\r\n cardIDs = [];\r\n numId = [];\r\n}", "function check(){\n if(cardOpen[0].id == cardOpen[1].id){\n cardMatch.push(cardOpen[0])\n cardMatch.push(cardOpen[1])\n setTimeout(function(){\n cardOpen = []\n enable()\n },1000);\n }\n else{\n setTimeout(function(){\n cardOpen[0].src = \"cards/card.png\"\n cardOpen[1].src = \"cards/card.png\"\n cardOpen = []\n enable()\n },1000);\n }\n}", "function shuffleCards() {\n for (var i = 0; i < 52; i++) {\n var randIndex = getRand();\n if (i == 0) {\n deckCards.arrayOfCards[i] = randIndex;\n } else {\n while (deckCards.arrayOfCards.indexOf(randIndex) != -1) {\n randIndex = getRand();\n }\n deckCards.arrayOfCards[i] = randIndex;\n }\n }\n}", "function showCard(character,number)\r\n{\r\n let cards = document.getElementById(\"cartes\");\r\n let backCard = document.getElementById(\"carta01\");\r\n let valueImage = backCard.getAttribute(\"src\");\r\n let resultCard = character+number;\r\n if(valueImage === \"imatges/back.png\")\r\n {\r\n backCard.src =\"imatges/\"+resultCard+\".png\";\r\n arrayCardsOnTable.push(resultCard); \r\n }\r\n else\r\n {\r\n if(arrayCardsOnTable.indexOf(resultCard) == -1)\r\n {\r\n let image = document.createElement(\"img\");\r\n image.src = \"imatges/\"+resultCard+\".png\";\r\n cards.appendChild(image);\r\n arrayCardsOnTable.push(resultCard);\r\n }\r\n else\r\n {\r\n while(arrayCardsOnTable.indexOf(resultCard) != -1)\r\n {\r\n character = randomLetter();\r\n number = randomNumber();\r\n resultCard = characterCard[character]+numberCard[number];\r\n }\r\n let image = document.createElement(\"img\");\r\n image.src = \"imatges/\"+resultCard+\".png\";\r\n cards.appendChild(image);\r\n arrayCardsOnTable.push(resultCard);\r\n }\r\n }\r\n sumCards(number);\r\n}", "function shuffle(cardImage) {\n let currentIndex = cardImage.length,\n temporaryValue,\n randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = cardImage[currentIndex];\n cardImage[currentIndex] = cardImage[randomIndex];\n cardImage[randomIndex] = temporaryValue;\n }\n\n return cardImage;\n}", "function checkEasyMatch() {\n var easyCards = document.querySelectorAll('img');\n const easyCardOneId = easyCardsSelectedId[0];\n const easyCardTwoId = easyCardsSelectedId[1];\n if (easyCardsSelected[0] === easyCardsSelected[1] && easyCardOneId !== easyCardTwoId) {\n easyCardsRight.push(easyCardsSelected);\n // Move counter\n moveCounter();\n easyCards[easyCardOneId].removeEventListener(\"click\", flipEasyCard);\n easyCards[easyCardTwoId].removeEventListener(\"click\", flipEasyCard);\n // Match feedback\n easyCards[easyCardOneId].classList.add('match');\n easyCards[easyCardTwoId].classList.add('match');\n } else {\n moveCounter();\n // Credit for setTimeout: Free Code Camp\n setTimeout(changeCardBack, 400);\n function changeCardBack() {\n easyCards[easyCardOneId].setAttribute('src', './assets/images/kitten-card-back.png');\n easyCards[easyCardTwoId].setAttribute('src', './assets/images/kitten-card-back.png');\n easyCards[easyCardOneId].setAttribute('alt', 'Card back, select to flip over');\n easyCards[easyCardTwoId].setAttribute('alt', 'Card back, select to flip over');\n };\n }\n // Reset array\n easyCardsSelected = [];\n easyCardsSelectedId = [];\n resultDisplay.textContent = easyCardsRight.length; \n if (easyCardsRight.length === kittenCardsEasy.length/2) {\n setTimeout(correctEasyMatch, 200); \n }\n}", "function checkMatch() {\n var cards = document.querySelectorAll('img')\n const ID1 = cardsIDChosen[0]\n const ID2 = cardsIDChosen[1]\n if (cardsChosen[0] == cardsChosen[1]) {\n alert('You have found a match!')\n cards[ID1].setAttribute('src', 'images/white.png')\n cards[ID1].setAttribute('className', 'match')\n cards[ID2].setAttribute('src', 'images/white.png')\n cards[ID2].setAttribute('className', 'match')\n cardPair.push(cardsChosen)\n } else {\n cards[ID1].setAttribute('src', 'images/cloud.jpg')\n cards[ID2].setAttribute('src', 'images/cloud.jpg')\n alert('Sorry, try again.')\n }\n\n cardsChosen = [] //reset for next pair of choices\n cardsIDChosen = [] //reset for next pair of choices\n\n resultDisplay.textContent = cardPair.length\n if (cardPair.length == cardArray.length / 2) { // if we've found all the pairs\n resultDisplay.textContent = 'Congrats!'\n }\n }", "checkIfClicked(id) {\n // create a copy of the image cards and use a random method to sort the array\n let clickedCard = this.state.cards.filter(card => card.id === id)[0];\n let cardsCopy = this.state.cards.slice().sort(function(a, b){return 0.5 - Math.random()});\n // if an image card has not been clicked, set its clicked state to true\n if (!clickedCard.clicked) {\n clickedCard.clicked = true;\n cardsCopy[cardsCopy.findIndex((card) => card.id === id)] = clickedCard;\n \n // set the state and increment the counter\n this.setState({\n cards: cardsCopy,\n currentScore: this.state.currentScore + 1,\n topScore: (this.state.currentScore + 1 > this.state.topScore ? this.state.currentScore + 1 : this.state.topScore),\n });\n }\n\n // if an image card has been clicked already, then set its click to false and reset the game\n else {\n \n let resetCardsCopy = cardsCopy.map((card) => {\n return {\n id: card.id,\n image: card.image,\n clicked: false,\n }\n });\n this.setState({\n cards: resetCardsCopy,\n currentScore: 0,\n });\n } \n }", "function flipCard(){\n let cardId = this.getAttribute('data-id')\n cardChosen.push(cardArray[cardId].name)\n cardChosenId.push(cardId)\n this.setAttribute('src', cardArray[cardId].img)\n if(cardChosen.length ===2){\n setTimeout(checkForMatch, 500)\n }\n}", "assignHardImgs() {\n let id = '1,2,3,4,5,6,7,8,9,10,22,23';\n let promiseData = $.ajax({\n url: 'https://rickandmortyapi.com/api/character/' + id,\n type: 'GET',\n data: {\n // $limit: 10,\n },\n });\n promiseData.then((data) => {\n let imageUrlArr = [];\n for (let j = 0; j < 12; j++) {\n imageUrlArr.push(data[j].image);\n imageUrlArr.push(data[j].image);\n }\n let shuffledArray = this.shuffle(imageUrlArr);\n // console.log(shuffledArray);\n for (let k = 0; k < shuffledArray.length; k++) {\n let $div = $('<div>').addClass('card-back');\n $('.container').append($div);\n $div.append(\n $('<img>', {\n id: `image-${k + 1}`,\n src: shuffledArray[k],\n }).addClass('card-unmatched'),\n );\n }\n this.firstShow();\n this.checkMatch();\n });\n }", "function shuffleDeckOfCards(){\n //loop using length of cardbody\n for(let singleCard in cardBody){\n while(shuffleCards.length < 16){\n //use math.random to generate a random numbers up to 16\n let randomNum = Math.floor(Math.random() * card.length);\n //Make sure numbers are unique\n if(shuffleCards.indexOf(randomNum) > -1){\n continue;\n }\n shuffleCards[shuffleCards.length] = randomNum;\n deckOfCards.push(cardBody[randomNum]);\n }\n }\n // loop through each card within the deckOfCards array and append the newly\n // shuffled cards to the card container\n for(let cards in deckOfCards){\n //Add shuffled cards to the card containers\n card[cards].append(deckOfCards[cards]);\n //Add event listener to each cardBody\n cardBody[cards].addEventListener('click', function() {\n cardBody[cards].classList.add('flipped');\n //Disable the card if it was been clicked\n cardBody[cards].parentElement.classList.add('disabled');\n //Add cards to an array for comparison\n matchCards.push(cardImage[cards]);\n checkCards();\n });\n\n }\n}", "function flipCard() {\n //get data-id attribute of card clicked and store in var cardId\n let cardId = this.getAttribute('data-id');\n console.log(\"User flipped \"+cards[cardId].rank);\n console.log(cards[cardId].cardImage);\n console.log(cards[cardId].suit);\n cardsInPlay.push(cards[cardId].rank);\n //update src attribute to image of card that was just clicked\n this.setAttribute('src', cards[cardId].cardImage);\n //checking if player picked two cards\n if (cardsInPlay.length === 2) {\n checkForMatch();\n }\n}", "function shuffleCard(cards){\n return cards[Math.floor(Math.random() * cards.length)];\n }", "function shuffleCards() {\n //array of possible cards\n var cards = [\n \"coins10\", \"coins10\",\n \"coins20\", \"coins20\",\n \"coins50\", \"coins50\",\n \"coins100\", \"coins100\",\n \"flower\", \"flower\",\n \"mushroom\", \"mushroom\",\n \"star\", \"star\",\n \"up1\", \"up1\"];\n \n //shuffle the array of cards\n shuffle(cards);\n \n //for loop to assign cards to each <img> tag with id=#[1-16]\n for(i=1; i <= 16; i++){\n $(\"#\" + i).attr(\"class\", cards[i-1]); \n } \n}", "function doCardsMatch() {\n if(firstCard.dataset.icon === secondCard.dataset.icon) {\n cardArray.push(firstCard);\n cardArray.push(secondCard);\n disable();\n return;\n };\n unflippingCards(); \n}", "function checkCard(){\n let cards = document.querySelectorAll('img')\n let cardNum1 = clickedNum[0]\n let cardNum2 = clickedNum[1]\n \n\n if (clicked[0] === clicked[1]){\n cards[cardNum1].removeEventListener('click', cardImgDisplay)\n cards[cardNum2].removeEventListener('click', cardImgDisplay)\n \n matched.push(clicked)\n \n } else {\n \n cards[cardNum1].setAttribute('src','images/TheOffice.jpeg')\n cards[cardNum2].setAttribute('src','images/TheOffice.jpeg')\n \n \n \n } \n \n clicked = []\n clickedNum = []\n score.textContent = matched.length\n if(matched.length === arr.length/2){\n won.textContent = 'You Found All 6 Matches!!!'\n score.textContent = 'You won!!!'\n \n }\n \n \n }", "function rest_unmatched() {\n var img1 = $('#' + memory[0]);\n var img2 = $('#' + memory[1]);\n console.log(img1, img2);\n $(img1).children().attr('src', 'img/front.png');\n $(img2).children().attr('src', 'img/front.png');\n \n matched_cards = [];\n memory = [];\n}", "function matchCards() {\n \n tiles_flipped += 2;\n // Clear both arrays\n tiles_values = [];\n tile_ids = [];\n \n // Change the player's turn\n if(playerturn === 1){\n playerturn = 2;\n } else if(playerturn === 2){\n playerturn = 1;\n }\n \n //change css accordingly\n if(playerturn === 1){\n\n document.getElementById(\"player1\").style.background = \"blue\";\n document.getElementById(\"player2\").style.background =\"none\";\n }else{\n \n document.getElementById(\"player2\").style.background = \"red\";\n document.getElementById(\"player1\").style.background =\"none\";\n \n }\n}", "function flipCard(cardID) {\n //Set front facing card image when clicked\n this.setAttribute('src', cards[this.getAttribute('data-id')].cardImage);\n //console log card rank, suite, and img src\n console.log(\"User flipped \" + cards[this.getAttribute('data-id')].rank + \" of \" + cards[this.getAttribute('data-id')].suite + \" \" + cards[this.getAttribute('data-id')].cardImage);\n //add rank of flipped card to cardsInPlay array\n cardsInPlay.push(cards[this.getAttribute('data-id')].rank);\n //If there are 2 cards flipped, check if thier ranks match\n if (cardsInPlay.length === 2) {\n checkForMatch();\n }\n}", "cardMatch(card1, card2) {\n this.matchedCards.push(card1);\n this.matchedCards.push(card2);\n card1.classList.add('matched');\n card2.classList.add('matched');\n this.AudioFiles.match();\n if(this.matchedCards.length === this.cardsArray.length)\n this.victory();\n }", "static swap(card,index) {\n if(invalidCards.indexOf(card.value) > -1) {\n let randIdx = Deck.generateRandomCardIndex();\n while(invalidPositions.indexOf(randIdx) > -1 || invalidCards.indexOf(deck[randIdx].value) > -1) {\n randIdx = Deck.generateRandomCardIndex();\n }\n randomIndex.push(randIdx);\n newCards.push(deck[randIdx]);\n let temp = card;\n deck[index] = deck[randIdx];\n deck[randIdx] = temp;\n }\n else {\n randomIndex.push(-1);\n }\n }", "function matchCards() {\r\n\r\n // Function Call to flip 'this' particular Card\r\n flipCard(this);\r\n\r\n // Storing Id and Src of Clicked Cards\r\n id = $(this).attr('id');\r\n src = $($($(this).children()[1]).children()[0]).attr(\"src\");\r\n\r\n // Counting Number of Moves\r\n count += 1;\r\n if (count % 2 == 0) {\r\n moves = count / 2;\r\n $(\"#moves\").html(moves);\r\n // Function call to set stars as number of moves changes\r\n setRating();\r\n }\r\n\r\n // Pushing values in Array if less than 2 Cards are open\r\n if (hasSrc.length < 2 && hasId.length < 2) {\r\n hasSrc.push(src);\r\n hasId.push(id);\r\n\r\n // Turning off Click on first Card\r\n if (hasId.length == 1)\r\n $(this).off('click');\r\n }\r\n\r\n // Matching the two opened Cards\r\n if (hasSrc.length == 2 && hasId.length == 2) {\r\n if (hasSrc[0] == hasSrc[1] && hasId[0] != hasId[1]) {\r\n // Counting Pairs\r\n pair += 1;\r\n\r\n // Turning off Click on matched Cards\r\n $.each(hasId, function(index) {\r\n $('#' + hasId[index] + '').off(\"click\");\r\n });\r\n\r\n } else {\r\n // Flipping back unmatched Cards with a bit of delay\r\n $.each(hasId, function(index, open) {\r\n setTimeout(function() {\r\n flipCard('#' + open + '');\r\n }, 600);\r\n });\r\n\r\n // Turing on Click on first unmatched Card\r\n $('#' + hasId[0] + '').on(\"click\", matchCards);\r\n }\r\n\r\n // Emptying the Arrays \r\n hasSrc = [];\r\n hasId = [];\r\n }\r\n\r\n // Checking if all Cards are matched\r\n if (pair == 8) {\r\n endGame();\r\n }\r\n\r\n }", "function addCard() {\n let $card = $(\"<img>\");\n let randomCard = cards[Math.floor(Math.random() * cards.length)];\n for (i = 0; i < cards.length; i++) {\n if (randomCard === cards[i]) {\n $card\n .attr(\"src\", cards[i])\n .attr(\"class\", \"chosen\")\n .on(\"click\", retractCards);\n $(\".grid\").append($card);\n cards.splice(i, 1);\n pickedCards.push(randomCard);\n console.log(cards);\n console.log(pickedCards);\n if (cards[i] === cards[0]) {\n let $hangman = $(\"#hangman\").html(\n \"*HANGED MAN - Bad Luck Shall Befall You!*\"\n );\n }\n if (cards.length === 0) {\n setTimeout(function () {\n alert(\"YOU ARE OUT OF FORTUNES!\");\n }, 500);\n }\n }\n }\n}", "function setCards() {\n const newArray = initialCards.concat(initialCards);\n const initialCards2 = shuffle(newArray);\n\n initialCards2.forEach((element) => {\n const cardData = {\n name: element.name,\n link: element.link,\n id: i,\n };\n\n const makeCard = createCard(cardData);\n // addCard(makeCard);\n i++;\n });\n}", "cardMatch(card1, card2) {\n this.matchedCards.push(card1);\n this.matchedCards.push(card2);\n card1.classList.add('matched');\n card2.classList.add('matched');\n this.calculateScore();\n if (this.matchedCards.length === this.cardArray.length)\n this.victory();\n }", "function setCards(numberOfCards){\n\nvar numberOfMatches = numberOfCards / 2;\n\nshuffle(cardObjects);\n\n // ensure that there are only as many card objects as nessasary\n while(cardObjects.length > numberOfMatches){\n cardObjects.pop();\n }\n\n shuffle(cardObjects);\n\n}", "shuffleCards() {\n let random = 0;\n let temp = 0;\n for (i = 1; i < game.cards.length; i++) {\n random = Math.round(Math.random() * i);\n temp = game.cards[i];\n game.cards[i] = game.cards[random];\n game.cards[random] = temp;\n }\n game.assignData();\n \n }", "function shuffleCards() {\n\t\t\tvar curr_index = cards.length, \n\t\t\t\ttemp_value, \n\t\t\t\trand_index;\n\t\t\twhile (0 !== curr_index){\n\t\t\t\t// Pick random value\n\t\t\t\trand_index = Math.floor(Math.random() * curr_index);\n\t\t\t\tcurr_index--;\n\t\t\t\t// Swap the randomly picked value with the current one\n\t\t\t\ttemp_value = cards[curr_index];\n\t\t\t\tcards[curr_index] = cards[rand_index];\n\t\t\t\tcards[rand_index] = temp_value;\n\t\t\t}\n\t\t}", "function createCard(cards, card, variant) {\n return {\n matchingId: cards.indexOf(card) + 1,\n uniqueId: `${cards.indexOf(card) + 1}${variant}`,\n imgFilename: card,\n randomFactor: Math.floor(Math.random() * 100) + 1, //To make sure cards are located at different positions. Based on the random factor they get ordered in the grid\n matched: false,\n flipped: false,\n };\n}", "Grab16(){\n var list = shuffledImages, \n i;\n for (i = 0; i < 16; i++) {\n \n this.state.newState[i] = list[i];\n }\n }", "turnCard(pickedCard){\n let img = this.cards[pickedCard].getImage();\n this.images[pickedCard].innerHTML = \"<img id='img\" + pickedCard + \"' src='./images/\" + img + \"'/>\";\n }", "cardMatch(card1, card2) {\n matchedCards.push(card1); \n matchedCards.push(card2);\n card1.classList.add(\"matched\");\n card2.classList.add(\"matched\");\n this.audioController.match();\n if (matchedCards.length === cardCount[difficulty]) {\n this.victory();\n }\n }", "function dealCards(numcards)\n{\n image = new Image();\n firstcard = Math.floor(Math.random() * 1000 % 52);\n\n do\n {\n secondcard = Math.floor(Math.random() * 1000 % 52);\n }\n while (secondcard == firstcard);\n\n hand = new Array(numcards);\n hand[0] = firstcard;\n hand[1] = secondcard;\n \n document.images[0].src = \"http://www.college1.com/images/cards/gbCard\" + firstcard + \".gif\";\n document.images[1].src = \"http://www.college1.com/images/cards/gbCard\" + secondcard + \".gif\";\n\nreturn hand;\n\n} // end of function dealCards", "function compareImg(){\n let allImages = document.querySelectorAll(\"img\") //img see line in createBoard where element is created\n let firstId = imgActivId[0];\n let secondId = imgActivId[1];\n\n if(imgActiv[0]!==imgActiv[1]){\n allImages[firstId].setAttribute(\"src\", \"img/blank.png\");\n allImages[secondId].setAttribute(\"src\", \"img/blank.png\");\n } else {\n imgMatched ++;\n if(imgMatched===8) {\n resetGame();\n \n }\n console.log(imgMatched);\n }\n \n imgActiv = []; //removes images from array\n imgActivId = [];\n}", "cardMatch(card1, card2) {\n this.matchedCards.push(card1);\n this.matchedCards.push(card2);\n card1.classList.add('matched');\n card2.classList.add('matched');\n this.soundControl.matched();\n if(this.matchedCards.length === this.cardsArray.length)\n \n this.winner();\n }", "shuffleCards() {\n\n \t\tfor(var i = 0; i < this.cards.length; i++) {\n \t\t\tvar randomIndex = Math.floor(Math.random() * this.cards.length);\n \t\tvar temp = this.cards[i];\n \t\t\n \t\tthis.cards[i] = this.cards[randomIndex];\n \t\tthis.cards[randomIndex] = temp;\n \t\t}\n\t }", "initCards() {\n let allCards = [\n { value: \"A\", matched: false},\n { value: \"A\", matched: false},\n { value: \"B\", matched: false},\n { value: \"B\", matched: false},\n { value: \"C\", matched: false},\n { value: \"C\", matched: false},\n { value: \"D\", matched: false},\n { value: \"D\", matched: false},\n { value: \"E\", matched: false},\n { value: \"E\", matched: false},\n { value: \"F\", matched: false},\n { value: \"F\", matched: false},\n { value: \"G\", matched: false},\n { value: \"G\", matched: false},\n { value: \"H\", matched: false},\n { value: \"H\", matched: false}\n ];\n this.shuffle(allCards);\n return allCards;\n }", "function ShuffleCards(array){\n let currentIndex = array.length, tempValue, randIndex;\n\n while(currentIndex != 0){\n randIndex = Math.floor(Math.random() * currentIndex); // Get random card\n currentIndex -= 1; // Decrement counter\n tempValue = array[currentIndex]; //Save known card\n array[currentIndex] = array[randIndex]; //Set known card to random card\n array[randIndex] = tempValue; //Set index of random card to known card\n }\n return array;\n}", "function flipCard (){\n\t//getAttribute method to get the data-id attribute of the card that was just clicked and store it in a variable cardId.\n\tvar cardId = this.getAttribute('data-id');\n\tcardsInPlay.push(cards[cardId].rank); //add the card that the user flipped to the cardsInPlay array.\n\t//log into the console the flipped card details.\n\tconsole.log(\"User flipped \" + cards[cardId].rank);\n\tconsole.log(cards[cardId].cardImage);\n\tconsole.log(cards[cardId].suit);\n\t//use the setAttribute method to update the src attribute to the image of the card that was just clicked\n\tthis.setAttribute('src', cards[cardId].cardImage);\n\n\t//if statement that checks to see if the length of the cardsInPlay array is 2 to call checkForMatch.\n\tif (cardsInPlay.length === 2){\n\t\tcheckForMatch();\n\t}\n}", "handleCardClick(index,key) {\n\n let tempBoard = this.state.board;\n\n let tempPlayer = this.state.player;\n let score1 = this.state.player[0].score;\n let score2 = this.state.player[1].score;\n if (tempBoard[index][key].locked === false) { //if the card it not mathed, turn over\n tempBoard[index][key].hidden = tempBoard[index][key].hidden === false ? true : false;\n if (this.numOfClick === 0) { // if only one card is fliped\n this.numOfClick++;\n this.preKey = key;\n this.preIndex = index;\n tempBoard[index][key].locked = true;\n }\n else { //if there are two card is fliped\n if (tempBoard[index][key].value === tempBoard[this.preIndex][this.preKey].value) {\n if (this.playerNumber === 1) {\n tempBoard[index][key].color = 'blue';\n tempBoard[this.preIndex][this.preKey].color = 'blue';\n } else {\n tempBoard[index][key].color = 'green';\n tempBoard[this.preIndex][this.preKey].color = 'green';\n }\n\n tempBoard[index][key].locked = true;\n tempBoard[this.preIndex][this.preKey].locked = true;\n this.numOfClick = 0;\n this.matchNum ++;\n if (this.playerNumber === 1) {\n score1 += 5;\n } else {\n score2 += 5;\n }\n this.playerNumber = this.playerNumber === 1? 2:1;\n } else {\n if (this.playerNumber === 1) {\n score1 --;\n } else {\n score2 --;\n }\n tempBoard[this.preIndex][this.preKey].locked = false;\n this.numOfClick = 0;\n setTimeout(() => {\n tempBoard[this.preIndex][this.preKey].hidden = true;\n tempBoard[index][key].hidden = true;\n this.setState({\n board: tempBoard,\n player: tempPlayer\n });\n }, 500);\n }\n\n }\n }\n\n if (this.matchNum === this.nameValue.value * this.nameValue.value / 2) {\n if (score1 === score2){\n this.stateOfGame = 'Tie';\n } else if (score1 > score2) {\n this.stateOfGame = 'Player1 Win';\n } else {\n this.stateOfGame = 'Player2 Win';\n }\n this.timerCount = false;\n if (score1 > this.highestScore) {\n this.highestScore = score1;\n }\n if (score2 > this.highestScore) {\n this.highestScore = score2;\n }\n\n }\n tempPlayer[0].score = score1;\n tempPlayer[1].score = score2;\n this.setState({\n board: tempBoard,\n player: tempPlayer\n });\n }", "function assignMatch() {\n for (card=0; card < cardArray.length; card++) {\n if ((cardArray[card].classList.contains(\"match\") === false) && (cardArray[card].classList.contains(\"card-image\"))) {\n cardArray[card].classList.add(\"match\");\n }\n }\n}", "function flipCard() {\r\n //this - whatever card we have clicked \r\n //we're getting the card clicked id and store to the cardsArray arrayChosen but only the name \r\n let cardId = this.getAttribute('data-id')\r\n cardsChosen.push(cardsArray[cardId].name)\r\n cardsChosenIds.push(cardId)\r\n\r\n //flip the card when clicked\r\n this.setAttribute('src', cardsArray[cardId].img)\r\n\r\n //revert if two selected aren't the same\r\n if (cardsChosen.length === 2) {\r\n setTimeout(checkForMatch, 500)\r\n\r\n }\r\n\r\n }", "function checkMatch() {\n let cardOne = tempArray[0].innerHTML;\n let cardTwo = tempArray[1].innerHTML;\n if (cardOne == cardTwo) {\n tempArray[0].classList.add('match');\n tempArray[0].classList.remove('temp');\n tempArray[1].classList.add('match');\n tempArray[1].classList.remove('temp');\n matchedArray.push(cardOne, cardTwo);\n tempArray = [];\n cardClicks = 0;\n if (matchedArray.length === 16) {\n endGame();\n }\n } else {\n let timeout;\n timeoutFunction();\n }\n}", "function compareCards() {\n if (cardMatch[0] === cardMatch[1]) {\n assignMatch();\n cardMatch=[];\n } else {\n setTimeout(function(){\n turnOver();\n cardMatch=[];\n }, 500);\n }\n}", "function checkMatch(cardsArray) {\n let flippedCards = [];\n cardsArray.forEach((value, index) => {\n if (value.view === value.front) {\n flippedCards.push({ value, index })\n }\n })\n if (flippedCards.length > 1) {\n if(flippedCards[0].value.view === flippedCards[1].value.view) {\n return [flippedCards[0].index, flippedCards[1].index]\n }\n }\n return false\n }", "function updateCards(index) {\n let card = cards[index]\n let cardsArr = [...cards]\n\n // If card is already flipped, or has been \"removed\" don't do anything\n if (!card.view || card.view === card.front) {\n return\n }\n\n if (turn <= 1) {\n card.view = card.front // Flip the card\n cardsArr[index] = card // Overwrite the old card state in the cards array\n\n let matchArr = checkMatch(cardsArr) // Get matching cards\n\n if (matchArr) {\n setTurn(0) // If match is found, reset turn to 0, because\n cardsArr = handleMatch(matchArr, cardsArr) //\n } else {\n setTurn((prev) => prev + 1)\n }\n setCards(cardsArr)\n } else {\n props.setCurrPlayer((props.currPlayer === \"player1\" ? \"player2\" : \"player1\"))\n setTurn(1)\n cardsArr = resetCards(cardsArr)\n card.view = card.front\n cardsArr[index] = card\n setCards(cardsArr)\n }\n return\n }", "selectCards() {\n this.cardsInSet = [];\n // shuffle all arrays\n for (let i=0; i<5; i++) {\n this.shuffleArray(this.matrix[i]);\n }\n // select random cards to fill this.cardsInSet\n this.randomSelect();\n }", "function checkCards(){\n if(matchCards.length == 2){\n\n //variables to hold the elements from the array\n firstCard = matchCards[0];\n secondCard = matchCards[1];\n\n //Call moves counter to update number of moves made\n movesCounter();\n\n //Check if the elements match\n if(firstCard.className == secondCard.className){\n //Loop through matched cards and push them to finalArray\n for(let populate in matchCards){\n finalArray.push(matchCards[populate]);\n //if Array has 16 Elements, call showModal function\n if(finalArray.length == 16){\n showModal();\n }\n }\n //Call macth functions if the cards are the same\n match();\n }\n else{\n //If cards dont match, call unmatched function\n unmatched();\n }\n //Clear the array because we only want to elements in at a time\n matchCards = [];\n }\n}", "shuffle(){\n if (this.nameValue.value % 2 !== 0) {\n alert('please enter the even number');\n } else {\n this.timerCount = true;\n this.numOfClick = 0;\n this.preIndex = 0;\n this.preKey = 0;\n this.matchNum = 0;\n this.score = 0;\n let list1=[];\n let list2=[];\n for (let i = 0; i < this.nameValue.value * this.nameValue.value / 2; i++) {\n list1[i] = i + 1;\n list2[i] = i + 1;\n }\n list1= list1.sort(function(){ return 0.5 - Math.random() })\n list2= list2.sort(function(){ return 0.5 - Math.random() })\n let tempBoard = [];\n let swift = 0;\n for (let i = 0; i < this.nameValue.value; i++) {\n tempBoard[i] = [];\n for (let j = 0; j < this.nameValue.value; j++) {\n if (swift%2 === 0) {\n tempBoard[i][j] = {'value': list1[Math.floor(swift / 2)], 'hidden': true, 'color': 'reddiv', 'locked' : false};\n swift ++;\n } else {\n tempBoard[i][j] = {'value': list2[Math.floor(swift / 2)], 'hidden': true, 'color': 'reddiv', 'locked' : false};\n swift ++;\n }\n }\n }\n this.stateOfGame = 'Please click and match all the pairs of the cards with the same number';\n this.setState({\n board:tempBoard,\n secondsElapsed : 0,\n player:[\n {\n name: \"player1\",\n score: 0,\n second: 0\n },\n {\n name: \"player2\",\n score: 0,\n second: 0\n }\n ]\n });\n}\n }", "checkMatch (card)\r\n {\r\n if (this.getCardType (card) == this.getCardType (this.cardToCheck))\r\n {\r\n //console.log (\"checked\");\r\n this.matchedCards.push(card);\r\n this.matchedCards.push(this.cardToCheck);\r\n //card.classList.add(\"revealed\");\r\n //this.cardToCheck.classList.add(\"revealed\");\r\n if (this.matchedCards.length == 16)\r\n {\r\n this.overlayOn ();\r\n }\r\n }\r\n else\r\n {\r\n //console.log (\"busy: \" + this.busy);\r\n this.misMatched (card, this.cardToCheck);\r\n //setTimeout (function () {console.log (\"go!\");}, 500);\r\n }\r\n }", "function checkCard(){\n \n if(!this.flipped){ // check if the clicked card is not flipped yet\n\n this.classList.toggle(\"flipped\"); // flip the card\n this.flipped = true; // set the flipped state\n choices.push(this.dataset.value, this.id); // push the card ids into the array \n flips++; \n }\n\n if(flips == 2){ \n\n if(choices[0] == choices[2]){ // check if card values are equal\n pairs++; \n if(pairs == 8){alert(\"Gewonnen\");} // check if the end of the game is reached \n choices = []; // empty the card array\n flips = 0; \n tries++; \n moves.innerHTML = tries + \" Züge\"; // update the move counter\n }\n\n else{\n setTimeout(() => {\n for(let i = 1; i < choices.length; i+=2){ \n let remove = document.getElementById(choices[i]); // select flipped cards in last move \n remove.classList.toggle(\"flipped\"); // unflip cards\n remove.flipped = false; // remove flipped state\n }\n choices = []; // empty the card array\n flips = 0; \n tries++;\n moves.innerHTML = tries + \" Züge\";\n }, 700);\n }\n }\n\n }", "function RandomSortCardIndex(iCardIndexList)\r\r\n{\r\r\n DebugLn(\"RandomSortCardIndex\");\r\r\n \r\r\n var iiCard = 0;\r\r\n var topCard = iCardIndexList.length - 1;\r\r\n for (iiCard = 0; iiCard < topCard; iiCard++)\r\r\n {\r\r\n var numRemainingCards = iCardIndexList.length - iiCard;\r\r\n var iiSwap = Math.floor(numRemainingCards * Math.random()) + iiCard;\r\r\n if (iiSwap > topCard) \r\r\n iiSwap = topCard;\r\r\n if (iiSwap != iiCard)\r\r\n {\r\r\n var temp = iCardIndexList[iiCard];\r\r\n iCardIndexList[iiCard] = iCardIndexList[iiSwap];\r\r\n iCardIndexList[iiSwap] = temp;\r\r\n }\r\r\n }\r\r\n}", "function compareCards(element) {\n const split = element.id.split('_')\n const id = split[1]\n quitOpacity(element)\n if (cardsToCompare.length <= 0 || cardsToCompare.length < 2) {\n cardsToCompare.push(id)\n }\n if (cardsToCompare.length > 1) {\n const firstCardId = parseInt(cardsToCompare[0])\n const firstCard = cards[firstCardId]\n const secondCardId = parseInt(cardsToCompare[1])\n const secondCard = cards[secondCardId]\n if (firstCard.id + 6 === secondCard.id || firstCard.id - 6 === secondCard.id) {\n firstCard.active = true\n secondCard.active = true\n cardsToCompare = []\n win = win + 2\n if (win === cardsNumber) { winGame() }\n }\n else {\n if (firstCard.id === secondCard.id) {\n if (!firstCard.active) {\n const element = document.querySelector(`#${firstCard.elementId}`)\n addOpacity(element)\n }\n cardsToCompare = []\n }\n else if (firstCard.active && secondCard.active) {\n cardsToCompare = []\n }\n else if (firstCard.active && !secondCard.active) {\n setTimeout(function () {\n const element = document.querySelector(`#${secondCard.elementId}`)\n addOpacity(element)\n }, 200)\n cardsToCompare = []\n }\n else if (!firstCard.active && secondCard.active) {\n setTimeout(function () {\n const element = document.querySelector(`#${firstCard.elementId}`)\n addOpacity(element)\n }, 200)\n cardsToCompare = []\n }\n else {\n setTimeout(function () {\n const firstElement = document.querySelector(`#${firstCard.elementId}`)\n addOpacity(firstElement)\n const secondElement = document.querySelector(`#${secondCard.elementId}`)\n addOpacity(secondElement)\n }, 500)\n cardsToCompare = []\n }\n }\n }\n}", "function setMainCard(){\n randMain = [Math.floor(Math.random() * x)];\n mainNums.push(randMain);\n mainCard.src = `images/${gameData.mainCards[randMain]}`;\n}", "function resertCards(isMatch = null) {\n if(isMatch == null){\n cards[0].removeEventListener(\"click\", flipCard);\n cards[2].removeEventListener(\"click\", flipCard);\n }\n [randFir, randSec, firstCard, secondCard, cardFirHTML, cardSecHTML, cards] = [null, null, null, null, null, null, null];\n// Zera todas as variaveis utilizadas no processo\n \n// Inicia se o reset das cartas possibilitando troca das cartas\n randFir = Math.floor(Math.random() * imagens.length);\n randSec = Math.floor(Math.random() * imagens.length);\n cardFirHTML = [imagens[randFir]];\n cardSecHTML = [imagens[randSec]];\n //console.clear();\n console.log(randFir, randSec)\n cardFirHTML.forEach(img => {\n cardFirHTML = `\n <div class= \"card\" data-card= \"${img}\">\n <img id= \"${randFir}\" class= \"card-face\" src= \"/image/cards/${img}\"> \n <img class= \"frontal-face\" src= \"/image/cards/frontal.png\">\n </div>\n `\n });\n\n cardSecHTML.forEach(img => {\n cardSecHTML = `\n <div class= \"card\" data-card= \"${img}\">\n <img id= \"${randSec} \"class= \"card-face\" src= \"/image/cards/${img}\"> \n <img class= \"frontal-face\" src= \"/image/cards/frontal.png\">\n </div>\n `\n });\n cardBoard.innerHTML = cardFirHTML + cardOperacaoHTML + cardSecHTML ;\n// As cartas são trocadas \n\n cards = document.querySelectorAll(\".card\");\n cards.forEach(card => card.addEventListener(\"click\", flipCard));\n// Adiciona as cartas na Variavel cards \n\n flipCard();\n}", "function setBoard() {\n const cards = $('.card');\n\n const shuffledCards = shuffle(cards);\n\n for (let i = 0; i < shuffledCards.length; i++) {\n $('.deck').append(shuffledCards[i]);\n }\n}", "function matchingCards (flippedCards) {\n flippedCards[0].classList.toggle('match');\n flippedCards[1].classList.toggle('match');\n flippedCards[0].classList.toggle('open');\n flippedCards[0].classList.toggle('show');\n flippedCards[1].classList.toggle('open');\n flippedCards[1].classList.toggle('show');\n matchedCards.push(flippedCards[0], flippedCards[1]);\n flippedCards.length = 0;\n}", "shuffle() {\n for (let i = this.cards.length - 1; i > 0; i--) {\n const newIndex = Math.floor(Math.random() * (i + 1)); //get random index before the current card to swap with\n const oldValue = this.cards[newIndex];\n this.cards[newIndex] = this.cards[i];\n this.cards[i] = oldValue;\n //Looping through all of our cards and swapping them with another card to get a random shuffle\n }\n }", "function isTwoCards() {\n //this stars another loop that will add 'this' 'data-card' on each card\n cardsInPlay.push(this.getAttribute('data-card'));\n//this shows the card's image\n console.log(this.getAttribute('data-card'));\n \n if (this.getAttribute('data-card')==='king') {\n this.innerHTML = \"<img src = 'king%20.png'>\";\n }else{\n this.innerHTML = \"<img src = 'queen.png'>\";\n }\n //structure of game is initiated: if 2 cards are active, run isMatch function to test\n //empty array cardInPlay will be populated by those cards during game\n \nif (cardsInPlay.length === 2){\n isMatch(cardsInPlay);\n cardsInPlay = [];\n }\n}", "shuffle() {\n //One array contains indexes, the other the objects themselves\n let available = [];\n let tempCards = [];\n for (let i = 0; i < this.cards.length; i++) {\n available[i] = i;\n tempCards[i] = this.cards[i];\n tempCards[i].pos.y += random(-100, 100);\n }\n\n //for each temporary card, put it somewhere in the deck and remove\n //that index from the array so no other card can go there.\n tempCards.forEach((card) => {\n let random = Math.floor(Math.random() * available.length);\n let index = available[random];\n this.cards[index] = card;\n available.splice(random, 1);\n });\n console.log(\"Deck is shuffled\");\n }", "function shuffleTiles(){\n //SHUFFLE\n console.log(\"Shuffling...\");\n shuffledTiles = shuffle(gameTiles);\n\n //UPDATE BOARD\n for (let i = 0; i <= shuffledTiles.length - 1; i++){ \n let curTile = $(`#${i}`);\n $(curTile).append($(\"<img></img>\")\n .attr('src', `${shuffledTiles[i].value}`)\n .addClass(\"hidden\", \"image\"));\n };\n }", "function cardClicked(clickEvent) {\n\n //This will create a reference to the actual card clicked on.\n const cardElementClicked = clickEvent.currentTarget;\n\n //That event is passed to this function which accesses the \n //currentTarget to get element that is clicked during the event.\n const cardClicked = cardElementClicked.dataset.cardtype;\n\n //Adds flip class to the clicked card.\n cardElementClicked.classList.add('flip');\n\n //sets the current card to cardClicked if cardClicked is null\n if (currentCard) {\n\n //matchFound will be set to true if cardClicked is equal to \n //currentCard.\n const matchFound = cardClicked === currentCard;\n\n //Adds matched cards to array of cardsMatched\n if (matchFound) {\n cardsMatched.push(cardClicked);\n //If cardsMatched is equal to cardsLength the array is complete and \n //the game is over.\n if (cardsMatched.length === cards.length) {\n\n setTimeout(gameWon, 500);\n }\n\n // Reset.\n currentCard = null;\n } else {\n //setTimeout is used to delay the function for 500 milliseconds\n // so the user can process the image.\n setTimeout(() => {\n\n document\n .querySelectorAll(`[data-cardType=\"${currentCard}\"]`)\n .forEach(card => card.classList.remove('flip'));\n\n //Remove flip class from the card that was just clicked.\n cardElementClicked.classList.remove('flip');\n\n // Reset.\n currentCard = null;\n }, 500);\n }\n //Reset. \n } else {\n currentCard = cardClicked;\n }\n}", "function shuffleCards(cardsArray){\n shuffle(cards);\n}", "shuffleCards() {\n for (var i = cards.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1))\n var temp = cards[i]\n cards[i] = cards[j]\n cards[j] = temp\n }\n }", "function cardMatch(listOfCards) {\n $(\".open\").removeClass(\"noDuplicate\");\n let cardOne = $(listOfCards[0]).html();\n let cardTwo = $(listOfCards[1]).html();\n if (cardOne === cardTwo) {\n $(\".open\").addClass(\"match\");\n cardMatchCounter ++;\n gameFinishCheck(cardMatchCounter);\n } else {\n /** counts how many failed attempts have been made to match cards */\n numberOfMisses ++;\n moveCounter(numberOfMisses);\n /** if the cards do not match, remove the cards from the list and hide\n * the card's symbol (put this functionality in another function\n * that you call from this one) */\n allFaceDown();\n }\n}", "function addToMatched() {\n\n const matchedCards = []; //new array for matched cards\n\n //add matched cards to the array\n for (let i = 0; i < cards.length; i++) {\n if (cards[i].classList.contains('match') === true) {\n matchedCards.push(cards[i]);\n }\n }\n\n //check if all cards have matched to end the game\n if (matchedCards.length === 16) {\n endGame();\n }\n}", "function flipped()\n{\n \n let flip = this.getAttribute(\"data-id\");\n pickedCard.push(cardsArr[flip].name);\n\n cardPickId.push(flip);\n //this.classList.replace(\"back\",\"front\");\n this.classList.add(\"flip\");\n this.setAttribute(\"src\",cardsArr[flip].img);\n \n \n if(pickedCard.length ===2){\n \n setTimeout(checkCard,500)\n }\n}", "function flipCard() {\n let cardId = this.getAttribute('data-id')\n cardsChosen.push(cardArray[cardId].name)\n cardsChosenId.push(cardId)\n this.setAttribute('src', cardArray[cardId].img)\n if (cardsChosen.length === 2) {\n setTimeout(checkForMatch, 720) // ask how I can set this to increase for level two and 3\n }\n }", "function verifyMatch() {\n totalMatchAttempts.push(tileChoice); // Update array for total matching attempts each time attempt is made\n let allTiles = document.querySelectorAll('img');\n const choiceOneId = tileChoiceId[0];\n const choiceTwoId = tileChoiceId[1];\n if (tileChoice[0] === tileChoice[1]) {\n tilesMatched.push(tileChoice); // Push matched tiles into corresponding array, used to determine game completion \n } else {\n allTiles[choiceOneId].setAttribute('data-disabled', 'false'); // If tiles don't match, enable them again\n allTiles[choiceTwoId].setAttribute('data-disabled', 'false'); // If tiles don't match, enable them again\n allTiles[choiceOneId].setAttribute('src', 'assets/images/tile-back.jpg'); // \"Flip\" tiles back face down\n allTiles[choiceTwoId].setAttribute('src', 'assets/images/tile-back.jpg'); // \"Flip\" tiles back face down\n }\n tileChoice = [];\n tileChoiceId = [];\n updateTriesCounter();\n checkForGameCompletion();\n}", "function checkforMatch(){\n if (toggledCards[0].firstElementChild.className === toggledCards[1].firstElementChild.className){\n toggledCards[0].classList.toggle('match');\n toggledCards[1].classList.toggle('match');\n toggledCards = [];\n matched++;\n console.log(matched);\n if (matched === cardPairs) {\n\t\t\tgameOver();\n\t\t\t}\n } else {\n setTimeout(() => {\n toggleCard(toggledCards[0]);\n toggleCard(toggledCards[1]);\n toggledCards = [];\n }, 1500);\n }\n}", "function checkForMatch()\n{\n if(firstCard.dataset.card===secondCard.dataset.card)\n {\n disableCards();\n return true;\n \n \n \n }\n else\n {\n unFlipCards();\n return false;\n \n }\n}", "function shuffle(cards)\n{\n\t// for loop???\n\t \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 SetImageActive(card)\n{\n if (card.length > 0)\n {\n let id = \"div#cardImages #\" + card + \" img\";\n $(id).attr('src', '/images/' + card + 'Active.png');\n }\n}", "function second(e) {\r\n // trackingImage condition\r\n if (trackingImage <= 1) {\r\n // giving a value that is inside the image array it gives a new src\r\n e.target.src = object.temp[parseInt(e.target.id)]\r\n\r\n if(trackingImage === 0){\r\n // the first flip card source is being stored in the previous that was assign to line 47\r\n previous = e.target.src //previous = 'img/pookeoke.jpg'\r\n id = e.target.id; //store the id\r\n }\r\n else if(trackingImage ===1){\r\n if (previous === e.target.src) {\r\n //remove those cards\r\n document.getElementById(id).remove();\r\n document.getElementById(e.target.id).remove();\r\n previous = \"\";\r\n }\r\n }\r\n trackingImage++;\r\n } else {\r\n let reset = document.getElementsByTagName('img')\r\n for (var i = 0; i < reset.length; i++) {\r\n reset[i].src = \"images/lucy.jpg\"\r\n }\r\n trackingImage = 0;\r\n }\r\n}", "function markMatch(){\n flippedCards = document.getElementsByClassName(\"flipped\");\n\n\n //remove div\n flippedCards[1].style.backgroundImage = \"none\";\n flippedCards[0].style.backgroundImage = \"none\";\n\n //print instructions\n cardOneDiv.innerHTML = \"Card 1: \" + choiceOne;\n cardTwoDiv.innerHTML = \"Card 2: \" + choiceTwo;\n\n //reset array and class\n openCards.splice(0, openCards.length);\n\n stripFlip();\n disableCard();\n}", "function setupCard(gameCanvas) {\r\n /*Size of image*/\r\n var height = 465;\r\n var width = 415;\r\n var cord = [], x, y, gridPos;\r\n var i = 0; //Loop counter\r\n \r\n /*Add the card to the canvas*/\r\n card = new imageLib(gameCanvas, width, height, 200, 10);\r\n card.oldPosX = 150;\r\n card.oldPosY = 200;\r\n \r\n /*Save current location on the canvas*/\r\n card.addImg(gameImage.loadedImg[\"card1\"]);\r\n \r\n /*Save all frames*/\r\n card.frameNum = 4;\r\n card.frameCount = 1;\r\n \r\n //var w = [0, 150, 150, 150, 150];\r\n //var h = [0, 150, 150, 150, 150];\r\n \r\n for (i = 1; i <= card.frameNum; i++) {\r\n card.frame[\"card\"+i] = {\r\n image: gameImage.loadedImg[\"card\"+i],\r\n width: width,\r\n height: height\r\n };\r\n }\r\n \r\n // for (i = 1; i <= card.frameNum; i++) {\r\n // card.frame[\"card\"+i] = {\r\n // image: gameImage.loadedImg[\"card\"+i],\r\n // width: w[i],\r\n // height: h[i]\r\n // };\r\n // }\r\n}", "function cardsSelected(img_ID, old_ID){\n //console.log(\"bf CCS\");\n //console.log(user.cardSelectedStack);\n document.getElementById(\"nineButton\").style.display = \"none\";\n let div_ID = 'div_' + img_ID;\n let img = img_ID.split(\"_\")[2]; //grabs just the img\n let d = document.getElementById(div_ID);\n let pos = user.cardSelectedStack.indexOf(div_ID);\n if (old_ID === \"\") { //a direct string change is not needed, push or pop is needed\n if ( pos >= 0 ) { //if the id is in the array, its already selected, so UNhighlight it\n if (img.indexOf('9', 0) >= 0 && user.cardSelectedStack.length === 1 ) { //selected card was a 9 not from joker\n document.getElementById(\"nineButton\").style.display = \"none\";\n }\n d.style.backgroundColor = \"white\";\n user.cardSelectedStack.splice(pos, 1);\n user.cardSelectedStack_toServ.splice(pos, 1); //has same functionality as cardSelectedStack\n } else { //if its not in the array then Highlight the card and add it to the array\n if (img.indexOf('9', 0) >= 0 && user.cardSelectedStack.length === 0) { //only selected card is a 9 not from joker\n if (user.dict_varData[user.username][2] && ((user.isDerby && user.isBattle) || (!user.isDerby)) ) {\n document.getElementById(\"nineButton\").style.display = \"block\";\n }\n }\n if (img === \"14j\") {\n img = div_ID.split(\"_\")[4];\n user.cardSelectedStack_toServ.push(img); //img from joker div_ID.split(\"_\")[4]\n } else {\n user.cardSelectedStack_toServ.push(img); //non joker img\n }\n d.style.backgroundColor = \"blue\";\n user.cardSelectedStack.push(div_ID);\n }\n if (user.cardSelectedStack.length > 1) {\n document.getElementById(\"nineButton\").style.display = \"none\";\n } else if (user.cardSelectedStack.length === 1 && user.cardSelectedStack[0].split(\"_\")[3].indexOf('9', 0) >= 0) {\n if (user.dict_varData[user.username][2] && ((user.isDerby && user.isBattle) || (!user.isDerby)) ) {\n document.getElementById(\"nineButton\").style.display = \"block\";\n }\n }\n } else { //here bc card is joker options change. Find and change the old joker id to new id\n pos = user.cardSelectedStack.indexOf(\"div_\" + old_ID); //pos of old joker id\n if (pos >= 0) {\n user.cardSelectedStack[pos] = div_ID; //replace with new id\n let new_img = div_ID.split(\"_\")[4];\n user.cardSelectedStack_toServ[pos] = new_img; //new joker value\n }\n }\n //console.log(\"af CCS\");\n //console.log(user.cardSelectedStack);\n}", "function generateCards(){\n shuffle(images);\n for (var i = 0; i < cards.length; i++){\n var image = images[i];\n var cardback = cardImages[i];\n var card = cards[i];\n var style = \"url(\" + image + \") no-repeat center\";\n cardback.style.background = style; \n cardback.style.backgroundSize = \"100% 100%\";\n card.dataset.pic = image;\n } \n}", "shuffle(){\n let randomInt = Math.floor(Math.random() * (this.cards.length));\n return randomInt;\n }", "function compareCards(e) {\n //track number of clicks\n ++clickCount;\n //limit click count to 2\n while (clickCount > 2) {\n clickCount = 0;\n ++clickCount;\n }\n\n //flag checks if game has started\n if (flag === true) {\n\n //sets the first selected card to variable\n if (clickCount === 1) {\n console.log(e);\n cardOne = e.currentTarget.children[1].firstElementChild.attributes[1].nodeValue;\n console.log(cardOne);\n selectedCardOne = e.delegateTarget.offsetParent;\n //sets the second selected card to variable\n\n } else {\n cardTwo = e.currentTarget.children[1].firstElementChild.attributes[1].nodeValue;\n\n selectedCardTwo = e.delegateTarget.offsetParent;\n // selectedCardTwoAccurate = e.delegateTarget .offsetParent.className;\n\n }\n //checks cards for match, mismatch, or duplicate selection\n if (clickCount === 2) {\n if (selectedCardOne != selectedCardTwo) { \n if (cardOne === cardTwo) {\n cardsMatched++;\n //Replace gifs with chekcs on match - LightSide\n if(cardOne === \"yoda.gif\"){\n $(\".yodagif\").attr(\"src\", \"check.jpg\");\n }\n if(cardOne === \"hangif.gif\"){\n $(\".hangif\").attr(\"src\", \"check.jpg\");\n }\n if(cardOne === \"leia-gif.gif\"){\n $(\".leiagif\").attr(\"src\", \"check.jpg\");\n }\n if(cardOne === \"lightsaber.gif\"){\n $(\".lightsabergif\").attr(\"src\", \"check.jpg\");\n }\n if(cardOne === \"obi.gif\") {\n $(\".obigif\").attr(\"src\", \"check.jpg\");\n }\n //Replace gifs with checks on match - Darkside\n if(cardOne === \"forseen.webp\"){\n $(\".forseengif\").attr(\"src\", \"check.jpg\");\n }\n if(cardOne === \"trooper.gif\") {\n $(\".troopergif\").attr(\"src\", \"check.jpg\");\n }\n if(cardOne === \"darthvader.gif\"){\n $(\".vadergif\").attr(\"src\", \"check.jpg\");\n }\n if(cardOne === \"force.gif\"){\n $(\".forcegif\").attr(\"src\", \"check.jpg\");\n }\n if(cardOne === \"starship.gif\"){\n $(\".starshipgif\").attr(\"src\", \"check.jpg\");\n }\n\n } else {\n //flips cards back to hidden after 1 second delay\n setTimeout(() => {\n flipCards(selectedCardOne);\n flipCards(selectedCardTwo);\n }, 1000);\n }\n } else {\n alert(`Can't select the same card!`);\n }\n }\n\n } else {\n console.log(`game has not started`);\n }\n //Check to see if the user has won the game\n if (cardsMatched === 5) {\n gameWon = true;\n console.log(\"You won the game!\");\n displayEndVideo();\n }\n }", "function shuffleCards() {\n clearCards();\n const generatedCards = [];\n while (generatedCards.length < 9) {\n const randomIndex = generateRandomIndex();\n if (!generatedCards.includes(randomIndex) && randomIndex < 9) {\n generatedCards.push(randomIndex);\n createCard(randomIndex);\n }\n }\n\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 showCard(nodeImg) {\n var cardNum = +nodeImg.id.slice(4);\n nodeImg.src = gifs[randomizedIndices[cardNum]];\n}", "function checkForMatch () {\nthis.getAttribute(\"data-src\", \"images/queen-of-diamonds.png\");\nif (cardsInPlay[0] === cardsInPlay[3]) {\nconsole.log(\"You found a match!\");\n} else {\nconsole.log(\"Sorry, try again.\");\n}\n}", "function shuffle() {\n cards.forEach(card=> {\n let randomPos = Math.floor(Math.random() * 16);\n card.style.order = randomPos;\n })\n}", "function cardsMatch(card1, card2) {\n pairedCards.push(card1);\n pairedCards.push(card2);\n\n if(pairedCards.length === cardsArray.length)\n gameOver();\n}", "function flipCard () {\n//Trigger check for match first\nthis.getAttribute('data-id');\ncheckForMatch();\nconsole.log(\"User flipped \" + cards[cardId].rank)\nif (cardsInPlay.length === 2 && cardsInPlay[0] !== cardsInPlay[3]) {\n\talert(\"Nope.\");\n} else if (cardsInPlay.length === 2 && cardsInPlay[0] === cardsInPlay[3]) {\n\talert(\"Match!\");\n}\ncardsInPlay.push(cards[cardId.rank]);\n\n}", "function setUpHand(playerArray, cards, playerId) {\n console.log('player array: ', playerArray)\n for (let card of cards) {\n playerArray.push(card)\n }\n $(`#${playerId}-cards`).html('')\n for (let card of playerArray) {\n console.log('card: ', card)\n $(`#${playerId}-cards`).append(`<img src=${card.image} />`)\n }\n }", "function findingCard(selectCard) {\n const cardId = selectCard.id;\n const cardInArrayId = document.getElementById(cardsOpen[1])\n\n if (cardId.endsWith('-1') && cardsOpen[1].endsWith('-2')) {\n cardInArrayId.classList.remove('open');\n cardInArrayId.classList.remove('show');\n cardInArrayId.classList.add('match');\n cardsOpen.pop();\n cardsOpen.pop();\n finishGame();\n console.log('You matched a set!');\n} else if (cardId.endsWith('-1') && cardsOpen[1].endsWith('-1')) {\n alert('You cannot click the same card twice.')\n location.reload();\n} else if (cardId.endsWith('-2') && cardsOpen[1].endsWith('-1')) {\n cardInArrayId.classList.remove('open');\n cardInArrayId.classList.remove('show');\n cardInArrayId.classList.add('match');\n cardsOpen.pop();\n cardsOpen.pop();\n console.log('You matched a set!');\n} else if (cardId.endsWith('-2') && cardsOpen[1].endsWith('-2')) {\n alert('You cannot click the same card twice.')\n location.reload();\n} else {\n console.log('*This should never be logged');\n}\n}" ]
[ "0.7384254", "0.73086804", "0.6935616", "0.6923473", "0.6801952", "0.679077", "0.67337126", "0.6687502", "0.6679658", "0.6656756", "0.6655947", "0.66548336", "0.6612141", "0.66083765", "0.6573074", "0.6568477", "0.65608865", "0.65406847", "0.6534259", "0.6519824", "0.6516414", "0.64797616", "0.64722085", "0.6453434", "0.64454013", "0.64358383", "0.6417762", "0.64105946", "0.63843715", "0.6369526", "0.63556343", "0.63300127", "0.6320069", "0.63147116", "0.63076675", "0.63011485", "0.62886953", "0.62816435", "0.6262013", "0.62582874", "0.6257564", "0.622887", "0.6228102", "0.6221282", "0.62163", "0.6210177", "0.62040514", "0.61965966", "0.61941886", "0.6181254", "0.61774725", "0.6175544", "0.6166811", "0.61657256", "0.61653125", "0.61493087", "0.61489004", "0.6143067", "0.6138988", "0.61258173", "0.6111296", "0.61014163", "0.6100186", "0.60964066", "0.60867673", "0.6074917", "0.6069797", "0.60697603", "0.6060428", "0.6058967", "0.6058933", "0.60550946", "0.6047251", "0.6044757", "0.60442865", "0.6043522", "0.6042229", "0.60367644", "0.60335934", "0.60314816", "0.6029595", "0.60214025", "0.6019743", "0.6018319", "0.60180235", "0.60173285", "0.6016743", "0.6011283", "0.6007847", "0.600648", "0.6004357", "0.6002957", "0.5994597", "0.59906125", "0.59887224", "0.59832585", "0.5975406", "0.597331", "0.59691113", "0.59626275" ]
0.6367538
30
function that creates the gameboard elements referencing the length of the cards array, adds the id and click event listener
function createBoard() { for (i = 0; i < cards.length; i++) { var cardElement = document.createElement('img'); cardElement.setAttribute('src', 'images/back.png'); cardElement.setAttribute('data-id', i); cardElement.addEventListener('click', flipCard); document.getElementById('game-board').appendChild(cardElement); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createBoard() {\n for(let i = 0; i < cardArray.length; i++){\n var card = document.createElement('img')\n\n card.setAttribute('src', 'images/pokeball.png') // giving a \"style\" and its value - black is the back of the card\n card.setAttribute('data-id', i)\n\n card.addEventListener('click', flipCard) //when there is \"click\" the function flipcard is called\n\n grid.appendChild(card) // linking the gameboard to the css\n }\n }", "function createBoard()\n\t{ \n\t\tfor (var i = 0; i < cards.length; i++) {\n\t var cardElement = document.createElement('img');\n\t cardElement.setAttribute('src', \"images/back.png\");\n\t //I add this random function to let the game become more excited \n\t var ran= Math.floor(Math.random() * 4); \n\t cardElement.setAttribute('data-id', ran);\n\t document.getElementById('game-board').appendChild(cardElement);\n\t cardElement.addEventListener('click',flipCard);\n\t}\n}", "function createBoard() {\n\t//loop through cards array\n\tfor (let i = 0; i < cards.length; i++) {\n\t\t//create an img element and store it in a variable cardElement\n\t\tlet cardElement = document.createElement('img');\n\t\t//add src attribute of 'images/back.png' for user to see back of card\n\t\tcardElement.setAttribute('src', 'images/back.png');\n\t\t//set card's data id attribute to be current index of card array\n\t\tcardElement.setAttribute('data-id', i);\n\t\t//add click event so that when user clicks on card, flipCard function is called\n\t\tcardElement.addEventListener('click', flipCard);\n\t\t//append cardElement to game board\n\t\tdocument.getElementById('game-board').appendChild(cardElement);\n\t}\n}", "function createBoard() {\n\n//loop through the cards array.\n for (var i=0; i<cards.length; i++) {\n//div element that will be used as a card.\n var cardElement = document.createElement('div');\n//add a class to the card element.\n cardElement.className = 'card';\n\n//attribute that equals the card value.\n cardElement.setAttribute('data-card', cards[i]);\n//click event listener to each card.\n cardElement.addEventListener('click', isTwoCards);\n\n//append the card to the board\n board.appendChild(cardElement);\n board.appendChild(cardElement);\n }\n\n}", "function createBoard() {\n //create img element, then iterate through all the cards and assign initial //images & event listeners. Then assign all cards to \"game-board\" element\n for (let i = 0; i < cards.length; i++) {\n let cardElement = document.createElement('img');\n cardElement.setAttribute('src', 'images/back.png');\n cardElement.setAttribute('data-id', i);\n cardElement.addEventListener('click', flipCard);\n document.getElementById('game-board').appendChild(cardElement);\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}", "function createBoard () {\n\tfor (var i=0; i<cards.length; i++) {\n\t\tvar newCard = document.createElement('div');\n\t\tnewCard.className = 'card';\n\t\tnewCard.setAttribute('data-card', cards[i]);\n\t\tnewCard.addEventListener('click', isTwoCards);\n\t\tgameBoard.appendChild(newCard);\n\t}\n}", "function createBoard() {\n\tfor (let i = 0; i < cards.length; i++) {\n\t\tvar cardElement = document.createElement('img');\n\t\tcardElement.setAttribute('src', \"images/back.png\");\n\t\tcardElement.setAttribute('data-id', i);\n\t\tcardElement.addEventListener('click', flipCard);\n\t\tdocument.getElementById('game-board').appendChild(cardElement);\n\t}\n}", "function createBoard (){\n\tfor (var i = 0; i < cards.length; i++) {\n\t\t//For each card, use createElement to create an \"img\" element and store it in a variable cardElement.\n\t\tvar cardElement = document.createElement('img');\n\t\t//use the setAttribute() method on cardElement to set some attributes that we want. (here src attribute)\n\t\tcardElement.setAttribute('src', 'images/back.png');\n\t\t//Set the card's 'data-id' attribute to be the current index of the card array, (i).\n\t\tcardElement.setAttribute('data-id', i);\n\t\t\n\t\t//use the addEventListener() method on the cardElement. Add a click event so that when a user clicks on a card, the flipCard function is called.\n\t\tcardElement.addEventListener('click', flipCard);\n\t\t//append the cardElement to the game board.\n\t\tdocument.getElementById('game-board').appendChild(cardElement);\n\t}\n}", "function createBoard() {\n for (let i = 0; i < shuffledCards.length; i++){\n let cardElement = document.createElement(\"img\");\n cardElement.setAttribute(\"src\", \"images/back.png\");\n cardElement.setAttribute(\"id\", i);\n // Page starts listening for user to interact with cards\n cardElement.addEventListener(\"click\", processGuess);\n document.getElementById(\"gameBoard\").appendChild(cardElement);\n }\n}", "function drawCards () {\r\n for ( let i = 0; i < cards.length; i++ ) {\r\n let element = document.createElement(\"div\");//Create a new div element\r\n \r\n element.className = \"card\";//Add the text node to the newly created div\r\n element.innerHTML = \"\";//Turn down all cards\r\n element.index = i;//Store cards number as \"index\"\r\n element.onclick = click;//Call the following click() function once a user clicks a card\r\n \r\n $field.appendChild( element );\r\n }\r\n}", "function createBoard(){\n\n\tfor (var i = 0; i < cards.length; i++) {\n\t//console.log(i); // testing here\n\tvar cardElement = document.createElement('img');\n\t//console.log(cardElement); // testing here as well.\n\tcardElement.setAttribute('src', 'images/back.png');\n\tcardElement.setAttribute('data-id', i);\n\tcardElement.addEventListener('click', flipCard);\n\tdocument.getElementById('game-board').appendChild(cardElement);\n\n}\n}", "function createBoard() {\n var game = document.getElementById('game-board');\n for (var i = 0; i < cards.length; i++) {\n var new_card = document.createElement('img');\n new_card.setAttribute('src', 'images/back.png');\n new_card.setAttribute('data-id', i);\n new_card.addEventListener('click', flipCard);\n game.appendChild(new_card);\n }\n}", "function startGame() {\nvar randArray = _.shuffle(letters);\nfor (var i = 0; i <= 9; i++) {\n var card = $(\"<div>\");\n card.addClass(\"column\");\n card.attr('id', i);\n card.appendTo($(\"#game\"));\n card.on('click', function(){\n\n cardClick(this, randArray);\n });\n};\n\n}", "function createBoard() {\n debug(\"createBoard\");\n shuffle(cardList);\n cardList.forEach(function(i) {\n newCard = document.createElement('li');\n newIcon = document.createElement('i');\n deck = document.querySelector('.deck');\n \n newCard.setAttribute(\"class\", \"card\");\n newIcon.setAttribute(\"class\", i);\n deck.appendChild(newCard);\n deck.lastChild.appendChild(newIcon);\n })\n evtListener(); \n }", "function createBoard() {\n for (let i = 0; i < imageArray.length; i++) {\n let card = document.createElement('img')\n card.setAttribute('src', 'images/logo.png')\n card.setAttribute('data-id', i)\n gameboard.appendChild(card)\n card.addEventListener('click', flipCard)\n }\n }", "function createBoard(){\n for(let i=0; i<cardArray.length; i++){\n const card = document.createElement('img')\n card.setAttribute('src', 'images/blank.jpg')\n card.setAttribute('data-id', i)\n card.addEventListener('click', flipCard)\n grid.appendChild(card)\n }\n}", "function generateBoard() {\n //clear previous board\n $('.deck').empty();\n //shuffle board\n let shuffledBoard = shuffle(cardList);\n //loop to set new board\n for (cards in shuffledBoard) {\n let card = document.createElement('li');\n card.classList.add('card');\n deck.appendChild(card);\n let icon = document.createElement('i');\n icon.classList.add('fa');\n icon.classList.add(`${shuffledBoard[cards]}`);\n card.appendChild(icon);\n card.addEventListener('click', displayCard);\n card.addEventListener('click', cardUp);\n }\n }", "function renderCardsToGame() {\n deck.innerHTML ='';\n cardsShuffled = shuffle(fullDeck); //an array\n console.log(cardsShuffled);\n //appends shuffled cards to the game board(deck)\n for(let i = 0; i < cardsShuffled.length; i++){\n cardEl = document.createElement('li');\n cardEl.classList.add('card');\n cardEl.id = \"card-\" + i;\n frontImageEl = document.createElement('i');\n frontImageEl.classList.add('front-card');\n backImageEl = document.createElement('i');\n backImageEl.classList.add('fa', cardsShuffled[i], 'back-card', 'toggle-view');\n cardEl.appendChild(frontImageEl);\n cardEl.appendChild(backImageEl);\n deck.appendChild(cardEl);\n\n //adds event listener to all cards\n cardEl.addEventListener('click', clickResponse);\n }\n }", "function createBoard(){\n let boardCont = document.createElement('div');\n for (i=0;i<9;i++){\n let cell = document.createElement('div');\n cell.classList.add('cell');\n cell.id = `${i}`;\n cell.addEventListener('click',function (event){\n changeSymbol(event.target)\n checkEnd()\n });\n boardCont.appendChild(cell);\n }\n boardCont.classList.add('container');\n boardCont.id = 'boardCont';\n document.body.appendChild(boardCont);\n}", "function createBoard() {\n cardArray.forEach((cardItem, index)=>{\n //create an img tag element for card\n let card = document.createElement('img')\n //set an attribute on created img tag\n card.setAttribute('src', 'images/back.png')\n card.setAttribute('data-id', index)\n card.addEventListener('click', flipCard)\n grid.appendChild(card)\n\n })\n}", "function createEasyBoard() {\n // Credit for .sort method shuffle: Marina Ferreira\n kittenCardsEasy.sort(() => 0.5 - Math.random());\n easyGameGrid.id = 'easyboard';\n for (let i = 0; i < kittenCardsEasy.length; i++) {\n var easyCard = document.createElement('img');\n easyCard.setAttribute('src', './assets/images/kitten-card-back.png');\n easyCard.setAttribute('data-id', i);\n // Screen Reader text\n easyCard.setAttribute('alt', 'Card back, select to flip over');\n easyCard.classList.add('col-6', 'col-lg-4', 'kittenCard');\n easyCard.addEventListener('click', flipEasyCard);\n easyGameGrid.appendChild(easyCard);\n }\n}", "place() {\n for (let i = 0; i < 7; i++) {\n let slot = `0${i}`;\n let slotElement = document.getElementById(slot);\n slotElement.addEventListener(\"click\", () => {\n //document.getElementById(slot).style.fill = \"ff0000\";\n\n let col = slot.substring(1);\n let piece = new gamePiece(this.playerTurn, col);\n this.drop(piece);\n //this.board.boardArr[row][col] = piece;\n });\n }\n }", "drawBoard() {\n var content = \"\"\n var count = 0\n for (var row = 0; row < this.dim; row++) {\n content += \"<tr>\\n\" \n for (var col = 0; col < this.dim; col++) {\n content += '<td id=\"cell' + count + '\" data-name=\"cell' + count + '\" class=\"' + this.itemClass + '\"></td>\\n'\n count += 1\n } \n content += \"</tr>\\n\" \n }\n $(this.cardId).html(content)\n\n // Bind a change event to each added item\n $(\".\" + this.itemClass).on('click', {client: this}, this.selectItemEvent);\n\n }", "function createCards(colors) {\n let gameBoard = document.getElementById(\"game\");\n\n for (let color of colors) {\n let newDiv = document.createElement(\"div\");\n newDiv.classList.add(`${color}`);\n newDiv.addEventListener(\"click\", function (e) {\n handleCardClick(e);\n });\n gameBoard.append(newDiv);\n }\n}", "function gameBoardSetup(){\n\n\tshuffle(cards);\n\t$(\"#mainBoard\").empty();\n\t$.each(cards, function(i, card){\n\t\t$(\"#mainBoard\").append(\"<div class='card \" + i +\"'><div class='face back'><img src='\" + card.cardImage + \"' id='\" + i + \"'></div><div class='face front'><img src='images/cardBack.png'></div></div>\");\n\t});\n\t$(\".card\").on(\"click\", flipCard);\n\n}", "function newGame() {\n let cardsList = Array.prototype.slice.call(CARDS);\n cardsList = shuffle(cardsList);\n for (var i = 0; i < cardsList.length; i++) {\n DECK.appendChild(cardsList[i])\n //cardsList[i].setAttribute(\"id\", i);\n };\n}", "function makeCard() {\n\n\tlet newLine = \"\\r\\n\"; //make blank line\n\n// create the div\n\tconst div = document.createElement(\"div\");\n\tdiv.className = \"clPanel\";\n\tdiv.id = \"card\"\n\t// + i;\n\tlet card = div.id;\n\tconsole.log(div.id);\n\tconsole.log(card);\n\tdiv.textContent = \"Card \" + i +newLine +newLine;\n\n\t//create a add before button\n\n\tlet btnAddBefore = document.createElement(\"button\");\n\tbtnAddBefore.className =\"buttons\";\n\tbtnAddBefore.textContent =\"Add before\";\n\tbtnAddBefore.addEventListener(\"click\", onAddBefore);\n\n\t//add a button:Add before\n\tdiv.appendChild(btnAddBefore);\n\n\t//create a add after button\n\tlet btnAddAfter = document.createElement(\"button\");\n\tbtnAddAfter.className =\"buttons\";\n\tbtnAddAfter.textContent = \"Add after\";\n\tbtnAddAfter.addEventListener(\"click\", onAddAfter);\n\n\t//add a button:Add after\n\tdiv.appendChild(btnAddAfter);\n\n\t//create a another line break\n\t\n\n\t//create a delete button\n\tlet btnDelete = document.createElement(\"button\");\n\tbtnDelete.className =\"buttons\";\n\tbtnDelete.textContent = \"Delete\";\n\tbtnDelete.addEventListener(\"click\",onDelete);\n\n\t//add a button: delete\n\tdiv.appendChild(btnDelete);\n\n\n\treturn div;\n}", "function addCards() {\n var boardGame = document.getElementById(\"boardGame\");\n for (var i = 0; i < 12; i++) {\n var card = createCard();\n boardGame.appendChild(card);\n }\n}", "function startGame() {\n for (var i = 0; i < letters.length; i++) {\n var div = $('<div>');\n div.attr('id', i);\n div.addClass(\"column\");\n div.appendTo($(\"div#game\"));\n }\n cardClick();\n}", "function newGame() {\r\n let cardsList = Array.prototype.slice.call(CARDS);\r\n cardsList = shuffle(cardsList);\r\n for (var i = 0; i < cardsList.length; i++) {\r\n DECK.appendChild(cardsList[i])\r\n //cardsList[i].setAttribute(\"id\", i);\r\n };\r\n}", "function initGame() {\n // Loop through each card and create its HTML\n for (let i = 0; i < cardsList.length; i++) {\n const card = document.createElement('li');\n // Add each card's HTML to the page\n card.classList.add('card');\n card.innerHTML = `<i class = \"${cardsList[i]}\" ></i>`; \n creation.appendChild(card);\n addClickEevent(card);\n\n } // End for loop\n }", "function buildBoard() {\n //clear game board.\n $('.deck').empty();\n openCards = [];\n\n //initialize counters\n clearTimeout(gameTimer);\n gameTimer = setInterval(onGameTimerCount, 1000);\n moveCount = 0;\n gameTimeCount = 0;\n $('.moves').text(moveCount);\n $('.time').text(\" (0 seconds)\");\n\n //initialize star ratings\n $('#star-3').removeClass('fa-star-o');\n $('#star-3').addClass('fa-star');\n $('#star-2').removeClass('fa-star-o');\n $('#star-2').addClass('fa-star');\n\n //shuffle the list of cards\n shuffle(cards);\n\n //loop through each card and create its HTML\n for (let i = 0; i < cards.length; i++) {\n //add each card's HTML to the page\n $('.deck').append('<li id=\\\"card-' + i + '\\\" class=\\\"card\\\"><figure class=\"back\"></figure><figure class=\\\"front fa ' + cards[i].name + '\\\"></figure>');\n cards[i].id = i;\n }\n\n $('.card').on('click', onCardClicked);\n}", "function initBoard(){\n deckDiv = createCardElement({\"color\":\"black\"});\n pileDiv = createCardElement({\"color\":\"black\"});\n\n boardDiv.append(deckDiv);\n boardDiv.append(pileDiv);\n\n deckDiv.addEventListener(\"click\", drawCard);\n\n /* change color button */\n let colorChooserDiv = document.getElementById('choose-colors');\n for (let child of Array.from(colorChooserDiv.children)) {\n //console.log('child:', child);\n //console.log(child.tagName);\n if (child.tagName == 'BUTTON') {\n //console.log('child:', child);\n child.addEventListener('click', setChosenColor);\n }\n }\n}", "function createBoard(){\n for(let i=0; i<carPic.length;i++){\n let card = document.createElement('img')\n // creating an image tage for each item of carpic array\n card.setAttribute('src','img/bbs.png')\n // adding the src of the image associated with each image\n card.setAttribute('data-id',i)\n // giving an ID to each item of the array\n card.addEventListener('click',cardFlip)\n // each card will flip on click\n table.appendChild(card)\n // adding an image associated with the attributes added to each item of the array\n card.classList.add(\"wheel\")\n // adding a css class of wheel to make it spin\n }\n }", "function cardGenerator(){\n let bingoContainer = document.getElementById('boardContainer')\n \n let cardContainerNode = document.createElement('div')\n\n cardContainerNode.id\n cardContainerNode.classList.add('bingoBoard')\n bingoContainer.appendChild(cardContainerNode)\n\n for (let cardNumber=1; cardNumber<24; cardNumber++){\n let newCardNode = document.createElement('div')\n newCardNode.innerText= randomNumber() //change after to random number\n newCardNode.id= cardNumber\n newCardNode.classList.add('numberSpot')\n\n \n cardContainerNode.appendChild(newCardNode)\n\n \n\n }\n\n selectCell ()\n}", "function startGame() {\n var game = $(\"#game\")\n for(var i=0; i<letters.length; i++){\n var mydiv = $(document.createElement(\"div\"));\n mydiv.addClass(\"column\");\n mydiv.attr('id', i); \n mydiv.on(\"click\", cardClick);\n game.append(mydiv);\n }\n var scorediv = $(document.createElement(\"div\"));\n scorediv.attr('id', \"score\");\n scorediv.html(guessCounter);\n scorediv.addClass(\"column\");\n var footer = $(\"#footer\");\n footer.append(scorediv);\n}", "function buildBoard$$1() {\n // Variables\n const cardsArray = [];\n\n // Creating cards\n for (let i = 0; i < cards$$1/2; i++) {\n for (let j = 0; j < 2; j++) {\n const card = `\n <div class=\"flip-card\">\n <div class=\"flip-card-inner\">\n <div class=\"flip-card-front\">\n <img src=\"images/card-${i}.jpg\">\n </div>\n <div class=\"flip-card-back\">\n <img src=\"images/back.jpg\">\n </div>\n </div>\n </div>`;\n cardsArray.push(card);\n }\n }\n\n // Shuffeling cards\n cardsArray.sort(function() {\n return 0.5 - Math.random();\n });\n\n // Adding cards to board\n for (let i = 0; i < cardsArray.length; i++) {\n $(board$$1).prepend(cardsArray[i]);\n }\n\n // Adding board to DOM\n $('#wrapper').prepend(board$$1);\n\n // Click event for the cards\n $('.flip-card').click(function(e) {\n cardClick(e);\n });\n }", "function displayBoard () {\n document.getElementById('setBoard').innerHTML = '';\n let cardTableRow = document.createElement('TR');\n for (let j = 0; j < board.length; j++) {\n const cardTableEntry = document.createElement('TD');\n cardTableEntry.className = 'cardTableEntry';\n const card = board[j];\n const cardPic = document.createElement('img');\n cardTableEntry.onclick = () => userClickEvent(cardPic);\n cardPic.src = '../pictures/SET/' + card.number + '-' + card.fill + '-' + card.color + '-' + card.shape + '.png';\n cardPic.alt = card.number + ' ' + card.fill + ' ' + card.color + ' ' + card.shape;\n cardPic.className = 'card';\n cardPic.style.display = 'block';\n cardTableEntry.appendChild(cardPic);\n cardTableRow.appendChild(cardTableEntry);\n\n // Start a new row after 6 cards have been placed\n if ((j + 1) % 6 === 0) {\n document.getElementById('setBoard').appendChild(cardTableRow);\n cardTableRow = document.createElement('TR');\n }\n }\n document.getElementById('setBoard').appendChild(cardTableRow);\n}", "function newAdvBoard(){\n\t//tiles flipped set to 0 each time a new board is generated\n\tadv_tiles_flipped = 0;\n\tvar adv_output = '';\n\t//runs the shuffle method on the memory array\n\tadv_memory_array.adv_memory_tile_shuffle();\n\t//loops over all the cards and adds all the divs to the output variable. Each div receives an id of dynamic tile number\n\tfor(var i = 0; i < adv_memory_array.length; i++){\n\t\tadv_output += '<div id = \"adv_tile_ ' + i + '\" onclick = \"advMemoryFlipTile(this,\\'' + adv_memory_array[i] + '\\')\"></div>';\n\t}\n\tdocument.getElementById('adv_memory_board').innerHTML = adv_output;\n}", "createGameBoard() {\n function tileClickHandler() {\n const row = parseInt(this.id.split('_')[1][0], 10);\n const col = parseInt(this.id.split('_')[1][1], 10);\n if (!player.getCurrentTurn() || !game) {\n alert('Its not your turn!');\n return;\n }\n\n if ($(this).prop('disabled')) {\n alert('This tile has already been played on!');\n return;\n }\n // Update board after your turn.\n game.playTurn(this);\n game.updateBoard(player.getPlayerType(), row, col, this.id);\n\n player.setCurrentTurn(false);\n player.updatePlaysArr(1 << ((row * 3) + col));\n\n game.checkWinner();\n }\n for (let i = 0; i < 3; i++) {\n this.board.push(['', '', '']);\n for (let j = 0; j < 3; j++) {\n $(`#button_${i}${j}`).on('click', tileClickHandler);\n }\n }\n }", "function createCards(colors) {\n const gameBoard = document.getElementById(\"game\");\n\n for (let color of colors) {\n let currClass = \"\" + color;\n let currDiv = document.createElement(\"div\");\n currDiv.className = currClass;\n currDiv.addEventListener(\"click\", handleCardClick);\n gameBoard.appendChild(currDiv);\n }\n}", "function createBoard(){\n flip_cards = 0;\n moves = 0;\n startTime();\n //document.getElementById(\"myMoves\").innerHTML = \"0\";\n //document.getElementById(\"gameTime\").innerHTML = \"00:00\";\n var output = '';\n card_arrays.deck_shuffle();\n for(var i = 0; i < card_arrays.length; i++){\n output += '<div id=\"deck_'+i+'\" onclick=\"flipThatCard(this,\\''+card_arrays[i]+'\\')\"></div>';\n }\n\n document.getElementById('deck_cards').innerHTML = output;\n\n}", "addClickEvents() {\n $('#card-0').on('click', () => game.cardClickEvent(0));\n $('#card-1').on('click', () => game.cardClickEvent(1));\n $('#card-2').on('click', () => game.cardClickEvent(2));\n $('#card-3').on('click', () => game.cardClickEvent(3));\n }", "function makeCards() {\n let shuffledArray = shuffle(arrayClassNames);\n\n deck.innerHTML = \"\";\n for (let x = 0; x < shuffledArray.length; x++) {\n const newCard = document.createElement('li');\n const newIcon = document.createElement('i');\n newCard.cover = shuffledArray[x];\n newCard.classList.add('card');\n newIcon.classList.add('fa');\n newIcon.classList = shuffledArray[x];\n const newDeck = document.querySelector('.deck');\n newDeck.appendChild(newCard);\n newCard.appendChild(newIcon);\n newCard.addEventListener('click', checkCard);\n }\n}", "function newGame() {\n\n // Don't generate if there already is a game\n if (gameStarted)\n return;\n\n cards.shuffle();\n flipped = 0;\n\n // Clear board if its filled already\n clearBoard();\n\n for (let i = 0; i < cards.length; i++) {\n\n // first create new li\n const cardLi = document.createElement('li');\n cardLi.classList.add('tileboard');\n\n // create the card class\n const card = document.createElement('div');\n card.classList.add('card'); // Assign className to new element\n card.classList.add(`tile_${i}`); // set identifier for card\n\n // the clickSelector\n card.setAttribute('onclick', `flipTile(this, ${cards[i]})`);\n\n // append card to Li, and then that to the board\n cardLi.appendChild(card);\n board.appendChild(cardLi);\n }\n\n gameStarted = true;\n}", "function startGame() {\n const shuffledPics = shuffle(pics);\n for(let i = 0; i < pics.length; i++) {\n const card = document.createElement(\"li\");\n card.classList.add(\"card\");\n card.innerHTML = `<i class=\"${pics[i]}\"></i>`;\n cardsContainer.appendChild(card);\n // Call the click function\n click(card);\n }\n}", "function createBoard(){ \r\n let index = 1;\r\n for(let r = 0; r < 3; r++){ // rows\r\n const newRow = gameBoard.insertRow(r);\r\n\r\n for(let c = 0; c < 3; c++){ // columns\r\n const newBox = newRow.insertCell(c)\r\n newBox.className = \"box\"+index; // specify class names to define styles in css for the game board\r\n newBox.addEventListener(\"click\", playerMove, {once: true});\r\n index++;\r\n }\r\n }\r\n}", "function initEventListener(tauler){\n document.getElementById(\"gameDisplay\").innerHTML = tauler.printHTML();\n let elements = document.getElementsByClassName(\"mob\");\n for(let i = 0; i < elements.length; i++){\n elements[i].classList.add(clase);\n }\n\n elements = document.getElementsByClassName(\"board\");\n for(let i = 0; i < elements.length; i++){\n //console.log(elements[i]);\n elements[i].addEventListener(\"click\", function(event){\n let x = event.currentTarget.id.split(\",\")[0];\n let y = event.currentTarget.id.split(\",\")[1]\n cercarObj(Number.parseInt(x) + 1,Number.parseInt(y)+1);\n });\n }\n}", "function turnAround(){\n // We want to make cards clickable again\n list.addEventListener(\"click\", clickedCard);\n document.getElementById(cardsId[0]).style.backgroundColor = \"#ffffff\";\n document.getElementById(cardsId[1]).style.backgroundColor = \"#ffffff\";\n\n //Empty comparison arrays\n cardsTurned = [];\n cardsId = [];\n}", "function createDeck()\n{\n cardsArr.sort(() => 0.5 - Math.random());\n for(let i =0; i < cardsArr.length; i++)\n {\n let cards = document.createElement(\"img\");\n cards.setAttribute(\"src\", \"/images/default.png\");\n cards.classList.add(\"back\");\n cards.setAttribute(\"data-id\",i);\n cards.addEventListener(\"click\",flipped);\n display.appendChild(cards);\n \n \n }\n currentPlayer.push(playerName.value);\n \n \n}", "function game (){\n $( \".card\" ).on( \"click\", function() {\n $( this ).addClass(\"open\");\n openCards.push( $( this ));\n puntua();\n allAction();\n complete();\n });\n}", "function displayCards() {\n // aus HTML wird card-container in cardContainerDiv gespeichert\n let cardContainerDiv = document.getElementById(\"card-container\");\n // Geht jede Karten auf der Spielfläche durch und stellt sie dann dar\n for (let i = 0; i < cardPool.length; i++) {\n // ein neues div wird erstellt und in cardDiv gespeichert\n let cardDiv = document.createElement(\"div\");\n // für css zum gestalten\n cardDiv.setAttribute(\"class\", \"card-div\");\n // neues img element wird erstellt und in cardImg gespeichert\n let cardImg = document.createElement(\"img\");\n // Das Sakura Bild (Kartenrückseite) wird dem cardImg zugewiesen\n cardImg.src = \"./pictures/ui/sakura.png\";\n // --Jede Rückseite bekommen verschiedene id's || warum i? Damit das onCardClick() weiß an welcher Position die Karte im cardPool array war\n cardImg.setAttribute(\"id\", i.toString());\n // für css\n cardImg.setAttribute(\"class\", \"card-image\");\n // beim klicken wird onCardClick() aufgerufen\n cardImg.addEventListener(\"click\", onCardClick);\n // cardImg ist ein Unterelement von cardDiv\n cardDiv.appendChild(cardImg);\n // cardDiv ist ein Unterelement von cardContainerDiv\n cardContainerDiv.appendChild(cardDiv);\n }\n }", "function gameBoardSetup(){\n\n\tshuffle(cards);\n\t$(\"#mainBoard\").empty();\n\t$.each(cards, function(i, card){\n\t\t$(\"#mainBoard\").append(\"<img src='images/cardBack.png' id='\"+i+\"'>\");\n\t});\n\t$(\"img\").on(\"click\", flipCard);\n\n}", "function board(cards_list, nb_card, column){\n var table = document.getElementById('game')\n var card_shuffle = shuffle(cards_list);\n\n for(var i = 0; i < nb_card; i++){\n var td = document.createElement('td')\n var img = document.createElement('img')\n\n if(!(i % column)){\n var tr = document.createElement('tr')\n table.appendChild(tr)\n }\n\n img.src = \"cards/card.png\"\n img.setAttribute('class', 'card-class')\n img.setAttribute('id', card_shuffle[i].id)\n\n tr.appendChild(td)\n td.appendChild(img)\n }\n\n var cards = document.querySelectorAll('.card-class');\n\n cards.forEach(cards => {\n cards.addEventListener('click', function(){\n flipCard(this, cards_list);\n this.classList.add('disable')\n checkEnd(cards_list)\n })\n });\n}", "function createCards(colors) {\n const gameBoard = document.getElementById(\"game\");\n\n\n for (let color of colors) {\n const card = document.createElement(\"div\");\n card.className = \"card-container\";\n card.value = color;\n card.innerHTML = '<div class=\"card-elements\" name=\"' + color + '\"><div class=\"card-back\" value=\"' + color + '\"></div><div id=\"card-front\" class=\"' + color + ' card-front\" value=\"' + color + '\"></div></div>';\n card.addEventListener(\"click\", handleCardClick);\n gameBoard.appendChild(card);\n }\n}", "function init() {\n canvas = $(\"#board\").get(0);\n ctx = canvas.getContext(\"2d\");\n boardDiv = $(\"#div_game\");\n\n for (let color of [cRed, cGreen, cPurple]) {\n for (let shape of [sDiamond, sWave, sOval]) {\n for (let fill of [fEmpty, fPartial, fSolid]) {\n for (let count of [1, 2, 3]) {\n //console.log(count + \" \" + color + \" \" + fill + \" \" + shape);\n board.deck.push({color: color, shape: shape, fill: fill, count: count});\n }\n }\n }\n }\n shuffle(board.deck);\n\n while (board.inPlayMain.length < 12) {\n board.inPlayMain.push(board.deck.pop());\n console.log(\"Board now has \" + board.inPlayMain.length + \" inPlayMain\");\n }\n\n if (!isSetAvailable()) {\n needExtraCards();\n }\n\n resizedWindow();\n drawBoard();\n\n //canvas.onclick = clickedBoard;\n}", "function initBoards() {\n let boardIds = [\"playerboard\", \"enemyboard\"]\n let rows = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'];\n // init grey spaces\n for (let boardId of boardIds) {\n let board = document.getElementById(boardId);\n let id = boardId[0];\n for (let row of rows) {\n for (let col = 0; col < 10; col++) {\n let div = document.createElement(\"div\");\n div.id = `${id}${row}${col}`;\n div.className = \"opaque\";\n if (boardId === \"enemyboard\") {\n div.onclick = () => handleBoardClick(div.id);\n }\n board.appendChild(div);\n }\n }\n }\n}", "function cardListener() {\n const cards = document.getElementsByClassName('card');\n for (let i = 0; i < 12; i = i + 1) {\n cards[i].addEventListener('click', function () { generateModal(i) });\n }\n}", "function drawBoard(size) {\n var parent = document.getElementById(\"game\");\n var table = document.createElement('table'); // create table\n table.id='board';\n var counter = 1;\n\n for (let i = 0; i < size; i++)\n {\n var row = document.createElement(\"tr\"); // create rows\n\n for(let x = 0; x < size; x++)\n {\n var col = document.createElement(\"td\"); // create columns\n col.innerHTML = \"\";\n col.id = counter; // the counter will go from 1 to 9, giving each cell its own id\n counter += 1;\n row.appendChild(col); // append columns as children of rows\n }\n table.appendChild(row); // append rows as children of table \n } \n parent.appendChild(table); // append table as child of main div\n var btn = document.createElement('button');\n btn.innerHTML = 'Play Again';\n parent.appendChild(btn); // append Play Again button as child of main div\n var sCode = document.createElement('p');\n sCode.innerHTML = '[ <a href=\"https://github.com/mariobox/tic-tac-toe\">Source Code</a> ]';\n parent.appendChild(sCode); // append link to source code as child of main div\n \n}", "newGame(cardsArray, startTime) {\n const startScreen = document.querySelector('.main__start-screen');\n const winScreen = document.querySelector('.main__win-screen');\n const fragment = document.createDocumentFragment();\n\n if (!document.querySelector('.main__controls')) {\n const resetGameButton = this.createElement(\n 'span',\n { className: 'controls__new-game', dataTid: 'Menu-newGame' },\n 'Начать заново',\n );\n const scoreTitle = this.createElement(\n 'span',\n { className: 'controls__title' },\n 'Очки: ',\n );\n const score = this.createElement(\n 'span',\n { className: 'controls__score', dataTid: 'Menu-scores' },\n );\n const scoreWrapper = this.createElement(\n 'div',\n { className: 'controls__wrapper' },\n scoreTitle,\n score,\n );\n const controls = this.createElement(\n 'section',\n { className: 'main__controls' },\n resetGameButton,\n scoreWrapper,\n );\n\n resetGameButton.addEventListener('click', controller.resetGame);\n fragment.appendChild(controls);\n }\n\n if (startScreen) startScreen.remove();\n if (winScreen) winScreen.remove();\n\n const mainCardsGrid = this.createElement(\n 'div',\n { className: 'main__cards-grid', dataTid: 'Deck' },\n );\n cardsArray.forEach((card) => {\n const tempCard = this.addCard(card.dataId, card.alt, card.src);\n\n mainCardsGrid.appendChild(tempCard);\n });\n const mainCards = this.createElement(\n 'section',\n { className: 'main__cards' },\n mainCardsGrid,\n );\n\n fragment.appendChild(mainCards);\n mainBoard.appendChild(fragment);\n scoreSpan = document.querySelector('.controls__score');\n\n // Show all cards at the start of every new game\n // Add click event listeners to every card\n document.querySelectorAll('.main__card').forEach((card) => {\n card.addEventListener('click', controller.onCardClick);\n\n setTimeout(() => {\n card.classList.add('card__flipped');\n setTimeout(() => {\n card.classList.remove('card__flipped');\n }, startTime);\n }, 100);\n });\n\n // Play audio on opening all of the cards\n this.cardFlipAudio();\n setTimeout(() => {\n this.cardFlipAudio();\n }, startTime);\n }", "function gameStart(){\n shuffleCards ();\n for (let i = 0; i < 16; i++) {\n let cards = document.createElement('li');\n cards.classList.add('card');\n\n// Declare the variable to create the symbols within the card, and create the card to be used\n let symbolList = document.createElement('i');\n symbolList.classList.add('fa');\n symbolList.classList.add(symbols[i]);\n\n listofCards.appendChild(symbolList);\n\n // move the card to the deck to be showed to the user\n cards.appendChild(symbolList);\n\t\tdocument.getElementById('deck').appendChild(cards);\n\n // the selecting of each card by a click\n select(cards);\n }\n}", "createTiles(clickHandler){\n //Create tiles in the DOM\n for (let i = 0; i < 15; i++) {\n for (let j = 0; j < 14; j++) {\n $('.center').append(`<button class=\"tile\" id=\"button_${i}_${j}\"></button>`)\n }\n $('.center').append(`<button class=\"tile\" id=\"button_${i}_14\" style=\"float:none;\"/>`);\n }\n\n //Attach click listener to tiles\n for (let i = 0; i < 15; i++) {\n this.board.push(['']);\n for (let j = 0; j < 15; j++) {\n $(`#button_${i}_${j}`).on('click', clickHandler);\n }\n }\n }", "function addEvents(){\n for(let i=0; i<cards.length;i++)\n cards[i].addEventListener('click',whenClicked);\n}", "function clickedEl(event) {\n //while (board != null) {\n \n if (event.target.id === 'board0') {\n index = 0;\n }\n else if (event.target.id === 'board1') {\n index = 1;\n }\n else if (event.target.id === 'board2') {\n index = 2;\n }\n else if (event.target.id === 'board3') {\n index = 3;\n }\n else if (event.target.id === 'board4') {\n index = 4;\n }\n else if (event.target.id === 'board5') {\n index = 5;\n }\n else if (event.target.id === 'board6') {\n index = 6;\n }\n else if (event.target.id === 'board7') {\n index = 7;\n }\n else if (event.target.id === 'board8') {\n index = 8;\n }\n }", "function createCards(list, isTop, el) {\n if(!isTop) {\n for(let i = 0; i < list.length; i++) {\n let cardCol = document.createElement('div');\n let animeCard = document.createElement('div');\n let animeImg = document.createElement('img');\n let animeTitle = document.createElement('h4');\n let animeInfo = document.createElement('div');\n let animeBody = document.createElement('p');\n let addBtn = document.createElement('button');\n let moreInfoBtn = document.createElement('button');\n let malURL = document.createElement('a');\n let animeBodyInfo = '<ul><li> Rated: '+ list[i].rated + '</li> <li> Episodes: '+list[i].episodes.toString() + '</li> <li>Score: '+list[i].score.toString() +'</li></ul>';\n $(cardCol).addClass('column my-4');\n $(animeImg).attr('src', list[i].image_url);\n $(animeImg).addClass('anime-img');\n $(malURL).attr('href', list[i].url);\n $(malURL).addClass('mal-url');\n $(malURL).text(list[i].url);\n $(malURL).hide();\n $(animeTitle).text(list[i].title);\n $(animeTitle).addClass('panel-title');\n $(animeCard).addClass('panel id-'+i.toString());\n $(animeCard).css('background-image', 'url('+list[i].image_url+')');\n $(animeCard).append(animeImg);\n $(animeImg).hide();\n //$(animeImg.).addClass('card-img');\n $(animeInfo).addClass('panel-content');\n $(animeBody).addClass('panel-body');\n $(addBtn).addClass('panel-btn');\n $(moreInfoBtn).addClass('panel-btn-info');\n $(addBtn).text('Add to List');\n $(moreInfoBtn).text('More Info');\n $(animeBody).html(animeBodyInfo);\n $(animeInfo).append(animeTitle);\n $(animeInfo).append(animeBody);\n $(animeInfo).append(addBtn);\n $(animeInfo).append(moreInfoBtn);\n $(animeCard).append(animeImg);\n $(animeCard).append(malURL);\n //$(animeCard).append(animeTitle);\n $(animeCard).append(animeInfo);\n $(cardCol).append(animeCard);\n $(el).append(cardCol);\n \n }\n }else {\n for(let i = 0; i < list.length; i++) {\n let cardCol = document.createElement('div');\n let animeCard = document.createElement('div');\n let animeImg = document.createElement('img');\n let animeTitle = document.createElement('h4');\n let animeInfo = document.createElement('div');\n let animeBody = document.createElement('p');\n let addBtn = document.createElement('button');\n let moreInfoBtn = document.createElement('button');\n let malURL = document.createElement('a');\n let animeBodyInfo = '<ul> <li>Episodes: '+list[i].episodes+\n '</li> <li>Rank: '+list[i].rank.toString()+'</li> <li>Score: '+list[i].score.toString()+\n '</li></ul>';\n $(cardCol).addClass('column my-4');\n $(animeImg).attr('src', list[i].image_url);\n $(animeImg).addClass('anime-img');\n $(malURL).attr('href', list[i].url);\n $(malURL).addClass('mal-url');\n $(malURL).text(list[i].url);\n $(malURL).hide();\n $(animeTitle).text(list[i].title);\n $(animeTitle).addClass('panel-title');\n $(animeCard).addClass('panel id-'+i.toString());\n $(animeCard).css('background-image', 'url('+list[i].image_url+')')\n $(animeCard).append(animeImg);\n $(animeImg).hide();\n //$(animeImg).addClass('card-img');\n $(animeInfo).addClass('panel-content');\n $(animeBody).addClass('panel-body');\n $(addBtn).addClass('panel-btn');\n $(moreInfoBtn).addClass('panel-btn-info');\n $(addBtn).text('Add to List');\n $(moreInfoBtn).text('More Info');\n $(animeBody).html(animeBodyInfo);\n $(animeInfo).append(animeTitle);\n $(animeInfo).append(animeBody);\n $(animeInfo).append(addBtn);\n $(animeInfo).append(moreInfoBtn);\n $(animeCard).append(animeImg);\n $(animeCard).append(malURL);\n //$(animeCard).append(animeTitle);\n $(animeCard).append(animeInfo);\n $(cardCol).append(animeCard);\n $(el).append(cardCol);\n }\n }\n}", "function createCards(cardType) {\n let i = createNewElement('i', cardType);\n let li = createNewElement('li', 'card');\n li.appendChild(i);\n li.addEventListener('click', listener, false);\n document.getElementsByClassName('deck')[0].appendChild(li);\n}", "buildBoard() {\n // As the ids are declared explicitly, this class is tied to this specific HTML doc\n $(\"#game-board\").empty()\n $(\"#variable-title\").append($(\"<button>\").addClass(\"btn btn-danger\").attr(\"id\", \"end-button\").text(\"End Game\"));\n for (let i = 1; i <= this.board.length; i++) {\n let box = $(\"<div>\").addClass(\"board-box\").attr(\"id\", `box-${i}`).attr(\"data-index\", i - 1);\n let play = $(\"<h1>\").addClass(\"play center\").text(this.board[i - 1]);\n box.append(play);\n $(\"#game-board\").append(box)\n }\n }", "function addClickListeners() {\n var cardContainer = document.getElementById(\"card-container\");\n cardContainer.addEventListener('click', function(event) {\n var clickedId = event.target.id;\n // if name, display name\n if (clickedId == \"name-overlay\")\n displayNameFromCard(currentCard);\n // if mana cost, display mana_cost\n if (clickedId == \"mana-overlay\")\n displayManaFromCard(currentCard);\n // if creature type, display creature type\n if (clickedId == \"type-overlay\")\n displayTypeFromCard(currentCard);\n // if set symbol, display set symbol\n if (clickedId == \"set-symbol-overlay\")\n displaySetFromCard(currentCard);\n // if text box, display text box\n if (clickedId == \"text-box-overlay\")\n displayAbilitiesFromCard(currentCard);\n // if power/toughness, display power/toughness\n if (clickedId == \"power-toughness-overlay\")\n displayPTFromCard(currentCard);\n // if artist, display artist\n if (clickedId == \"artist-overlay\")\n displayArtistFromCard(currentCard);\n // if art is clicked, display artist\n if (clickedId == \"art-overlay\")\n displayArtistFromCard(currentCard);\n document.getElementById(\"card-exp\").scrollIntoView({block: \"end\", behaviour: \"smooth\"});\n });\n}", "function createCards(colors) {\n const gameBoard = document.getElementById(\"game\");\n\n for (let color of colors) {\n var card = document.createElement(\"div\");\n // card.style.backgroundColor = \"black\"\n card.classList = \"card\"\n card.setAttribute(\"data-color\", [color]);\n card.addEventListener(\"click\", handleCardClick);\n\n gameBoard.appendChild(card);\n }\n}", "function putCardsOnTable() {\n let BUTTON = document.createElement(\"button\");\n BUTTON.classList.add(\"btn\");\n INTERACTIONS.appendChild(BUTTON);\n BUTTON.innerHTML = \"Get Cards\";\n BUTTON.addEventListener(\"click\", event => {\n event.preventDefault();\n for (let i = 0; i < DECK; i++) {\n cards.push(getCard());\n }\n drawCards(cards);\n });\n}", "function createCards() {\n // Creates the backs of each card and sets the id of each\n let back = document.createElement('div');\n back.className = 'back';\n backs = [];\n\t\n for (i = 0; i <= 3; i++) {\n backs.push(back.cloneNode());\n backs[i].setAttribute('id', `large${i+1}`);\n }\n for (i = 0; i <= 19; i++) {\n backs.push(back.cloneNode());\n backs[i + 4].setAttribute('id', `small${i+1}`);\n }\n\n // Creates the front face and each card container template\n let front = document.createElement('div');\n front.className = 'front';\n\n card.className = 'card available';\n card.appendChild(front.cloneNode());\n\n // Iterates each card and then appends the appropriate card back\n for (i = 0; i <= 23; i++) {\n cards.push(card.cloneNode());\n cards[i].appendChild(backs[i]);\n }\n\n // Creates the card containers and appends the correct cards to them\n let largeContainer = document.createElement('div');\n largeContainer.setAttribute('id', 'large-cards');\n\n let smallContainer = document.createElement('div');\n smallContainer.setAttribute('id', 'small-cards');\n\n for (i = 0; i <= 3; i++) {\n largeContainer.appendChild(cards[i]);\n }\n\n for (i = 0; i <= 19; i++) {\n smallContainer.appendChild(cards[i + 4]);\n }\n\n inputContainer.appendChild(largeContainer);\n inputContainer.appendChild(smallContainer);\n\n assignLarge();\n assignSmall();\n addCardListeners();\n}", "function startGame() {\n createButtons();\n const cards = createCardsArray();\n appendCardsToDom(cards);\n}", "function startGame() {\n\n\t// Duplication of the array.\n\tconst dubCards = card.slice();\n\tconst cards = card.concat(dubCards);\n\n\tcards.sort(() => 0.5 - Math.random());\n\n\tcreateCards(cards);\n\n\tconst cardsDiv = document.querySelectorAll('.card');\n\tcardsDiv.forEach(card => card.addEventListener('click', flipCard));\n\n}", "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 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 cardClick() {\n cards = document.querySelectorAll('.card');\n for (let i = 0; i < cards.length; i++) {\n cards[i].addEventListener('click', () => createModal(people[i]));\n }\n}", "function setupNewGame() {\n var divAllCards = document.getElementsByClassName(\"allCards\")[0];\n var divCard, imgCard, divCounter, textCounter;\n for (var i = 0; i < gifs.length; i++) {\n divCard = document.createElement(\"div\");\n imgCard = document.createElement(\"img\");\n divCard.className = \"card\";\n imgCard.className = \"cardImg\";\n imgCard.id = \"card\" + i;\n imgCard.src = backOfCard;\n imgCard.setAttribute(\"data-matched\", false);\n imgCard.addEventListener(\"click\", cardClick);\n divCard.appendChild(imgCard);\n divAllCards.appendChild(divCard);\n }\n // add the counter in the middle\n var allCards = document.getElementsByClassName(\"card\");\n divCounter = document.createElement(\"div\");\n divCounter.className = \"counter\";\n textCounter = document.createTextNode(totalCardsShown);\n divCounter.appendChild(textCounter);\n divAllCards.insertBefore(divCounter, allCards[numOfUniqueCards]);\n}", "function setNewCards() {\n\tcardList = shuffle(cardList);\n\tfor (let i = 0; i < cardList.length; i++) {\n\t\tcardList[i].classList.remove('match', 'open', 'show');\n\t\tcardList[i].addEventListener('click', turnCard);\n\t\tmyDeck.appendChild(cardList[i]);\n\t}\n}", "function giveCards(handsize) {\n htmlHands = document.querySelectorAll(\".hand\");\n htmlHands.forEach(player => player.innerHTML = \"\");\n\n //console.log(htmlPlayer);\n\n let j = 0; //index of remainingcards\n let k = 0; //index of board.players\n\n htmlHands.forEach(player => {\n createHtmlRoles(k, rolescard, player);\n board.players[k].hand = []; //reset player hand\n htmlPlayerInfos[k].innerText = \"\"; //reset player infos\n\n for (let i = 0; i < handsize; i++) {\n createHtmlCard(board.remainingCards[j], player);\n board.players[k].hand.push(board.remainingCards[j]);\n j++;\n }\n htmlPlayerInfos[k].innerText = `${board.players[k].name} => Number of wire : ${board.players[k].hand.filter(card => card.isWire).length} - Bomb ? ${board.players[k].hand.filter(card => card.isBomb).length === 1 ? \"YES!\" : \"NO!\"}`;\n k++;\n });\n\n\n\n htmlCards.forEach(card => card.onclick = cardClickHandler);\n}", "create(){\n let initial_x_pos = 150;\n let initial_y_pos = 120;\n \n // make a shuffle\n this.postionValue();\n\n // asociate card images, positions and listeners\n for(let i=0; i<this.cardValues.length; i++){\n // dynamic name asociation\n let cardname = `card${this.cardPositions[i]}`;\n // put a second line of cards\n if(i==5) initial_x_pos = 150;\n if(i>4) initial_y_pos = 320;\n // relate the image, the card and the backcard with same index\n let card=this.add.image(initial_x_pos, initial_y_pos, cardname);\n let backCard = this.add.image(initial_x_pos, initial_y_pos, 'back-card');\n backCard.index=i;\n card.index=i;\n // move and point to the next postion\n initial_x_pos+=130;\n // set the scale of the cards (images are too big)\n card.setScale(0.18);\n backCard.setScale(0.18);\n // hide the value cards\n card.visible = false;\n // set the backcard image interactive (add a listener)\n backCard.setInteractive();\n // add the cards to arrays to have 2 arrays of cars\n this.backCardArray.push(backCard);\n this.cardArray.push(card);\n }\n // relate the onclick with the custom handler\n this.input.on('gameobjectdown', this.onClickCard.bind(this));\n }", "function makeHtmlBoard() {\n let htmlBoard = document.getElementById('board');\n htmlBoard.innerHTML = '';\n // This code blocks creates a top row assigns it an id of \"column-top\" and assigns a click handler to it\n // Then the code creates a series of cells with an id that corresponds to the column count (left to right)\n let top = document.createElement(\"tr\");\n top.setAttribute(\"id\", \"column-top\");\n top.addEventListener(\"click\", handleClick);\n\n\n for (let x = 0; x < WIDTH; x++) {\n let headCell = document.createElement(\"td\");\n headCell.setAttribute(\"id\", x);\n top.append(headCell);\n }\n htmlBoard.append(top);\n\n // This code creates the rest of the game board. The area that game pieces are placed in\n for (let y = 1; y <= HEIGHT; y++) {\n const row = document.createElement(\"tr\");\n for (let x = 0; x < WIDTH; x++) {\n const cell = document.createElement(\"td\");\n cell.setAttribute(\"id\", `${x}-${HEIGHT - y}`);\n row.append(cell);\n }\n htmlBoard.append(row);\n }\n}", "function newGame() {\n\tconst randomCards = shuffle(cardDeck);\n\tfor(randomCard of randomCards){\n\t\tgameBoard.appendChild(randomCard);\n\t\trandomCard.classList.remove('open','show','match');\n\t\trandomCard.addEventListener('click', cardClick);\n\t}\n\tmoves = 0;\n\tmatches = 0;\n\tseconds = 0;\n\tminutes = 0;\n}", "makeHtmlBoard() {\n const board = document.getElementById('board');\n board.innerHTML = '';\n\n // make column tops (clickable area for adding a piece to that column)\n const top = document.createElement('tr');\n top.setAttribute('id', 'column-top');\n\n // store a reference to the handleClick bound function \n // so that we can remove the event listener correctly later\n this.handleGameClick = this.handleClick.bind(this);\n \n top.addEventListener(\"click\", this.handleGameClick);\n\n for (let x = 0; x < this.width; x++) {\n const headCell = document.createElement('td');\n headCell.setAttribute('id', x);\n top.append(headCell);\n }\n\n board.append(top);\n\n // make main part of board\n for (let y = 0; y < this.height; y++) {\n const row = document.createElement('tr');\n \n for (let x = 0; x < this.width; x++) {\n const cell = document.createElement('td');\n cell.setAttribute('id', `${y}-${x}`);\n row.append(cell);\n }\n \n board.append(row);\n }\n }", "function makeHtmlBoard() {\n // TODO: get \"htmlBoard\" variable from the item in HTML w/ID of \"board\"\n let htmlBoard = document.querySelector('#board');\n\n // TODO: add comment for this code\n // generate top row that user will select move on\n let top = document.createElement(\"tr\");\n \n // addid to element + add event to same element\n top.setAttribute(\"id\", \"column-top\");\n top.addEventListener(\"click\", handleClick);\n\n // TODO: add comment for this code\n // using 'top' variable append a table data element 'width' amount of times\n for (let x = 0; x < WIDTH; x++) {\n //define data cell\n let headCell = document.createElement(\"td\");\n\n // apply id to data cell\n headCell.setAttribute(\"id\", x);\n\n //append data cell to 'top' row\n top.append(headCell);\n }\n // append this row to the DOM\n htmlBoard.append(top);\n\n // dynamically creates the main part of html board\n // uses HEIGHT to create table rows\n // uses WIDTH to create table cells for each row\n for (let y = 0; y < HEIGHT; y++) {\n // TODO: Create a table row element and assign to a \"row\" variable\n // generate row \n let gameRow = document.createElement(\"tr\");\n\n for (let x = 0; x < WIDTH; x++) {\n // TODO: Create a table cell element and assign to a \"cell\" variable\n // generate gameCell\n let gameCell = document.createElement('td');\n \n // TODO: add an id, y-x, to the above table cell element\n // you'll use this later, so make sure you use y-x\n gameCell.setAttribute(\"id\", `${y}-${x}`);// check\n\n // TODO: append the table cell to the table row\n gameRow.append(gameCell);\n }\n // TODO: append the row to the html board\n htmlBoard.append(gameRow)\n }\n \n\n}", "function newGame() {\n // Don't generate if there already is a game\n if (gameStarted) {\n return;\n }\n\n cards.shuffle();\n flipped = 0;\n\n // Clear board if its filled already\n clearBoard();\n\n for (let i = 0; i < cards.length; i++) {\n // Create new li\n const cardLi = document.createElement('li');\n cardLi.classList.add('tileboard');\n\n // Create the card class\n const card = document.createElement('div');\n card.classList.add('card'); // Assign className to new element\n card.classList.add(`tile_${i}`); // set identifier for card\n card.setAttribute('onclick', `flipTile(this, ${cards[i]})`);\n\n // Append card to Li, and then that to the board\n cardLi.appendChild(card);\n board.appendChild(cardLi);\n }\n gameStarted = true;\n}", "buildDeck(cardKeysShuffled) {\n // removing deck if any\n const deck = document.querySelector(\"#deck\");\n if (deck) {\n deck.removeEventListener('click', Board.onClick);\n deck.remove();\n }\n\n // build deck\n const fragment = document.createDocumentFragment();\n const ul = document.createElement('ul');\n ul.id = ul.className = 'deck';\n ul.addEventListener(\"click\", Board.onClick);\n fragment.appendChild(ul);\n\n // building cards\n for (const cardKey of cardKeysShuffled) {\n const li = document.createElement('li');\n const i = document.createElement('i');\n li.className = `card`;\n li.id = this.cardMap[cardKey].getUid();\n i.className = `fa ${this.cardMap[cardKey].getHtmlClass()}`;\n li.appendChild(i);\n ul.appendChild(li);\n }\n\n // inserting deck into DOM\n document.querySelector('#game').appendChild(fragment);\n }", "function newBoard() {\n tiles_flipped = 0;\n var output = \"\";\n memory_array.memory_tile_shuffle();\n for (var i = 0; i < memory_array.length; i++) {\n output +=\n '<div id = \"tile_' +\n i +\n '\" onclick=\"memoryFlipTile(this,\\'' +\n memory_array[i] +\n \"')\\\"></div>\";\n }\n document.getElementById(\"memory_board\").innerHTML = output;\n element.addEventListener(\"click\", newBoard());\n}", "function createCardLayout(gameCards) {\n for (let i = 1; i < app.gameCards + 1; i++) {\n const cardDiv = document.createElement(\"div\");\n cardDiv.className = 'memory-card';\n cardDiv.dataset.avenger = `${app.difficultyLevel}avenger${i}`;\n app.cardArray.push(cardDiv);\n\n const charDiv = document.createElement(\"div\");\n charDiv.className = `card-d-orchid ${app.difficultyLevel}avenger${i} front-face`;\n cardDiv.appendChild(charDiv);\n\n const avengerDiv = document.createElement(\"div\");\n avengerDiv.className = `back-face`;\n cardDiv.appendChild(avengerDiv);\n }\n for (let j = 1; j < app.gameCards + 1; j++) {\n const cardDiv = document.createElement(\"div\");\n cardDiv.className = 'memory-card';\n cardDiv.dataset.avenger = `${app.difficultyLevel}avenger${j}`;\n app.cardArray.push(cardDiv);\n\n const charDiv = document.createElement(\"div\");\n charDiv.className = `card-d-orchid ${app.difficultyLevel}avenger${j} front-face`;\n cardDiv.appendChild(charDiv);\n\n const avengerDiv = document.createElement(\"div\");\n avengerDiv.className = `back-face`;\n cardDiv.appendChild(avengerDiv);\n }\n}", "makeHtmlBoard() {\n // select the HTML element table and set the inner HTML of that table to be blank\n const board = document.getElementById('board');\n board.innerHTML = '';\n\n // make column tops (clickable area for adding a piece to that column). These have to be separate from actual playable squares.\n const top = document.createElement('tr');\n top.setAttribute('id', 'column-top');\n\n //Store a reference to the handleClick bound function so that we can remove the event listener correctly later. \n this.handleGameClick = this.handleClick.bind(this);\n\n // Adding the event listener to the top of the board\n top.addEventListener('click', this.handleGameClick);\n\n for (let x = 0; x < this.width; x++) {\n const headCell = document.createElement('td');\n headCell.setAttribute('id', x);\n top.append(headCell);\n }\n\n board.append(top);\n\n // make main part of board\n for (let y = 0; y < this.height; y++) {\n const row = document.createElement('tr');\n\n for (let x = 0; x < this.width; x++) {\n const cell = document.createElement('td');\n cell.setAttribute('id', `${y}-${x}`);\n row.append(cell);\n }\n\n board.append(row);\n }\n }", "function buildBoard(size){\n\t\t\t$(\"#board\").append( $(\"<table id='boardId'>\").addClass(\"boardTable\") );\n\t\t\tfor (i = 0; i < size; ++i) {\n\t\t\t\t$(\".boardTable\").append( $(\"<tr>\").addClass(\"boardRow\") );\n\t\t\t\tfor (j = 0; j < size; ++j) {\n\t\t\t\t\t$(\".boardRow:last\").append( $(\"<td>\").addClass(\"boardCell\").data(\"column\",j)\n\t\t\t\t\t.click(function() {\n var __this = this;\n\t\t\t\t\t\tif(turn==0) {\n if (firstMove) {\n persistNewGame(function(err,game){\n if (err) {\n Materialize.toast('Sorry, something went wrong with creating the new game.', 4000);\n }\n firstMove = false;\n gameId = game.id;\n playColumn(jQuery.data(__this,\"column\"));\n });\n } else {\n playColumn(jQuery.data(__this,\"column\"));\n }\n }\n\t\t\t\t\t}));\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function drawTiles() {\n tileContainer.innerHTML = '';\n\n for (var i = 0; i < tiles.length; i++) {\n var newTile = document.createElement('div');\n newTile.setAttribute('class', 'col-3 border text-center');\n newTile.id = i;\n newTile.innerHTML = tiles[i].tileName;\n newTile.addEventListener('click', handleClick);\n tileContainer.appendChild(newTile);\n }\n}", "function addClickEventListener() {\n\tfor (var i = 0; i < 7; i++) { // 7 references num board columns\n\t\t$('.' + (i +1)).on(\"click\", function(){ // i references column classes\n\t\t\t// console.log(this.attr)\n var clickIndex = $(this).data(\"column-id\")\n console.log(clickIndex)\n\t\t\t\t\tgameBoard.addPiece(clickIndex); //i references row\n\t\t})\n\t}\n}", "function getCards() {\n const whichCard = document.querySelectorAll('.card');\n for (let i = 0; i < whichCard.length; i++){\n whichCard[i].addEventListener('click', function(e) {\n updateCards(e.target);\n })\n }\n}", "function createCards() {\n var columns = document.getElementsByClassName(\"cards-column\");\n\n for (var i = 0; i < cardsRandom.length; i++) {\n var image = document.createElement(\"img\");\n image.classList.add(\"cards-img\");\n image.setAttribute('id', cardsRandom[i].toString() + \"_\" + i.toString());\n image.setAttribute('src', \"img/memorygame/card-back.png\");\n\n if (i >= 0 && i < 3) {\n columns[0].appendChild(image);\n }\n else if (i >= 3 && i < 6) {\n columns[1].appendChild(image);\n }\n else if (i >= 6 && i < 9) {\n columns[2].appendChild(image);\n }\n else if (i >= 9 && i < 12) {\n columns[3].appendChild(image);\n }\n else if (i >= 12 && i < 15) {\n columns[4].appendChild(image);\n }\n else {\n columns[5].appendChild(image);\n }\n }\n}", "createCards() {\n this.memoryNames.forEach((name) => {\n const card = document.createElement('img');\n card.classList.add('card-image');\n card.alt = name;\n this.showFrontSide(card);\n card.classList.add('preventClick');\n setTimeout(() => card.classList.remove('preventClick'), 6000);\n setTimeout(() => this.showBackSide(card), 6000);\n card.style.order = Math.floor(Math.random() * 10);\n card.onclick = () => this.cardClickHandler(event);\n card.ondragstart = () => false;\n this.gameContainer.appendChild(card);\n });\n }", "draw() {\n const cards = document.querySelectorAll(\".memory-card\");\n let backs = document.getElementsByClassName(\"back-face\");\n for (let i = 0; i < cards.length; i++) {\n let card = this.deck.getCardByIndex(i);\n card.setElement(cards[i]);\n backs[i].src = this.deck.getCardByIndex(i).image;\n }\n let that = this;\n this.deck.cards.forEach((card) =>\n card.element.addEventListener(\"click\", function (e) {\n that.evalClick(this);\n })\n );\n }", "function startGame() {\n shuffle(cardIcons);\n for(let i = 0; i < cardIcons.length; i++) {\n const card = document.createElement(\"li\");\n card.classList.add(\"card\");\n card.innerHTML = `<i class=\"${cardIcons[i]}\"></i>`;\n deckOfCards.appendChild(card);\n click(card);\n }\n }", "function fillCards(){\n let shuffledCards = shuffle(cardList);\n \n for(let e = 0; e < cards.length; e++){\n let i = document.createElement('i');\n i.setAttribute(\"class\", `${shuffledCards[e]}`);\n cards[e].appendChild(i);\n }\n \n cards.forEach(e => e.addEventListener('click', clickCard));\n stars.forEach(e => e.classList.add('win'));\n}", "function generateMemoryCards() {\n flipped_counter = 0;\n var output = '';\n setBeerCollectionData(beer_Collection);\n for (var i = 0; i < beer_Collection.length; i++) {\n output += '<div id = \"BeerCard_' + i + '\" onClick = \"showBeerCard(this,\\'' + beer_Collection[i] + '\\')\">Click Me</div>';\n }\n document.getElementById('mainContainer').innerHTML = output;\n setCounter();\n}" ]
[ "0.7777658", "0.77560633", "0.77040654", "0.77017087", "0.76292866", "0.7617252", "0.7609963", "0.75762135", "0.755554", "0.7528606", "0.74824196", "0.7481658", "0.7479096", "0.74525815", "0.7433708", "0.74336857", "0.73769796", "0.7287076", "0.7268543", "0.72262454", "0.71784693", "0.7173322", "0.7158029", "0.7118291", "0.7114635", "0.7096161", "0.7091839", "0.70850444", "0.70775956", "0.7066581", "0.7059075", "0.70561886", "0.7026353", "0.7019962", "0.70183486", "0.6958913", "0.6955307", "0.69429916", "0.69246125", "0.6920654", "0.6918753", "0.69186157", "0.69076097", "0.69066507", "0.6899551", "0.6893603", "0.6880462", "0.68773377", "0.68767655", "0.6860187", "0.6856684", "0.6855658", "0.6838421", "0.68357587", "0.6834265", "0.6831281", "0.6825186", "0.67934", "0.67921805", "0.6784796", "0.67844087", "0.676552", "0.6764403", "0.6760175", "0.67597765", "0.67516196", "0.67449635", "0.67365736", "0.67345667", "0.67101175", "0.67010874", "0.6682856", "0.66786206", "0.66781306", "0.6676996", "0.66758734", "0.667218", "0.6668261", "0.6658931", "0.66550547", "0.6653391", "0.66343594", "0.6633924", "0.663294", "0.6631229", "0.66190875", "0.66173154", "0.6615695", "0.66086406", "0.660582", "0.66015434", "0.6599687", "0.6597671", "0.6586747", "0.6586662", "0.6586226", "0.6586058", "0.65768975", "0.6571157", "0.65699965" ]
0.75315344
9
reset function, changes img to backs, and wipes the cards in play
function resetFunc() { var cardArray = document.getElementsByTagName('img'); for (i = 0; i < cardArray.length; i++) { cardArray[i].setAttribute('src', 'images/back.png'); } cardsInPlay = []; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function resetCards(){\n\t\t\t\tselectedOdd.src = \"bearback.jpg\"\n\t\t\t\tselectedEven.src = \"bearback.jpg\"\n\t\t\t\tselectedOdd = null;\n selectedEven = null; \n timerOn = false; \n //Will remove timer, then user can resume the game. \n window.clearInterval(timerReset); \n\t\t}", "function resetGame() {\n\t //select all images\n\t\tlet allCards = document.querySelectorAll('img');\n\t\t//for every card, reset image attribute to back of card\n\t\tfor (let i = 0; i < allCards.length; i++) {\n\t\t allCards[i].setAttribute('src', 'images/back.png');\n\t}\n}", "function resetCards(){\n resetStars();\n selectedCards = [];\n canSelectCard = true;\n shuffleCards(cards);\n displayCards(cards);\n listenForCardFlip();\n}", "function reset() {\n\tcardsContainer.innerHTML = \"\";\n\n\t//Call startGame to create new cards\n\tstartGame();\n\t\n\t//Reset any related variables like matchedCards\n\tmatchedCards = [];\n\topenedCards = [];\n\n\tmoves = 0;\n\tmovesContainer.innerHTML = 0;\n\n\tstarsContainer.innerHTML = star + star + star;\n\n\tresetTimer();\n\tstopTimer();\n\n\tshuffle(icons);\n}", "function resetEverything(){\n resetImages();\n resetPlay();\n resetPause();\n }", "function resetCards () {\n /*Close imgs*/\n for(let i = 0; i < countCards; i++) {\n cardsField.children[i].style.backgroundImage = 'none';\n cardsField.children[i].className = \"\";\n }\n selectedCards = [];\n pause = false;\n \n /*Check for End*/\n if (deletedCards == countCards) {\n resetBlock.style.display = \"block\";\n for(var j = 0; j < countCards; j++){\n /* delete elements li */\n cardsField.removeChild(document.getElementById(j));\n }\n }\n }", "function reset_cards(){\n\t//hide all cards faces\n\t$('.card').removeClass('open');\n\t//stack all cards\n\tstack_cards(0.2);\n\t//close all cards\n\tclose_all_cards();\n\t//remove any rotation\n\tanimate_card(0);\n}", "function reset(){\n let newCardsToPlay = {}\n hand[0].forEach(card_id => newCardsToPlay[card_id] = false);\n setCardsToPlay(newCardsToPlay);\n }", "function reset() {\n gameState = PLAY\n \n bike1.addImage( bike1Img);\n\n c1G.destroyEach();\n c2G.destroyEach();\n c3G.destroyEach();\n \n distance=0\n}", "function reset () {\n memoryBoard.removeChild(memoryBoard.querySelector('.reset'));\n setTimeout(() => {\n cards.forEach(card => {\n card.classList.remove('flip');\n card.addEventListener('click', flipCard);\n });\n shuffle();\n }, 300);\n}", "function reset() {\n var cards = document.getElementsByClassName(\"card\");\n for (var i = 0; i < cards.length; ++i) {\n cards[i].classList.remove('flipped');\n }\n elPreviousCard = null;\n flippedCouplesCount = 0;\n busy = false;\n shuffleCardsRandomly();\n insideGame = false;\n hideItem('idBtnPlayAgain');\n}", "function resetGame() {\n cardShuffle();\n resetBoard();\n cardsInPlay = [];\n cardInPlayId = -1;\n}", "function reset() {\n Caman(\"#canvas\", img, function () {\n this.revert();\n })\n brillo = 0;\n contraste = 0;\n saturacion = 0;\n exposicion = 0;\n ruido = 0;\n difuminacion = 0; \n resetearbotones();\n}", "function clearImgs() {\n imgCardPanel.clear();\n}", "function resetCards() {\n moveCount = 0;\n getMoveCount();\n cards.forEach(function(card) {\n card.classList.remove(\"open\", \"show\", \"match\");\n });\n shuffleCards();\n resetTimer();\n setStars(3);\n}", "function resetHeld(){\n\t\tvar heldCtx = holdCanvas[0].getContext(\"2d\");\n\t\t_firstCardHold = _secondCardHold = _thirdCardHold = _fourthCardHold = _fifthCardHold = false;\n\t\t$(\".held\").removeClass(\"held\");\n\t\theldCtx.clearRect(0,0,holdCanvas.width(),holdCanvas.height());\n\t}", "function reset() {\n modal.style.display = \"none\";\n for (let i = 0; i < imgItemsArray.length; i++) {\n imgItemsArray[i].classList.remove(\"show-img\");\n imgItemsArray[i].classList.remove(\"match\");\n }\n flippedCards = [];\n matchingPairs = 0;\n moves = 0;\n counter.textContent = `${moves} moves`;\n time = 0;\n clock.innerHTML = \"<span>0:00</span>\"; \n clockOff = true;\n stopClock();\n startGame();\n}", "reset() {\n this.playerContainer.players.forEach(x => x.clearHand())\n this.winner = undefined;\n this.incrementState();\n this.clearSpread();\n this.deck = new Deck();\n this.clearPot();\n this.clearFolded();\n }", "function reset(){\n const hearts = document.querySelectorAll('.tries > img');\n document.querySelector('#phrase').innerHTML = \"\";\n for(let i = 0; i < buttons.length; i++) {\n buttons[i].className = \"key\";\n buttons[i].disabled = false;\n }\n for(let i = 0; i < hearts.length; i++) {\n hearts[i].src = \"images/liveHeart.png\";\n }\n}", "function resetGame() {\n $(`${imgGridContainerId}`).children().remove();\n $(`${imgGridContainerId} div`).css(\"visibility\", \"visible\");\n $(\"#targetImg img\").attr(\"src\", \"#\");\n $targetImg.css(\"display\", \"none\");\n $('.text-2').css(\"display\", \"none\");\n matchedImageCounter = 0;\n countDown = 20;\n startGame();\n return false;\n}", "function reset()\r\n{\r\n document.querySelector(\".det\").style.display = \"block\";\r\n document.querySelector(\".lan\").style.display = \"none\";\r\n document.querySelector(\".play1\").setAttribute(\"src\",\"images/dice1.png\");\r\n document.querySelector(\".play2\").setAttribute(\"src\",\"images/dice1.png\");\r\n document.querySelector(\"h1\").innerHTML = \"Welcome Back\";\r\n}", "function resetGame() {\n\tresetClockAndTime();\n\tresetMoves();\n\tresetStars();\n\tshuffleDeck();\n\tresetCards();\n\tmatched = 0;\n\ttoggledCards = [];\n}", "function reset(){\n document.getElementById('game-board').innerHTML = ''\n cardsInPlay = []\n createBoard()\n}", "function clearDeck() {\n isFlippedCard = false;\n freezePlay = false;\n cardOne = null;\n cardTwo = null;\n }", "onResetClick() {\n this.setState({\n cards: shuffleImages(IMAGES.slice()),\n correct: [],\n selected: []\n });\n }", "resetGame() {\n // remove phrase from gameboard\n $(\"#phrase ul\").empty();\n\n // reset the onscreen keyboard css\n const qwertyKey = $(\"#qwerty button\");\n qwertyKey.each((i, e) => {\n e.classList.remove(\"chosen\");\n e.classList.remove(\"wrong\");\n e.classList.add(\"css\");\n e.disabled = false;\n });\n\n // change the scoreboard images\n const scoreBoardElement = $('#scoreboard li');\n scoreBoardElement.each( (i, li) => {\n let img = li.firstElementChild;\n img.src = 'images/liveHeart.png';\n });\n }", "restoreCards(){\n this._cards = this.buildCardSet();\n }", "function reset() {\r\n\r\n deck = [];//Clear deck\r\n user.player.score = 0;//set score to 0\r\n user.dealer.score = 0;\r\n user.player.hasAce = false;\r\n user.dealer.hasAce = false;\r\n document.getElementById(\"winner\").innerText = \"\";//clear winnertext\r\n //clear all card images.\r\n var playerDiv = document.getElementById(\"playerDiv\");\r\n while (playerDiv.hasChildNodes()) {\r\n playerDiv.removeChild(playerDiv.firstChild);\r\n }\r\n var dealerDiv = document.getElementById(\"dealerDiv\");\r\n while (dealerDiv.hasChildNodes()) {\r\n dealerDiv.removeChild(dealerDiv.firstChild);\r\n }\r\n\r\n}", "function resetGame() {\n\tcards = [];\n\tcardsDisplayed = 0;\n\tclearTimeout(timer);\n\ttoggleNumbers();\n\t$('#timer').html('30');\n\t$('.card').each(function() {\n\t\t$(this).html('&nbsp;');\n\t\t\n\t}); // end each\n\t$('#total').html('&nbsp;');\n\t$('#answer').text('');\n\t$('.card').each(function() {\n\t\tif ($(this).hasClass('disabled')) {\n\t\t\t$(this).removeClass('disabled');\n\t\t}\n\t\tif ($(this).hasClass('pause')) {\n\t\t\t$(this).removeClass('pause');\n\t\t}\n\t}); // end each\n\t$('#variables').html('');\n\tuserVariables = [];\n\t$('#notice').fadeOut();\n\t\n}", "function resetBoard() {\n for (let i = 0; i < cards.length; i++){\n let cardElement = document.getElementById(i);\n cardElement.setAttribute(\"src\", \"images/back.png\");\n }\n}", "function resetAll() {\n flippedCards = [];\n matchedCards = [];\n timerOff = true;\n stopTime();\n clearTime();\n resetCards();\n resetMoves();\n resetStars();\n}", "function resetPage() {\n cards.push(...pickedCards);\n for (let i = 0; i < pickedCards.length; i++) {\n pickedCards.splice(i, pickedCards.length);\n }\n $(\"img\").remove();\n $(\"#hangman\").css(\"display\", \"none\");\n console.log(cards);\n console.log(pickedCards);\n}", "function resetGame() {\n\t// Repopulate card deck\n\tcardDeck = masterDeck.map(function(card) { return card }); \n\t// Empty all containers of their elements\n\t$('#game-board').html('')\n\t$('#p1-hand').html(''); \n\t$('#p2-hand').html('');\n\t$('#p1-points').html('');\n\t$('#p2-points').html('');\n\t$('#turn-count').html('');\n\t// Reset board array\n\tgameBoard = [0, 1, 2, 3, 4, 5, 6, 7, 8]; \n\t// Reset turn count\n\tturnCount = 0;\n\t// Reset points\n\tplayer1.points = 5; \n\tplayer2.points = 5;\n}", "reset() {\n let that = this;\n this.matched.forEach((card) => {card.flip()});\n this.clicked.forEach((card) => {card.flip()});\n this.matched = [];\n this.clicked = [];\n setTimeout(function () {that.start();}, 500);\n }", "function resetGame() {\n localStorage.setItem('Game.State', null);\n document.querySelector('.moves').textContent = \"0\";\n \n if (cardDeck) {\n cardDeck.clear();\n }\n \n cardDeck = new CarDeck();\n cardDeck.shuffle();\n bindClickEvent();\n \n cardDeck.cards.forEach(card => {\n card.closeCard()\n card.unmatch()\n });\n \n state = {\n matchingCard: null,\n isMatching: false,\n totalMoves: 0,\n elapsedSeconds: 0,\n isGameOver: false\n }\n \n updateScreenMode(true)\n }", "function gameReset(){\n\t\t\tshowAction(\"RESET!\");\n\t\t\tif(timer) gameEnd();\n\t\t\t$(\".info .timer .sec\").text(0);\n\t\t\t$(\".info .timer .sectext\").hide();\n\t\t\ttime = null;\n\t\t\tcardsleft = settings.cardcnt;\n\t\t\t$(\"#wrap-gameboard li.flip\").removeClass(\"found selected flip\");\n\t\t\t$(\"#wrap-gameboard li.hover\").removeClass(\"hover\");\n\t\t}", "function reset(){\r\n gameState = PLAY;\r\n gameOver.visible = false;\r\n // restart.visible = false;\r\n enemiesGroup.destroyEach();\r\n blockGroup.destroyEach();\r\n stars1Group.destroyEach();\r\n stars2Group.destroyEach();\r\n candyGirl.addAnimation(\"running\", candygirl_running);\r\n score = 0;\r\n}", "function resetGame() {\n clearGameCards();\n resetMoves();\n resetTimer();\n}", "function resetGame() {\n resetTimer();\n resetMoves();\n resetStars();\n shuffleDeck();\n resetCards();\n}", "function reset() {\n timeElapsed=0;\n clearAllArrays();\n deleteCards();\n shuffle(deckOfCards);\n displayCards();\n guessedCards=[];\n}", "function reset(){\n\n theme.play();\n\n gameState = PLAY;\n gameOver.visible = false;\n restart.visible = false;\n \n monsterGroup.destroyEach();\n \n Mario.changeAnimation(\"running\",MarioRunning);\n\n score=0;\n\n monsterGroup.destroyEach();\n\n \n}", "function resetGame() {\n open = [];\n matched = 0;\n moveCalculator = 0;\n resetTimer();\n updateMoveCalculator();\n $('.card').attr('class', 'card');\n showCards();\n resetStars();\n}", "function reset()\n{\n image.src = \"http://pixelartmaker.com/art/6508f549b984385.png\";\n winningBird.style.display = 'none';\n eagle.style.display = 'initial';\n falcon.style.display = 'initial';\n eagle.style.marginLeft = 0;\n falcon.style.marginLeft = 0;\n eagleDistance = 0;\n falconDistance = 0;\n newNumber = 0;\n newNumber1 = 0;\n number = 0;\n number1 = 0;\n}", "function resetAll(){\n\t\n\tfor(var x in images){\n\t\timages[x].src = \"img/down.png\";\n\t}\n\n}", "function resetOpenedCards() {\n openedCards = []\n}", "function resetGame() {\r\n shuffle(deck);\r\n gameStart();\r\n dealerarea.innerHTML = \"\";\r\n playerarea.innerHTML = \"\";\r\n winnerarea.innerHTML = \"\";\r\n playerHand.firsttotal = 0;\r\n dealerHand.firsttotal = 0;\r\n playerHand.secondtotal = 0;\r\n dealerHand.secondtotal = 0;\r\n }", "resetGame() {\n const ul = document.querySelector('ul');\n const li = ul.querySelectorAll('li');\n const qwertyDiv = document.getElementById('qwerty');\n const buttons = qwertyDiv.querySelectorAll('button');\n const img = document.querySelectorAll('img');\n this.missed = 0;\n for (let i = 0; i < li.length; i++) {\n li[i].remove(); \n }\n \n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].disabled = false;\n buttons[i].className = 'key';\n }\n\n img.forEach(image => image.src = 'images/liveHeart.png'); \n }", "function resetGame() {\n updateChips();\n endGame.style.display = \"none\";\n result.innerText = \"\";\n newPlayer.hand = [];\n newDealer.hand = [];\n newPlayer.score = 0;\n newDealer.score = 0;\n deal.disabled = false;\n newPlayer.removeCards();\n newDealer.removeCards();\n // If cards low, make four new decks \n if (newDeck.cards <= 12) {\n newDeck.createDeck();\n newDeck.createDeck();\n newDeck.createDeck();\n newDeck.createDeck();\n newDeck.shuffle();\n }\n}", "function resetGame() {\n\n // reset the matched cards array\n matchedCards = [];\n // shuffle cards\n cards = shuffle(cards);\n // remove all classes from each card\n removeClasses();\n // reset moves\n moves = 0;\n counter.innerHTML = moves;\n // reset rating\n for (var i = 0; i < stars.length; i++) {\n stars[i].style.visibility = \"visible\";\n }\n // reset timer\n resetTimer();\n // start timer\n startTimer();\n}", "function reset() {\n \n setTimeout(() => {\n [hasFlippedCard, gameBoard] = [false, false];\n [firstCard, secondCard] = [null, null];\n\n cards.forEach(cardBg => cardBg.classList.remove('bg_yes'));\n cards.forEach(cardBg => cardBg.classList.remove('bg_no'));\n\n cards.forEach(cards => cards.addEventListener('click', flipCard));\n }, 700); \n }", "function resetGame() {\n\t$('.box').removeClass('played');\n\t$('.box').removeClass('U-turn');\n\t$('.box').removeClass('I-turn');\n\t$('.box').html('');\n\t$('.box').addClass('free');\n\tisPlayerOne = true;\n\tisPlayerTwo = false;\n\n}", "function unturnAllCardsTurned (item){\n\tfor (var i = 0; i < memoryCards.length; i++){\n\t\tif (memoryCards[i].turned === true){\n\t\t\tmemoryCards[i].turned = false;\n\t\t}\n\t}\n\titem.src = card;\n\tpreviousItem = document.getElementById(idOfHtmlCards[0]);\n\tpreviousItem.src = card;\n\tidOfHtmlCards = [];\n\treturn true;\n\n\n}", "function resetHand(){\n card1 = undefined\n card2 = undefined\n cardsFlipped = 0\n attempt++\n}", "function resetFunc(typeOfImg) {\n typeImg = typeOfImg;\n objOfImgs.listOfNumber = shuffle(objOfImgs.listOfNumber);\n sq = [].slice.call(document.querySelectorAll(\".square\"));\n sq.forEach(function(elem) {\n elem.style.background = \"rgba(238, 235, 235, 0.25)\";\n elem.style.border = \"2px dotted rgba(179, 3, 3, 0.5)\";\n })\n numOfClicks = isWin = 0;\n squareRounds = [];\n removeEvent();\n addEvent();\n}", "function reset() {\r\n // Clear all images\r\n for (let i = 0; i < sliderImages.length; i++) {\r\n sliderImages[i].style.display = \"none\"; // taking display and setting to none\r\n }\r\n}", "function resetGame() {\n resetClockAndTime();\n resetMoves();\n resetStars();\n initGame();\n activateCards();\n startGame();\n}", "resetGame() {\n document.getElementById(\"overlay\").className = \"start\";\n //On screen Keyboard Reset\n const qwerty = document.getElementById(\"qwerty\");\n const qwertyButtons = qwerty.querySelectorAll(\"button\");\n qwertyButtons.forEach(button => {\n button.className = \"key\"; // change back to key\n button.disabled = false; // enable all buttons\n });\n\n //Missed Reset\n this.missed = 0;\n\n //Hearts Resets\n const images = document.querySelectorAll(\"li img\");\n for (const i of images) {\n i.src = \"images/liveHeart.png\";\n }\n\n //display blocks\n const ul = document.querySelector(\"#phrase ul\");\n while (ul.firstChild) {\n // while ul has firstChild, another way to clear the li items\n ul.removeChild(ul.firstChild); //remove that firstChild\n }\n }", "function resetBoard() {\n [hasFlippedCard, stopFlip] = [false, false];\n [firstCard, secondCard] = [null, null];\n\n /* if all cards are face up and matched a replay/reset button is created */\n if(cards.length === memoryBoard.querySelectorAll('.flip').length){\n memoryBoard.insertAdjacentHTML('beforeend','<button class=\"reset\">Replay</button>');\n document.querySelector('.reset').addEventListener('click', reset);\n };\n}", "resetGame(){\n document.getElementById(\"dark-bg\").classList.add(\"d-none\");\n while(document.getElementsByClassName(\"flipped\").length > 0) {\n document.getElementsByClassName(\"flipped\")[0].removeAttribute(\"style\");\n document.getElementsByClassName(\"flipped\")[0].classList.remove(\"flipped\");\n }\n while(document.getElementsByClassName(\"invis\").length > 0) {\n document.getElementsByClassName(\"invis\")[0].removeAttribute(\"style\");\n document.getElementsByClassName(\"invis\")[0].classList.remove(\"invis\");\n }\n clearInterval(this.counter);\n this.shuffleCards(this.randomizedCards);\n this.removedCards = [];\n this.score = 0;\n this.seconds = \"00\";\n this.minutes = 0;\n this.onScreen[0].classList.remove(\"d-none\");\n this.onScreen[1].classList.add(\"d-none\");\n document.getElementById(\"dark-bg\").classList.add(\"d-none\");\n this.wonGameStatus = false;\n this.startCounter();\n }", "function reset(){\n\tdocument.getElementById('game-board').innerHTML = \" \"; //to clear the game board.\n\tcardsInPlay = []; //to clear the array content so the alert will be effective again once we reset the board.\n\tcreateBoard(); //to create a new game board :)\n}", "function resetVars() {\n hasFlipped = false,\n stopEvents = false,\n firstCard = null,\n secondCard = null;\n}", "function resetGame() {\n // reset the global variables\n cardsCollected = [];\n DeckOfCards = [];\n cardOneElement = null;\n cardTwoElement = null;\n startTime = null;\n currentTurn = 0;\n gameWon = false;\n seconds = 0;\n moves = 0;\n stars = 3;\n}", "function reset() {\n [hasFlipped, lockBoard] = [false, false];\n [firstCard, secondCard] = [null, null];\n}", "function resetCurrentGame() {\n clearGameCards();\n resetMoves();\n resetTimer();\n startGame();\n resetGameSound();\n}", "function resetCards() {\n let openCardsArray = Array.prototype.slice.call(openCardsHC);\n openCardsArray.forEach(function (card) {\n card.classList.remove('open', 'show');\n });\n let matchCardsArray = Array.prototype.slice.call(matchCardsHC);\n matchCardsArray.forEach(function (card) {\n card.classList.remove('match');\n });\n}", "function resetCards() {\r\n let openCardsArray = Array.prototype.slice.call(openCardsHC);\r\n openCardsArray.forEach(function(card) {\r\n card.classList.remove('open', 'show');\r\n });\r\n let matchCardsArray = Array.prototype.slice.call(matchCardsHC);\r\n matchCardsArray.forEach(function(card) {\r\n card.classList.remove('match');\r\n });\r\n}", "function reset_game_board(){\n $('.community_cards').empty();\n $('.players_cards').empty();\n $('.feedback').empty();\n }", "function resetBoard(){\n\tfor(var i = 0; i < cards.length; i++){\n\tcardElement.removeAttribute('data-card', cards[i]);\n\t}\n}", "function resetOpenCards() {\n openCards = {};\n}", "function resetGame() {\n matched = 0;\n resetTimer();\n resetMoves();\n resetStars();\n resetCards();\n shuffleDeck();\n}", "resetGame(){\n document.querySelector(\"#phrase ul\").innerHTML = '';\n const keys = document.querySelectorAll(\".keyrow button\");\n keys.forEach(key => {\n key.disabled = false;\n key.className = 'key';\n });\n const images = document.querySelectorAll(\".tries img\");\n images.forEach(image => {\n image.src = 'images/liveHeart.png';\n });\n this.missed = 0;\n }", "function resetGame() {\n //Reset variables\n count = 0;\n totalRounds = 0;\n upperTotalScore = 0;\n lowerTotalScore = 0;\n grandTotalScore = 0;\n hasUpperBonus = 0;\n hasYahtzee = false;\n \n //Restore scoreesheet and dice images to original/initial state\n document.getElementById(\"scoresheet\").innerHTML = initialScoresheet;\n \n for(var i = 0; i < imgElements.length; i++) {\n imgElements[i].src = setImgSource(i + 1);\n }\n }", "function resetBoard() {\n\n\tif (gameOverStatus) {\n\t\tgameReset();\n\t}\n\n\t//reset cards in play\n\tcardsInPlay = [];\n\n\t//remove cards in game-board\n\tvar usedCards = document.getElementById('game-board');\n\twhile (usedCards.hasChildNodes()) {\n\t\tusedCards.removeChild(usedCards.firstChild);\n\t}\n\n\t//fill board with cards again\n\tcreateBoard();\n}", "function reset() {\n\t$snake.off(\"keydown\");\n\tdeleteSnake();\n\t\n\tmakeSnake();\n\tupdateScores();\n\tassignKeys();\n\tplayGame();\n}", "function resetButton() {\n\t\tvar newBoard = document.querySelector('div');\n\t\tnewBoard.innerHTML = \" \";\n\t\tcardsInPlay.length = 0;\n\t\tcreateBoard();\n\t\n}", "function remAllCards()\r\n{\r\n\tremCards(HOUSE);\r\n\tremCards(PLAYER);\r\n}", "function imgReset(){\n\t$(kanvas).attr(\"width\", myImg.width);\n\t$(kanvas).attr(\"height\", myImg.height);\n\t$(\".imgtitle span\").text(\"Citra Asli\");\n\tctx.drawImage(myImg, 0, 0);\n\t$(\"#inp-brightness\").val(0);\n\t$(\"#inp-contrass\").val(0);\n\t$(\"#hist\").hide();\n}", "function reset() {\n cardsArray.forEach(function(card) {\n card.classList.remove('match', 'unmatched', 'selected', 'disabled');\n });\n starsArray.forEach(function(star) {\n star.style.visibility = 'visible';\n });\n\n // Resets moves\n count = 0;\n moves = 0;\n counter.innerHTML = moves;\n\n // Resets timer\n clearInterval(interval);\n seconds = 0;\n minutes = 0;\n hours = 0;\n timer.innerHTML = minutes + ' min(s) ' + seconds + ' secs(s)';\n\n // Shuffles the cards\n shuffleCards();\n}", "resetGame() {\n // empty the phrase UL\n document.querySelector('#phrase ul').innerHTML = ''\n\n const keys = document.querySelectorAll('.keyrow button')\n keys.forEach((key) => {\n key.disabled = false;\n key.className = 'key'\n })\n\n const tries = document.querySelectorAll('.tries img')\n for (let i = 0; i < tries.length; i++) {\n tries[i].src = 'images/fullHeart.png'\n }\n }", "function resetImage() {\n originalImage.drawTo(canvas);\n}", "function resetGame()\n{\n clearInterval(doAnimation);\n isfarmerRight = isseedsRight = isfoxRight = ischickenRight = false;\n \n updateImages(); //Place and size the images.\n setButtonsAndMessage(false, false, false, false, MSGINTRO);\n}", "resetPlayer() {\n this.out = false;\n this.coins = 2;\n this.numCards = 2;\n this.cards = [];\n }", "function resetAll() {\n counter = 0;\n hangmanGame.resetVar();\n hangmanGame.resetObj();\n loadLetters();\n gameBackground.image.src = `./assets/images/${theme}/background.png`;\n backgroundGlow.image.src = `./assets/images/${theme}/glow.png`;\n character.image.src = `./assets/images/character/${theme}.png`;\n hangmanGame.status = \"menu\";\n}", "function reset() {\n clear();\n initialize(gameData);\n }", "function resetHearts() {\n let source = \"images/liveHeart.png\";\n for (let life of lives) {\n life.src = source;\n }\n}", "reset() {\n\t\tfor (let i = 0; i < this.tiles.length; i++) {\n\t\t\tthis.tiles[i].unsetPiece();\n\t\t}\n\t\tfor (let i = 0; i < this.whitePieces.length; i++) {\n\t\t\tthis.whitePieces[i].unsetTile();\n\t\t\tthis.whitePieces[i].animation = null;\n\t\t\tthis.blackPieces[i].unsetTile();\n\t\t\tthis.blackPieces[i].animation = null;\n\t\t}\n\t}", "reset() {\n this.cards = [];\n //create a deck of cards in ascending order\n for (let i = 0; i < 52; i++) {\n this.cards[i] = new Card(Math.floor(i / 13), i % 13, this.pos.x, this.pos.y, true);\n }\n // use the shuffle function to shuffle the cards.\n // p5.js has an Array.shuffle() function that could replace this.\n this.shuffle();\n console.log(\"Deck reset\");\n }", "gameReset(){\n \t\tconst currentLettersDisplay = document.querySelectorAll(\"#phrase li\");\n \t\tconst currentButtons = document.querySelectorAll('#qwerty button');\n \t\tconst allTries = document.querySelectorAll('.tries img');\n\n \t\t//remove all letters from phrase display\n \t\tfor (let l of currentLettersDisplay){\n \t\t\tl.remove();\n \t\t}\n\n \t\t //resets the buttons to their initial state\n \t\tfor (let b of currentButtons){\n \t\t\tb.disabled = false;\n \t\t\tb.className = \"key\";\n \t\t}\n\n \t\t//resets the tries images to full heart pictures (liveHeart.png)\n \t\tfor (let t of allTries){\n \t\t\tt.src=\"images/liveHeart.png\";\n \t\t}\n \t}", "function resetGame() {\n deck.innerHTML = '';\n tally.textContent = 0;\n seconds = 0;\n minutes = 0;\n moves = 0;\n stars.innerHTML = '';\n pairedCards = [];\n setupDeck();\n modal.style.display = 'none';\n}", "function turnBackCards(activeCards) {\n for (var i = 0; i < activeCards.length; i++) {\n activeCards[i].classList.remove(\"cards-show\");\n activeCards[i].classList.remove(\"selected-cards\");\n activeCards[i].src = \"img/memorygame/card-back.png\";\n }\n}", "function reset() {\n $('.game-field').html('');\n game.moves = 1;\n $('.game-field').attr('onClick', 'icon(this.id)');\n $('.win').removeClass('win');\n setTimeout(firstMove, 200);\n }", "function resetClicked(evt){\n\t//hide the modal\n modalHide();\t\n\t//reset the cards\n resetCards();\n\t//reset the turn counter\n resetCounter();\n //reset the card list\n cardList = [];\n\t//reset the timer\n resetTimer();\n //reset stars\n resetStars();\n //shuffle the deck\n shuffleCards();\n}", "function Reset() {\n charDeck = [\n \"+0\",\n \"+0\",\n \"+0\",\n \"+0\",\n \"+0\",\n \"+0\",\n \"-1\",\n \"-1\",\n \"-1\",\n \"-1\",\n \"-1\",\n \"+1\",\n \"+1\",\n \"+1\",\n \"+1\",\n \"+1\",\n \"+2\",\n \"-2\",\n \"Miss\",\n \"x2\"\n ];\n discard = [];\n document.getElementById(\"cardFront\").src = \"img/Blank.png\";\n document.getElementById(\"cardBack\").src = \"img/Back.png\";\n numOfRollingCards = 0;\n RollingCardsInDeck = 0;\n\n CalculatePercents();\n document.getElementById(\"modifieraverage\").innerHTML =\n \"Average Modifier: \" + CalculateAverageModifier();\n}", "resetSession() {\n const phraseList = document.querySelector('#phrase ul')\n let bgColor = document.getElementById('overlay');\n bgColor.className = 'start';\n\n phraseList.innerHTML = '';\n this.missed = 0;\n\n let letterButtons = document.getElementsByTagName('button');\n for (let i = 0; i < letterButtons.length; i++) {\n letterButtons[i].className = 'key';\n letterButtons[i].disabled = false;\n \n }\n\n const healthPoints = document.querySelectorAll('img');\n \n //All hearts is selected and changed to a 'liveHeart' based on the reset missed property index value\n for (let i = 0; i < healthPoints.length; i++) {\n healthPoints[i].src = \"images/liveHeart.png\"\n \n }\n }", "function resetCardHolders() {\n firstCard = null;\n firstCardIndex = null;\n secondCard = null;\n secondCardIndex = null;\n disabled = false;\n}", "function resetCard() {\n deleteActiveMarker();\n $('.card-spinner').addClass('show').removeClass('hide');\n $('.card-body').addClass('invisible');\n $('.gm-style').find('.card-cc').remove();\n $('#search-searchboxinput').val('');\n $('.card-body [class^=\"data-\"], .data-fatalities, .data-injured, .data-location, .data-date').text(' ');\n $('.card-mental-health-sources, .card-news-sources, .card-carousel, .card-victim-list, .card-tags').html(' ');\n}", "function reset() {\n document.getElementById('theOne').style.display = 'none';\n const fragment = document.createDocumentFragment();\n var nodesArray = shuffle([].slice.call(document.querySelectorAll('.card')));\n for (let i = 0; i < nodesArray.length; i++) {\n nodesArray[i].classList = 'card';\n fragment.appendChild(nodesArray[i])\n };\n deck.innerHTML = '';\n deck.appendChild(fragment);\n //resets the move count\n counting = 0;\n moves[0].innerText = counting;\n //resets the rating stars\n for (i = 0; i < stars.length; i++) {\n stars[i].firstElementChild.classList = 'fa fa-star'\n };\n //calling timerStop\n timerStop();\n}", "function buttonReset() {\n image(imgReset, 350, 550);\n}", "function resetAll() {\n startGame();\n for (let i = 0; i < cards.length; i++) {\n cards[i].classList.remove('visible');\n }\n moves = 0;\n moveCounter.innerHTML = moves;\n matched = [];\n showStars();\n countDownTimer.innerHTML = 60;\n stopTime();\n}", "function resetGame() {\n window.cancelAnimationFrame(anim_id);\n playing = false;\n score = 0;\n level = 1;\n new_game = true;\n speed = init_speed\n direction = ''\n snake.reset(init_speed);\n fruit.reset();\n }" ]
[ "0.8342347", "0.82801455", "0.80494064", "0.79560626", "0.7934626", "0.78431875", "0.781149", "0.77682674", "0.77416027", "0.7710266", "0.76985663", "0.7653253", "0.7624593", "0.7603284", "0.7527799", "0.7518257", "0.7495085", "0.7489263", "0.7466037", "0.74349135", "0.7426444", "0.7404099", "0.7395204", "0.73871434", "0.73723435", "0.73599637", "0.73270285", "0.73091257", "0.72872394", "0.7273117", "0.7251278", "0.7243287", "0.7225906", "0.72213125", "0.72195286", "0.7217392", "0.7216788", "0.7183814", "0.7181149", "0.71761334", "0.71550375", "0.7143153", "0.7142035", "0.7134498", "0.7133673", "0.7126083", "0.7123824", "0.7123815", "0.7123593", "0.7119989", "0.7119732", "0.71121615", "0.710509", "0.71041113", "0.71022093", "0.71005577", "0.7100479", "0.7089812", "0.7083811", "0.7078545", "0.7078186", "0.7077938", "0.70771116", "0.7075688", "0.7071613", "0.7070726", "0.70697033", "0.706325", "0.7062623", "0.70593387", "0.70592105", "0.70510274", "0.70442593", "0.70365936", "0.7035842", "0.7035405", "0.7029978", "0.7029789", "0.7024995", "0.70247406", "0.7018956", "0.70132864", "0.7012637", "0.7007366", "0.70068675", "0.70050645", "0.7003283", "0.7000684", "0.6999867", "0.6997699", "0.69949263", "0.69925505", "0.6989963", "0.69877577", "0.6985219", "0.6984405", "0.69818944", "0.6976358", "0.6972912", "0.69722587" ]
0.8445453
0
Shuffle function does the same as reset with shuffle involved as well
function shuffleFunc() { resetFunc(); shuffle(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "shuffle() {\n // TODO\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 }", "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() {\n if(this.deck.length <= 1) { return; }\n \n for(let idx = 0; idx < this.deck.length - 1; idx++) {\n let idx_random = this.randomIndex(idx, this.deck.length - 1);\n \n if(idx_random !== idx) {\n let swap = this.deck[idx];\n this.deck[idx] = this.deck[idx_random];\n this.deck[idx_random] = swap;\n }\n }\n }", "function shuffle () {\n for(let i=setDeck.length-1; i >= 0; i--){\n let j = Math.floor(Math.random() * i)\n let temp = setDeck[i]\n setDeck[i] = setDeck[j]\n setDeck[j] = temp\n }\n}", "randomShuffle() {\n const shuffled = [];\n const unshuffled = this.cards.slice();\n\n while (unshuffled.length > 0) {\n const randomCard = Math.floor(Math.random() * unshuffled.length);\n shuffled.push(unshuffled.splice(randomCard, 1)[0]);\n }\n\n this.cards = shuffled;\n }", "shuffle() {\n // -- To shuffle an array a of n elements (indices 0..n-1):\n // for i from n−1 downto 1 do\n // j ← random integer such that 0 ≤ j ≤ i\n // exchange a[j] and a[i]\n for (let n = this.cards.length - 1; n > 0; --n)\n {\n //Step 2: Randomly pick a card which has not been shuffled\n let k = Math.floor(Math.random() * (n + 1));\n\n //Step 3: Swap the selected item with the last \"unselected\" card in the collection\n let temp = this.cards[n];\n this.cards[n] = this.cards[k];\n this.cards[k] = temp;\n }\n }", "shuffle() {\n for (let i = this.cards.length - 1; i > 1; i--) {\n let x = Math.floor(Math.random() * i);\n let temp = this.cards[i];\n this.cards[i] = this.cards[x];\n this.cards[x] = (temp);\n }\n }", "shuffle() {\n for (let i = this.cards.length - 1; i > 0; i--) {\n const newIndex = Math.floor(Math.random() * (i + 1)); //get random index before the current card to swap with\n const oldValue = this.cards[newIndex];\n this.cards[newIndex] = this.cards[i];\n this.cards[i] = oldValue;\n //Looping through all of our cards and swapping them with another card to get a random shuffle\n }\n }", "shuffle() {\n this._decks.forEach(deck => deck.shuffle())\n return super.shuffle();\n }", "shuffle() {\n const { cards } = this;\n for (let i = cards.length - 1; i > 0; i--) {\n const swapIndex = Math.floor(Math.random() * (i + 1)); \n const currentCard = this.cards[i];\n const cardToSwap = this.cards[swapIndex];\n this.cards[i] = cardToSwap;\n this.cards[swapIndex] = currentCard;\n };\n return this;\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 }", "function shuffleDeck() {\n var firstShuffle = shuffle(deck);\n var secondShuffle = shuffle(firstShuffle);\n deck = shuffle(secondShuffle);\n}", "shuffle() {\n let currentIndex = this.length;\n let temp, randomIndex;\n\n while (0 !== currentIndex) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temp = this[currentIndex];\n this[currentIndex] = this[randomIndex];\n this[randomIndex] = temp;\n }\n }", "function shuffle()\n{\n var tem = getRandom(shuffleIndexCount);\n var tem2 = shuffleIndex[tem];\n shuffleIndex[tem] = shuffleIndex[shuffleIndexCount];\n\n shuffleIndexCount--;\n if(shuffleIndexCount < 0)\n {\n shuffleIndexCount = songsList.length;\n }\n return tem2;\n}", "shuffle(){\n const deck = this.deck;\n let m = deck.length;\n let i;\n \n while(m){\n i = Math.floor(Math.random() * m--);\n \n [deck[m], deck[i]] = [deck[i], deck[m]];\n }\n \n return this;\n }", "reshuffle() {\n this._deck = [];\n for(var i = 0; i < 52; i++) {\n\t\t\tthis._deck.push(i);\n\t\t}\n \n this.shuffle();\n }", "shuffleCards() {\n\n \t\tfor(var i = 0; i < this.cards.length; i++) {\n \t\t\tvar randomIndex = Math.floor(Math.random() * this.cards.length);\n \t\tvar temp = this.cards[i];\n \t\t\n \t\tthis.cards[i] = this.cards[randomIndex];\n \t\tthis.cards[randomIndex] = temp;\n \t\t}\n\t }", "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 (arr) {\n var arrCopy = arr.slice();\n shuffleInplace(arrCopy);\n return arrCopy;\n }", "function shuffleDeck(){\n for(let i=0;i<deck.length;i++ ){\n swapIdx=Math.trunc( Math.random() * deck.length);\n let temp =deck[swapIdx];\n deck[swapIdx]=deck[i];\n deck[i]=temp;\n }\n}", "function shuffle() {\n randomize(deck);\n renderDeck(deck);\n}", "function shuffleit() {\n list_cards = shuffle(list_cards);\n shuffle_cards(list_cards);\n}", "reset(shuffle = true){\n this.cards = [];\n for (var i = 0; i <= 12; i++) {\n for (var j = 0; j <= 3; j++) {\n let card = new Card(values[i], suits[j]);\n this.cards.push(card);\n }\n }\n if (shuffle){ this.shuffle(); }\n this.dealtIndex = 0;\n }", "shuffle() {\n _deck.set(this, shuffleArray(_deck.get(this)));\n }", "function shuffleCards() {\r\n shuffle(cardsOrig);\r\n cardsTop = cardsOrig.slice(0);\r\n shuffle(cardsOrig);\r\n cardsBottom = cardsOrig.slice(0);\r\n cards = cardsTop.concat(cardsBottom);\r\n shuffle(cards);\r\n console.log(cards);\r\n}", "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 shuffleInplace (arr) {\n var j, tmp;\n for (var i = arr.length - 1; i > 0; i--) {\n j = baseRandInt(i + 1);\n tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n }\n }", "function shuffleCards() {\n\t\t\tvar curr_index = cards.length, \n\t\t\t\ttemp_value, \n\t\t\t\trand_index;\n\t\t\twhile (0 !== curr_index){\n\t\t\t\t// Pick random value\n\t\t\t\trand_index = Math.floor(Math.random() * curr_index);\n\t\t\t\tcurr_index--;\n\t\t\t\t// Swap the randomly picked value with the current one\n\t\t\t\ttemp_value = cards[curr_index];\n\t\t\t\tcards[curr_index] = cards[rand_index];\n\t\t\t\tcards[rand_index] = temp_value;\n\t\t\t}\n\t\t}", "function shuffle()\n\t{\n\t\tvar o = slides;\n\t\tfor (var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\tslides = o;\n\t}", "shuffle() {\n for (let i = this.deck.length - 1; i > 0; i--) {\n let randomIndex = Math.floor(Math.random() * (i + 1));\n let currentIndex = this.deck[i];\n this.deck[i] = this.deck[randomIndex];\n this.deck[randomIndex] = currentIndex;\n }\n\n return this.deck;\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( 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}", "shuffleCards() {\n for (var i = cards.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * (i + 1))\n var temp = cards[i]\n cards[i] = cards[j]\n cards[j] = temp\n }\n }", "function shuffle () {\n for (var i = 0; colorSet.length > 0; i += 1) {\n colorShuffled = colorShuffled.concat(colorSet.splice(Math.floor(Math.random() * colorSet.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}", "shuffleCards() {\n let random = 0;\n let temp = 0;\n for (i = 1; i < game.cards.length; i++) {\n random = Math.round(Math.random() * i);\n temp = game.cards[i];\n game.cards[i] = game.cards[random];\n game.cards[random] = temp;\n }\n game.assignData();\n \n }", "shuffle() {\n let len = this.cards.length;\n while(len) {\n // randomly choose a card and move it to the end\n // of the deck\n this.cards.push(\n this.cards.splice( Math.floor( Math.random() * len ), 1 )[0]\n )\n len -= 1\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(arr) {\n for (var i = 0; i < arr.length; ++i) {\n var randomIndex = Math.floor(Math.random() * arr.length);\n swap(arr, i, randomIndex);\n }\n\n return arr;\n }", "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}", "function reshuffle() {\n shuffleArray(group.people);\n selectGroup(true);\n saveNewOrder();\n}", "function shuffle() {\n\tshuffleCards = cards.sort(function(a,b){return 0.5 - Math.random()});\n}", "shuffleDeck() {\n let n = this.deck.length;\n for (let i = 0; i < n; i++) {\n var r = Math.floor(Math.random() * n);\n this.shuffledCards.push(this.deck[r]);\n this.deck[r] = this.deck[n - 1];\n n--;\n }\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}", "shuffleDeck(state) {\n state.hint = initialState.hint;\n state.hasWon = initialState.hasWon;\n state.currentDeck = initialState.currentDeck;\n state.currentScore = initialState.currentScore;\n state.spareStack.splice(0, state.spareStack.length);\n [state.currentDeck, state.spareStack] = shuffleService.shuffleCards();\n return state;\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}", "shuffle(deck) {\n for (let i = deck.length - 1; i > 0; i--) {\n const j = Math.floor(Math.random() * (i + 1));\n const temp = deck[i];\n deck[i] = deck[j];\n deck[j] = temp;\n }\n return deck;\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}", "shuffle() {\n let remainingCardTobeShuffled = this.deck.length, randomCardSwapIndex;\n\n // Swaps 52 times\n while (remainingCardTobeShuffled) {\n\n // Create a random index to be swapped\n randomCardSwapIndex = Math.floor(Math.random() * remainingCardTobeShuffled--);\n\n // Shortcut in js to swap two elements\n [this.deck[remainingCardTobeShuffled], this.deck[randomCardSwapIndex]] = [this.deck[randomCardSwapIndex], this.deck[remainingCardTobeShuffled]];\n }\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}", "function shuffle(o){ //v1.0\n\t\t\tfor(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\t\treturn o;\n\t\t}", "shuffle() {\n for(let x = 0; x < 2; x++) { \n for (let i = this.cards.length - 1; i > 0; i--) {\n let j = Math.floor(Math.random() * (i + 1)); // random index from 0 to i\n [this.cards[i], this.cards[j]] = [this.cards[j], this.cards[i]]; // swap elements\n }\n }\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(arr){\n let randomIndex, tmp\n\n for(let index = arr.length; index > 0; index--){\n randomIndex = random(index)\n\n tmp = arr[randomIndex]\n arr[randomIndex] = arr[index]\n arr[index] = tmp\n }\n\n return arr\n}", "function shufflePlayerList() {\r\n shuffle(players);\r\n\r\n playerInTurn = 0;\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 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 }\n }", "function shuffleCards()\n{\n var i = 0;\n var j = 0;\n var temp = null;\n\n for (i = cards.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1));\n temp = cards[i];\n cards[i] = cards[j];\n cards[j] = temp;\n }\n}", "function shuffleCards()\n{\n var i = 0;\n var j = 0;\n var temp = null;\n\n for (i = cards.length - 1; i > 0; i -= 1) {\n j = Math.floor(Math.random() * (i + 1));\n temp = cards[i];\n cards[i] = cards[j];\n cards[j] = temp;\n }\n}", "randomShuffle(array) {\n var currentIndex = array.length,\n temporaryValue, randomIndex;\n\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n\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 return array;\n }", "function shuffle(deck) {\n for (var i = deck.length - 1; i > 0; i--) {\n var j = Math.floor(Math.random() * i);\n var temp = deck[i];\n deck[i] = deck[j];\n deck[j] = temp;\n }\n return deck;\n}", "function shuffle() {\n var currentIndex = questions.length, temporaryValue, randomIndex;\n\n while (0 !== currentIndex) {\n\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n\n temporaryValue = questions[currentIndex];\n questions[currentIndex] = questions[randomIndex];\n questions[randomIndex] = temporaryValue;\n }\n\n return questions;\n}", "function shuffle(o){ //v1.0\n\t for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\treturn o;\n\t}", "function shuffle(o){ //v1.0\n\t for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t return o;\n\t}", "function shuffle(o) { //v1.0\n for (var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n return o;\n }", "shuffle() {\n const { cards } = this;\n for (let i = cards.length - 1; i > 0; i--) {\n // Find a random number in index\n // Assign to variable \"swapIndex,\" \n // Add new card every loop to this index\n const swapIndex = Math.floor(Math.random() * (i + 1)); \n // In this case, i+1 is 52 for cards in the deck\n // Locate current place in array\n const currentCard = this.cards[i];\n // Moves the chosen cards to the front of the array\n // Then swaps with remaining cards\n // Chooses a card from remaining array\n const cardToSwap = this.cards[swapIndex];\n this.cards[i] = cardToSwap;\n this.cards[swapIndex] = currentCard;\n };\n return this;\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 }", "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(o) { //v1.0\n for (var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n return o;\n }", "function shuffle(o){ //v1.0\n\t\tfor(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\treturn o;\n\t}", "function shuffle(o){ //v1.0\n\t\tfor(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n\t\treturn o;\n\t}", "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( 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 resetDeck() {\n currentDeck = shuffle([...DECK]);\n}", "function shuffle(arr) {\n var j, x, i;\n for (i = arr.length - 1; i > 0; i--) {\n j = Math.floor(Math.random() * (i + 1));\n x = arr[i];\n arr[i] = arr[j];\n arr[j] = x;\n }\n return arr;\n}", "function shuffle(arr) {\n var ctr = arr.length, temp, index;\n while (ctr > 0) {\n index = Math.floor(Math.random() * ctr);\n ctr--;\n temp = arr[ctr];\n arr[ctr] = arr[index];\n arr[index] = temp;\n }\n return arr;\n}", "function shuffle(arr) {\n var length = arr.length, i, temp, randomIndex;\n\n for (i = 0; i < length; i++) {\n randomIndex = getRandomInt(i, length - 1);\n temp = arr[i];\n arr[i] = arr[randomIndex];\n arr[randomIndex] = temp;\n }\n}", "function someFunction() {\n shuffle(arr)\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 shuffle ( array ) {\n\t\tvar counter = array.length, temp, index;\n\n\t\t// While there are elements in the array\n\t\twhile (counter--) {\n\t\t\t// Pick a random index\n\t\t\tindex = (Math.random() * counter) | 0;\n\n\t\t\t// And swap the last element with it\n\t\t\ttemp = array[counter];\n\t\t\tarray[counter] = array[index];\n\t\t\tarray[index] = temp;\n\t\t}\n\n\t\treturn array;\n\t}", "function createShuffle() {\r\n shuffled = [];\r\n for (var i = 0; i < songs.length; i++) {\r\n shuffled.push(i);\r\n }\r\n return randomize(shuffled);\r\n }", "function shuffle(arr) {\n var j, x, i;\n for (i = arr.length; i; i--) {\n j = Math.floor(Math.random() * i);\n x = arr[i - 1];\n arr[i - 1] = arr[j];\n arr[j] = x;\n }\n}", "newShuffle(){\n this.drawPile = shuffle(this.newDeck());\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 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(o) { //v1.0\n for (var j, x, i = o.length; i; j = parseInt(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x){}\n return o;\n }", "static shuffle() {\n shuffleWords(words);\n shuffleWords(globalPool);\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 }", "shuffle ()\r\n {\r\n for (let i = this.arr.length - 1; i > 0; i--)\r\n {\r\n let num = Math.floor (Math.random () * (i + 1));\r\n this.arr [num].style.order = i;\r\n this.arr [i].style.order = num;\r\n }\r\n }", "function shuffle() {\n let currentIndex = cardList.length, temporaryValue, randomIndex;\n\n while (currentIndex !== 0) {\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex -= 1;\n temporaryValue = cardList[currentIndex];\n cardList[currentIndex] = cardList[randomIndex];\n cardList[randomIndex] = temporaryValue;\n }\n return cardList;\n}", "function shuffle() {\n var currentIndex = recipes.length, temporaryValue, randomIndex ;\n\n // While there remain elements to shuffle...\n while (0 !== currentIndex) {\n\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 = recipes[currentIndex];\n recipes[currentIndex] = recipes[randomIndex];\n recipes[randomIndex] = temporaryValue;\n }\n}", "function shuffle(deck) {\n\n for (var i = 0; i < deck.length; i++) {\n new_i = Math.round(Math.random() * deck.length);\n tmp = deck[new_i];\n deck[new_i] = deck[i];\n deck[i] = tmp;\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(o){ //v1.0\n for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n return o;\n }", "function shuffle(o){ //v1.0\n for(var j, x, i = o.length; i; j = Math.floor(Math.random() * i), x = o[--i], o[i] = o[j], o[j] = x);\n return o;\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 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(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}" ]
[ "0.801566", "0.77262646", "0.76398546", "0.7610369", "0.7523084", "0.74649537", "0.7463079", "0.7451059", "0.7438878", "0.74300104", "0.74195415", "0.7409581", "0.73898494", "0.7378674", "0.73700774", "0.7367741", "0.7349255", "0.7308936", "0.7299316", "0.72966886", "0.72829443", "0.7280223", "0.7246217", "0.72378826", "0.7228329", "0.72204036", "0.7212979", "0.7204875", "0.7200529", "0.7194756", "0.71923083", "0.71904826", "0.71805936", "0.71688473", "0.71626115", "0.7150888", "0.7138933", "0.7135488", "0.712403", "0.71225166", "0.71160233", "0.71128947", "0.71105874", "0.71016926", "0.7098174", "0.7096923", "0.7096534", "0.70939547", "0.709025", "0.70800334", "0.7068523", "0.706397", "0.7062304", "0.7061188", "0.70574045", "0.70515376", "0.7039761", "0.70336926", "0.7029882", "0.7029882", "0.70260733", "0.7025294", "0.7023167", "0.70213956", "0.70197123", "0.70175534", "0.7016437", "0.700969", "0.70096785", "0.70077604", "0.70071846", "0.70071846", "0.700336", "0.6999166", "0.6997293", "0.6995776", "0.6993438", "0.69932806", "0.69914323", "0.69912314", "0.69900566", "0.6988133", "0.6986746", "0.6984871", "0.69821626", "0.6977705", "0.6977705", "0.6975526", "0.69748497", "0.6974471", "0.69737786", "0.6968926", "0.69640374", "0.696293", "0.6962111", "0.6961799", "0.6961799", "0.69612813", "0.6959678", "0.6959602" ]
0.80238956
0
static API_ADDRESS = '
function HttpApiService(http) { this.http = http; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static get API_URL() {\r\n const port = 1337; // Change this to your server port\r\n return `http://localhost:${port}/`;\r\n }", "static get API_URL(){\n\t\tconst port = 8081;\n\t\treturn `http://localhost:${port}`\n\t}", "static get API_URL() {\n const port = 1337; // Change this to your server port\n return `http://localhost:${port}`;\n }", "static test() {\n console.log(Config.Api_Address);\n }", "get apiUrl() {\n return `http://${this.host}:${this.tempApiPort}/api`; // setups up the url that the api is located at and used as a shortcut for our fetch api scripts to retrieve data\n }", "constructor(url) {\n this.API_URL = url\n }", "static get DEFAULT_API_BASE_URL() { return 'https://api.todobot.io'; }", "constructor() {\n this.api_url = process.env.REACT_APP_API_ENDPOINT;\n }", "static get API_BASE_URL() {\n return 'https://andrew-wanex.com/mundusvestro_v1.0.0/weather';\n }", "static get apiEndpoint() {\n return 'secretmanager.googleapis.com';\n }", "function getAPI() {\n\treturn \"http://\" + apiUrl + \":\" + apiPort + \"/\" + apiResource;\n}", "function getAPIKey(){\n\n}", "function apiURL(service) { //Función para formar la ruta completa a la API \n return BaseApiUrl + service;\n}", "function ApiClient() {\n\n}", "get apiEndpoint() {\n return HttpHelper.apiEndpoint;\n }", "function setApi() {\n api = 'http://api.openweathermap.org/data/2.5/weather?lat=' + lat + '&lon=' + lon + '&units=imperial&APPID=' + apiId;\n}", "function API(){}", "function API(){}", "api_name() {\n\n }", "static get baseUrl() {\n return 'https://api.opencagedata.com';\n }", "getApiBaseUrl() {\n // eslint-disable-next-line no-undef\n return process.env.API_BASE_URL;\n }", "static getRequestURL() {\n return `${process.env.REACT_APP_GEOSERVER_URL}`;\n }", "static get restBaseUrl() {\n return `${BASE_URL}`;\n }", "static get apiEndpoint() {\n return 'securitycenter.googleapis.com';\n }", "function setAPIBaseUrl() {\n\tnew BRequest().setAPIBaseUrl();\n}", "function getapi(){\n\tif (window.location.protocol != \"https:\"){\n\t\treturn \"http://wev.se/etc/api\";\n\t} else{\n\t\treturn \"https://wev.se/etc/api\";\n\t}\n}", "constructor() {\n this.url = BASE_URL;\n }", "function ServiceUrl() {\n this.baseUrl = \"https://pharmaappnew.azurewebsites.net/api/\";\n }", "function setBaseURL(){\n return baseURL = 'http://' + config.getListenAddress() + ':' + config.getListenPort() + '/api/' + config.getVersion() + '/addressbook/'\n}", "function api_url(data){\n\treturn base_url+data;\n}", "apiUrl() {\n return process.env.VUE_APP_ROOT_API;\n }", "get BASE_URL() {\n return this.USE_LOCAL_BACKEND ?\n 'http://' + manifest.debuggerHost.split(`:`).shift() + ':3000/' + this.API_VERSION :\n 'https://mhacks.org/' + this.API_VERSION\n }", "get apiHostname() {\n return url.format({\n protocol: this.apiProtocol,\n host: this.apiHost\n });\n }", "setApiKey() {\n\n }", "getServerAPIURL() {\n let result = \"/api\";\n if ((window.ENV) && (window.ENV.serverURL)) {\n result = window.ENV.serverURL;\n }\n return result;\n }", "constructor() {\n switch (window.location.hostname) {\n case 'localhost':\n this._baseUrl = 'http://localhost:8080/api';\n break;\n case 'itberries-frontend.herokuapp.com':\n this._baseUrl = 'https://itberries-backend.herokuapp.com/api';\n\n // this._baseUrl = 'https://itberries-frontend.herokuapp.com/api';\n break;\n case 'it-berries.neat.codes':\n this._baseUrl = 'https://it-berries.neat.codes/api';\n break;\n }\n }", "get api() {\n return getEnv(self).api;\n }", "weatherAPI(){\n return this.apiKeyGC;\n }", "static get DATABASE_URL () {\r\n const port = 1337; // Change this to your server port\r\n return `http://localhost:${port}/api`;\r\n }", "function returnAPIKey(){\r\n\treturn \"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\";\r\n}", "constructor(httpClient) {\n this.httpClient = httpClient;\n //public url_base = \"http://localhost:8080\";\n this.url_base = \"https://yaoyuan333.wm.r.appspot.com\";\n }", "function GetApiPath() {\n return '/api/data/v9.0/';\n }", "constructor (api) { this.api = api }", "constructor (api) { this.api = api }", "constructor (api) { this.api = api }", "constructor() {\n this.rootUrl = '//35.239.128.233:8070';\n }", "function createWeatherURL() {\n weatherURL = \"https://api.openweathermap.org/data/2.5/forecast?q=davis,ca,us&units=imperial&appid=\" + APIKey;\n}", "getAPI(request, response) {\n let message = {};\n message.name = 'implementation pending';\n message.version = 'implementation pending';\n return response.jsonp(message);\n }", "get APIBase() {\n return this[sApiBase];\n }", "static get apiEndpoint() {\n return 'dialogflow.googleapis.com';\n }", "static get API_URL() {\n return 'https://dog.ceo/api/breeds/list/all';\n }", "baseUrl(){\n return `https://www.warcraftlogs.com:443/${this.version}`\n }", "constructor() {\n // Check environmental variables (which we can use with Heroku) first and fall back to a configuration file.\n if (process.env.NPS_API_KEY){\n this.authKey = process.env.NPS_API_KEY;\n }\n else {\n var config = yaml.readSync('../config.yml');\n this.authKey = config['nps-api-key'];\n }\n\n this.auth = `&api_key=${this.authKey}`;\n this.url = 'https://developer.nps.gov/api/v1/';\n }", "get api() {\n return google;\n }", "constructor(http) {\n this.http = http;\n this.baseUrl = 'https://localhost:44347/api/';\n }", "function MainService() {\n this.httpUrl = 'http://34.93.84.140:3000';\n }", "async function get_api_url () {\n const { protocol, host, port } = await get_options();\n return `${protocol}://${host}:${port}/gui`;\n}", "function getPublicApi() {\n return {\n\n };\n }", "constructor(){\n\t\t//console.log('API START');\n\t}", "static apiRoute() {\n return 'api'\n }", "function getBaseURL() {\n var baseURL = window.location.protocol + '//' + window.location.hostname + ':' + api_port;\n return baseURL;\n}", "function Api(){\n}", "constructor(api) {\r\n this._api = api;\r\n }", "function getAPIBaseURL() {\n let baseURL = window.location.protocol\n + '//' + window.location.hostname\n + ':' + window.location.port\n + '/api';\n return baseURL;\n}", "static get DATABASE_URL() {\r\n const baseUrl='http://localhost:1337/';\r\n return baseUrl;\r\n }", "get api() {\n return this.fapp.api;\n }", "static get DATABASE_URL() {\r\n const port = 1337;\r\n return 'http://locahost:${port}';\r\n }", "get api_version() {\n return \"1.1\"\n }", "route() {\n return `/api/staff/v1/${this._api_route}`;\n }", "constructor(api) {\n this.api = api;\n }", "_setDefaults () {\n let parsedBase = urlHelper.parse(apiBaseUrl)\n\n this.urlDefinition = {\n protocol: parsedBase.protocol,\n host: parsedBase.host,\n slashes: parsedBase.slashes,\n pathname: parsedBase.pathname\n }\n }", "function base_url() {\n return 'http://10.10.0.242/Vales/';\n}", "function getAPIKey() {\n return ss.getRange(API_KEY).getValue();\n}", "getTokenRequestUrl() {\r\n return config.oauthTokenRequestBaseUrl;\r\n }", "getApiKey() {\n return `get${this.apiKey}List`\n }", "function getGlobDataAPI(){\n\n}", "static get DATABASE_URL() {\r\n const port = 1337; // Change this to your server port\r\n const url = window.location.href;\r\n if(url.startsWith('https')) {\r\n return `https://amroaly.github.io/mws-restaurant-stage-1/data/restaurants.json`;\r\n } \r\n // for dev it shoud be http://localhost:${port}\r\n // instead of https://amroaly.github.io/mws-restaurant-stage-1/\r\n return `http://localhost:${port}/restaurants`;\r\n }", "function APIClass() {\n\t// Config\n\tthis.api_url_base = \"http://\" + window.location.hostname + \":\";\n\tthis.default_config = new Config(PORT.ORCHESTRATOR, CONTENT_TYPE.NONE, METHOD.GET);\n\n\n\t/**\n\t * Open HTTP Request\n\t * @param api_config\n\t * @param uri\n\t * @returns {XMLHttpRequest}\n\t */\n\tthis.open_request = function(api_config, uri) {\n\t\tlet url = this.api_url_base + api_config.port + uri;\n\t\tconsole.log(\"[API] [\" + api_config.method + \"] \" + url);\n\n\t\tlet http = new XMLHttpRequest();\n\t\thttp.open(api_config.method, url, true);\n\t\tif(api_config.contentType !== CONTENT_TYPE.NONE) {\n\t\t\thttp.setRequestHeader(\"Content-Type\", api_config.contentType);\n\t\t}\n\t\thttp.setRequestHeader(\"Authorization\", \"Basic \" + window.localStorage.getItem(\"defpi_token\"));\n\t\treturn http;\n\t};\n\n\t/**\n\t * Send method for API request\n\t * @param {object}\t\t\t\tapi_config\n\t * @param {string} \t\turi\n\t * @param {object} \t\tdata\n\t * @param {function} \t\tcallback\n\t * @param {function(number)} error\n\t */\n\tthis.send = function(api_config, uri, data, callback, error) {\n\t\tif(api_config === null) api_config = this.default_config;\n\n\t\tlet http = this.open_request(api_config, uri);\n\t\thttp.onreadystatechange = function() {\n\t\t\tif(http.readyState === http.DONE ) {\n\t\t\t\tif (http.status >= 200 && http.status <= 207) {\n\t\t\t\t\tif (this.getResponseHeader(\"Content-Type\") === \"application/javascript\" || this.getResponseHeader(\"Content-Type\") === \"application/json\") {\n\t\t\t\t\t\tlet response = JSON.parse(http.response);\n\t\t\t\t\t\tcallback(response);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcallback(http.response);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconsole.error(\"[Api] HTTP CODE: \" + http.status);\n\t\t\t\t\tif(error != null) { error(http.status); return; }\n\n\t\t\t\t\tconsole.log(\"Server down?\");\n\t\t\t\t\t//document.location = \"/\";\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\thttp.send(data);\n\t};\n\n}", "function vcMakeConfig() {\n return '{apiKey:\"' + _skywayApiKey + '\", domain:\"' + _skywayDomain + '\"}';\n}", "get apiKey() {\n return this.config.apiKey;\n }", "get apiBaseUrl() {\n if (!this.appConfig) {\n throw Error('Config file not loaded!');\n }\n return this.appConfig.apiBaseUrl;\n }", "constructor(){\n\t\tthis.params = new URLSearchParams();\n\t\tthis.params.append('apikey', '47f218b0-b5d5-11e8-8c0c-03e1b17d6f1e');\n\t\tthis.params.append('size', 100);\n\t}", "static get DATABASE_URL() {\n const url = \"http://localhost\";\n const port = 1337;\n const param = \"restaurants\";\n\n return url + \":\" + port + \"/\" + param;\n }", "_createApiUrl() {\n this._apiUrl = `https://api.trello.com/1/cards/${this._cardId}/attachments/${this._attachmentId}`;\n }", "get serverUrl() {\n return `http://${this.host}:${this.port}`;\n }", "function HTTPUtil() {\n}", "generateReqUrl() {\n this.url = `https://api.openweathermap.org/data/2.5/weather?q=${this.loc}&appid=${this.apiKey}${this.units}${this.lang}${this.mode}`;\n this.query ? this.url += `&${queryString.stringify(this.query)}` : this.url;\n \n }", "function configApi(){\n this._url = {\n api: 'http://api.themoviedb.org/3',\n img: 'http://image.tmdb.org/t/p/w185/'\n };\n this.$get = function() {\n return this._url;\n };\n\n /**\n * @param {object} url\n */\n this.setUrl = function(url) {\n this._url = url;\n };\n }", "static get DATABASE_URL() {\r\n // const port = 8000 // Change this to your server port\r\n // return `http://localhost:${port}/data/restaurants.json`;\r\n return `http://localhost:${DBHelper.port}/restaurants`;\r\n }", "function RestapiServiceProvider(http) {\n this.http = http;\n this.apiUrl = 'http://81.252.184.9:5003/data/'; //mobile url\n console.log('Hello RestapiServiceProvider Provider');\n }", "baseURL() {\n \n return config.baseURL\n }", "static get PATH() {\n return \"/v2/applications\";\n }", "static getConfig() {\n return {\n apiKey: Firebase.apiKey,\n appId: Firebase.appId,\n authDomain: Firebase.authDomain,\n databaseURL: Firebase.databaseURL,\n projectId: Firebase.projectId,\n messagingSenderId: Firebase.messagingSenderId,\n };\n }", "get api_route() {\n return this._api_route;\n }", "function getBaseServer() {\n return process.env.placeGeneratorGcacheURL ? process.env.placeGeneratorGcacheURL : 'https://maps.googleapis.com';\n}", "baseUrl() {\n // console.log(\"baseUrl: \" + process.env.REACT_APP_URL);\n\n return (process.env.REACT_APP_URL) ? process.env.REACT_APP_URL : \"/api/\";\n }", "constructor() {\n this.baseUrl = 'http://localhost:9000/api/expenses'\n }", "static get DATABASE_URL() {\n //const port = 8080 // Change this to your server port\n const url = `http://localhost:${PORT}/restaurants`;\n\n return url;\n }", "function getMapBoxAPIKey() {\n \n var mapboxAPIKey = \"\";\n\n mapboxAPIKey = C_MAPBOX_API_KEY;\n \n // Later = Replace API key fetch from DB \n // mapboxAPIKey = d3.request(apiUrlMapboxKey).get({retrun});\n\n return mapboxAPIKey;\n\n}", "static get DATABASE_URL() {\r\n const port = 8081 // Change this to your server port\r\n // return `http://localhost:${port}/data/restaurants.json`;\r\n return `http://localhost:1337/restaurants`;\r\n }", "static baseUrl() {\n return '/'\n }" ]
[ "0.7679229", "0.76224905", "0.76219505", "0.7297923", "0.7104186", "0.6986184", "0.6906008", "0.69051623", "0.6865523", "0.6758331", "0.6725578", "0.67111385", "0.6624466", "0.66036487", "0.6599575", "0.6584151", "0.6576798", "0.6576798", "0.6573657", "0.65618455", "0.6556057", "0.65254086", "0.65062886", "0.65047276", "0.6474145", "0.6471881", "0.6460269", "0.6412716", "0.64126897", "0.63526106", "0.63349223", "0.63259304", "0.62994576", "0.62438726", "0.6215458", "0.6214525", "0.6212539", "0.617256", "0.61545265", "0.6153907", "0.6138874", "0.61259073", "0.60990727", "0.60990727", "0.60990727", "0.60927504", "0.60837674", "0.60805345", "0.60667086", "0.60638034", "0.60400414", "0.60174686", "0.5999701", "0.5988065", "0.59862965", "0.59855753", "0.59834445", "0.5979575", "0.59696597", "0.5960266", "0.5943183", "0.5915021", "0.59132296", "0.59127367", "0.58928704", "0.5887082", "0.5875902", "0.586663", "0.5856075", "0.58543587", "0.5844367", "0.5843904", "0.5843309", "0.5823473", "0.5821039", "0.58088636", "0.5803881", "0.5801561", "0.57993174", "0.57745135", "0.57723594", "0.5762159", "0.57588255", "0.5749719", "0.57399195", "0.57378364", "0.5736472", "0.5735631", "0.5722187", "0.5719832", "0.57157356", "0.5715281", "0.57135695", "0.569265", "0.5692223", "0.5680876", "0.5671431", "0.5669888", "0.5668455", "0.5661417", "0.56601226" ]
0.0
-1
Adds border of color depending on each alert's status on left side of each list item
function getListItemStatus(s) { switch (s) { case 'StatusAcknowledged': return 'warn' case 'StatusUnacknowledged': return 'err' case 'StatusClosed': return 'ok' } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayStatusColor ($group) {\n $group.find('.cmb-group-title').each(function () {\n var $this = $(this);\n var status = $this.next().find('[id$=\"status\"] option:selected').text();\n if (status) {\n var $parent = $this.parents('.cmb2-wrap.form-table');\n color = $parent.find('ul.statuses li .status:contains(' + status + ')').next().text();\n color = color ? color : 'transparent';\n $this.append('<span class=\"status\" style=\"background: ' + color + '\">' + status + '</span>');\n }\n });\n }", "function shiftPosition(){\n\t\t$(\"#data-list li\").css('margin-left','0px');\n\t\t$(\"#data-list li\").css('border-left','5px solid #222222');\n\t\t$(this).css('margin-left','10px');\n\t\t$(this).css('border-left','5px solid #DB902B');\n\n\n\n\n\t}", "function assignColourCode() {\n $('.issue-list-item').each(function() {\n var colourCode = getColourCode($(this).attr('data-updated'));\n $(this).css('border-left-width', '5px').css('border-left-color', colourCode);\n });\n}", "function scheduleRedBorder(callback, list, element) {\n if (! callback(list)) {\n element.style.border = \"3px solid red\";\n }\n}", "boldWinningSlots(arr) {\n for (let i = 0; i < arr.length; i++) {\n this.getSlot(arr[i]).style.border = '4px solid red';\n }\n }", "function listItemOnClick(listItem) {\n\tlistItem.addEventListener('click', () => {\n\t\tif (colorise === true) {\n\t\t\tlet randomColor = `rgb(${Math.floor(Math.random() * 255)},${Math.floor(Math.random() * 255)},${Math.floor(\n\t\t\t\tMath.random() * 255\n\t\t\t)})`;\n\t\t\tlistItem.style.border = `2px solid ${randomColor}`;\n\t\t}\n\t});\n}", "function alertRed(itemId, tabId)\n{\n document.getElementById(itemId + '-lbl').style.color='red';\n document.getElementById(itemId + '-lbl').style.fontWeight='bold';\n document.getElementById(itemId).style.fontWeight='bold';\n document.getElementById(itemId).style.borderColor='#fa5858';\n //document.getElementById(itemId + '_chzn').style.borderColor='red';\n\n //Check if a tab should be show.\n if(tabId) {\n showTab(tabId);\n }\n\n return;\n}", "function statusDisplayList (hsl) {\n\ttry {\n\t\t\n\t\thsl.display (statusBar);\n\n\t} catch (ex) {\n\t\tshowStatus (\"[UI/UIstatus.statusDisplayList] \" + ex.message);\n\t}\n}", "function formatErrorIndications(elementERR) {\n /** first the format of inpunt elements, but not the div of checkbox, the effect is ugly.\n And no all checkbox are mandatory.\n With this, the user can locate easily the elements with errors **/\n if (elementERR !== activities) {\n elementERR.style.borderBottom = '3px solid red';\n }\n\n /** Second the format of the error meesages **/\n const errorMessages = document.getElementsByClassName('errorMessage');\n for (let i = 0; i < errorMessages.length; i+= 1) {\n errorMessages[i].style.background = 'lightblue';\n errorMessages[i].style.borderLeft = '6px solid red';\n errorMessages[i].style.marginBottom = '5px';\n errorMessages[i].style.paddingLeft = '5px';\n errorMessages[i].style.lineHeight = 1.5;\n errorMessages[i].style.color = 'black';\n errorMessages[i].style.fontSize = '14px';\n errorMessages[i].style.fontWeight = 500;\n }\n }", "function styleListItem(li) {\n\tswitch(li.className) {\n case 'One':\n\t\t\tli.style.backgroundColor = '#00f';\n\t\t\tli.style.color = '#fff';\n\t\t\tbreak;\n case 'Two':\n\t\t \tli.style.backgroundColor = '#ff0';\n\t\t\tli.style.color = '#fff';\n\t\t\tbreak;\n\t\tcase 'Three':\n\t\t \tli.style.backgroundColor = '#f00';\n\t\t\tli.style.color = '#fff';\n\t\t\tbreak;\n default:\n\t\t\tli.style.backgroundColor = '#f0f';\n\t\t\tli.style.color = '#fff';\n\t}\nreturn li;\n}", "function getCount() {\n const allListItems = document.querySelectorAll('#invitedList li');\n\n for (var i = 0; i < allListItems.length; i++) {\n let increment = 1 - `${i / 10}`;\n // console.log(increment);\n if (increment === 0) {\n // console.log(\"It's white!\");\n } else {\n allListItems[i].style.backgroundColor = `rgba(251, 212, 4, ${increment})`;\n }\n }\n\n}", "alertProjectEndExceeded(item) {\n item.style = item.end > this.groups.get(item.group).end ? \"background: rgba(175, 0, 0, 1);\" : \"\";\n }", "function loopfunction(item) {\n item.style.backgroundColor = item.className;\n item.style.border = \"none\";\n if (item.id == mode || item.className == hex_to_color_dict[ctx.strokeStyle]) {\n item.style.border = \"2px solid black\";\n }\n }", "statusColor(status) {\n switch(status) {\n case 2:\n return \"titleGreen\";\n case 1:\n return \"titleOrange\"; \n case 3:\n return \"titleRed\";\n default:\n return \"titleOrange\";\n }\n }", "function RouteDisplay(){\n const listItems = messages.map((message) =>\n <h4>{message.Content}</h4>\n );\n\n return (\n <ul className=\"RouteDisplay\" style={{ backgroundColor: (status == '1') ? '#1fdb51' : '#f5260f', paddingTop: '2%'}}>\n {listItems}\n </ul>);\n}", "function getBeforeStyle(date1, date2, threshold, orderStatus) {\n \n if(getProgressDurationInMinutes(date1, date2) > threshold) {\n return {\n border : '3px solid #ff3b34',\n // background : '#ff3b34'\n }\n } else if (getProgressDurationInMinutes(date1, date2) === 0 && orderStatus === \"force_redeemed\") {\n return {\n border : '3px solid #4caf50'\n }\n } else if (getProgressDurationInMinutes(date1, date2) === 0) {\n return {\n border : '3px solid #dfdfdf'\n }\n } else {\n return {\n border : '3px solid #4caf50',\n // background : '#4caf50'\n }\n }\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}", "static getStyle(status) {\n let style = {}; //'let' keyword since style will be mutated\n switch (status) {\n case \"task-received\": style.backgroundColor = \"red\"; break;\n case \"task-started\": style.backgroundColor = \"yellow\"; break;\n case \"task-succeeded\": style.backgroundColor = \"green\"; break;\n };\n return style;\n }", "function createPopUp () {\n bell.appendChild(list);\n list.appendChild(listitem);\n list.appendChild(listitem2);\n list.appendChild(listitem3);\n list.style.listStyle = 'none'\n \n list.style.position = 'relative'\n list.style.right = '150px'\n list.style.bottom = '-10px'\n list.style.width = '300px'\n list.style.display = 'flex'\n list.style.flexDirection = 'column';\n list.setAttribute(\"id\", \"newList\");\n list.style.background = 'white';\n list.style.color = 'black';\n list.style.border = 'solid 3px grey'\n \nlistitem.style.height = '20px'\nlistitem.style.height = '20px'\nlistitem.style.borderBottom = 'solid 3px grey'\n listitem.innerHTML = '<li>You have 3 unread Messages<a style=\"margin-left: 90px;\" id=\"notif1\">x</a></li>'\n listitem2.innerHTML = '<li>See who has been viewing your profile<a id=\"notif2\" style=\"margin-left: 32px;\">x</a></li>'\n \n\n }", "function xiborder(obj){\n var xilis=$('li',obj);\nfor(var i=0;i<xilis.length;i++){\n xilis[i].onmouseover=function(){\n this.style.border=\"1px solid red\";\n }\n xilis[i].onmouseout=function(){\n this.style.border=\"1px solid #fff\";\n }\n \n }\n}", "function addMenuBorder(mObj, iS, alpha, bordCol, bordW, backCol, backW)\n{\n // Loop through the menu array of that object, finding matching ItemStyles.\n for (var mN in mObj.menu)\n {\n var mR=mObj.menu[mN], dS='<div style=\"position:absolute; background:';\n if (mR[0].itemSty != iS) continue;\n // Loop through the items in that menu, move them down and to the right a bit.\n for (var mI=1; mI<mR.length; mI++)\n {\n mR[mI].iX += bordW+backW;\n mR[mI].iY += bordW+backW;\n }\n // Extend the total dimensions of menu accordingly.\n mW = mR[0].menuW += 2*(bordW+backW);\n mH = mR[0].menuH += 2*(bordW+backW);\n\n // Set the menu's extra content string with divs/layers underneath the items.\n if (isNS4) mR[0].extraHTML += '<layer bgcolor=\"'+bordCol+'\" left=\"0\" top=\"0\" width=\"'+mW+\n '\" height=\"'+mH+'\" z-index=\"980\"><layer bgcolor=\"'+backCol+'\" left=\"'+bordW+'\" top=\"'+\n bordW+'\" width=\"'+(mW-2*bordW)+'\" height=\"'+(mH-2*bordW)+'\" z-index=\"990\"></layer></layer>';\n else mR[0].extraHTML += dS+bordCol+'; left:0px; top:0px; width:'+mW+'px; height:'+mH+\n 'px; z-index:980; '+(alpha!=null?'filter:alpha(opacity='+alpha+'); -moz-opacity:'+(alpha/100):'')+\n '\">'+dS+backCol+'; left:'+bordW+'px; top:'+bordW+'px; width:'+(mW-2*bordW)+'px; height:'+\n (mH-2*bordW)+'px; z-index:990\"></div></div>';\n }\n}", "_renderListColour() {\n listColour.style.backgroundColor = this.curList.colour;\n colourPickerBtn.style.backgroundColor = this.curList.colour;\n }", "updateCssStyles (mailbox) {\n this.cssElement.innerHTML = `\n .mailbox-list .list-item[data-id=\"${mailbox.id}\"] .mailbox.active {\n border-color: ${mailbox.color};\n }\n .mailbox-list .list-item[data-id=\"${mailbox.id}\"] .mailbox:hover {\n border-color: ${mailbox.color};\n }\n .mailbox-list .list-item[data-id=\"${mailbox.id}\"] .mailbox.active:before {\n background-color: ${mailbox.color};\n }\n `\n }", "function redAlert() {\n const div = document.createElement('div');\n div.className = 'conflict-alert';\n div.style.marginLeft = 'auto';\n \n const span = document.createElement('span');\n span.style.display = 'block';\n span.style.backgroundColor = 'red';\n span.style.borderRadius = '15px';\n span.style.width = '15px';\n span.style.height = '15px'; \n div.appendChild(span);\n\n return div;\n }", "function initStatusItems() {\n return [\n newStatusItem(\n 'Creating Sugar configuration file (config.php)',\n 'Creating Sugar Configuration File...'\n ),\n newStatusItem(\n 'Creating Sugar application tables, audit tables and relationship metadata',\n 'Creating application/audit tables and relationship data...'\n ),\n newStatusItem(\n 'Creating the database',\n 'Creating the database...'\n ),\n newStatusItem(\n 'Creating default Sugar data',\n 'Creating default Sugar data...'\n ),\n newStatusItem(\n 'Updating license information...',\n 'Updating license information...'\n ),\n newStatusItem(\n 'Creating default users...',\n 'Creating default users...'\n ),\n newStatusItem(\n 'Creating default reports...',\n 'Creating default reports...'\n ),\n newStatusItem(\n 'Populating the database tables with demo data',\n 'Inserting demo data...'\n ),\n newStatusItem(\n 'Creating default scheduler jobs...',\n 'Creating default scheduler jobs...'\n )\n /*newStatusItem(\n 'is now complete!',\n 'Installation is complete!'\n )*/\n ];\n}", "highlight() {\n const filteredTiles = this._filterForHigher();\n if (!filteredTiles || !filteredTiles.length) {\n this._error(`No islands found buying for ${this.minimumBells} and above.`);\n return;\n }\n\n filteredTiles.forEach((tag) => {\n const parent = tag.parentElement.parentElement.parentElement;\n\n if (parent) {\n const queueInfo = this._getQueueInfo(parent);\n const islandName = this._getIslandName(parent);\n parent.setAttribute('style', 'background-color: #011B8E;');\n this._info(`Island: ${islandName} | Buying for: ${tag.innerText} | Queue information: ${queueInfo}.`);\n } \n \n tag.setAttribute('style', 'background-color: yellow; color: black;');\n });\n }", "function SimpleAlerts({ alerts }) {\n const classes = useStyles();\n\n return (\n <Container component=\"main\" maxWidth={\"xs\"}>\n {alerts.length > 0 &&\n alerts.map((alert, index) => (\n <Alert\n key={index}\n severity={`${alert.type}`}\n className={classes.alert}\n >\n {alert.msg}\n </Alert>\n ))}\n </Container>\n );\n}", "function check_borders() {\n if (\n snake.x < 0 ||\n snake.x > (width - cw) / cw ||\n snake.y < 0 ||\n snake.y > (height - cw) / cw\n ) {\n// clearInterval(gameloop) and append item to list; \n var item = document.createElement(\"li\");\n let current = $(\"#current\").text();\n\n item.append(name + \": \" + current);\n document.getElementById(\"list\").append(item);\n showGameOver();\n }\n }", "function colorListItems(arrObjs){\n $('#names-list > li').each(function (i) {\n $(this).css('color', arrObjs[i].favColor);\n });\n }", "function _setBorderColor(color) {\n $menuWindow.css('border-color', color);\n $connector.css('background-color', color);\n }", "function highlighter(name) {\n currentChannelList.forEach((li) => {\n li.setAttribute(\"style\", \"background-color: rgb(24, 65, 63); border: none;\");\n });\n document.querySelector(`.chosenChannel-${name.trim().split(\" \").join(\"-\").toLowerCase()}`).setAttribute(\"style\", \"border: 3px solid rgb(233, 54, 87); background-color: rgb(14, 49, 47);\");\n}", "function getContainerColor(item) {\n /*\n if(item.timeleft==\"(No data)\" && item.ischain!=\"true\"){\n return \"#d9d5d0\"\n }*/\n if (item.timeleft == \"Closed\" && item.ischain == \"true\") {\n return \"#b5a19e\"\n }\n if (item.timeleft == \"Closed\" && item.ischain != \"true\") {\n return \"#fad8d2\"\n }\n if (item.timeleft != \"Closed\" && item.ischain == \"true\") {\n return \"#b5aa9e\"\n }\n return \"#e6e3d8\"\n //return \"#f5f4ed\"\n}", "function paintItGreen(){\n let everyUl = document.getElementsByTagName('ul')\n for(let i = 0; i < everyUl.length; i++) {\n everyUl[i].style.backgroundColor = 'green'\n }\n }", "function alerts() {\n $(\"span.top-label.label.label-warning\").text(todoItemsData.length);\n $('.dropdown-alerts').empty();\n $.each(todoItemsData, (idx, item) => {\n let i = $('<i class=\"fa fa-tasks fa-fw\"></i>');\n let span = $('<span class=\"pull-right text-muted small\"></span>').text( daysLeft(item.date) + ' days left');\n let div = $('<div></div>').append(i).append(item.title).append(span);\n let a = $('<a href=\"#\"></a>')\n .click( () => {\n $('.card[data-todoid=\"' + item.item_id + '\"] .edit-btn').click();\n })\n .append(div);\n let li = $('<li></li>').append(a);\n let divider = $('<li class=\"divider\"></li>');\n $(\"ul.dropdown-menu.dropdown-alerts\").append(li).append(divider);\n });\n}", "function showIndividualLineStatus(lineName, lineStatus) {\n if(lineStatus == \"Good Service\"){\n swal(lineName, lineStatus, \"success\");\n } else {\n swal(lineName, lineStatus, \"error\");\n }\n}", "function setTablistHighlightBox() {\n \n var $tab\n , offset\n , height\n , width\n , highlightBox = {}\n \n highlightBox.top = 0\n highlightBox.left = 32000\n highlightBox.height = 0\n highlightBox.width = 0\n \n for (var i = 0; i < $tabs.length; i++) {\n $tab = $tabs[i]\n offset = $($tab).offset()\n height = $($tab).height()\n width = $($tab).width()\n \n // console.log(\" Top: \" + offset.top + \" Left: \" + offset.left + \" Height: \" + height + \" Width: \" + width)\n \n if (highlightBox.top < offset.top) {\n highlightBox.top = Math.round(offset.top)\n }\n \n if (highlightBox.height < height) {\n highlightBox.height = Math.round(height)\n }\n \n if (highlightBox.left > offset.left) {\n highlightBox.left = Math.round(offset.left)\n }\n \n var w = (offset.left - highlightBox.left) + Math.round(width)\n \n if (highlightBox.width < w) {\n highlightBox.width = w\n }\n \n } // end for\n \n // console.log(\"[HIGHLIGHT] Top: \" + highlightBox.top + \" Left: \" + highlightBox.left + \" Height: \" + highlightBox.height + \" Width: \" + highlightBox.width)\n \n $tablistHighlight.style.top = (highlightBox.top - 2) + 'px'\n $tablistHighlight.style.left = (highlightBox.left - 2) + 'px'\n $tablistHighlight.style.height = (highlightBox.height + 7) + 'px'\n $tablistHighlight.style.width = (highlightBox.width + 8) + 'px'\n \n } // end function", "function statusColor() {\n $(\".time-block\").each(function() {\n const hourBlock = parseInt($(this).attr(\"hour-block\"));\n const textArea = $(\".description\", this);\n let currentHr = moment().format('H') // Get current hour only\n \n //Change the class based on the current time\n if (hourBlock < currentHr) {\n textArea.addClass(\"past\");\n } else if (hourBlock > currentHr) {\n textArea.addClass(\"future\");\n } else { textArea.addClass(\"present\"); }\n });\n }", "function alertColor(index, className) {\n\t// Return all classes starting with alert-color pattern\n\treturn (className.match (/(^|\\s)alert-\\S+/g) || []).join(' ');\n}", "function checkOut(){\n var table = document.getElementById('appointment-list');\n for(var i=0; i<table.rows.length;i++){\n var row = table.rows[i];\n if(row.hilite){\n row.style.backgroundColor=\"red\";\n }\n }\n}", "function messagesArea(element, height, color) {}", "function addStatus(msg) {\r\n\tvar obj = JSON.parse(msg);\r\n\tif (obj.length > window.compareStatus) {\r\n\t\t\r\n\t\tvar numberToInsert = obj.length - window.compareStatus;\r\n\t\twindow.compareStatus = obj.length;\r\n\t\ttry {\r\n\t\t\tvar container=$('#container');\r\n\t\t\t$.each(obj, function(i, val) {\r\n\t\t\t\ti = i + 3;\r\n\t\t\t\tif (!val.picture) {\r\n\t\t\t\t\tval.picture = window.userPic + '/profilePic.jpg/';\r\n\t\t\t\t}\r\n\t\t\t\tvar is_delete = \"\";\r\n\t\t\t\tif (val.email == window.userLogin) {\r\n\t\t\t\t\tis_delete = '<div class=\"dropdown\"><a class=\"account\" ></a><div class=\"submenu\" style=\"display: none; \"><ul class=\"root\"><li class=\"stedit\"><a href=\"#\" >Edit</a></li><li class=\"stdelete\"><a href=\"#\" >Delete</a></li></ul></div></div>';\r\n\t\t\t\t}else{\r\n\t\t\t\t\tis_delete = '<div class=\"dropdown\"><a class=\"account\" ></a><div class=\"submenu\" style=\"display: none; \"><ul class=\"root\"><li class=\"stUnfollow\"><a rel=\"'+val.email+'\" href=\"#\" >Unfollow</a></li><li class=\"stReport\"><a class=\"iframe\" rel=\"'+val.status_id+'\" href=\"'+window.reportAdmin+'/'+val.email+'/'+ val.name+'/'+val.picture+'/'+val.status_id+'\" >Report</a></li></ul></div></div>';\r\n\t\t\t\t}\r\n\t\t\t\tvar privacy;\r\n\t\t\t\tif(val.privacy_type_id==1){\r\n\t\t\t\t\tprivacy=\"Shared with: public\";\r\n\t\t\t\t}else{\r\n\t\t\t\t\tprivacy=\"Only me\";\r\n\t\t\t\t}\r\n\t\t\t\tvar checkPlaylist = parseInt(val.music);\r\n\t\t\t\t//truong hop playlist\r\n\t\t\t\tif (checkPlaylist == 1) {\r\n\t\t\t\t\tvar $content = $('<div class=\"item\" id=\"status' + val.status_id + '\"><span id=\"arrow\"></span>' + is_delete + '<div class=\"stimg\"><img id=\"' + val.email + '\" src=\"' + window.userPic + val.picture + '\" style=\"width:70px;height:70px\"/></div><div class=\"sttext\"><div class=\"sttext_content\"><div class=\"topPart\"><b><a href=\"' + window.userWall + \"/\" + val.email + '\">' + val.name + '</a></b><div class=\"sttime\"><abbr class=\"timeago\" title=\"' + val.created_at + '\"></abbr><br><abbr class=\"privacy\" title=\"' + privacy + '\"></abbr></div></div><div class=\"strmsg\">' + val.message + '</div><div id=\"jquery_jplayer_' + i + '\" class=\"jp-jplayer\"></div><div id=\"jp_container_' + i + '\" class=\"jp-audio\">' + playlistElement + '</div></div></div><div class=\"sttext_content2\"><div class=\"staction\"><a href=\"#\" class=\"like like_button icontext\" id=\"like' + val.status_id + '\"></a><a href=\"#\" class=\"comment_button icontext comment\" id=\"' + val.status_id + '\">Comment</a><a class=\"iframe share_button\" href=\"'+window.shareStatus+'/'+val.status_id+'\">Share</a></div><ul class=\"loadplace\" id=\"loadplace' + val.status_id + '\"></ul><div class=\"panel\" id=\"slidepanel' + val.status_id + '\"><div class=\"cmtpic\"><img src=\"' + window.userPicCmt + '\" style=\"width:33px;height:33px;\" /></div><textarea style=\"width:383px;height:32px\" placeholder=\" Write your comment...\" class=\"commentInput\" id=\"textboxcontent' + val.status_id + '\"></textarea></div></div></div>');\r\n\t\t\t\t\tcontainer.append($content);\r\n\t\t\t\t\tgetComment(val.status_id);\r\n\t\t\t\t\tgetLike(val.status_id);\r\n\t\t\t\t\tgetSong('#jquery_jplayer_' + i, '#jp_container_' + i, checkPlaylist);\r\n\t\t\t\t\tnumberToInsert = numberToInsert - 1;\r\n\t\t\t\t\tif (numberToInsert == 0) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t//truong hop upload\r\n\t\t\t\t} else if (checkPlaylist > 1) {\r\n\t\t\t\t\tvar $content = $('<div class=\"item\" id=\"status' + val.status_id + '\"><span id=\"arrow\"></span>' + is_delete + '<div class=\"stimg\"><img id=\"' + val.email + '\" src=\"' + window.userPic + val.picture + '\" style=\"width:70px;height:70px\"/></div><div class=\"sttext\"><div class=\"sttext_content\"><div class=\"topPart\"><b><a href=\"' + window.userWall + \"/\" + val.email + '\">' + val.name + '</a></b><div class=\"sttime\"><abbr class=\"timeago\" title=\"' + val.created_at + '\"></abbr><br><abbr class=\"privacy\" title=\"' + privacy + '\"></abbr></div></div><div class=\"strmsg\">' + val.message + '</div><div id=\"jquery_jplayer_' + i + '\" class=\"jp-jplayer\"></div><div id=\"jp_container_' + i + '\" class=\"jp-audio\"><div class=\"jp-type-single\" id=\"jp_interface_' + i + '\">' + element + '</div></div></div></div><div class=\"sttext_content2\"><div class=\"staction\"><a href=\"#\" class=\"like like_button icontext\" id=\"like' + val.status_id + '\"></a><a href=\"#\" class=\"comment_button icontext comment\" id=\"' + val.status_id + '\">Comment</a><a class=\"iframe share_button\" href=\"'+window.shareStatus+'/'+val.status_id+'\">Share</a><a href=\"#\" class=\"playlist_button\" id=\"playlist' + val.status_id + '\">Playlist</a></div><ul class=\"loadplace\" id=\"loadplace' + val.status_id + '\"></ul><div class=\"panel\" id=\"slidepanel' + val.status_id + '\"><div class=\"cmtpic\"><img src=\"' + window.userPicCmt + '\" style=\"width:33px;height:33px;\" /></div><textarea class=\"commentInput\" style=\"width:383px;height:32px\" placeholder=\" Write your comment...\" id=\"textboxcontent' + val.status_id + '\"></textarea></div></div></div>');\r\n\t\t\t\t\tcontainer.append($content);\r\n\t\t\t\t\tgetComment(val.status_id);\r\n\t\t\t\t\tgetLike(val.status_id);\r\n\t\t\t\t\tsetSong('#jquery_jplayer_' + i, '#jp_interface_' + i, window.userMusic + '/' + val.music, val.title);\r\n\t\t\t\t\tnumberToInsert = numberToInsert - 1;\r\n\t\t\t\t\tif (numberToInsert == 0) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t//truong hop nhac online\r\n\t\t\t\t} else {\r\n\t\t\t\t\tif(val.music==\"\"){\r\n\t\t\t\t\t\tvar $content = $('<div class=\"item\" id=\"status' + val.status_id + '\"><span id=\"arrow\"></span>' + is_delete + '<div class=\"stimg\"><img id=\"' + val.email + '\" src=\"' + window.userPic + val.picture + '\" style=\"width:70px;height:70px\"/></div><div class=\"sttext\"><div class=\"sttext_content\"><div class=\"topPart\"><b><a href=\"' + window.userWall + \"/\" + val.email + '\">' + val.name + '</a></b><div class=\"sttime\"><abbr class=\"timeago\" title=\"' + val.created_at + '\"></abbr><br><abbr class=\"privacy\" title=\"' + privacy + '\"></abbr></div></div><div class=\"strmsg\">' + val.message + '</div></div><div class=\"sttext_content2\"><div class=\"staction\"><a href=\"#\" class=\"like like_button icontext\" id=\"like' + val.status_id + '\"></a><a href=\"#\" class=\"comment_button icontext comment\" id=\"' + val.status_id + '\">Comment</a></div><ul class=\"loadplace\" id=\"loadplace' + val.status_id + '\"></ul><div class=\"panel\" id=\"slidepanel' + val.status_id + '\"><div class=\"cmtpic\"><img src=\"' + window.userPicCmt + '\" style=\"width:33px;height:33px;\" /></div><textarea class=\"commentInput\" style=\"width:383px;height:32px\" placeholder=\" Write your comment...\" id=\"textboxcontent' + val.status_id + '\"></textarea></div></div></div>');\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tvar $content = $('<div class=\"item\" id=\"status' + val.status_id + '\"><span id=\"arrow\"></span>' + is_delete + '<div class=\"stimg\"><img id=\"' + val.email + '\" src=\"' + window.userPic + val.picture + '\" style=\"width:70px;height:70px\"/></div><div class=\"sttext\"><div class=\"sttext_content\"><div class=\"topPart\"><b><a href=\"' + window.userWall + \"/\" + val.email + '\">' + val.name + '</a></b><div class=\"sttime\"><abbr class=\"timeago\" title=\"' + val.created_at + '\"></abbr><br><abbr class=\"privacy\" title=\"' + privacy + '\"></abbr></div></div><div class=\"strmsg\">' + val.message + '</div><div id=\"jquery_jplayer_' + i + '\" class=\"jp-jplayer\"></div><div id=\"jp_container_' + i + '\" class=\"jp-audio\"><div class=\"jp-type-single\" id=\"jp_interface_' + i + '\">' + element + '</div></div></div></div><div class=\"sttext_content2\"><div class=\"staction\"><a href=\"#\" class=\"like like_button icontext\" id=\"like' + val.status_id + '\"></a><a href=\"#\" class=\"comment_button icontext comment\" id=\"' + val.status_id + '\">Comment</a><a class=\"iframe share_button\" href=\"'+window.shareStatus+'/'+val.status_id+'\">Share</a><a href=\"#\" class=\"playlist_button\" id=\"playlist' + val.status_id + '\">Playlist</a></div><ul class=\"loadplace\" id=\"loadplace' + val.status_id + '\"></ul><div class=\"panel\" id=\"slidepanel' + val.status_id + '\"><div class=\"cmtpic\"><img src=\"' + window.userPicCmt + '\" style=\"width:33px;height:33px;\" /></div><textarea class=\"commentInput\" style=\"width:383px;height:32px\" placeholder=\" Write your comment...\" id=\"textboxcontent' + val.status_id + '\"></textarea></div></div></div>');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontainer.append($content);\r\n\t\t\t\t\tgetComment(val.status_id);\r\n\t\t\t\t\tgetLike(val.status_id);\r\n\t\t\t\t\tsetSong('#jquery_jplayer_' + i, '#jp_interface_' + i, val.music, val.title);\r\n\t\t\t\t\tnumberToInsert = numberToInsert - 1;\r\n\t\t\t\t\tif (numberToInsert == 0) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t //$(\".iframe\").colorbox({iframe:true, width:\"50%\", height:\"50%\"});\r\n\t\t\t});\r\n\t\t} catch (e) {\r\n\t\t\talert(e);\r\n\t\t}\r\n\t}\r\n}", "function updateAlert(alertJson) {\n\n\tvar firstListClass = $('ul#alert-list li:first').attr('class');\n\tswitch (alertJson.alert){\n\t\tcase 1: \n\t\t\t// load average alert, if previous message was a recover, then pop an alert message\n\t\t\tif (firstListClass == \"recover\" || firstListClass == \"initialMessage\") {\n\t\t\t\t$(\".initialMessage\").remove();\n\t\t\t\t$(\".\"+firstListClass).toggleClass(\"old\", true);\n\t\t\t\t$(\".\"+firstListClass).toggleClass(\"recover\", false);\n\t\t\t\t$('#alert-list').prepend('<li class=\"error\">High load generated an alert - '+alertJson.value.toFixed(2)+', triggered at '+formatTime(formatDate(alertJson.date))+'</li>');\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 0:\n\t\t\t// load average is back to normal, if previous message was an alert, then pop arecover message\n\t\t\tif (firstListClass == \"error\") {\n\t\t\t\t$(\".\"+firstListClass).toggleClass(\"old\", true);\n\t\t\t\t$(\".\"+firstListClass).toggleClass(\"error\", false);\n\t\t\t\t$('#alert-list').prepend('<li class=\"recover\">Load is back to normal, at '+formatTime(formatDate(alertJson.date))+' - load :'+alertJson.value.toFixed(2)+' - threshold :'+threshold.toFixed(2)+'</li>');\n\t\t\t}\n\t\t\tbreak;\n\t}\n}", "function iconListBackground(wrapper) {\n const w = document.getElementById(wrapper);\n if (w) {\n const wHeight = w.offsetHeight;\n var offsetT = w.getBoundingClientRect().top;\n o = (wHeight + offsetT) / wHeight;\n if (o > 0 && o < 1) {\n w.style.backgroundColor = \"rgba(66, 39, 144,\" + o + \")\";\n }\n }\n}", "function highlight(ctl, msg) {\r\n ctl.css('border', '2px solid red')\r\n .parent()\r\n .append('<span id=\"' + ctl.attr('id') + prefix + '\" style=\"color:red;\">' + msg + '</span>');\r\n }", "boldColumn(lastSlotNum) {\n for (let i = lastSlotNum; i >= 0; i -= 7) {\n this.getSlot(i).style.border = '4px solid black';\n }\n }", "function setStatus(result, background) {\n $(\"#text\").html(result);\n var a = document.getElementById(\"alert\");\n a.style.backgroundColor = background;\n}", "function red(status){\n var red = document.getElementById(\"red_light\");\n red.style = status?\" box-shadow: inset 0px 0px 20px 0px black;\":\" box-shadow: inset 0px 0px 80px 0px black;\"\n}", "function handleCheck(event){\n // console.log('event: ', event)\n for(let i = 0; i < colOfEdges.length; i += 1){\n if(event.target.checked){\n // if the checkbox is checked, then iterate the edges and add the style.\n // const styleEdge = `border-left: 1px solid lightgrey; border-right: 1px solid lightgrey;`\n const styleEdge = `border-left: 1px solid red; border-right: 1px solid red;`\n colOfEdges[i].setAttribute('style', styleEdge)\n } else {\n colOfEdges[i].setAttribute('style', '')\n }\n }\n}", "function colorCode(){\r\n // Determine which colors to show for each times lot.\r\n for(var i = 0; i < timeLiEl.length; i++){\r\n // if the current time is equal to a timeblock time make it green.\r\n if(timeCompare == times[i]){\r\n inputArea[i].style.backgroundColor = \"#ff7675\";\r\n }\r\n // if the current time is less than a timeblock time make it red.\r\n else if(timeCompare < times[i]){\r\n inputArea[i].style.backgroundColor = \"#55efc4\";\r\n }\r\n };\r\n }", "function checkLeft() {\r\n let boxID = id;\r\n let boxIDArray = id.split('');\r\n boxIDArray[1] = parseInt(boxIDArray[1]) - 1;\r\n boxID = boxIDArray.join('');\r\n for(var i = 1; i <= 3; i++) {\r\n if($('#'+boxID).css(\"background-color\") === boxColor) {\r\n boxCount += 1;\r\n boxIDArray[1] = parseInt(boxIDArray[1]) - 1;\r\n boxID = boxIDArray.join('');\r\n } \r\n }\r\n }", "function showStatus() \n{\n\t/* score */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"score:\"+score, 5, 16);\n\t/* level */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"level:\"+level, 5, 32);\n\t/* bullet left */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"bullet:\"+bnum, 5, 48);\n\t/* blood */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"blood:\"+blood, 5, 64);\n}", "highlightListText(linewidget) {\n let width = linewidget.children[0].width;\n let left = this.viewer.getLeftValue(linewidget);\n let top = linewidget.paragraph.y;\n this.createHighlightBorder(linewidget, width, left, top, false);\n this.viewer.isListTextSelected = true;\n }", "renderStatuses(){\n const statuses = this.props.ticket.statuses;\n return (\n <div>\n <Typography type=\"display1\" gutterBottom>\n Statuses\n </Typography>\n {statuses && statuses.length > 0 ? \n <div>\n <Divider className={this.props.classes.divider}/>\n {\n statuses.map(obj=>(\n this.renderStatus(obj)\n ))\n }\n </div>\n \n :\n <div>\n <Typography type=\"body2\" gutterBottom>\n No Status Available\n </Typography>\n <Divider className={this.props.classes.divider}/>\n </div>\n }\n {this.props.position == 'technician' ? \n <div>\n <Typography type=\"title\" gutterBottom>\n Add Status\n </Typography>\n {this.renderStatusForm()}\n </div>:null}\n \n </div>\n )\n }", "function menu(){\n var menuBG = color();\n var menuArray = document.getElementsByClassName('menu');\n menuArray[0].style.backgroundColor = menuBG;\n var checkArray = document.getElementsByClassName('check');\n var textArray = document.getElementsByClassName('settings-text');\n for(var i = 0 ; i < checkArray.length ; i++){\n var hex = get('rows-container').style.backgroundColor;\n checkArray[i].style.backgroundColor = hex;\n textArray[i].style.color = hex;\n textArray[i].style.borderBottom = \"4px solid \" + hex;\n };\n textArray[2].style.color = hex;\n textArray[2].style.borderBottom = \"4px solid \" + hex;\n }", "function makeActive(currentItem, totalItems, sectionName) {\n\n\tfor (i = 1; i <= totalItems; i ++) {\n\t\tdocument.getElementById(sectionName + \"-item-\"+i).style.borderBottom = \"none\";\n\t}\n\n\tdocument.getElementById(sectionName + \"-item-\"+currentItem).style.borderBottom = \"3px solid #b32229\";\n}", "function StatusListRecieved(evt)\n{\n // future socket replies should not go to this function\n // anymore. Instead, send them on to MessageHandlerServerReply\n ws.onmessage = MessageHandlerServerReply\n\n // parse the list of status items from the server\n var status_item_list = JSON.parse(evt.data);\n\n // Create the table of status items\n var root=document.getElementById(\"LinuxCNCStatusTable\");\n var tab=document.createElement('table');\n tab.className=\"stattable\";\n\n // Create the table header row\n var row=document.createElement('tr');\n cell = document.createElement('th'); \n cell.appendChild(document.createTextNode( \"ID\" ));\n row.appendChild(cell);\n cell = document.createElement('th'); \n cell.appendChild(document.createTextNode( \"Name\" ));\n row.appendChild(cell); \n cell = document.createElement('th'); \n cell.appendChild(document.createTextNode( \"Description\" ));\n row.appendChild(cell); \n cell = document.createElement('th'); \n cell.appendChild(document.createTextNode( \"Value\" ));\n row.appendChild(cell); \n tab.appendChild(row);\n\n // collumn width settings\n var c1 = document.createElement('col');\n c1.setAttribute('width','3%');\n tab.appendChild(c1);\n var c2 = document.createElement('col');\n c2.setAttribute('width','20%');\n tab.appendChild(c2);\n var c3 = document.createElement('col');\n c3.setAttribute('width','30%');\n tab.appendChild(c3); \n\n // now create one row for each status item\n var tbo=document.createElement('tbody');\n\n var abscount = 0;\n for(var i=0;i<status_item_list['data'].length;i++)\n {\n var arcnt ;\n if (status_item_list['data'][i][\"isarray\"])\n arcnt = status_item_list['data'][i][\"arraylength\"];\n else\n arcnt = 1;\n\n for (var aridx = 0; aridx < arcnt; aridx++)\n {\n abscount++;\n\n var id = i.toString() + \",\" + aridx.toString();\n StatusItems[ id ] = new StatusObject( status_item_list['data'][i][\"name\"], status_item_list['data'][i][\"help\"], status_item_list['data'][i][\"valtype\"], status_item_list['data'][i][\"isarray\"], aridx );\n row=document.createElement('tr');\n var oddeven = \"odd\";\n if (abscount % 2 == 0)\n oddeven = \"stattableodd\";\n else\n oddeven = \"stattableeven\";\n row.className = oddeven;\n\n cell = document.createElement('td'); \n if (status_item_list['data'][i][\"isarray\"])\n {\n cell.appendChild(document.createTextNode(id));\n if (arcnt == 0)\n cell.setAttribute(\"name\", StatusItems[id].name );\n }\n else\n {\n cell.appendChild(document.createTextNode(i.toString()));\n cell.setAttribute(\"name\", StatusItems[id].name );\n }\n \n row.appendChild(cell);\n \n\n cell = document.createElement('td'); \n cell.appendChild(document.createTextNode(StatusItems[id].decorated_name()));\n row.appendChild(cell);\n\n cell = document.createElement('td'); \n cell.appendChild(document.createTextNode(StatusItems[id].description))\n row.appendChild(cell);\n\n cell = document.createElement('td'); \n row.appendChild(cell);\n outputCell = document.createElement('div');\n cell.appendChild(outputCell);\n StatusItems[id].outputCell = outputCell;\n\n tbo.appendChild(row);\n\n ws.send( JSON.stringify({ \"id\":id, \"command\":\"watch\", \"name\":StatusItems[id].name, \"index\":aridx }) ) ; \n }\n }\n tab.appendChild(tbo);\n\n root.appendChild(tab); \n}", "function checkItems() {\n\tvar li = document.getElementsByTagName('LI')[0];\n\tif (!document.body.contains(li)) {\n\t\tvar list = document.getElementById('list');\n\t\tvar div = document.createElement('div');\n\t\tdiv.innerHTML = \"Задач нет. Добавьте новую задачу!\";\n\t\tdiv.classList.add('todo__alert');\n\t\tdiv.setAttribute('id', 'todoAlert');\n\t\tlist.appendChild(div);\n\t}\n}", "function errorRedBorder(element) {\n element.style.borderColor = \"rgb(217,83,79)\";\n element.style.borderWidth = \"2px\";\n}", "Style() {\n return {\n background: this.props.task.status ? 'rgba(0,0,0,0.7)' : 'red'\n }\n }", "function showSuccessAlert(ev) {\n customSetting.color = '#000000';\n customSetting.bgColor = '#90ee90';\n customAlert('This operation was successful!', customSetting);\n}", "function processStatus(db)\n{\n try {\n var doRow = false;\n var secondRow = false;\n globalStatus = 4;\n statusMarquee = `<div class=\"row\">\n <div class=\"col-2 text-warning\">\n \t<strong>System</strong>\n </div>\n <div class=\"col text-white\">\n \t<strong>Status</strong>\n </div>\n <div class=\"col-2 text-warning\">\n \t<strong>System</strong>\n </div>\n <div class=\"col text-white\">\n \t<strong>Status</strong>\n </div>\n </div><div class=\"row\" style=\"${secondRow ? `background: rgba(255, 255, 255, 0.1);` : ``}\">`;\n\n\n db.each(function (thestatus) {\n try {\n if (doRow)\n {\n if (!secondRow)\n {\n secondRow = true;\n } else {\n secondRow = false;\n }\n statusMarquee += `</div><div class=\"row\" style=\"${secondRow ? `background: rgba(255, 255, 255, 0.1);` : ``}\">`;\n doRow = false;\n } else {\n doRow = true;\n }\n\n switch (thestatus.status)\n {\n case 1:\n statusMarquee += `<div class=\"col-2\">\n \t<span class=\"m-1 badge badge-danger\">${thestatus.label}</span>\n </div>\n <div class=\"col text-white\">\n \t<strong>CRITICAL</strong>: ${thestatus.data}\n </div>`;\n if (globalStatus > 1)\n globalStatus = 1;\n break;\n case 2:\n statusMarquee += `<div class=\"col-2\">\n \t<span class=\"m-1 badge badge-urgent\">${thestatus.label}</span>\n </div>\n <div class=\"col text-white\">\n \t<strong>Urgent</strong>: ${thestatus.data}\n </div>`;\n if (globalStatus > 2)\n globalStatus = 2;\n break;\n case 3:\n statusMarquee += `<div class=\"col-2\">\n \t<span class=\"m-1 badge badge-warning\">${thestatus.label}</span>\n </div>\n <div class=\"col text-white\">\n \t<strong>Warning</strong>: ${thestatus.data}\n </div>`;\n if (globalStatus > 3)\n globalStatus = 3;\n break;\n case 4:\n statusMarquee += `<div class=\"col-2\">\n \t<span class=\"m-1 badge badge-secondary\">${thestatus.label}</span>\n </div>\n <div class=\"col text-white\">\n \t<strong>Offline</strong>: ${thestatus.data}\n </div>`;\n break;\n case 5:\n statusMarquee += `<div class=\"col-2\">\n \t<span class=\"m-1 badge badge-success\">${thestatus.label}</span>\n </div>\n <div class=\"col text-white\">\n \t<strong>Good</strong>: ${thestatus.data}\n </div>`;\n if (globalStatus > 3)\n globalStatus = 5;\n break;\n default:\n }\n } catch (e) {\n iziToast.show({\n title: 'An error occurred - Please check the logs',\n message: `Error occurred during Status iteration in processStatus call.`\n });\n console.error(e);\n }\n });\n\n statusMarquee += `</div>`;\n\n if (disconnected)\n globalStatus = 0;\n\n\n var status = document.getElementById('status-div');\n var color = 'rgba(158, 158, 158, 0.3)';\n clearInterval(flashInterval);\n switch (globalStatus)\n {\n case 0:\n color = 'rgba(244, 67, 54, 0.5)';\n statusLine.innerHTML = 'No connection to WWSU! The server might be offline and WWSU not functional';\n if (globalStatus !== prevStatus)\n offlineTimer = setTimeout(function () {\n responsiveVoice.speak(\"Attention! The display sign has been disconnected from the server for one minute. This could indicate a network problem, the server crashed, or the server is rebooting.\");\n }, 60000);\n // Flash screen for major outages every second\n flashInterval = setInterval(function () {\n $(\"html, body\").css(\"background-color\", \"#D32F2F\");\n setTimeout(function () {\n $(\"html, body\").css(\"background-color\", \"#000000\");\n }, 250);\n }, 1000);\n\n Slides.slide(`system`).isSticky = true;\n Slides.slide(`system`).active = true;\n break;\n case 1:\n color = 'rgba(244, 67, 54, 0.5)';\n statusLine.innerHTML = 'WWSU is critically unstable and is not functioning properly!';\n clearTimeout(offlineTimer);\n if (globalStatus !== prevStatus)\n responsiveVoice.speak(\"Warning! Warning! The WWSU system is in a critically unstable state. Please review the display sign and take action immediately to fix the problems.\");\n // Flash screen for major outages every second\n flashInterval = setInterval(function () {\n $(\"html, body\").css(\"background-color\", \"#D32F2F\");\n setTimeout(function () {\n $(\"html, body\").css(\"background-color\", \"#000000\");\n }, 250);\n }, 1000);\n\n Slides.slide(`system`).isSticky = true;\n Slides.slide(`system`).active = true;\n break;\n case 2:\n color = 'rgba(245, 124, 0, 0.5)';\n statusLine.innerHTML = 'WWSU is experiencing issues that may impact operation';\n clearTimeout(offlineTimer);\n if (globalStatus !== prevStatus)\n responsiveVoice.speak(\"Attention! The WWSU system is encountering issues at this time that need addressed.\");\n // Flash screen for partial outages every 5 seconds\n // Flash screen for major outages every second\n flashInterval = setInterval(function () {\n $(\"html, body\").css(\"background-color\", \"#FF9800\");\n setTimeout(function () {\n $(\"html, body\").css(\"background-color\", \"#000000\");\n }, 250);\n }, 5000);\n\n Slides.slide(`system`).isSticky = true;\n Slides.slide(`system`).active = true;\n break;\n case 3:\n statusLine.innerHTML = 'WWSU is experiencing minor issues';\n clearTimeout(offlineTimer);\n color = 'rgba(251, 192, 45, 0.5)';\n\n Slides.slide(`system`).isSticky = false;\n Slides.slide(`system`).active = true;\n break;\n case 5:\n statusLine.innerHTML = 'WWSU is operational';\n clearTimeout(offlineTimer);\n color = 'rgba(76, 175, 80, 0.5)';\n Slides.slide(`system`).active = false;\n Slides.slide(`system`).isSticky = false;\n break;\n default:\n statusLine.innerHTML = 'WWSU status is unknown';\n color = 'rgba(158, 158, 158, 0.3)';\n Slides.slide(`system`).active = false;\n Slides.slide(`system`).isSticky = false;\n }\n\n prevStatus = globalStatus;\n\n status.style.backgroundColor = color;\n status.style.color = 'rgba(255, 255, 255, 1)';\n statusLine.style.color = 'rgba(255, 255, 255, 1)';\n\n // Update status html\n var innercontent = document.getElementById('system-status');\n if (innercontent)\n innercontent.innerHTML = statusMarquee;\n\n } catch (e) {\n iziToast.show({\n title: 'An error occurred - Please check the logs',\n message: 'Error occurred during the call of Status[0].'\n });\n console.error(e);\n }\n}", "function flag_status_timeout() {\n document.getElementById('status_time_td').style.backgroundColor ='yellow';\n for (var logger in global_loggers) {\n var config_button = document.getElementById(logger + '_config_button');\n if (config_button) {\n config_button.style.backgroundColor = 'yellow';\n } else {\n console.log('Couldnt find logger ' + logger);\n }\n }\n}", "function highlightTopPlayers() {\r\n dojo.byId('topPlayersStatus').style.color = 'black';\r\n dojo.byId('topPlayers').style.color = 'black';\r\n }", "function colorHeaders() {\n\tvar eventDivs = $(\".fc-event-title\");\n\tfor (var i = 0; i < itinerary.length; i++) {\n\t\tfor (var j = 0; j < eventDivs.length; j++) {\n\t\t\tif ($(eventDivs[j]).html() == \"Travel Time\" || $($(eventDivs[j]).parent().parent().children()[0]).html().indexOf(\"Travel Time\") != -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (getItem(itinerary[i]).data.start >= calBegin && getItem(itinerary[i]).value == $(eventDivs[j]).html()) {\n\t\t\t\t$($(eventDivs[j]).parent().parent().children()[0]).css(\"background-color\", \"#CCCCCC\");\n\t\t\t}\n\t\t}\n\t}\n}", "colorIn(list) {\r\n list.forEach((item) => {\r\n item.div.style.backgroundColor = item.color;\r\n });\r\n }", "function color(co){\n tabla.style.color = co\n for(item of borde){\n item.style.borderColor = co\n }\n}", "function borderUp(x) {\r\n x.style.borderLeftStyle = 'solid';\r\n x.style.borderLeftWidth = '5px';\r\n x.style.borderLeftColor = '#B23A48';\r\n }", "status() {\n\n console.log(\"itemClass: \" + this.itemClass)\n console.log(\"cardId: \" + this.cardId)\n console.log(\"selectedColor: \" + this.selectedColor)\n\n }", "function status(message, borderColor) {\n $('#status').fadeOut(10);\n $('#status').text(message);\n $('.status').css(\"border-color\", borderColor);\n $('#status').fadeIn();\n} // end of fucntion status", "function backgroundColorAccueil() {\r\n $(li1).addClass('backgroundColorClick');\r\n if(li2.hasClass('backgroundColorClick')){\r\n li2.removeClass('backgroundColorClick');\r\n }\r\n if(li3.hasClass('backgroundColorClick')){\r\n li3.removeClass('backgroundColorClick');\r\n }\r\n }", "function set_man_price_active_color(index){\n var range_min_left = man_price_rang_from_system_min[index].offsetLeft+(man_price_rang_from_system_min[index].offsetWidth/2),\n range_max_left = man_price_rang_from_system_max[index].offsetLeft,\n distence = (range_max_left-range_min_left);\n \n man_price_active_color[index].style.left = `${range_min_left}px`;\n\n if(man_price_rang_from_system_max[index].offsetLeft==man_price_rang_from_system_min[index].offsetLeft){\n man_price_active_color[index].style.width = `0px`;\n }else{\n man_price_active_color[index].style.width = `${distence}px`;\n }\n}", "function alterBorder() {\r\n var scrollTable = query(queryText)[0];\r\n if (scrollTable.offsetHeight >= visibleAreaHeight) { //scrollbar visible & active\r\n //dont want a border on final row, if an odd row\r\n var lastRow = query(\".odd-last-row\", scrollTable)[0];\r\n if (typeof lastRow != \"undefined\") {\r\n domClass.add(lastRow, \"no-bottom-border\");\r\n }\r\n }\r\n else if (scrollTable.offsetHeight < visibleAreaHeight) { //scrollbar visible & inactive\r\n //we want a border on final row, if an even row\r\n var lastRow = query(\".even-last-row\", scrollTable)[0];\r\n if (typeof lastRow != \"undefined\") {\r\n domClass.add(lastRow, \"add-bottom-border\");\r\n }\r\n }\r\n else {\r\n curam.debug.log(\"curam.util.alterScrollableListBottomBorder: \" \r\n + bundle.getProperty(\"curam.util.code\"));\r\n }\r\n }", "render() {\n const { error, isLoaded, items } = this.state;\n\n if (error) {\n console.log(\"Error: \" + error.message + \". Setting text to say 'Please Try Again'\");\n return <div>{this.props.target} information is currently not available. Please try again later.</div>;\n } else if (!isLoaded) {\n return <div>Loading {this.props.target} List...</div>;\n } else {\n\n // Gives a value to the badge\n document.getElementById(\"alertsBadge\").innerHTML = items.length\n\n // Adds a color property to each alert based on its category\n for(var i = 0; i < items.length; i++){\n\n switch(items[i].category){\n\n case \"Park Closure\":\n items[i].colorClass = \"text-primary\";\n break;\n case \"Information\":\n items[i].colorClass = \"text-info\";\n break;\n\n case \"Caution\":\n items[i].colorClass = \"text-warning\";\n break;\n\n case \"Danger\":\n items[i].colorClass = \"text-danger\";\n break;\n default:\n items[i].colorClass = \"text-body\";\n\n }\n }\n\n // Adds alerts to modal if there are any, otherwise sets a placeholder text\n if(items.length > 0){\n return (\n <div>\n {items.map(item => (\n <div>\n <h6>{item.title}</h6>\n <p><strong className={item.colorClass}>{item.category}</strong>: {item.description} {item.url.length > 0 &&\n <a href={item.url}>More Info</a>}\n </p>\n </div>\n ))}\n </div>\n );\n }else{\n return (<div>No alerts at this time</div>)\n }\n }\n }", "function calBackgroundColor () {\n $(\"#cal-list li\").each(function(index){\n\n if (index + 9 < moment().hour()) {\n $(this).find(\".cal-enter\").addClass(\"past\");\n }\n else if (index + 9 == moment().hour()) {\n $(this).find(\".cal-enter\").addClass(\"present\");\n }\n else {\n $(this).find(\".cal-enter\").addClass(\"future\");\n }\n\n })\n // console.log('calBackgroundColor has been called')\n}", "function liMultiChange() {\n var odd = document.querySelectorAll('.list-group-item:nth-child(odd)');\n var even= document.querySelectorAll('li:nth-child(even)');\n\n for(var i = 0; i < odd.length; i++){\n odd[i].style.backgroundColor = '#f4f4f4';\n odd[i].style.marginRight = '500px';\n even[i].style.backgroundColor = '#ccc';\n even[i].style.marginRight = '500px';\n }\n\n}", "function getColorByStatus(record) {\n\tvar color = 0x5186BD;\n\tvar status = record.getValue('activity_log.status');\n\n\tif (status == 'SCHEDULED') {\n\t\tcolor = 0x666600;\n\t} else if (status == 'CANCELLED') {\n\t\tcolor = 0x9900FF;\n\t} else if (status == 'IN PROGRESS') {\n\t\tcolor = 0x0000FF;\n\t} else if (status == 'IN PROCESS-H') {\n\t\tcolor = 0xFF00FF;\n\t} else if (status == 'STOPPED') {\n\t\tcolor = 0xFF9900;\n\t} else if (status == 'COMPLETED') {\n\t\tcolor = 0x009900;\n\t} else if (status == 'COMPLETED-V') {\n\t\tcolor = 0x009900;\n\t} else if (status == 'CLOSED') {\n\t\tcolor = 0x66FF33;\n\t}\n\t\n\tif(record.getValue('activity_log.isOverdue')=='true'){\n\t\tcolor = 0xFF0000;\n\t}\n\n\treturn color;\n}", "function valActivities (activity) {\n activity.addEventListener('change', (e) => {\n if (e.target.checked) {\n for (let i = 0; i < list.length; i++) {\n list[i].style.color = '';\n }\n error3.className = 'is-hidden';\n\n } else if (activitiesCount === 0){\n for (let i = 0; i < list.length; i++) {\n list[i].style.color = 'red';\n }\n error3.className = '';\n error3.textContent = actError;\n list[0].after(error3);\n }\n })\n}", "unboldColumn(lastSlotNum) {\n for (let i = lastSlotNum; i >= 0; i -= 7) {\n if (this.getSlot(i).style.border != '4px solid red') {\n this.getSlot(i).style.border = '2px solid black';\n }\n }\n }", "function listItemOnHover(listItem) {\n\tlistItem.addEventListener('mouseover', () => {\n\t\tlistItem.style.color = 'gray';\n\t});\n\tlistItem.addEventListener('mouseleave', () => {\n\t\tlistItem.style.color = 'black';\n\t});\n}", "getTableLeftBorder(borders) {\n if (!isNullOrUndefined(borders.left)) {\n return borders.left;\n }\n else {\n let border = new WBorder(borders);\n border.lineStyle = 'Single';\n border.lineWidth = 0.66;\n return border;\n }\n }", "function createMissingExcuseList() {\n//delete list elements\nthis.row = document.getElementById(\"row_blueprint\");\nthis.pupil = document.getElementById(\"pupil_blueprint\");\nmissingExcuses = studentList.filter(data => data.type == \"missingExcuse\");\nx=0;\nmissingExcuses.forEach(function(element) {\nmodeIcon = null;\n//check for status icons\nif(element['adminMeldung'] != 0) {\n\tofficeNotice = true;\n\trowcolor = \"orange-text\";\n\tif (element['adminMeldungTyp'] == 0) {\n\t\tstateIcon = \"contact_phone\";\t\n\t\t} else{\n\t\tstateIcon = \"contact_mail\";\n\t\t}\t\n\t} else if (element['lehrerMeldung'] != 0) {\n\tstateIcon = \"school\";\n\trowcolor = \"red-text\";\t\n\t} else if (element['elternMeldung'] != 0) {\n\tstateIcon = \"supervisor_account\";\n\trowcolor = \"orange-text\";\t\n\t}\nif ( element['entschuldigt'] != \"0000-00-00\") {\n\trowcolor = \"green-text\";\t\n\t} else {\n\trowcolor =\trowcolor;\n\t}\nif (null != document.getElementById(\"row\"+element['absenceId'])) {\n\tdocument.getElementById(\"row\"+element['absenceId']).remove();\n\t}\nthis.rowClone = this.row.cloneNode(true);\nthis.rowClone.id = \"row\"+element['absenceId'];\nthis.rowClone.className = rowcolor;\nthis.rowClone.innerHTML = \n\t\t'<span' + rowcolor+' \">'\n\t\t+element['name'] + ' ('\n\t\t+ element['klasse'] \n\t\t+')'\n\t\t+'<i class=\"material-icons left\">'+stateIcon+'</i>';\nthis.rowClone.innerHTML += '</span>';\nthis.rowClone.innerHTML += '<a href=\"#\" onClick=\"excuseNotice('+element['absenceId']+')\" class=\"grey-text\"><i class=\"material-icons right\">playlist_add_check</i></a>';\nthis.rowClone.innerHTML +='<hr/>';\nx++;\ndocument.getElementById('missingexcuseslist').appendChild(this.rowClone);\nthis.rowClone.style.display=\"block\";\n});\n\n\n\n}", "function borderThicken(current,next) {\n\tcurrent.style.border = '1px solid gray';\n\tnext.style.border = '2px solid black';\n}", "function BorderClick(){\n \tjQuery (\".boxes\").css(\"border-bottom\", \"6px solid black\")\n }", "function highlightactive(e) {\r\n e.preventDefault();//Prevent the default behavior\r\n //Checking which section we are in and making its list item with a different color\r\n if (document.querySelector('#anchor1').getBoundingClientRect().y + 100 > 0) {\r\n document.querySelector('#LiItemSection1').setAttribute(\"style\", \"background: white;color:#162B4E\");\r\n document.querySelector('#LiItemSection2').setAttribute('style', \"background-color:#162B4E;color:white\");\r\n document.querySelector('#LiItemSection3').setAttribute('style', \"background-color:#162B4E;color:white\");\r\n\r\n } else if (document.querySelector('#anchor2').getBoundingClientRect().y > 0) {\r\n document.querySelector('#LiItemSection2').setAttribute(\"style\", \"background: white;color:#162B4E\");\r\n document.querySelector('#LiItemSection1').setAttribute('style', \"background-color:#162B4E;color:white\");\r\n document.querySelector('#LiItemSection3').setAttribute('style', \"background-color:#162B4E;color:white\");\r\n } else if (document.querySelector('#anchor3').getBoundingClientRect().y > 0) {\r\n document.querySelector('#LiItemSection3').setAttribute(\"style\", \"background: white;color:#162B4E\");\r\n document.querySelector('#LiItemSection2').setAttribute('style', \"background-color:#162B4E;color:white\");\r\n document.querySelector('#LiItemSection1').setAttribute('style', \"background-color:#162B4E;color:white\");\r\n }\r\n document.querySelector('#LiItemSection1').addEventListener('hover', entermouse);\r\n document.querySelector('#LiItemSection2').addEventListener('hover', entermouse);\r\n document.querySelector('#LiItemSection3').addEventListener('hover', entermouse);\r\n}", "renderContent(data) {\n \tconst rowData = data.item;\n let baseColor;\n let iconToDisplay;\n\t\tlet itemSuspictionColor;\n // give a differente backgroundColor to the notifications already clicked\n let index;\n if (this.state.existingList && this.state.existingList.length > 0) {\n index = this.state.existingList.map((single) => {return single._id}).indexOf(rowData._id);\n }\n // display the right icon according to the theme\n switch (rowData.theme) {\n case 'tabac':\n iconToDisplay = tabac;\n break;\n case 'sport':\n iconToDisplay = sport;\n break;\n case 'nutrition':\n iconToDisplay = food;\n break;\n case 'relax':\n iconToDisplay = relax;\n break;\n default: iconToDisplay = tabac;\n }\n // display the right back color according to the argument\n switch (rowData.action) {\n case 'bet':\n case 'chalAccepted':\n case 'chalMatched':\n case 'challengeReactivated':\n case 'pendingChallenge':\n \t// give the right color to the board\n baseColor = color3;\n\t\t\t\t// give the right color to clicked notifs\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.state.existingList\n\t\t\t\t\t\t&& this.state.existingList[index]\n\t\t\t\t\t\t&& this.state.existingList[index].clicked\n\t\t\t\t\t\t&& this.state.existingList[index].clicked === true\n\t\t\t\t\t)\n\t\t\t\t\t|| ((\n\t\t\t\t\t\trowData.action === 'chalAccepted'\n\t\t\t\t\t\t|| rowData.action === 'chalMatched'\n\t\t\t\t\t\t|| rowData.action === 'pendingChallenge'\n\t\t\t\t\t\t) && rowData.player === this.props.userId\n\t\t\t\t\t)\n\t\t\t\t\t|| (rowData.action === 'pendingChallenge' && rowData.used === true)\n\t\t\t\t) {\n\t\t\t\t\titemColor = color16;\n\t\t\t\t} else {\n\t\t\t\t\titemColor = white;\n\t\t\t\t}\n break;\n case 'challengeFreezed':\n case 'challFinished':\n \t// give the right color to the board\n baseColor = color4;\n\t\t\t\t// give the right color to clicked notifs\n\t\t\t\tif (\n\t\t\t\t\tthis.state.existingList\n\t\t\t\t\t&& this.state.existingList[index]\n\t\t\t\t\t&& this.state.existingList[index].clicked\n\t\t\t\t\t&& this.state.existingList[index].clicked === true\n\t\t\t\t) {\n\t\t\t\t\titemColor = color15;\n\t\t\t\t} else {\n\t\t\t\t\titemColor = white;\n\t\t\t\t}\n break;\n case 'avatar':\n case 'chalRefused':\n case 'endStage':\n case 'endProgram':\n \t// give the right color to the board\n baseColor = color2;\n\t\t\t\t// give the right color to clicked notifs\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.state.existingList\n\t\t\t\t\t\t&& this.state.existingList[index]\n\t\t\t\t\t\t&& this.state.existingList[index].clicked\n\t\t\t\t\t\t&& this.state.existingList[index].clicked === true\n\t\t\t\t\t)\n\t\t\t\t\t|| rowData.action === 'chalRefused'\n\t\t\t\t\t|| rowData.action === 'endStage'\n\t\t\t\t\t|| rowData.action === 'endProgram'\n\t\t\t\t) {\n\t\t\t\t\titemColor = color14;\n\t\t\t\t} else {\n\t\t\t\t\titemColor = white;\n\t\t\t\t}\n break;\n case 'onBoardingWelcome':\n case 'onBoarding1':\n case 'onBoarding2':\n case 'morningIncentive':\n \t// give the right color to the board\n baseColor = color9;\n\t\t\t\t// give the right color to clicked notifs\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.state.existingList\n\t\t\t\t\t\t&& this.state.existingList[index]\n\t\t\t\t\t\t&& this.state.existingList[index].clicked\n\t\t\t\t\t\t&& this.state.existingList[index].clicked === true\n\t\t\t\t\t)\n\t\t\t\t\t|| rowData.action === 'onBoarding2'\n\t\t\t\t) {\n\t\t\t\t\titemColor = color13;\n\t\t\t\t} else {\n\t\t\t\t\titemColor = white;\n\t\t\t\t}\n break;\n case 'freeze':\n case 'suspect':\n \t// give the right color to the board\n baseColor = color1;\n\t\t\t\t// give the right color to clicked notifs\n\t\t\t\tif (\n\t\t\t\t\t(\n\t\t\t\t\t\tthis.state.existingList\n\t\t\t\t\t\t&& this.state.existingList[index]\n\t\t\t\t\t\t&& this.state.existingList[index].clicked\n\t\t\t\t\t\t&& this.state.existingList[index].clicked === true\n\t\t\t\t\t)\n\t\t\t\t\t|| rowData.action === 'suspect'\n\t\t\t\t) {\n\t\t\t\t\titemColor = color11;\n\t\t\t\t} else {\n\t\t\t\t\titemColor = white;\n\t\t\t\t}\n break;\n default: baseColor = color1;\n }\n const fondAdapted = {\n alignSelf: 'stretch',\n justifyContent: 'center',\n marginTop: 2,\n marginHorizontal: 26,\n marginVertical: 15,\n borderRadius: 8,\n backgroundColor: baseColor\n };\n const imgAdapted = {\n width: imgWidth,\n height: imgWidth,\n borderWidth: 3,\n borderColor: baseColor,\n borderRadius: imgWidth / 2,\n marginBottom: 5\n };\n const innerBox = {\n \tflex: 1,\n flexDirection: 'row',\n alignSelf: 'center',\n justifyContent: 'space-between',\n \tmarginHorizontal: 10,\n paddingVertical: 17,\n \tbackgroundColor: itemColor,\n paddingHorizontal: 10\n };\n // make the notification clickable when it is not in a challenge detail\n if (rowData.action === 'pendingChallenge' && rowData.player === this.props.userId) {\n\n // ---------------------- informs the challenger of the pending Challenge he made ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.opponentImage ? { uri: rowData.opponentImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <View style={styles.iconTheme}><Image source={iconToDisplay} style={styles.imageIcon}/></View>\n\t \t<Text style={styles.txtTime}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n <Text style={styles.txt}>\n Vous avez defié <Text style={styles.bold}>{rowData.opponentFirstName} {rowData.opponentFamilyName}</Text>\n </Text>\n {rowData.bonus && rowData.bonus > 0 ?\n \tthis.bonus(rowData.bonus)\n \t:\n \tnull\n }\n <Text style={styles.txt}>Votre défi attend d'être accepté</Text>\n </View>\n </View>\n </View>\n );\n\n // pending challenges wher the user is opponent and the challenge is not older that the time limit for validation\n } else if (rowData.action === 'pendingChallenge' && (rowData.currentTime - new Date(rowData.date).getTime()) > rowData.oldMax) {\n\n // ---------------------- informs the opponent of a pending Challenge ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <View style={styles.iconTheme}><Image source={iconToDisplay} style={styles.imageIcon}/></View>\n\t \t<Text style={styles.txtTime}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n <Text style={styles.txt}>\n Le défi que <Text style={styles.bold}>{rowData.playerFirstName} {rowData.playerFamilyName}</Text> vous a lancé ne peut plus être accepté car le temps limite a été dépassé.\n </Text>\n </View>\n </View>\n </View>\n );\n } else if (rowData.action === 'avatar') {\n\n // ---------------------- informs the opponent of a pending Challenge ----------------//\n\n return (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n \t\tActions.bonusMain();\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n\t \t<Text style={styles.txtTimeNoIcon}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Vous</Text> venez d'enregistrer votre avatar{\"\\n\"}\n {rowData.bonus && rowData.bonus > 0 ?\n \tthis.bonus(rowData.bonus)\n \t:\n \tnull\n }\n </Text>\n </View>\n </View>\n </TouchableOpacity>\n );\n } else if (rowData.action === 'onBoardingWelcome') {\n\n // ---------------------- welcome message ----------------//\n\n return (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n\t \tif (this.props.origin === 'main' || this.props.origin === 'chall') {\n\t \t Actions.tutorial({format: 'tuto'});\n\t \t} else {\n\t \t Actions.tutorialNot({format: 'tuto'});\n\t \t}\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Bienvenue sur Tricky !</Text> Êtes-vous prêt à relever les défis ?\n </Text>\n <Text style={styles.txtClickable}>{'Besoin d\\'aide ?'.toUpperCase()}</Text>\n </View>\n </View>\n </TouchableOpacity>\n );\n } else if (rowData.action === 'onBoarding1') {\n\n // ---------------------- incentive tue user to launch a challenge ----------------//\n\n return (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n \t Actions.challenge({ idProgram: this.props.idProgram });\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Lancez</Text> votre premier défi à un collègue, et tentez de doubler votre mise !\n </Text>\n <Text style={styles.txtClickable}>{'Je commence !'.toUpperCase()}</Text>\n </View>\n </View>\n </TouchableOpacity>\n );\n } else if (rowData.action === 'onBoarding2') {\n\n // ---------------------- incentive tue user to launch a challenge ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Sur Tricky</Text> en lançant des défis à vos collègues vous les incitez à prendre soin de leur santé.{\"\\n\"}\n Si vous misez bien vous gagnez des points qui pourront être convertibles en <Text style={styles.bold}>chèque cadeau</Text> !\n </Text>\n </View>\n </View>\n </View>\n );\n } else if (rowData.action === 'morningIncentive') {\n\n // ---------------------- incentive tue user to launch a challenge ----------------//\n\n return (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n \t\tActions.challenge({ idProgram: this.props.idProgram });\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Bonjour {rowData.playerFirstName},</Text> aujourd'hui tu as {rowData.amount ? rowData.amount : '--'} Tricks soit XXX Euros à la fin de cette partie !\n </Text>\n <Text style={styles.txtClickable}>{'J\\'augmente mes Tricks...'.toUpperCase()}</Text>\n </View>\n </View>\n </TouchableOpacity>\n );\n } else if (rowData.action === 'chalRefused') {\n\n // ---------------------- informs the opponent of a pending Challenge ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n <View style={styles.iconTheme}><Image source={iconToDisplay} style={styles.imageIcon}/></View>\n\t \t<Text style={styles.txtTime}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n { this.props.userId === rowData.player ?\n <Text style={styles.txt}><Text style={styles.bold}>{this.selfDetector(this.props.userId, rowData.opponent, rowData.opponentFirstName, rowData.opponentFamilyName)}</Text> a réfusé le défi que vous avez lancé</Text>\n :\n null\n }\n { this.props.userId === rowData.opponent ?\n <Text style={styles.txt}><Text style={styles.bold}>Vous</Text> avez réfusé le défi lancé par {this.selfDetector(this.props.userId, rowData.player, rowData.playerFirstName, rowData.playerFamilyName)}</Text>\n :\n null\n }\n </View>\n </View>\n </View>\n );\n } else if (rowData.action === 'endStage') {\n\n // ---------------------- informs the opponent of a pending Challenge ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n\t \t<Text style={styles.txtTimeNoIcon}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Congratulations !</Text> La premiere partie du jeu est <Text style={styles.bold}>terminée</Text>{\"\\n\"}\n Vos Tricks ont été réinitialisés et votre gagne calculé.{\"\\n\"}\n Allez voir dans la <Text style={styles.bold}>page boutique</Text> le montant que vous avez <Text style={styles.bold}>gagné !</Text>\n </Text>\n </View>\n </View>\n </View>\n );\n } else if (rowData.action === 'endProgram') {\n\n // ---------------------- informs the opponent of a pending Challenge ----------------//\n\n return (\n <View\n style={fondAdapted}\n >\n <View style={innerBox}>\n <View style={imgAdapted}>\n <Image\n source={rowData.playerImage ? { uri: rowData.playerImage, isStatic: true } : defaultUser}\n style={styles.image}\n />\n </View>\n <View style={styles.listBox}>\n\t \t<Text style={styles.txtTimeNoIcon}>{timerNotifs(rowData.currentTime, rowData.date).toUpperCase()} :</Text>\n <Text style={styles.txt}>\n <Text style={styles.bold}>Congratulations !</Text> Le programme du jeu est arrivé à sa <Text style={styles.bold}>fin.</Text>{\"\\n\"}\n Votre gagne final a été calculé.{\"\\n\"}\n Allez voir dans la <Text style={styles.bold}>page boutique</Text> le montant que vous avez <Text style={styles.bold}>gagné !</Text>\n </Text>\n </View>\n </View>\n </View>\n );\n\n // assign a clickable or not clickable container\n } else if (\n \tthis.props.notClickable\n \t&& this.props.notClickable === true\n \t&& (rowData.action !== 'freeze' && rowData.action !== 'suspect')\n ) {\n \treturn (\n <View\n style={fondAdapted}\n >\n \t { this.basicContent(rowData, imgAdapted, innerBox, iconToDisplay) }\n </View>\n \t);\n } else if (rowData.action === 'pendingChallenge' && rowData.used === true) {\n \treturn (\n <View\n style={fondAdapted}\n >\n \t { this.basicContent(rowData, imgAdapted, innerBox, iconToDisplay) }\n </View>\n \t);\n } else if (rowData.action !== 'freeze' && rowData.action !== 'suspect') {\n \treturn (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n \tthis.props.selectNotif(rowData.challengeId, rowData.action);\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n \t { this.basicContent(rowData, imgAdapted, innerBox, iconToDisplay) }\n </TouchableOpacity>\n \t);\n\n } else if (rowData.action === 'freeze' || rowData.action === 'suspect') {\n \treturn (\n <TouchableOpacity\n style={fondAdapted}\n onPress={() => {\n \tmarkSingleNotif(rowData._id, rowData.date, () => {\n \t\tif (rowData.action === 'freeze') {\n\t\t \t// check if the freeze as been already jugged\n\t\t \tif (!rowData.used || rowData.used !== true) {\n\t\t \tif (this.props.origin === 'main' || this.props.origin === 'chall') {\n\t\t \t\tActions.dettFreeze({ idFreeze: rowData.freezeId, freezer: rowData.freezer, accusedId: rowData.accused, idChallenge: rowData.challengeId, image: rowData.image, comment: rowData.comment ? rowData.comment : null });\n\t\t \t} else {\n\t\t \t\tActions.dettFreezeNot({ idFreeze: rowData.freezeId, freezer: rowData.freezer, accusedId: rowData.accused, idChallenge: rowData.challengeId, image: rowData.image, comment: rowData.comment ? rowData.comment : null });\n\t\t \t}\n\t\t \t} else {\n\t\t \tif (this.props.origin === 'main' || this.props.origin === 'chall') {\n\t\t Actions.dettFreeze({ idFreeze: rowData.freezeId, freezer: rowData.freezer, accusedId: rowData.accused, idChallenge: rowData.challengeId, image: rowData.image, updated: true, comment: rowData.comment ? rowData.comment : null });\n\t\t } else {\n\t\t \tActions.dettFreezeNot({ idFreeze: rowData.freezeId, freezer: rowData.freezer, accusedId: rowData.accused, idChallenge: rowData.challengeId, image: rowData.image, updated: true, comment: rowData.comment ? rowData.comment : null });\n\t\t }\n\t\t \t}\n \t\t} else if (rowData.action === 'suspect') {\n\t\t this.props.selectNotif(rowData.challengeId, rowData.action);\n \t\t}\n \t\tthis.handleRefresh();\n \t});\n }}\n >\n \t { this.basicContent(rowData, imgAdapted, innerBox, iconToDisplay) }\n </TouchableOpacity>\n \t);\n }\n }", "function Themes_PreProcessListBox(theObject)\n{\n\tif (String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT]))\n\t\ttheObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = \"White\";\n\tif (String_IsNullOrWhiteSpaceOrAuto(theObject.Properties[__NEMESIS_PROPERTY_CLIENTEDGE]) &&\n\t\tString_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BORDER]) &&\n\t\tString_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BORDER_LEFT]) &&\n\t\tString_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BORDER_TOP]) &&\n\t\tString_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BORDER_RIGHT]) &&\n\t\tString_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_BORDER_BOTTOM]))\n\t\ttheObject.Properties[__NEMESIS_PROPERTY_CLIENTEDGE] = \"Yes\";\n}", "function backgroundColorSincrire() {\r\n $(li2).addClass('backgroundColorClick');\r\n if(li1.hasClass('backgroundColorClick')){\r\n li1.removeClass('backgroundColorClick');\r\n }\r\n if(li3.hasClass('backgroundColorClick')){\r\n li3.removeClass('backgroundColorClick');\r\n }\r\n }", "function clearPreviousHighlights() {\r\n let listOfItemsTwo = Array.from(\r\n document.getElementById(\"toDoList\").getElementsByTagName(\"li\")\r\n );\r\n for (let b = 0; b < listOfItemsTwo.length, b++; ) {\r\n listOfItemsTwo[b].style.backgroundColor = \"rgb(250, 161, 161)\";\r\n console.log(listOfItemsTwo[b]);\r\n }\r\n}", "function setRedBoxes(){\n\tsetInputBox2RedBorder($('input[name=LP-name]'));\n\tsetInputBox2RedBorder($('input[name=LP-mail]'));\n\tsetInputBox2RedBorder($('input[name=LP-phone]'));\n\tsetInputBox2RedBorder($('input[name=BP-name]'));\n\tsetInputBox2RedBorder($('input[name=BP-mail]'));\n\t//setInputBox2RedBorder($('input[name=LP-phone]'));\n\tsetInputBox2RedBorder($(\".CVR\"));\n\tsetInputBox2RedBorder($(\".EAN\"));\n\tsetInputBox2RedBorder($(\"#datepicker\"));\n\t//$(\"LP-name\").css(\"border\",\"3px solid red\");\n\tvar name = document.getElementsByName(\"LP-name\");\n\t//name[0].focus();\n\t//alert();\n\t//name[0].css(\"border\",\"3px solid red\");\n}", "function customStyleReminder() {\n vm.reminderHeaders = (vm.reminders.length >= 3) ? 'paddding-right-11' : '';\n }", "_itemOnMouseMove(event) {\n const that = this;\n\n if (!that.ownerListBox) {\n return;\n }\n\n if (JQX.ListBox.DragDrop.Dragging && that.ownerListBox.allowDrop && !JQX.Utilities.Core.isMobile) {\n const itemsWithFeedback = [].slice.call(that.ownerListBox.getElementsByClassName('jqx-list-item-bottom-line-feedback'));\n\n for (let i = 0; i < itemsWithFeedback.length; i++) {\n itemsWithFeedback[i].$.removeClass('jqx-list-item-line-feedback');\n itemsWithFeedback[i].$.removeClass('jqx-list-item-bottom-line-feedback');\n }\n\n JQX.ListBox.DragDrop.DropDetails = { item: that, position: 'top' };\n if (!that.ownerListBox._areCSSVarsSupported) {\n if (that.ownerListBox._indexOf(that) === that.ownerListBox._items.length - 1 || that.parentNode.lastElementChild === that) {\n const rect = that.getBoundingClientRect();\n\n if (event.pageY - window.pageYOffset > rect.top + (rect.height / 2) - 1) {\n JQX.ListBox.DragDrop.DropDetails = { item: that, position: 'bottom' };\n }\n }\n return;\n }\n\n that.$.removeClass('jqx-list-item-line-feedback');\n that.$.removeClass('jqx-list-item-bottom-line-feedback');\n\n if (that.ownerListBox.sorted && that.ownerListBox.autoSort) {\n return;\n }\n\n const visibleItems = that.ownerListBox._items.filter(item => !item.hidden);\n\n if (visibleItems.indexOf(that) === visibleItems.length - 1 || that.parentNode.lastElementChild === that) {\n const rect = that.getBoundingClientRect();\n\n if (event.pageY - window.pageYOffset > rect.top + (rect.height / 2) - 1) {\n that.$.addClass('jqx-list-item-bottom-line-feedback');\n JQX.ListBox.DragDrop.DropDetails = { item: that, position: 'bottom' };\n }\n else if (!arguments[1]) {\n that.$.addClass('jqx-list-item-line-feedback');\n }\n }\n else if (!arguments[1]) {\n that.$.addClass('jqx-list-item-line-feedback');\n }\n }\n }", "function showFieldMessage() {\r\n fieldArr.forEach(function (item) {\r\n\r\n if (item === descField) {\r\n item.textContent = 'Please fill the description';\r\n\r\n }\r\n if (item === assField) {\r\n item.textContent = 'Please fill responsible person name';\r\n\r\n }\r\n item.style.color = 'red';\r\n inputDesc.style.border = '1px solid red';\r\n inputAss.style.border = '1px solid red';\r\n\r\n });\r\n\r\n}", "function ISSUE_ELEMENT_LIST$static_(){IssuesPanelBase.ISSUE_ELEMENT_LIST=( IssuesPanelBase.ISSUE_BLOCK.createElement(\"list\"));}", "function checkIn(){\n var table = document.getElementById('appointment-list');\n for(var i=0; i<table.rows.length;i++){\n var row = table.rows[i];\n if(row.hilite){\n row.style.backgroundColor=\"green\";\n }\n }\n}", "function dispalyMessages(messages) {\n // let list_message = document.querySelector('.list-text');\n if (list_message !== null) {\n list_message.remove();\n }\n list_message = document.createElement('div');\n list_message.className = 'list-text';\n\n for (let value of messages) {\n\n let messageText = document.createElement('p');\n messageText.className = \"message-text\";\n messageText.textContent = value.message;\n list_user.textContent = value.users;\n \n if (value.users === itemOfuser) {\n messageText.style.background = 'red';\n }\n if(value.bold === true){\n messageText.style.fontWeight = 'bold';\n }else{\n messageText.style.fontWeight = 'normal';\n }\n\n if(value.italic === true){\n messageText.style.fontStyle = 'italic';\n }else{\n messageText.style.fontStyle = 'normal';\n }\n\n list_message.appendChild(messageText);\n messageTitle.appendChild(list_message);\n }\n}", "function showServerStatus (respArr) {\n for (var i = 1; i< 4; i++) {\n var idObj = document.getElementById ('serverId' + i);\n var configRowIdObj = document.getElementById ('authServerId' + i);\n var breakIdObj = document.getElementById ('authServerBreak' + i);\n var serverObj = document.getElementById ('serverObjId' + i);\n \n idObj.innerHTML = statusMsgArr[parseInt (respArr[i], 10)];\n configRowIdObj.className = \"configRow\";\n breakIdObj.className = \"break\";\n }\n}", "function restoreBorder() {\n if (scope.lastSelectedWatcher) {\n scope.lastSelectedWatcher.element.css('border', scope.lastSelectedWatcherBorder);\n }\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}", "function formatMessageActivities (elementHTML) {\n elementHTML.style.background = 'lightblue';\n elementHTML.style.borderBottom = '2px solid lightSlateGray';\n elementHTML.style.lineHeight = 1.5;\n elementHTML.style.paddingLeft = '5px';\n elementHTML.style.marginLeft = '20px';\n elementHTML.style.fontStyle = 'italic';\n elementHTML.textContent = \"The workshop in the competing time slot isn't available.\";\n return elementHTML;\n }", "function addBarLines(event){\n if (event.target && event.keyCode == 84){\n areLines = !areLines;\n if (areLines){\n for (let i = 0; i < arr.length; i++){\n data.children[i].style.setProperty('transition-duration', '0s');\n data.children[i].style.boxSizing = 'border-box';\n data.children[i].style.borderStyle = 'solid';\n data.children[i].style.borderWidth = '0px 1px 0px 1px';\n data.children[i].style.borderColor = '#B0B0B0';\n }\n }else{\n for (let i = 0; i < arr.length; i++){\n data.children[i].style.setProperty('transition-duration', '0s');\n data.children[i].style.setProperty('box-sizing', 'initial');\n data.children[i].style.setProperty('border-style', 'initial');\n data.children[i].style.setProperty('border-width', 'initial');\n data.children[i].style.setProperty('border-color', 'initial');\n }\n }\n }else{\n if (areLines){\n event.style.boxSizing = 'border-box';\n event.style.borderStyle = 'solid';\n event.style.borderWidth = '0px 1px 0px 1px';\n event.style.borderColor = '#B0B0B0';\n }\n }\n\n}" ]
[ "0.56633437", "0.56244004", "0.55653024", "0.5555771", "0.5451087", "0.54466873", "0.5383758", "0.5317974", "0.52989113", "0.52874887", "0.52812505", "0.52554566", "0.5181292", "0.51353246", "0.5130881", "0.5121103", "0.51172745", "0.5106437", "0.5091735", "0.50798875", "0.5061811", "0.50605637", "0.50541484", "0.5024217", "0.5022471", "0.4994473", "0.49555588", "0.49499497", "0.49447754", "0.4926099", "0.49245158", "0.49105474", "0.48790085", "0.4877051", "0.4874122", "0.48733473", "0.4873142", "0.48601988", "0.4845002", "0.48438406", "0.48395628", "0.4829103", "0.4820884", "0.48201185", "0.48167163", "0.481185", "0.4803839", "0.48037207", "0.48026544", "0.4797611", "0.478995", "0.47871414", "0.4787009", "0.47814775", "0.47663754", "0.4765079", "0.47645918", "0.4756913", "0.47527072", "0.4739893", "0.47332224", "0.47312805", "0.47293317", "0.47249436", "0.47166687", "0.471094", "0.47108847", "0.47103655", "0.47096848", "0.47073713", "0.46990883", "0.46954972", "0.46890217", "0.46866494", "0.46863118", "0.46817985", "0.4677026", "0.46662757", "0.46554852", "0.46535918", "0.46478632", "0.4647016", "0.46430647", "0.46379513", "0.46366227", "0.46334815", "0.46331787", "0.4630959", "0.46303716", "0.4623887", "0.46153685", "0.46128768", "0.46128142", "0.4612737", "0.46126282", "0.46109793", "0.46072572", "0.46067977", "0.46009725", "0.4600241" ]
0.5363318
7
Gets the header to display above the list to give a quick overview on if they are viewing alerts for all services or only their favorited services. Possibilities: Home page, showing alerts for all services Home page, showing alerts for any favorited services and notified alerts Services page, alerts for that service
function getHeaderNote() { const { favoritesOnly, includeNotified } = variables.input if (includeNotified && favoritesOnly) { return `Showing ${filter} alerts you are on-call for and from any services you have favorited.` } if (allServices) { return `Showing ${filter} alerts for all services.` } if (props.serviceID && serviceNameQuery.data?.service?.name) { return `Showing ${filter} alerts for the service ${serviceNameQuery.data.service.name}.` } return null }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeader() {\n return This.headerTpl({\n date: date,\n teams: teams\n });\n }", "viewHeader() {\n\t\tif (this.state.page === \"Info\") {\n\t\t\tif (this.state.page === \"Info\") {\n\t\t\t\treturn (\n\t\t\t\t\t<div>Getting Started</div>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn (\n\t\t\t\t\t<div>Welcome to Cast Off!</div>\n\t\t\t\t);\n\t\t\t}\n\t\t} else {\n\t\t\tif (!this.props.userkey) {\n\t\t\t\treturn (\n\t\t\t\t\t<div>Welcome to Cast Off!</div>\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\treturn (\n\t\t\t\t\t<div>{this.state.page}</div>\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}", "function RenderHeader() {\n var tabletext = AddTableHeader('Name');\n let click_periods = manual_periods.concat(limited_periods);\n let times_shown = GetShownPeriodKeys();\n times_shown.forEach((period)=>{\n let header = period_info.header[period];\n if (click_periods.includes(period)) {\n let is_available = CU.period_available[CU.usertag][CU.current_username][period];\n let link_class = (manual_periods.includes(period) ? 'cu-manual' : 'cu-limited');\n let header_class = (!is_available ? 'cu-process' : '');\n let counter_html = (!is_available ? '<span class=\"cu-display\" style=\"display:none\">&nbsp;(<span class=\"cu-counter\">...</span>)</span>' : '');\n tabletext += AddTableHeader(`<a class=\"${link_class}\">${header}</a>${counter_html}`,`class=\"cu-period-header ${header_class}\" data-period=\"${period}\"`);\n } else {\n tabletext += AddTableHeader(header,`class=\"cu-period-header\" data-period=\"${period}\"`);\n }\n });\n return AddTableHead(AddTableRow(tabletext));\n}", "function deviceHeaderView(){\n\tvar local_device = get_local_device();\n\tvar local_session = get_local_simulation();\n\tvar html = viewDeviceTemplate(local_device, local_session);\n\tvar content = getContainer();\n\tcontent.innerHTML = html;\n}", "renderHeader () {\n this.header = this.renderSubview(\n new ListHeader({ title: this.title }),\n this.queryByHook('header-container')\n )\n return this.header\n }", "function header() {\n return E('header#header') . has([\n H1(\"todos\") // some kind of placeholder?\n ]);\n }", "getHorsesAndServices(user) {\n let collatedOutput = '';\n\n if (this._requests.length) {\n this._requests.forEach((request) => {\n // Only add information for requests that were assigned to a reassignee, if applicable\n if (!this.isReassignedToUser(user) ||\n (request._reassignedTo && String(request._reassignedTo._id) === String(user._id))) {\n if (request._horse) {\n collatedOutput += `Service${request.services.length === 1 ? '' : 's'} for ${request._horse.showName} (${request._horse.barnName}) - `;\n } else {\n // If the request isn't populated with a horse, that means the horse was deleted\n collatedOutput += `Service${request.services.length === 1 ? '' : 's'} for [HORSE DELETED FROM APP] - `;\n }\n // Go through the requests on the invoice and list each request's service info\n request.services.forEach((service) => {\n let calculatedRate;\n if (User.isManager(user)) {\n // Horse managers should see fees aplied to exported totals\n calculatedRate = this.addServiceFee((service.quantity || 1) * service.rate);\n } else {\n calculatedRate = (service.quantity || 1) * service.rate;\n }\n collatedOutput += `${service.service} (x${service.quantity || 1}): ${calculatedRate.toFixed(2)}; `;\n });\n }\n });\n\n // Cut off the trailing comma and space\n collatedOutput = collatedOutput.slice(0, -2);\n return collatedOutput;\n }\n return 'N/A';\n }", "function renderHeader(){\n // in Salmon Cookies, mkae this look like image in lab-07 instructions: iterate thru the hours array\n}", "function setHeader () {\n\t\theaderLabel.text='Summary';\n\t\tleftBtn.title='Back';\n\t\trightBtn.title='Email';\n\t\trightBtn.width=Ti.Platform.osname =='android'?'27%':'23%',\n\t\trightBtn.font=Ti.Platform.osname =='android'?{fontSize:'17dp'}:{fontSize:'15%'};\n\t\theaderView.add(leftBtn);\t\n\t\theaderView.add(rightBtn);\t\t\t\t\t\n\t\theaderView.add(headerLabel);\n\t\tsummaryWindow.add(headerView);\n}", "function createAppHeader(){\n console.log(`_______________________`)\n console.log(`| |`)\n console.log(`| EMPLOYEE |`)\n console.log(`| MANAGEMENT |`)\n console.log(`| SYSTEM |`)\n console.log(`|_____________________|`)\n console.log(` `)\n console.log(` `)\n console.log(` `)\n}", "function showHeader() {\n // TODO: improve header\n grunt.log.subhead(consts.header);\n}", "function printLeftHeader() {\n const header = document.createElement('header');\n header.innerHTML =\n `<div class=\"logo\">\n <div class=\"loader\"></div>\n QuepasApp\n </div>\n <div class=\"configurations\">\n <span></span> <input type=\"button\" value=\"Logout\" onclick=\"logout();\">\n </div>\n <div class=\"profile\">\n <input type=\"button\" value=\"My Profile\" onclick=\"openProfile(data.user);\">\n </div>\n <div class=\"add-conversation\">\n <input type=\"button\" value=\"Start Conversation\" onclick=\"startConversation();\">\n </div>\n <div class=\"friends-list\">\n <input type=\"button\" value=\"Friends List\" onclick=\"openFriendsList();\">\n </div>`;\n header.innerHTML +=\n `<div class=\"admin-zone\"></div>`;\n return header;\n}", "function pageTitles() {\n\n // Edit the page headings with the totalShifts\n $(\"#totalShifts\").append(results.Collections.Total);\n $(\"#totalCollectors\").append(results.Collectors.Total);\n\n }", "getHeaders() {\n const {\n sessionView,\n headers,\n } = this.props;\n const headerIndex = headers.indexOf(VIEW_TO_HEADER_MAP[sessionView])\n const usedHeaders = headers.slice(0, headerIndex+1);\n\n return usedHeaders.map((header, i) => {\n const isFocused = i === headerIndex;\n const focusedClass = isFocused ? \" focused\" : \"\";\n const title = this.getBreadcrumbTitle(header);\n\n return (\n <div\n className={ `bc-header${focusedClass}` }\n key={ header }\n title={ REVISIT_SECTION_TITLE }\n onClick={ e => {\n e.preventDefault();\n if (!isFocused) {\n this.breadcrumbClickHandlers[HEADER_TO_VIEW_MAP[header]]();\n }\n }}\n >\n { title }\n </div>\n );\n });\n }", "function showTopHeaders() {\n var headerRow = document.createElement('TR');\n headerRow.innerHTML = '<th>' + name + '</th>';\n \n var firstKey = Object.keys(primary)[0];\n if (primary[firstKey]) {\n for (var header in primary[firstKey]) {\n if (primary[firstKey].hasOwnProperty(header)) {\n var newHeader = document.createElement('TH');\n newHeader.innerHTML = header;\n headerRow.appendChild(newHeader);\n }\n }\n }\n this.dom.appendChild(headerRow);\n }", "static get HEADERS() {\n return 1;\n }", "function showTypeAndDate(){\n\t\tvar view = this;\n\t\tvar $e = view.$el;\n\t\tvar reportType = view.reportType;\n\t\tvar $reportHeaderMailingSelectorCount = $e.find(\".reportHeader-mailingSelector .count\");\n\t\tvar $reportHeaderMailingSelectorNeedS = $e.find(\".reportHeader-mailingSelector .needS\");\n\t\tvar $reportHeaderMailingSelectorType = $e.find(\".reportHeader-mailingSelector .type\");\n\t\tvar $reportHeaderMailingSelectorDate = $e.find(\".reportHeader-mailingSelector .date\");\n\t\tvar $reportHeaderPeriod = $e.find(\".reportHeader-period\");\n\t\tvar $reportHeaderDate = $reportHeaderPeriod.find(\".reportHeader-date\");\n\t\tvar setType = smr.getSetAndType(reportType);\n\t\tvar count = setType.set.list().length;\n\t\t//show mailings\t\t\n\t\tif(reportType == smr.REPORT_TYPE.DELIVERABILITY){\n\t\t\tvar title = setType.type;\n\t\t\tif(setType.type==\"VSG\") title = \"Mailing Server Group\";\n\t\t\t$e.find(\".reportHeader-mailingSelector\").html(\"<span class='count'>\"+count+\"&nbsp;</span>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"<span class='type'>\"+title+\"</span>\" +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t (count>1?\"<span class='needS'>s</span>\":\"\"));\n\t\t}else if(reportType == smr.REPORT_TYPE.DELIVERABILITYDOMAINS){\n\t\t\tif(count==0){\n\t\t\t\t$e.find(\".reportHeader-mailingSelector\").html(\"All Mailing Server Groups\");\n\t\t\t}else{\n\t\t\t\t$e.find(\".reportHeader-mailingSelector\").html(\"<span class='count'>\"+count+\"&nbsp;</span>\" +\n\t\t\t\t\t\t\"<span class='type'>Mailing Server Group</span>\" +\n\t\t\t\t\t\t(count>1?\"<span class='needS'>s</span>\":\"\"));\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.AUDIENCE){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tif(selectorList[0]){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(selectorList[0].name);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"\");\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.MAILINGDETAIL){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tif(selectorList[0]){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html((selectorList[0].name && selectorList[0].name.length>30) ?selectorList[0].name.substring(0,27)+\"...\" : selectorList[0].name );\n\t\t\t\t$reportHeaderMailingSelectorNeedS.attr(\"title\",selectorList[0].name);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"no name\");\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.USERINSIGHT){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tvar curNum = setType.set.attr(\"UserInsightShowIndex\") || 1;\n\t\t\tvar item = selectorList[curNum-1];\n\t\t\tif(item){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html((item.name && item.name.length>30) ?item.name.substring(0,27)+\"...\" : item.name );\n\t\t\t\t$reportHeaderMailingSelectorNeedS.attr(\"title\",item.name)\n\t\t\t\t$e.find(\".reportHeader-info .email\").html(item.email);\n\t\t\t\t//hide the dateAdded 2013-09-16\n\t\t\t\t//$e.find(\".reportHeader-info .info .dateAdded\").html(item.dateAdded);\n\t\t\t\tvar renderObj = {\"currentNum\":curNum, \"total\": selectorList.length , \"hasControl\":(selectorList.length>1), \"haveNext\":(curNum<selectorList.length),\"havePrev\":(curNum>1)};\n\t\t\t\tvar html = smr.render(\"tmpl-reportHeader-userPage\",renderObj);\n\t\t\t\t$e.find(\".reportHeader-findUser .user-page\").html(html);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"no name\");\n\t\t\t\t$e.find(\".reportHeader-info .email\").html(\"no email\");\n\t\t\t\t//$e.find(\".reportHeader-info .info .dateAdded\").html(\"-\");\n\t\t\t}\n\t\t}else if(reportType == smr.REPORT_TYPE.ABTEST){\n\t\t\tvar selectorList = setType.set.list();\n\t\t\tif(selectorList[0]){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(selectorList[0].name);\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.html(\"no name\");\n\t\t\t}\n\t\t}else{\n\t\t\tvar selectorType = setType.type;\n\t\t\tvar list = setType.set.list();\n\t\t\tif(selectorType==\"Campaign\"){\n\t\t\t\tvar includeSubOrg = setType.set.attr(\"includeSubOrg\");\n\t\t\t\tif(includeSubOrg){\n\t\t\t\t\tvar tempList = [];\n\t\t\t\t\tvar tempName = {};\n\t\t\t\t\tfor(var i=0;i<list.length;i++){\n\t\t\t\t\t\tif(tempName[list[i].name]) continue;\n\t\t\t\t\t\ttempList.push(list[i]);\n\t\t\t\t\t\ttempName[list[i].name] = true;\n\t\t\t\t\t}\n\t\t\t\t\tcount = tempList.length;\n\t\t\t\t}\n\t\t\t}else if(selectorType==\"Tag\"){\n\t\t\t\tvar tempList = [];\n\t\t\t\tvar tempName = {};\n\t\t\t\t$.each(list,function(i,temp){\n\t\t\t\t\tif(tempName[temp.pid]) return;\n\t\t\t\t\ttempList.push(temp);\n\t\t\t\t\ttempName[temp.pid] = true;\n\t\t\t\t});\n\t\t\t\tcount = tempList.length;\n\t\t\t}\n\t\t\t\n\t\t\t$reportHeaderMailingSelectorCount.html(count);\n\t\t\tif(count != 1){\n\t\t\t\t$reportHeaderMailingSelectorNeedS.show();\n\t\t\t}else{\n\t\t\t\t$reportHeaderMailingSelectorNeedS.hide();\n\t\t\t}\n\t\t\tif(reportType==smr.REPORT_TYPE.DOMAINDRILLDOWN){\n\t\t\t\tselectorType = setType.set.attr(\"domainType\");\n\t\t\t\tif(selectorType == \"VSG\") selectorType=\"Mailing Server Group\" ;\n\t\t\t}\n\t\t\t$reportHeaderMailingSelectorType.html(selectorType);\n\t\t}\n\t\t\n\t\tif(setType.set.attr(\"limit\")){\n\t\t\t$reportHeaderPeriod.show();\n\t\t\tvar dateRange = setType.set.period().getDateRange(); \n\t\t\t\n\t\t\tif(reportType == smr.REPORT_TYPE.MAILINGDETAIL){\n\t\t\t\tif(smr.allDateRangeShow){\n\t\t\t\t\t$reportHeaderDate.html(\"All\");\n\t\t\t\t}else{\n\t\t\t\t\t$reportHeaderDate.html(smr.formatDate(dateRange.startDate,\"medium\")+\" - \"+smr.formatDate(dateRange.endDate,\"medium\"));\n\t\t\t\t}\n\t\t\t\tvar list = setType.set.list();\n\t\t\t\tvar mailingType = list[0]? list[0].mailingType: \"Batch\";\n\t\t\t\tif(mailingType != \"Transactional\" && mailingType != \"transactional\" && mailingType != \"Program\" && mailingType != \"program\"){\n\t\t\t\t\t$reportHeaderDate.parent().hide();\n\t\t\t\t}else{\n\t\t\t\t\t$reportHeaderDate.parent().show();\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tif(reportType == \"userInsight\"){\n\t\t\t\t\tvar $reportSelectDate = $(\".reportHeader-selectdate\");\n\t\t\t\t\t$reportHeaderDate = $reportHeaderPeriod.find(\".reportHeader-date\");\n\t\t\t\t\tvar period = setType.set.period();\n\t\t\t\t\tif(period.dateType==\"inCustomDateRange\"){\n\t\t\t\t\t\t$reportHeaderDate.html(smr.formatDate(dateRange.startDate,\"medium\")+\" - \"+smr.formatDate(dateRange.endDate,\"medium\"));\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$reportHeaderDate.html($reportSelectDate.find(\"select.dateTypeSelect option[value='\"+period.dateType+\"']\").html());\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$reportHeaderDate.html(smr.formatDate(dateRange.startDate,\"medium\")+\" - \"+smr.formatDate(dateRange.endDate,\"medium\"));\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$reportHeaderPeriod.hide();\n\t\t}\n\t}", "function addEventTableHeader() {\n var tableHead =\n \"<tr>\" +\n \"<th>Title</th>\" +\n \"<th>Status</th>\" +\n \"<th>Location</th>\" +\n \"<th>Organizer</th>\" +\n \"<th>Date and Time</th>\" +\n \"<th>Webpage</th>\" +\n \"<th>Image</th>\" +\n \"<th>Category</th>\" +\n \"<th>Actions</th>\" +\n \"</tr>\";\n\n return tableHead\n}", "populateHeader() {\n const { restaurantName, restaurantCuisine, restaurantHoursToday } = this.pageElements;\n const { name, cuisine_type: cuisine, operating_hours: operatingHours } = this.restaurant;\n const daysOfTheWeek = Object.keys(operatingHours);\n const todayNum = new Date().getDay();\n const currentDay = daysOfTheWeek[todayNum > 0 ? todayNum - 1 : todayNum];\n \n restaurantName.textContent = name;\n restaurantCuisine.textContent = cuisine;\n restaurantHoursToday.textContent = operatingHours[currentDay];\n }", "function setHeader(stats) {\n var head = '';\n if (stats.show == 'true') {\n head = '<div id=\"logo\" style=\"text-align:' + stats.align.value + ';\"> <img src=\"' + basePath + 'images/' + stats.logo + '\" style=\"margin:' + calculateMarginFromFreeSpace(0.15, 0.7) + 'px 0\"/></div>';\n }\n return head;\n }", "render() {\n return html`${appHeaderTemplate({\n title: this.title,\n initialTool: this.initialTool,\n showScoringDetailsModal: this.#showScoringDetailsModal,\n sendSupportEmail: this.#sendSupportEmail,\n navigateToByoc: this.#navigateToByoc,\n showAdditionalInfoModal: this.#showAdditionalInfoModal\n })}`\n }", "function defaultheaderView(){\n\tvar header = document.getElementById('template6');\n\tvar head= getHeader();\n\thead.innerHTML = header.innerHTML;\n}", "appendReceiptSearchTableHeader () {\n var head_titles = ['ID', 'Name', 'Address', 'Phone No', 'Items', 'Retail', 'Cost', 'Profit', 'Date', 'Time'];\n var $head = `<thead><tr><th>${head_titles.join('</th><th>')}</th></tr></thead>`;\n $(\"#receipts-lists\").append($head);\n }", "function showAllHeaders(heading) {\n vm.toggle('section', heading);\n heading.forEach(function (heading_item) {\n vm.isHeader = vm.isExpanded('heading', heading_item);\n // alert( vm.isHeader);\n if (toggle('heading', heading_item)) {\n\n }\n\n });\n // vm.isExpanded('heading', headings);\n //vm.showallheaders = true;\n }", "function printHeaders(clientProp) {\n var seoLvTab = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('SEO Liquid Values');\n var headerRange = spinUpTab.getRange(1,1,1,spinUpFileHeaders.length).setValues([spinUpFileHeaders]);\n var lvheaderRange = seoLvTab.getRange(1,1,NUM_LV_HEADER_ROWS,seoLiquidValueTabHeaders[clientProp.vertical][0].length);\n lvheaderRange.setValues(seoLiquidValueTabHeaders[clientProp.vertical]);\n setLVHeaderFormatting(clientProp.vertical,clientProp.domainType,seoLvTab);\n}", "function ReportHeader(){}", "function HeaderRender(parent, serviceLocator) {\n var _this = this;\n this.frzIdx = 0;\n this.notfrzIdx = 0;\n this.helper = function (e) {\n var gObj = _this.parent;\n var target = e.sender.target;\n var parentEle = parentsUntil(target, 'e-headercell');\n if (!(gObj.allowReordering || gObj.allowGrouping) || (!isNullOrUndefined(parentEle)\n && parentEle.querySelectorAll('.e-checkselectall').length > 0)) {\n return false;\n }\n var visualElement = _this.parent.createElement('div', { className: 'e-cloneproperties e-dragclone e-headerclone' });\n var element = target.classList.contains('e-headercell') ? target : parentEle;\n if (!element || (!gObj.allowReordering && element.classList.contains('e-stackedheadercell'))) {\n return false;\n }\n var height = element.offsetHeight;\n var headercelldiv = element.querySelector('.e-headercelldiv') || element.querySelector('.e-stackedheadercelldiv');\n var col;\n if (headercelldiv) {\n if (element.querySelector('.e-stackedheadercelldiv')) {\n col = gObj.getStackedHeaderColumnByHeaderText(headercelldiv.innerText.trim(), gObj.columns);\n }\n else {\n col = gObj.getColumnByUid(headercelldiv.getAttribute('e-mappinguid'));\n }\n _this.column = col;\n if (_this.column.lockColumn) {\n return false;\n }\n visualElement.setAttribute('e-mappinguid', _this.column.uid);\n }\n if (col && !isNullOrUndefined(col.headerTemplate)) {\n if (!isNullOrUndefined(col.headerTemplate)) {\n var result = void 0;\n var colIndex = gObj.getColumnIndexByField(col.field);\n result = col.getHeaderTemplate()(extend({ 'index': colIndex }, col), gObj, 'headerTemplate');\n appendChildren(visualElement, result);\n }\n else {\n visualElement.innerHTML = col.headerTemplate;\n }\n }\n else {\n visualElement.innerHTML = headercelldiv ?\n col.headerText : element.firstElementChild.innerHTML;\n }\n visualElement.style.width = element.offsetWidth + 'px';\n visualElement.style.height = element.offsetHeight + 'px';\n visualElement.style.lineHeight = (height - 6).toString() + 'px';\n gObj.element.appendChild(visualElement);\n return visualElement;\n };\n this.dragStart = function (e) {\n var gObj = _this.parent;\n gObj.element.querySelector('.e-gridpopup').style.display = 'none';\n gObj.notify(columnDragStart, { target: e.target, column: _this.column, event: e.event });\n if (isBlazor()) {\n e.bindEvents(e.dragElement);\n }\n };\n this.drag = function (e) {\n var gObj = _this.parent;\n var target = e.target;\n if (target) {\n var closest$$1 = closest(target, '.e-grid');\n var cloneElement = _this.parent.element.querySelector('.e-cloneproperties');\n if (!closest$$1 || closest$$1.getAttribute('id') !== gObj.element.getAttribute('id')) {\n classList(cloneElement, ['e-notallowedcur'], ['e-defaultcur']);\n if (gObj.allowReordering) {\n gObj.element.querySelector('.e-reorderuparrow').style.display = 'none';\n gObj.element.querySelector('.e-reorderdownarrow').style.display = 'none';\n }\n return;\n }\n gObj.notify(columnDrag, { target: e.target, column: _this.column, event: e.event });\n }\n };\n this.dragStop = function (e) {\n var gObj = _this.parent;\n var cancel;\n gObj.element.querySelector('.e-gridpopup').style.display = 'none';\n if ((!parentsUntil(e.target, 'e-headercell') && !parentsUntil(e.target, 'e-groupdroparea')) ||\n (!gObj.allowReordering && parentsUntil(e.target, 'e-headercell')) ||\n (!e.helper.getAttribute('e-mappinguid') && parentsUntil(e.target, 'e-groupdroparea'))) {\n remove(e.helper);\n cancel = true;\n }\n gObj.notify(columnDragStop, { target: e.target, event: e.event, column: _this.column, cancel: cancel });\n };\n this.drop = function (e) {\n var gObj = _this.parent;\n var uid = e.droppedElement.getAttribute('e-mappinguid');\n var closest$$1 = closest(e.target, '.e-grid');\n remove(e.droppedElement);\n if (closest$$1 && closest$$1.getAttribute('id') !== gObj.element.getAttribute('id') ||\n !(gObj.allowReordering || gObj.allowGrouping)) {\n return;\n }\n gObj.notify(headerDrop, { target: e.target, uid: uid });\n };\n this.parent = parent;\n this.serviceLocator = serviceLocator;\n this.ariaService = this.serviceLocator.getService('ariaService');\n this.widthService = this.serviceLocator.getService('widthService');\n if (this.parent.isDestroyed) {\n return;\n }\n if (!this.parent.enableColumnVirtualization) {\n this.parent.on(columnVisibilityChanged, this.setVisible, this);\n }\n this.parent.on(columnPositionChanged, this.colPosRefresh, this);\n }", "index(msg = null) {\n console.info('[Dashboard]: index');\n let html = '';\n\n let evnts = EventModel.getTrackedEvents();\n if (evnts.length > 7){\n evnts.length = 7;\n }\n\n let event = false;\n let venue = false;\n let org = false;\n try {\n event = app.user.getTrackedEvents().sort(sortByDate)[0];\n venue = Venue.findByID(event.venueID, app.venues);\n org = Organisation.findByID(event.organiserID, app.organisations);\n } catch (err) {\n console.log('[DASH] No tracked events');\n }\n\n html += app.dashboardView.welcomeSplash(event, venue, org);\n html += app.dashboardView.index(msg);\n html += app.eventView.eventList(evnts);\n\n this.updateShell(html);\n }", "header(overall) {\n let score = `${overall.score} / ${overall.total}`;\n let html = `<div class=\"nav\">\n <h3 class=\"title\">${this.type}</h3>\n <h3 class=\"score\">${score}</h3>\n </div>`;\n document.getElementById('nav').innerHTML = html;\n }", "function MUA_headertext(mode) {\n let header_text = (mode === \"update\") ? loc.User + \": \" + mod_MUA_dict.username : loc.Add_user;\n if(mod_MUA_dict.user_schoolbase_pk){ header_text = loc.Add_user_to + mod_MUA_dict.user_schoolname;}\n document.getElementById(\"id_MUA_header\").innerText = header_text;\n } // MUA_headertext", "function setHeader() {\n metaService.setHeader(portal.title, portal.faviconId);\n }", "getHeader() {\n\t\tif(this.inProgress()) {\n\t\t\treturn (\n\t\t\t<Grid className='listingItemGrid'>\n\t\t\t\t<Col className='listingItemHeaderStatusColumn' xs={4} sm={5} md={5} lg={5}>\n\t\t\t\t\t{this.getStatus()}\n\t\t\t\t</Col>\n\t\t\t\t<Col className='listingItemHeaderButtonColumn' xs={8} sm={4} md={4} lg={4}>\n\t\t\t\t\t{this.getButton()}\n\t\t\t\t</Col>\n\t\t\t</Grid>); \n\t\t}\n\t\treturn (\n\t\t\t<Grid className='listingItemGrid'>\n\t\t\t\t<Col className='listingItemHeaderStatusColumn' xs={7} sm={7} md={7} lg={8}>\n\t\t\t\t\t<Time value={this.props.listing.transactionDate} format=\"MMMM D, YYYY\" /> - {this.getStatus()}\n\t\t\t\t</Col>\n\t\t\t\t<Col className='listingItemHeaderButtonColumn' xs={5} sm={2} md={2} lg={1}>\n\t\t\t\t\t{this.getButton()}\n\t\t\t\t</Col>\n\t\t\t</Grid>); \n\t}", "getSummaryHeader(){\n\t//=================================\n\t//get contents\n\tvar add_header = Object.keys(this.summaryColumns);\n\t//append the datasource id\n\tadd_header = add_header.map(element => element + \" [\" + this.short_id + \"]\")\n\treturn add_header;\n\t}", "function addHeader() {\n if (UTIL.idExists(\"jbmnplsHeader\")) {return;}\n var counter = 0;\n var fname = \"Matthew\";\n var lname = \"Ng\";\n var studNum = \"1234567\";\n var header = \"<header id='jbmnplsHeader'><div id='jbmnplsTopGroup'><div id='jbmnplsBanner' class='banner'></div><nav id='jbmnplsNav'><ul>\";\n for(var item in NAVIGATION) {\n if(PAGES.isValid(item) && LINKS.hasOwnProperty(item)) {\n header += \"<li><a item='\"+counter+\"' type='\"+item+\"' href='\"+LINKS.HOME+\"#\"+item+\"' realHref='\"+LINKS[item]+\"'>\"+NAVIGATION[item]+\"</a></li>\";\n counter++;\n }\n }\n BRIDGE.registerFunction(\"showAbout\", function(){\n showPopup(true, \"<h1>Jobmine Plus Version \"+CONSTANTS.VERSION+\"</h1><br/>Hey there!<br/><br/>This is Matthew Ng the creator of Jobmine Plus. I am a System Designs Engineering Student at the University of Waterloo. I created this because Jobmine is not user friendly so this addon/extension should speed things up.<br/><br/>Feel free to email me if there are any problems, concerns or requests for future updates:<br/><a href='mailto:{{ email }}'>{{ email }}</a><br/><br/>Visit the extensions website for information and future updates:<br/><a href='{{ upload_link }}'>{{ upload_link }}</a><br/><br/>\", \"About Me\", 400);\n });\n header += '</ul></nav><div id=\"uwBanner\" class=\"banner\"></div><a href=\"' + LINKS.ANDROID_APP + '\" target=\"_blank\" class=\"google_play_button\"></a></div><div id=\"jbmnplsBottomGroup\"><div id=\"jbmnplsStatus\"><ul></ul></div><div id=\"jbmplsControlPanel\"><span class=\"fakeLink\" onclick=\"showSettings();\">Settings</span> | <span onclick=\"showAbout();\" class=\"fakeLink\">About</span> | <a href=\"'+LINKS.LOGOUT+'\">Logout</a></div></div></header>';\n $(\"body\").prepend(header);\n}", "function notificationHeader(){\n let num = dropDown.children.length - 1;\n dropDownHeader.textContent = \"You have \" + num + \" notifications\";\n if(num > 0){\n liveNotification.style.opacity = \"1\";\n }\n if(num === 0){\n liveNotification.style.opacity = \"0\";\n }\n}", "get orderSuccessPageHeading() { return $('#mobile-wrap > div > div > div.content-pane.container > div > div > div.page-title > h1'); }", "function getHeaderView() {\n logger.info('base getHeaderView called');\n\n $.pdp_header_controller = Alloy.createController('product/components/detailHeader');\n\n $.pdp_header_controller.init();\n\n return $.pdp_header_controller.getView();\n}", "function header(){\n var thE1 = document.createElement('th');\n var trE1 = document.createElement('tr');\n thE1.textContent = 'Store Locations';\n trE1.appendChild(thE1);\n\n for (var i = 0; i < hourList.length; i++){\n thE1 = document.createElement('th');\n thE1.textContent = hourList[i];\n trE1.appendChild(thE1);\n }\n thE1 = document.createElement('th');\n thE1.textContent ='Daily location Totals: ';\n trE1.appendChild(thE1);\n var salesTable = document.getElementById('tabl');\n salesTable.appendChild(trE1);\n}", "get orderSuccessPageHeading() { return $('body > div.wrapper > div > div.main-container.col1-layout > div > div > div.page-title'); }", "function header() {\n\tif (output.innerHTML === \"\"){\n\tlistHeading.innerHTML =\"\";\n} else {\n\tlistHeading.innerHTML =\"<h3> Capitalized name(s): </h3>\";\n}\n} // --- my solution", "function colorHeaders() {\n\tvar eventDivs = $(\".fc-event-title\");\n\tfor (var i = 0; i < itinerary.length; i++) {\n\t\tfor (var j = 0; j < eventDivs.length; j++) {\n\t\t\tif ($(eventDivs[j]).html() == \"Travel Time\" || $($(eventDivs[j]).parent().parent().children()[0]).html().indexOf(\"Travel Time\") != -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (getItem(itinerary[i]).data.start >= calBegin && getItem(itinerary[i]).value == $(eventDivs[j]).html()) {\n\t\t\t\t$($(eventDivs[j]).parent().parent().children()[0]).css(\"background-color\", \"#CCCCCC\");\n\t\t\t}\n\t\t}\n\t}\n}", "function ListHeader(props) {\n return (\n <header id=\"ListHeader\" className=\"panelHeader\">\n <Logo/>{' '}\n <span className=\"settingsIcon\" onClick={props.doShowPrefs}>\n <SettingsIcon/>\n </span>\n </header>\n );\n}", "function createServerBulkHeader() {\n var caption = [];\n\n caption.push('<span class=\"table-caption\">TabletServer&nbsp;Bulk&nbsp;' +\n 'Import&nbsp;Status</span><br>');\n\n $('<caption/>', {\n html: caption.join('')\n }).appendTo('#bulkImportStatus');\n\n var items = [];\n\n var columns = ['Server&nbsp;', '#&nbsp;', 'Oldest&nbsp;Age&nbsp;'];\n\n var titles = ['', descriptions['# Imports'], descriptions['Oldest Age']];\n\n /*\n * Adds the columns, add sortTable function on click,\n * if the column has a description, add title taken from the global.js\n */\n for (i = 0; i < columns.length; i++) {\n var first = i == 0 ? true : false;\n items.push(createHeaderCell(first, 'sortTable(0,' + i + ')',\n titles[i], columns[i]));\n }\n\n $('<tr/>', {\n html: items.join('')\n }).appendTo('#bulkImportStatus');\n}", "function ListView_UpdateHeader(theObject)\n{\n\t//has headers?\n\tif (theObject.Content && theObject.Content.Header_Panel)\n\t{\n\t\t//remove header panel from parent\n\t\ttheObject.Content.Header_Panel.parentNode.removeChild(theObject.Content.Header_Panel);\n\t}\n\t//delete all headers\n\ttheObject.Content.Headers = [];\n\ttheObject.Content.Header_Height = 0;\n\ttheObject.Content.Header_Width = 0;\n\ttheObject.Content.Header_Panel = null;\n\t//want headers?\n\tvar strHeader = null;\n\t//check the style\n\tswitch (theObject.Content.ListView_Style)\n\t{\n\t\tcase __LISTVIEW_STYLE_ICON:\n\t\tcase __LISTVIEW_STYLE_SMALLICON:\n\t\tcase __LISTVIEW_STYLE_LIST:\n\t\t\t//no headers for these\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t//we want to show headers?\n\t\t\tstrHeader = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_COLUMN_HEADER], false) ? theObject.Properties[__NEMESIS_PROPERTY_HEADER] : null;\n\t\t\tbreak;\n\t}\n\t//want headers?\n\tif (!String_IsNullOrWhiteSpace(strHeader))\n\t{\n\t\t//create the header panel\n\t\ttheObject.Content.Header_Panel = theObject.HTML.appendChild(document.createElement(\"div\"));\n\t\ttheObject.Content.Header_Panel.id = \"HeaderPanel\";\n\t\ttheObject.Content.Header_Panel.style.cssText = \"position:absolute;left:0px;top:0px;background-color:transparent;overflow:hidden;width:100%;\";\n\t\t//this will always require a spacer panel\n\t\ttheObject.Content.Header_Panel.Spacer = theObject.Content.Header_Panel.appendChild(document.createElement(\"div\"));\n\t\ttheObject.Content.Header_Panel.Spacer.id = \"HeaderPanel_Spacer\";\n\t\ttheObject.Content.Header_Panel.Spacer.style.cssText = \"position:absolute;left:0px;top:0px;background-color:transparent;height:1px;width:1px;\";\n\t\t//helpers\n\t\tvar i, c;\n\t\t//split the headers\n\t\tvar aHeaders = strHeader.split(__LISTVIEW_SEPARATOR);\n\t\t//get widths\n\t\tvar aWidth = String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_COLUMNS_WIDTH]) ? [] : theObject.Properties[__NEMESIS_PROPERTY_COLUMNS_WIDTH].split(__LISTVIEW_SEPARATOR);\n\t\t//start position\n\t\tvar nLeft = 0;\n\t\t//fixed properties\n\t\tvar strFont = theObject.Properties[__NEMESIS_PROPERTY_FONT];\n\t\tvar headerBG = Get_Color(theObject.Properties[__NEMESIS_PROPERTY_HEADER_BACKGROUNDCOLOR], \"#F0F0F0\");\n\t\tvar headerFG = Get_Color(theObject.Properties[__NEMESIS_PROPERTY_HEADER_TEXTCOLOR], \"#000000\");\n\t\t//modifiers\n\t\tvar bFlat = Get_Bool(theObject.Properties[__NEMESIS_PROPERTY_FLAT], false);\n\t\t//modifier for the borders size\n\t\tvar modifier = bFlat ? -2 : -4;\n\t\tvar nPropertyHeaderHeight = Get_Number(theObject.Properties[__NEMESIS_PROPERTY_HEADER_HEIGHT], null);\n\t\t//valid?\n\t\tif (nPropertyHeaderHeight)\n\t\t{\n\t\t\t//use it\n\t\t\ttheObject.Content.Header_Height = nPropertyHeaderHeight;\n\t\t}\n\t\t//loop through them all\n\t\tfor (i = 0, c = aHeaders.length; i < c; i++)\n\t\t{\n\t\t\t//create the header item\n\t\t\tvar newHeader = theObject.Content.Header_Panel.appendChild(document.createElement(\"div\"));\n\t\t\t//set its styles\n\t\t\tnewHeader.style.cssText = \"position:absolute;top:0px;text-align:left;word-wrap:normal;white-space:nowrap;\";\n\t\t\tnewHeader.style.left = nLeft + \"px\";\n\t\t\tnewHeader.style.backgroundColor = headerBG;\n\t\t\tnewHeader.style.color = headerFG;\n\t\t\t//make it unselectable\n\t\t\tBrowser_SetSelectable(newHeader, false);\n\t\t\t//set its font\n\t\t\tBasic_SetFonts(newHeader, strFont);\n\t\t\t//Flat?\n\t\t\tif (bFlat)\n\t\t\t{\n\t\t\t\t//set a simple 1 pixel border\n\t\t\t\tnewHeader.style.border = \"1px solid #000000\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//set a 2 px raised border\n\t\t\t\tnewHeader.style.border = \"2px outset #FFFFFF\";\n\t\t\t}\n\t\t\t//set text\n\t\t\tnewHeader.innerHTML = aHeaders[i].ToPlainText(theObject.DataObject.Id); // SAFE BY ENCODING\n\t\t\t//get its forced width\n\t\t\tvar forcedWidth = Get_Number(aWidth[i], null);\n\t\t\t//has width?\n\t\t\tif (forcedWidth != null)\n\t\t\t{\n\t\t\t\t//was forcing to 0?\n\t\t\t\tif (forcedWidth == 0)\n\t\t\t\t{\n\t\t\t\t\t//we want to hide this\n\t\t\t\t\tnewHeader.style.display = \"none\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//set its width\n\t\t\t\t\tnewHeader.style.width = forcedWidth + modifier + \"px\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t//increment left\n\t\t\tnLeft += Browser_GetOffsetWidth(newHeader);\n\t\t\t//no forced header height?\n\t\t\tif (!nPropertyHeaderHeight)\n\t\t\t{\n\t\t\t\t//update height\n\t\t\t\ttheObject.Content.Header_Height = Math.max(theObject.Content.Header_Height, Browser_GetOffsetHeight(newHeader));\n\t\t\t}\n\t\t\t//store it in the array\n\t\t\ttheObject.Content.Headers.push(newHeader);\n\t\t}\n\t\t//loop through them all again\n\t\tfor (i = 0, c = aHeaders.length; i < c; i++)\n\t\t{\n\t\t\t//get this header\n\t\t\tvar header = theObject.Content.Headers[i];\n\t\t\t//force heights\n\t\t\theader.style.height = theObject.Content.Header_Height + modifier + \"px\";\n\t\t\t//update lineheight to vertically center the text\n\t\t\theader.style.lineHeight = header.style.height;\n\t\t\t//create the resize object\n\t\t\tvar sizer = header.appendChild(document.createElement(\"div\"));\n\t\t\t//set its styles\n\t\t\tsizer.style.cssText = \"position:absolute;top:0px;height:100%;right:0px;width:2px;cursor:col-resize;background:url('\" + __NEMESIS_EMPTY_BG + \"');\";\n\t\t\t//set our sizer data\n\t\t\tsizer.Sizer =\n\t\t\t\t{\n\t\t\t\t\tInterpreterObject: theObject,\n\t\t\t\t\tUIDObject: theObject.DataObject.Id,\n\t\t\t\t\tColumnPosition: i,\n\t\t\t\t\tHeader: header\n\t\t\t\t};\n\t\t\t//add dragging to it\n\t\t\tBrowser_AddEvent(sizer, __BROWSER_EVENT_MOUSEDOWN, ListView_Sizer_BeginDrag);\n\t\t}\n\t\t//correct header height\n\t\ttheObject.Content.Header_Panel.style.height = theObject.Content.Header_Height + \"px\";\n\t\t//memorise its width\n\t\ttheObject.Content.Header_Width = nLeft;\n\t}\n}", "get pageHeader() { return $('h1') }", "renderHeader(h, {\n column,\n $index\n }, tableTitle) {\n return h(\n 'el-tooltip', {\n props: {\n content: tableTitle,\n placement: 'bottom',\n },\n domProps: {\n innerHTML: tableTitle\n }\n }, [h('span')]\n )\n }", "header(name, info) {\n this.headingName.setContent(name)\n this.headingInfo.setContent(info)\n }", "function tableHeader() {\n var headerTop = document.getElementById('SalesReport');\n var row = document.createElement('tr');\n headerTop.appendChild(row);\n var tableData = document.createElement('th');\n row.appendChild(tableData);\n for (var i = 0; i < hoursOfOperation.length; i++) {\n var hourHead = document.createElement('th');\n hourHead.innerText = hoursOfOperation[i];\n row.appendChild(hourHead);\n };\n var totalHead = document.createElement('th');\n totalHead.innerText = ('Daily Location Total');\n row.appendChild(totalHead);\n}", "getHeaderContent() {\n return (\n <span>\n Configuration\n <span className=\"title-separator\">/</span>\n {this.props.routes[this.props.routes.length - 1].name}\n </span>\n );\n }", "function header() {\n return \"Shipping Label Maker\";\n}", "getPrimaryNavigation() {\r\n const { classes } = this.props;\r\n return (\r\n <List subheader={\r\n <ListSubheader\r\n className={classes.subheader}\r\n style={{\r\n position: 'unset'\r\n }}\r\n >\r\n Monitor\r\n </ListSubheader>\r\n }>\r\n <Divider />\r\n {this.NavigationListItem({\r\n title: 'Alerts',\r\n route: '/alerts',\r\n icon: <MoveToInboxIcon />\r\n })}\r\n {this.NavigationListItem({\r\n title: 'Schedule',\r\n route: '/schedule',\r\n icon: <SendIcon />\r\n })}\r\n {this.NavigationListItem({\r\n title: 'Products',\r\n route: '/products',\r\n icon: <FolderIcon />\r\n })}\r\n {this.NavigationListItem({\r\n title: 'Event Log',\r\n route: '/eventlog',\r\n icon: <InfoIcon />\r\n })}\r\n {this.NavigationListItem({\r\n title: 'Settings',\r\n route: '/settings',\r\n icon: <SettingsIcon />\r\n })}\r\n </List>\r\n );\r\n }", "function putHeader() {\n html = \"<html><head><title>Search results</title>\";\n html += \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"idldoc-resources/main.css\\\" />\";\n\n html += \"<style type=\\\"text/css\\\" media=\\\"all\\\">\";\n html += \" span.score { color: black; }\";\n html += \" span.context { color: #A0A0A0; }\";\n html += \" span.term { color: black; background: yellow; }\";\n html += \" li { margin-bottom: 0.5em; }\";\n html += \"</style>\";\n\n html += \"</head><body>\";\n\n html += \"<div class=\\\"header smaller\\\">\";\n html += \"<h1>\" + title + \"</h1>\";\n html += \"<h2>\" + subtitle + \"</h2>\";\n html += \"</div>\";\n\n html += \"<div class=\\\"content\\\">\";\n html += \"<h2>Search results for \\\"\" + searchString + \"\\\"</h2>\";\n}", "function adminUrenTotTableHeader() {\n var tableHeader = document.createElement(\"thead\");\n var tr = addHtmlElement(tableHeader, document.createElement(\"tr\"));\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Status\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Totaal\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Datum\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Gewerkt\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Over 100%\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Over 125%\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Verlof\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Wacht\");\n addHtmlElementContent(tr, document.createElement(\"th\"), \"Ziekte\");\n return tableHeader;\n }", "get tablist_header() {\n return this.settings.tab_list_header ?? `${this.state_color}${this.title_color}`\n }", "function showDayNameHeaders() {\n var str = '';\n var start = HOUR_LISTING_WIDTH + 1;\n var idstr = '';\n var calcDay = null;\n\n // Spacer to align with the timeline that displays hours below\n // for the timed event canvas\n str += '<div id=\"dayListSpacer\" class=\"dayListDayDiv\"' +\n ' style=\"left:0px; width:' +\n (HOUR_LISTING_WIDTH - 1) + 'px; height:' +\n (DAY_LIST_DIV_HEIGHT-1) +\n 'px;\">&nbsp;</div>';\n\n // Do a week's worth of day cols with day name and date\n for (var i = 0; i < 7; i++) {\n calcDay = cosmo.datetime.Date.add(viewStart, cosmo.datetime.util.dateParts.DAY, i);\n // Subtract one pixel of height for 1px border per retarded CSS spec\n str += '<div class=\"dayListDayDiv\" id=\"dayListDiv' + i +\n '\" style=\"left:' + start + 'px; width:' + (self.dayUnitWidth-1) +\n 'px; height:' + (DAY_LIST_DIV_HEIGHT-1) + 'px;';\n str += '\">';\n str += cosmo.datetime.abbrWeekday[i] + '&nbsp;' + calcDay.getDate();\n str += '</div>\\n';\n start += self.dayUnitWidth;\n }\n dayNameHeadersNode.innerHTML = str;\n return true;\n }", "function statusDisplayList (hsl) {\n\ttry {\n\t\t\n\t\thsl.display (statusBar);\n\n\t} catch (ex) {\n\t\tshowStatus (\"[UI/UIstatus.statusDisplayList] \" + ex.message);\n\t}\n}", "getGamesHeader() {\n if(this.state.team) {\n return (\n <h3 className='unselectable text-center'> {this.state.team.team_name} vs 76ers</h3>\n );\n }\n }", "function buildHeader() {\r\n $(\"#header\").html(\r\n `\r\n A2 / ${meArr[0].fName} ${meArr[0].lName} / ${meArr[0].id} / ${meArr[0].user}\r\n <hr>\r\n `\r\n );\r\n $(\"#header\").addClass(\"header\");\r\n}", "function initHeaderAnalytics() {\n var $header = $(\".header-wrapper\"),\n $logo = $header.find(\"#logo\"),\n $searchInput = $header.find(\".search\"),\n $compare = $header.find(\".model-flyout-compare\"),\n $findADealer = $header.find(\".find-a-dealer\"),\n $cpo = $header.find(\".certified-preowned\"),\n $owners = $header.find(\".owners-link\"),\n $categoryLinks = $header.find(\".navModel\");\n\n // Logo\n $logo.click(function() {\n onGlobalNavClick(\"Header\", \"Home Link\", \"Lexus Logo\");\n });\n\n // Search\n $searchInput.focus(function(e) {\n\n e.stopPropagation();\n\n var category = e.target.getAttribute(\"data-category\") || \"Search\";\n onGlobalNavClick(\"Header\", category, \"Internal Search\");\n });\n\n //Owners link\n $owners.click(function(e) {\n var category = e.target.getAttribute(\"data-category\") || \"\",\n label = e.target.getAttribute(\"data-label\") || \"\";\n\n fireTag(GLOBAL_ELEMENT_HEADER_FOOTER_CLICK, {\n \"<container>\": \"Header\",\n \"<category>\": category,\n \"<label>\": label,\n \"<break_point>\": getBreakpoint(),\n \"<orientation>\": getOrientation()\n });\n });\n\n // CPO link\n $cpo.click(function(e) {\n\n var category = e.target.getAttribute(\"data-category\") || \"\",\n label = e.target.getAttribute(\"data-label\") || \"\";\n\n fireTag(GLOBAL_ELEMENT_HEADER_FOOTER_CLICK, {\n \"<container>\": \"Header\",\n \"<category>\": category,\n \"<label>\": label,\n \"<break_point>\": getBreakpoint(),\n \"<orientation>\": getOrientation()\n });\n });\n\n // Find a dealer link\n $findADealer.click(function(e) {\n\n var container = e.target.getAttribute(\"data-container\") || \"Header\";\n\n fireTag(GLOBAL_ELEMENT_FIND_A_DEALER_BUTTON_CLICK, {\n \"<container>\": container,\n \"<break_point>\": getBreakpoint(),\n \"<orientation>\": getOrientation()\n });\n });\n\n // Compare from model flyout\n $compare.click(function() {\n fireTag(GLOBAL_ELEMENT_MODEL_FLYOUT_COMPARE_CLICK, {\n \"<container>\": \"Model Flyout\",\n \"<break_point>\": getBreakpoint(),\n \"<orientation>\": getOrientation()\n });\n });\n\n // Model links from Model Flyout\n $categoryLinks.click(function(e) {\n\n var label, model;\n\n if (e.target.className === 'asterisk') {\n return;\n }\n\n label = e.target.getAttribute(\"data-label\") || $(e.target).closest(\"a\").data(\"label\") || \"Category not found\";\n model = e.target.getAttribute(\"data-model\") || $(e.target).closest(\"a\").data(\"model\") || \"Model data not found\";\n\n onGlobalNavModelClick(\"Model Flyout\", \"Vehicle Click\", label, \"Select Model\", model.toUpperCase().replace(\"-\", \" \"));\n });\n\n // Mobile Nav\n $(\".mobileMenuItem:not(.nonCategory) a\").click(function(e) {\n var label = e.target.getAttribute(\"data-title\") || $(e.target).data(\"title\") || \"Label not found\";\n if (!($(this).hasClass(\"legacy-nav\"))) {\n onGlobalNavClick(\"Header\", \"Mobile Menu\", label);\n }\n });\n }", "function MainHeaderComponent(logoutService, configurationService, router, errorTermsStoreService, localeAppResourcesService, dialog, snackBar, helpService, dialogService, serverStatusService) {\n this.logoutService = logoutService;\n this.configurationService = configurationService;\n this.router = router;\n this.errorTermsStoreService = errorTermsStoreService;\n this.localeAppResourcesService = localeAppResourcesService;\n this.dialog = dialog;\n this.snackBar = snackBar;\n this.helpService = helpService;\n this.dialogService = dialogService;\n this.serverStatusService = serverStatusService;\n this.contextMenuClass = 'main-header-context-menu';\n this.toShowOverlay = false;\n this.hideCustomerLogo = false;\n this.headerTabClicked = new _angular_core__WEBPACK_IMPORTED_MODULE_0__[\"EventEmitter\"]();\n }", "function header() {\n let tableHeadingRow = document.createElement('tr');\n table.append(tableHeadingRow);\n let tableHeading = document.createElement('th');\n tableHeadingRow.append(tableHeading);\n\n for (let i = 0; i<hours.length; i++){\n tableHeading = document.createElement('th');\n tableHeadingRow.append(tableHeading);\n tableHeading.textContent = ' '+hours[i]+ ' ';\n }\n // last heading\n let tableHeading2 = document.createElement('th');\n tableHeadingRow.append(tableHeading2);\n tableHeading2.textContent = 'Daily Location Total';\n}", "function MainHeaderComponent(logoutService, configurationService, router, errorTermsStoreService, localeAppResourcesService, dialog, snackBar, helpService, dialogService, serverStatusService) {\n this.logoutService = logoutService;\n this.configurationService = configurationService;\n this.router = router;\n this.errorTermsStoreService = errorTermsStoreService;\n this.localeAppResourcesService = localeAppResourcesService;\n this.dialog = dialog;\n this.snackBar = snackBar;\n this.helpService = helpService;\n this.dialogService = dialogService;\n this.serverStatusService = serverStatusService;\n this.contextMenuClass = 'main-header-context-menu';\n this.toShowOverlay = false;\n this.hideCustomerLogo = false;\n this.headerTabClicked = new _angular_core__WEBPACK_IMPORTED_MODULE_1__[\"EventEmitter\"]();\n }", "function renderTableHeader(data) {\n console.log(data.page)\n if (data.page == null) {\n return <div>No Data Avialable</div>;\n }\n let header = Object.keys(data.page.results[0])\n return header.map((key, index) => {\n return <th key={index}> {key.toUpperCase()}</th>\n })\n }", "function SetHeaderMessage(type) {\n\tswitch (type) {\n\t\tcase \"noScores\":\n\t\t\t$j('#hsHeader').html('You have no high scores!');\n\t\t\tdocument.getElementById('noScores').style.display = 'block';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\t$j('#hsHeader').html(type);\n\t\t\tdocument.getElementById('noScores').style.display = 'none';\n\t\t\tbreak;\n\t}\n}", "redrawHeader()\n\t{\n\t\tlet headerProperties;\n\t\tif (Utils.dialog.isChatId(this.controller.getDialogId()))\n\t\t{\n\t\t\theaderProperties = this.getChatHeaderParams();\n\n\t\t\tthis.changeChatKeyboardStatus();\n\t\t}\n\t\telse\n\t\t{\n\t\t\theaderProperties = this.getUserHeaderParams();\n\t\t\tthis.setCallMenu();\n\t\t}\n\n\t\tif (!headerProperties)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!this.headerMenuInited)\n\t\t{\n\t\t\t//BXMobileApp.UI.Page.TopBar.title.setUseLetterImage();\n\t\t\tBXMobileApp.UI.Page.TopBar.title.params.useLetterImage = true; // TODO remove this\n\t\t\tBXMobileApp.UI.Page.TopBar.title.setCallback(() => this.openHeaderMenu());\n\n\t\t\tthis.headerMenuInited = true;\n\t\t}\n\n\t\tif (headerProperties.name)\n\t\t{\n\t\t\tBXMobileApp.UI.Page.TopBar.title.setText(headerProperties.name);\n\t\t}\n\t\tif (headerProperties.desc)\n\t\t{\n\t\t\tBXMobileApp.UI.Page.TopBar.title.setDetailText(headerProperties.desc);\n\t\t}\n\t\tif (headerProperties.avatar)\n\t\t{\n\t\t\tBXMobileApp.UI.Page.TopBar.title.setImage(headerProperties.avatar);\n\t\t}\n\t\telse if (headerProperties.color)\n\t\t{\n\t\t\t//BXMobileApp.UI.Page.TopBar.title.setImageColor(dialog.color);\n\t\t\tBXMobileApp.UI.Page.TopBar.title.params.imageColor = headerProperties.color;\n\t\t}\n\n\t\treturn true;\n\t}", "function renderHeader() {\n\n var today = new Date();\n //alert(\"today: \" + today);\n var day = moment(today).date();\n\n var month = getMonth(moment(today).month());\n //var year = moment(today).year();\n\n var year = moment(today).year();\n \n // create today's date to be used as a key for storing the work schedule on local storage\n todayDate = day + \"/\" + month + \"/\" + year;\n //alert(\"todayDate: \" + todayDate);\n \n var weekDay = getWeekDay(moment(today).weekday());\n\n var currentDayVal = weekDay + \", \" + month + \" \" + day;\n $(\"#currentDay\").text(currentDayVal);\n}", "getWelcomeHeaderText() {\n const welcomeHeader = $(this.getWelcomeHeaderSelector());\n\n welcomeHeader.waitForExist(undefined);\n welcomeHeader.waitForDisplayed(undefined);\n\n return welcomeHeader.getText();\n }", "function PaintHeaders(View)\n{\n\tif (!self.TABLE || !self.TABLE.document || !self.TABLE.document.getElementById(\"paneBody1\"))\n\t{\n\t\t\n\t\tsetTimeout(function() { PaintHeaders.apply(this, arguments); }, 5);\n\t\treturn;\n\t}\n\t\n\t__View = View;\n\n\tswitch (View)\n\t{\n\t\tcase \"Period\": functionCall = \"HeaderCalendar\"; date_fld_name = \"1\"; break;\n\t\tcase \"Daily\": functionCall = \"HeaderCalendar_Daily\"; date_fld_name = \"3\"; break;\n\t\tcase \"Exception\": functionCall = \"HeaderCalendar_Exception\"; date_fld_name = \"4\"; break;\n\t}\n\n\tvar html = '<div style=\"padding-bottom:10px\">'\n\thtml += '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"width:50px\" rowspan=\"2\">';\n\thtml += '&nbsp;';\n\thtml += '<td style=\"width:50px\" rowspan=\"2\">';\n\thtml += '&nbsp;';\n\thtml += '<td style=\"width:50px\" rowspan=\"2\">';\n\n\tif (View == \"Daily\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'CommentsClicked_Daily()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.CommentIconMouseOver(1,\\'\\');return true;\" ';\n\t\thtml += 'onmouseout=\"parent.CommentIconMouseOver(0,\\'\\');return true;\">';\n\t\thtml += '<img styler=\"documenticon\" src=\"'+NoCommentsIconImage.src+'\" border=\"0\" width=\"32\" height=\"32\" ';\n\t\thtml += 'default_icon=\"' + NoCommentsIcon + '\" active_icon=\"' + ExistingCommentsIcon + '\" ';\n\t\thtml += 'name=\"comment\" alt=\"'+getSeaPhrase(\"OPEN_COMMENTS\",\"TE\")+dteDay(TimeCard.StartDate)+\", \"+ FormatDte3(TimeCard.StartDate)+'\">';\n\t\thtml += '</a>';\n\t}\n\telse\n\t{\n\t\thtml += '&nbsp;';\n\t}\n\t\n\thtml += '<td style=\"width:100%;text-align:center\">';\n\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\thtml += '<span class=\"fieldlabelbold\">'+getSeaPhrase(\"EMPLOYEE\",\"TE\")+'&nbsp;</span>';\n\t\thtml += '<span class=\"fieldlabel\">'+Employee.EmployeeName+'</span>';\n\n\t\tif (parseInt(TimeCard.TimeCardType,10) == 2)\n\t\t{\n\t\t\thtml += '&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"plaintablecellbold\">'+getSeaPhrase(\"EXCEPTION\",\"TE\")+'</span>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\thtml += '&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"plaintablecellbold\">'+getSeaPhrase(\"NORMAL\",\"TE\")+'</span>';\n\t\t}\n\t}\n\telse\n\t{\n\t\thtml += '&nbsp;';\n\t}\n\t\n\thtml += '<td rowspan=\"2\" nowrap style=\"vertical-align:top\">';\n\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\t// If the ProcessFlow service was found, trigger the flow. Otherwise use the email CGI program.\n\t\tvar techVersion = (iosHandler && iosHandler.getIOSVersionNumber() >= \"9.0\") ? ProcessFlowObject.TECHNOLOGY_900 : ProcessFlowObject.TECHNOLOGY_803;\n\t\tvar httpRequest = (typeof(SSORequest) == \"function\") ? SSORequest : SEARequest;\n\t\tvar pfObj = new ProcessFlowObject(window, techVersion, httpRequest, \"EMSS\");\n\t\tpfObj.showErrors = false;\n\n\t\tif (typeof(pfServiceObj) == \"undefined\")\n\t\t{\n\t\t\tpfServiceObj = pfObj.lookUpService(\"EMSSTimeEntChg\");\n\t\t}\t\n\t\n\t\tif (pfServiceObj == null)\n\t\t{\n\t\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'EmployeeEmailClicked()\\');return false;\">';\n\t\t\thtml += getSeaPhrase(\"SEND_EMAIL\",\"ESS\");\n\t\t\thtml += '</a>&nbsp;&nbsp;'\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor (var i=0; i<Reports.Detail.length && (parseInt(Reports.Detail[i].Employee, 10) != parseInt(Employee.EmployeeNbr,10)); i++);\n\n\t\t\tif (i < Reports.Detail.length)\t\t\n\t\t\t{\n\t\t\t\thtml += '<a href=\"mailto:' + Reports.Detail[i].Email + '\">';\n\t\t\t\thtml += getSeaPhrase(\"SEND_EMAIL\",\"ESS\");\n\t\t\t\thtml += '</a>&nbsp;&nbsp;'\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\t\n\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'OpenTimeOff_Period()\\');return false;\">';\n\thtml += getSeaPhrase(\"OPEN_LEAVE_BALANCE_WIN\",\"TE\")+'</a>';\n\thtml += '<td>&nbsp;</td></tr>';\n\thtml += '<tr><td align=\"center\">';\n\thtml += '<table style=\"width:410px\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';\n\thtml += '<tr><td style=\"vertical-align:middle;width:14px\"></td>';\n\thtml += '<td style=\"vertical-align:middle;width:25px\">';\n\n\tif (View == \"Period\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousPeriod()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse if (View == \"Exception\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousException()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousDay()\\');return false;\" '\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" '\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"'\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_DAY\",\"TE\")+'\" border=\"0\">'\n\t}\n\n\thtml += '</a></td><td style=\"vertical-align:middle;text-align:center\" nowrap>';\n\thtml += '<span class=\"plaintablecellbold\">'+dteDay(TimeCard.StartDate)+\", \"+FormatDte3(TimeCard.StartDate);\n\n\tif (View == \"Period\" || View == \"Exception\")\n\t{\n\t\thtml += ' - ' + dteDay(TimeCard.EndDate)+\", \"+FormatDte3(TimeCard.EndDate);\n\t}\n\t\n\thtml += '</span></td><td style=\"vertical-align:middle;width:25px\">'\n\n\tif (View == \"Period\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextPeriod()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse if (View == \"Exception\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextException()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextDay()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_DAY\",\"TE\")+'\" border=\"0\">';\n\t}\n\t\n\tvar CalendarStartDate = \"\";\n\tif (hs36 && hs36.CalendarDate != null)\n\t{\n\t\tCalendarStartDate = FormatDte4(hs36.CalendarDate);\n\t}\n\telse if (getDteDifference(ymdtoday, TimeCard.StartDate) <= 0 && getDteDifference(ymdtoday, TimeCard.EndDate) >= 0)\n\t{\t\n\t\tCalendarStartDate = fmttoday;\n\t}\n\telse\t\n\t{\t\n\t\tCalendarStartDate = FormatDte4(TimeCard.StartDate);\n\t}\n\t\n\thtml += '</a></td><td style=\"vertical-align:middle\" nowrap>&nbsp;';\n\thtml += '<input onchange=\"parent.ReturnDate(this.value)\" styler=\"calendar\" class=\"inputbox\" onkeydown=\"this.value=this.getAttribute(\\'start_date\\')\" onkeyup=\"this.value=this.getAttribute(\\'start_date\\')\" type=\"text\" name=\"navDate\" size=\"10\" maxlength=\"10\" start_date=\"' + CalendarStartDate + '\" value=\"' + CalendarStartDate + '\"/>';\n\thtml += '<a styler=\"hidden\" href=\"\" onclick=\"parent.CheckAuthen(\\''+functionCall+'()\\');return false\">' + uiCalendarIcon() + '</a>';\n\n\thtml += '</td><td style=\"width:14px\">&nbsp;';\n\thtml += '</td></tr></table>';\n\thtml += '<td>&nbsp;<td>&nbsp;';\n\thtml += '<tr><td>&nbsp';\n\thtml += '<td>&nbsp;';\n\thtml += '<td>&nbsp;';\n\thtml += '<td style=\"text-align:center\">';\n\thtml += '<span class=\"fieldlabelbold\">';\n\t\n\tswitch (TimeCard.View)\n\t{\n\t\tcase 1: html += getSeaPhrase(\"INVALID_PERIOD\",\"TE\"); break;\n\t\tcase 2: html += getSeaPhrase(\"TE_LOCKED\",\"TE\"); break;\n\t\tcase 3: html += getSeaPhrase(\"OLD_PERIOD\",\"TE\"); break;\n\t\tdefault:\n\t\t{\n\t\t\tif (TimeCard.ManagerFlag)\n\t\t\t{\n\t\t\t\tswitch(TimeCard.Status)\n\t\t\t\t{\n\t\t\t\t\tcase -1: html += getSeaPhrase(\"CARD_NOT_ENTERED\",\"TE\"); break;\n\t\t\t\t\tcase 0: html += getSeaPhrase(\"CARD_ENTERED_NOT_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 1: html += getSeaPhrase(\"CARD_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 2: html += getSeaPhrase(\"CARD_APPROVED\",\"TE\"); break;\n\t\t\t\t\tcase 3: html += getSeaPhrase(\"CARD_ON_HOLD\",\"TE\"); break;\n\t\t\t\t\tcase 4: html += getSeaPhrase(\"CARD_REJECTED\",\"TE\"); break;\n\t\t\t\t\tcase 5:\n\t\t\t\t\tcase 6:\n\t\t\t\t\tcase 7:\n\t\t\t\t\tcase 8:\n\t\t\t\t\tcase 9: html += getSeaPhrase(\"OLD_PERIOD\",\"TE\"); break;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch (parseInt(TimeCard.Status, 10))\n\t\t\t\t{\n\t\t\t\t\tcase 1: html += getSeaPhrase(\"CARD_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 2: html += getSeaPhrase(\"CARD_APPROVED_NO_MORE\",\"TE\"); break;\n\t\t\t\t\tcase 3: html += getSeaPhrase(\"CARD_ON_HOLD_NO_MORE\",\"TE\"); break;\n\t\t\t\t\tcase 4: html += getSeaPhrase(\"CARD_RETURNED_NEED_CHANGE\",\"TE\"); break;\n\t\t\t\t\tdefault:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (View == \"Period\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_TIME_CLICK_MULTIENTRIES\",\"TE\")+'<img styler=\"multipleentrydetailicon\" width=15 height=15 alt=\"'+getSeaPhrase(\"SPLIT_NOTIFY\",\"TE\")+'\" src='+SplitIcon+'>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (View == \"Exception\")\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_EXCEPTION_TIME\",\"TE\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_TIME\",\"TE\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\thtml += '</span><td align=right>&nbsp;</table></div>';\n\n\tself.TABLE.document.getElementById(\"paneBody1\").innerHTML = html;\n}", "function PaintHeaders(View)\n{\n\tif (!self.TABLE || !self.TABLE.document || !self.TABLE.document.getElementById(\"paneBody1\"))\n\t{\n\t\t\n\t\tsetTimeout(function() { PaintHeaders.apply(this, arguments); }, 5);\n\t\treturn;\n\t}\n\t\n\t__View = View;\n\n\tswitch (View)\n\t{\n\t\tcase \"Period\": functionCall = \"HeaderCalendar\"; date_fld_name = \"1\"; break;\n\t\tcase \"Daily\": functionCall = \"HeaderCalendar_Daily\"; date_fld_name = \"3\"; break;\n\t\tcase \"Exception\": functionCall = \"HeaderCalendar_Exception\"; date_fld_name = \"4\"; break;\n\t}\n\n\tvar html = '<div style=\"padding-bottom:10px\">'\n\thtml += '<table cellpadding=\"0\" cellspacing=\"0\" border=\"0\"><tr><td style=\"width:50px\" rowspan=\"2\">';\n\thtml += '&nbsp;';\n\thtml += '<td style=\"width:50px\" rowspan=\"2\">';\n\thtml += '&nbsp;';\n\thtml += '<td style=\"width:50px\" rowspan=\"2\">';\n\n\tif (View == \"Daily\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'CommentsClicked_Daily()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.CommentIconMouseOver(1,\\'\\');return true;\" ';\n\t\thtml += 'onmouseout=\"parent.CommentIconMouseOver(0,\\'\\');return true;\">';\n\t\thtml += '<img styler=\"documenticon\" src=\"'+NoCommentsIconImage.src+'\" border=\"0\" width=\"32\" height=\"32\" ';\n\t\thtml += 'default_icon=\"' + NoCommentsIcon + '\" active_icon=\"' + ExistingCommentsIcon + '\" ';\n\t\thtml += 'name=\"comment\" alt=\"'+getSeaPhrase(\"OPEN_COMMENTS\",\"TE\")+dteDay(TimeCard.StartDate)+\", \"+ FormatDte3(TimeCard.StartDate)+'\">';\n\t\thtml += '</a>';\n\t}\n\telse\n\t{\n\t\thtml += '&nbsp;';\n\t}\n\t\n\thtml += '<td style=\"width:100%;text-align:center\">';\n\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\thtml += '<span class=\"fieldlabelbold\">'+getSeaPhrase(\"EMPLOYEE\",\"TE\")+'&nbsp;</span>';\n\t\thtml += '<span class=\"fieldlabel\">'+Employee.EmployeeName+'</span>';\n\n\t\tif (parseInt(TimeCard.TimeCardType,10) == 2)\n\t\t{\n\t\t\thtml += '&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"plaintablecellbold\">'+getSeaPhrase(\"EXCEPTION\",\"TE\")+'</span>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\thtml += '&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"plaintablecellbold\">'+getSeaPhrase(\"NORMAL\",\"TE\")+'</span>';\n\t\t}\n\t}\n\telse\n\t{\n\t\thtml += '&nbsp;';\n\t}\n\t\n\thtml += '<td rowspan=\"2\" nowrap style=\"vertical-align:top\">';\n\n\tif (TimeCard.ManagerFlag)\n\t{\n\t\t// If the ProcessFlow service was found, trigger the flow. Otherwise use the email CGI program.\n\t\tvar techVersion = (iosHandler && iosHandler.getIOSVersionNumber() >= \"9.0\") ? ProcessFlowObject.TECHNOLOGY_900 : ProcessFlowObject.TECHNOLOGY_803;\n\t\tvar httpRequest = (typeof(SSORequest) == \"function\") ? SSORequest : SEARequest;\n\t\tvar pfObj = new ProcessFlowObject(window, techVersion, httpRequest, \"EMSS\");\n\t\tpfObj.showErrors = false;\n\n\t\tif (typeof(pfServiceObj) == \"undefined\")\n\t\t{\n\t\t\tpfServiceObj = pfObj.lookUpService(\"EMSSTimeEntChg\");\n\t\t}\t\n\t\n// MOD BY BILAL\t\n//\t\tif (pfServiceObj == null)\n//\t\t{\n\t\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'EmployeeEmailClicked()\\');return false;\">';\n\t\t\thtml += getSeaPhrase(\"SEND_EMAIL\",\"ESS\");\n\t\t\thtml += '</a>&nbsp;&nbsp;'\t\t\t\n//\t\t}\n//\t\telse\n//\t\t{\n\t\t\tfor (var i=0; i<Reports.Detail.length && (parseInt(Reports.Detail[i].Employee, 10) != parseInt(Employee.EmployeeNbr,10)); i++);\n\n//\t\t\tif (i < Reports.Detail.length)\t\t\n//\t\t\t{\n//\t\t\t\thtml += '<a href=\"mailto:' + Reports.Detail[i].Email + '\">';\n//\t\t\t\thtml += getSeaPhrase(\"SEND_EMAIL\",\"ESS\");\n//\t\t\t\thtml += '</a>&nbsp;&nbsp;'\t\t\t\n//\t\t\t}\n//\t\t}\n// END OF MOD\n\t}\n\t\n\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'OpenTimeOff_Period()\\');return false;\">';\n\thtml += getSeaPhrase(\"OPEN_LEAVE_BALANCE_WIN\",\"TE\")+'</a>';\n\thtml += '<td>&nbsp;</td></tr>';\n\thtml += '<tr><td align=\"center\">';\n\thtml += '<table style=\"width:410px\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\">';\n\thtml += '<tr><td style=\"vertical-align:middle;width:14px\"></td>';\n\thtml += '<td style=\"vertical-align:middle;width:25px\">';\n\n\tif (View == \"Period\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousPeriod()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse if (View == \"Exception\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousException()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'PreviousDay()\\');return false;\" '\n\t\thtml += 'onmouseover=\"parent.TABLE.document.previous.src=\\''+PreviousIconOver+'\\';return true;\" '\n\t\thtml += 'onmouseout=\"parent.TABLE.document.previous.src=\\''+PreviousIcon+'\\';return true;\"'\t\t\n\t\thtml += '><img styler=\"prevcalendararrow\" name=\"previous\" src=\"'+PreviousIcon+'\" alt=\"'+getSeaPhrase(\"TO_PRE_DAY\",\"TE\")+'\" border=\"0\">'\n\t}\n\n\thtml += '</a></td><td style=\"vertical-align:middle;text-align:center\" nowrap>';\n\thtml += '<span class=\"plaintablecellbold\">'+dteDay(TimeCard.StartDate)+\", \"+FormatDte3(TimeCard.StartDate);\n\n\tif (View == \"Period\" || View == \"Exception\")\n\t{\n\t\thtml += ' - ' + dteDay(TimeCard.EndDate)+\", \"+FormatDte3(TimeCard.EndDate);\n\t}\n\t\n\thtml += '</span></td><td style=\"vertical-align:middle;width:25px\">'\n\n\tif (View == \"Period\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextPeriod()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse if (View == \"Exception\")\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextException()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\t\t\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_PERIOD\",\"TE\")+'\" border=\"0\">';\n\t}\n\telse\n\t{\n\t\thtml += '<a href=\"\" onclick=\"parent.CheckAuthen(\\'NextDay()\\');return false;\" ';\n\t\thtml += 'onmouseover=\"parent.TABLE.document.next.src=\\''+NextIconOver+'\\';return true;\" ';\n\t\thtml += 'onmouseout=\"parent.TABLE.document.next.src=\\''+NextIcon+'\\';return true;\"';\n\t\thtml += '><img styler=\"nextcalendararrow\" name=\"next\" src=\"'+NextIcon+'\" alt=\"'+getSeaPhrase(\"TO_NEXT_DAY\",\"TE\")+'\" border=\"0\">';\n\t}\n\t\n\tvar CalendarStartDate = \"\";\n\tif (hs36 && hs36.CalendarDate != null)\n\t{\n\t\tCalendarStartDate = FormatDte4(hs36.CalendarDate);\n\t}\n\telse if (getDteDifference(ymdtoday, TimeCard.StartDate) <= 0 && getDteDifference(ymdtoday, TimeCard.EndDate) >= 0)\n\t{\t\n\t\tCalendarStartDate = fmttoday;\n\t}\n\telse\t\n\t{\t\n\t\tCalendarStartDate = FormatDte4(TimeCard.StartDate);\n\t}\n\t\n\thtml += '</a></td><td style=\"vertical-align:middle\" nowrap>&nbsp;';\n\thtml += '<input onchange=\"parent.ReturnDate(this.value)\" styler=\"calendar\" class=\"inputbox\" onkeydown=\"this.value=this.getAttribute(\\'start_date\\')\" onkeyup=\"this.value=this.getAttribute(\\'start_date\\')\" type=\"text\" name=\"navDate\" size=\"10\" maxlength=\"10\" start_date=\"' + CalendarStartDate + '\" value=\"' + CalendarStartDate + '\"/>';\n\thtml += '<a styler=\"hidden\" href=\"\" onclick=\"parent.CheckAuthen(\\''+functionCall+'()\\');return false\">' + uiCalendarIcon() + '</a>';\n\n\thtml += '</td><td style=\"width:14px\">&nbsp;';\n\thtml += '</td></tr></table>';\n\thtml += '<td>&nbsp;<td>&nbsp;';\n\thtml += '<tr><td>&nbsp';\n\thtml += '<td>&nbsp;';\n\thtml += '<td>&nbsp;';\n\thtml += '<td style=\"text-align:center\">';\n\thtml += '<span class=\"fieldlabelbold\">';\n\t\n\tswitch (TimeCard.View)\n\t{\n\t\tcase 1: html += getSeaPhrase(\"INVALID_PERIOD\",\"TE\"); break;\n\t\tcase 2: html += getSeaPhrase(\"TE_LOCKED\",\"TE\"); break;\n\t\tcase 3: html += getSeaPhrase(\"OLD_PERIOD\",\"TE\"); break;\n\t\tdefault:\n\t\t{\n\t\t\tif (TimeCard.ManagerFlag)\n\t\t\t{\n\t\t\t\tswitch(TimeCard.Status)\n\t\t\t\t{\n\t\t\t\t\tcase -1: html += getSeaPhrase(\"CARD_NOT_ENTERED\",\"TE\"); break;\n\t\t\t\t\tcase 0: html += getSeaPhrase(\"CARD_ENTERED_NOT_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 1: html += getSeaPhrase(\"CARD_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 2: html += getSeaPhrase(\"CARD_APPROVED\",\"TE\"); break;\n\t\t\t\t\tcase 3: html += getSeaPhrase(\"CARD_ON_HOLD\",\"TE\"); break;\n\t\t\t\t\tcase 4: html += getSeaPhrase(\"CARD_REJECTED\",\"TE\"); break;\n\t\t\t\t\tcase 5:\n\t\t\t\t\tcase 6:\n\t\t\t\t\tcase 7:\n\t\t\t\t\tcase 8:\n\t\t\t\t\tcase 9: html += getSeaPhrase(\"OLD_PERIOD\",\"TE\"); break;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tswitch (parseInt(TimeCard.Status, 10))\n\t\t\t\t{\n\t\t\t\t\tcase 1: html += getSeaPhrase(\"CARD_SUBMITTED\",\"TE\"); break;\n\t\t\t\t\tcase 2: html += getSeaPhrase(\"CARD_APPROVED_NO_MORE\",\"TE\"); break;\n\t\t\t\t\tcase 3: html += getSeaPhrase(\"CARD_ON_HOLD_NO_MORE\",\"TE\"); break;\n\t\t\t\t\tcase 4: html += getSeaPhrase(\"CARD_RETURNED_NEED_CHANGE\",\"TE\"); break;\n\t\t\t\t\tdefault:\n\t\t\t\t\t{\n\t\t\t\t\t\tif (View == \"Period\")\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_TIME_CLICK_MULTIENTRIES\",\"TE\")+'<img styler=\"multipleentrydetailicon\" width=15 height=15 alt=\"'+getSeaPhrase(\"SPLIT_NOTIFY\",\"TE\")+'\" src='+SplitIcon+'>';\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (View == \"Exception\")\n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_EXCEPTION_TIME\",\"TE\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\thtml += getSeaPhrase(\"ENTER_TIME\",\"TE\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\thtml += '</span><td align=right>&nbsp;</table></div>';\n\n\tself.TABLE.document.getElementById(\"paneBody1\").innerHTML = html;\n}", "renderHeader(type, discipline, course, date, teacher, std_name, std_num) {\n var header = [\n { text: 'Exame ' + type, style: ['header', {alignment:'center'}] },\n { style: 'header_table',\n table: {\n widths: [ 'auto', '*' ],\n body: [\n [ \n { text: [ { text: 'Disciplina: ', bold:true }, discipline ] }, \n { text: [ { text: 'Curso: ', bold:true }, course ] },\n ],\n [ \n { text: [ { text: 'Data: ', bold:true }, date ] }, \n { text: [ { text: 'Professor: ', bold:true }, teacher ] },\n ],\n [ \n { text: [ { text: 'Aluno: ', bold:true }, std_name ] }, \n { text: [ { text: 'Numero: ', bold:true }, std_num] },\n ]\n\t\t\t\t\t]\n\t\t\t\t},\n layout: 'noBorders'\n\t\t\t}, \n ]\n return header;\n }", "function renderHomePage() {\n var items = $('.cvt-report li');\n if (items) {\n items.remove();\n }\n \n var page = $('.home');\n page.addClass('visible');\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "function addHeader( ptitle )\n {\n ddCont.push(\n {\n image: imagesRack.loadedImages[ 'page-header' ].dataURI,\n width: 844,\n absolutePosition: {\n x: 0,\n y: 0\n }\n }\n );\n\n ddCont.push(\n //header: no dice for classic header:\n { \n text: ptitle,\n margin: [20, 0, 40, 30],\n color: '#fff',\n fontSize: 26,\n bold: true\n }\n );\n }", "renderTableHeader() {\n return ( \n <tr>\n <th>#</th>\n <th>Disease Funds</th>\n <th>Status</th>\n <th>Maximum Award Level</th>\n <th>Treatments Covered</th>\n </tr>\n );\n }", "function renderHeader () {\n var trEl = document.createElement('tr');\n\n var headerTitles = ['', 'Daily Location Total'];\n for(var i = 0; i < headerTitles.length; i++) {\n //'for each pass, this code will run'\n var thEl = document.createElement('th');//create\n thEl.textContent = headerTitles[i];//add content\n trEl.appendChild(thEl);//append this table header element into a row\n }\n for(var i = 0; i < openHours.length; i++) {\n var thEl = document.createElement('th');\n thEl.textContent = openHours[i];\n trEl.appendChild(thEl);\n }\n cookiesTable.appendChild(trEl);\n}", "function createTableHeader(){\n\tvar $table = $('#domainsTable');\n\t//var content = \"<tr> <th>Domain Name</th> <th> </th></tr>\";\n\tvar content = \"<tr><th>List of Available Domain Names.</th></tr>\";\n\t$table.append(content);\n}", "function setCalendarHeader(){\n let indexOfToday = $('.today').index(); \n switch (indexOfToday) {\n case 1:\n $(dayName[indexOfToday]).text(today.toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 1]).text(new Date((new Date()).valueOf() + 1000 * 3600 * 24).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 2]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 2)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 3]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 3)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 4]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 4)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 5]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 5)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 1]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 6)).toLocaleString('en-us', { weekday: 'long' }));\n FridayController(dayName[indexOfToday])\n SaturdayController(dayName[indexOfToday + 1])\n SundayController(dayName[indexOfToday +2 ])\n MondayController(dayName[indexOfToday + 3])\n TuesdayController(dayName[indexOfToday + 4])\n WednesdayController(dayName[indexOfToday + 5])\n ThursdayController(dayName[indexOfToday - 1])\n break;\n \n case 2:\n $(dayName[indexOfToday]).text(today.toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 1]).text(new Date((new Date()).valueOf() + 1000 * 3600 * 24).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 2]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 2)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 3]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 3)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 4]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 4)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 2]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 5)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 1]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 6)).toLocaleString('en-us', { weekday: 'long' }));\n FridayController(dayName[indexOfToday -1])\n SaturdayController(dayName[indexOfToday])\n SundayController(dayName[indexOfToday + 1])\n MondayController(dayName[indexOfToday + 2])\n TuesdayController(dayName[indexOfToday + 3])\n WednesdayController(dayName[indexOfToday + 4])\n ThursdayController(dayName[indexOfToday - 2])\n break;\n \n case 3:\n $(dayName[indexOfToday]).text(today.toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 1]).text(new Date((new Date()).valueOf() + 1000 * 3600 * 24).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 2]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 2)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 3]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 3)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 3]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 4)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 2]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 5)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 1]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 6)).toLocaleString('en-us', { weekday: 'long' }));\n FridayController(dayName[indexOfToday - 2])\n SaturdayController(dayName[indexOfToday - 1])\n SundayController(dayName[indexOfToday])\n MondayController(dayName[indexOfToday + 1])\n TuesdayController(dayName[indexOfToday + 2])\n WednesdayController(dayName[indexOfToday + 3])\n ThursdayController(dayName[indexOfToday - 3])\n break;\n \n case 4:\n $(dayName[indexOfToday]).text(today.toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 1]).text(new Date((new Date()).valueOf() + 1000 * 3600 * 24).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 2]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 2)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 4]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 3)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 3]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 4)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 2]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 5)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 1]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 6)).toLocaleString('en-us', { weekday: 'long' }));\n FridayController(dayName[indexOfToday - 3])\n SaturdayController(dayName[indexOfToday - 2])\n SundayController(dayName[indexOfToday - 1])\n MondayController(dayName[indexOfToday])\n TuesdayController(dayName[indexOfToday + 1])\n WednesdayController(dayName[indexOfToday + 2])\n ThursdayController(dayName[indexOfToday - 4])\n break;\n \n case 5:\n $(dayName[indexOfToday]).text(today.toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 1]).text(new Date((new Date()).valueOf() + 1000 * 3600 * 24).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 5]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 2)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 4]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 3)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 3]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 4)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 2]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 5)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 1]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 6)).toLocaleString('en-us', { weekday: 'long' }));\n FridayController(dayName[indexOfToday - 4])\n SaturdayController(dayName[indexOfToday - 3])\n SundayController(dayName[indexOfToday - 2])\n MondayController(dayName[indexOfToday - 1])\n TuesdayController(dayName[indexOfToday])\n WednesdayController(dayName[indexOfToday + 1])\n ThursdayController(dayName[indexOfToday - 5])\n break;\n \n case 6:\n $(dayName[indexOfToday]).text(today.toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 6]).text(new Date((new Date()).valueOf() + 1000 * 3600 * 24).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 5]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 2)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 4]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 3)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 3]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 4)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 2]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 5)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday - 1]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 6)).toLocaleString('en-us', { weekday: 'long' }));\n FridayController(dayName[indexOfToday - 5])\n SaturdayController(dayName[indexOfToday - 4])\n SundayController(dayName[indexOfToday - 3])\n MondayController(dayName[indexOfToday - 2])\n TuesdayController(dayName[indexOfToday -1])\n WednesdayController(dayName[indexOfToday])\n ThursdayController(dayName[indexOfToday - 6])\n break;\n \n default:\n $(dayName[indexOfToday]).text(today.toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 1]).text(new Date((new Date()).valueOf() + 1000 * 3600 * 24).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 2]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 2)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 3]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 3)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 4]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 4)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 5]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 5)).toLocaleString('en-us', { weekday: 'long' }));\n $(dayName[indexOfToday + 6]).text(new Date((new Date()).valueOf() + ((1000 * 3600 * 24) * 6)).toLocaleString('en-us', { weekday: 'long' }));\n FridayController(dayName[indexOfToday + 1])\n SaturdayController(dayName[indexOfToday + 2])\n SundayController(dayName[indexOfToday + 3])\n MondayController(dayName[indexOfToday + 4])\n TuesdayController(dayName[indexOfToday + 5])\n WednesdayController(dayName[indexOfToday + 6])\n ThursdayController(dayName[indexOfToday])\n break;\n }\n }", "function show ( headers, list ) {\n $('body').html( $('<table id=\"stats\">') );\n $('#stats').append( $('<tr>').html( _.map(headers, function(label) {\n return $('<th>').html( label );\n })));\n $('#stats').append( _.map( list, function( el ) {\n return $('<tr>').html( _.map( el, function( stat ) {\n return $('<td>').html( stat );\n }));\n }));\n }", "function getTitle() {\n if ($scope.ShowMode != null && $scope.ShowMode == 'edit') {\n return 'Edicion: ' + $scope.WorkCliente.Nombre;\n }\n else {\n //alert($scope.WorkCliente.Nombre + \" - \" + $scope.WorkCliente.IdDescuento + \" - \" + $scope.WorkCliente.IdUsuario);\n return 'Nuevo Cliente';\n }\n }", "function header(title) {\r\n console.log(\"===================================\")\r\n console.log(\" \"+title)\r\n console.log(\"===================================\")\r\n }", "function renderHeader() {\n var tableHeader = document.createElement('tr')\n table.append(tableHeader)\n var cityLabel = document.createElement('th');\n cityLabel.textContent = 'Store Location';\n tableHeader.append(cityLabel);\n for (var i = 0; i < hours.length; i++) {\n var headerCellHour = document.createElement('th');\n headerCellHour.textContent = hours[i];\n tableHeader.append(headerCellHour);\n }\n var dailyTotalLabel = document.createElement('th');\n dailyTotalLabel.textContent = 'End of day Sales'\n tableHeader.append(dailyTotalLabel)\n}", "get viewMoreStewardsTab_MenuHeader() {return browser.element(\"//android.view.ViewGroup[1]/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup/android.view.ViewGroup[2]/android.view.ViewGroup/android.widget.TextView[1]\");}", "function printTableHeader() {\n\n const tr1Element = document.createElement( 'tr' );\n tableElement.appendChild( tr1Element );\n const thElement = document.createElement( 'th' );\n tr1Element.appendChild( thElement );\n thElement.textContent = 'Location';\n\n for ( let i = 0; i < workingHours.length; i++ ) {\n const thElement = document.createElement( 'th' );\n tr1Element.appendChild( thElement );\n thElement.textContent = workingHours[i];\n }\n const th2Element = document.createElement( 'th' );\n tr1Element.appendChild( th2Element );\n th2Element.textContent = 'Daily Location Total';\n}", "get listEmptyMessageDiv() { return browser.element(\".zero-state-header\") }", "function eltdOnWindowScrollHeader() {\n \n }", "function Header(props) {\r\n\tvar ths = [];\r\n\tfor (var groupName of props.groupNames) {\r\n\t\tths.push(\r\n\t\t\t<th key={groupName}>\r\n\t\t\t\t{showGroupColumnHeader(groupName, props.onDeleteGroup, props.onAddAllMembersToGroup)}\r\n\t\t\t</th>\r\n\t\t);\r\n\t}\r\n\r\n\treturn (\r\n\t\t<thead>\r\n\t\t\t<tr height=\"30px\" valign=\"middle\">\r\n\t\t\t\t<th width=\"20%\"></th>\r\n\t\t\t\t{ths}\r\n\t\t\t\t<th width=\"5%\"></th>\r\n\t\t\t</tr>\r\n\t\t</thead>\r\n\t);\r\n}", "function formatHeadline(text) {\n const categories = addCategory();\n const timeStamp = formatTimeAndDate(countryCode);\n const header = `<h4><a id=\"${timeStamp[1]}\" name=\"${timeStamp[1]}\"></a>${text} - ${timeStamp[0]} ${categories}</h4>`;\n return header;\n}", "goToHeader() {\n this.owner.enableHeaderAndFooter = true;\n this.enableHeadersFootersRegion(this.start.paragraph.bodyWidget.page.headerWidget);\n }", "function createWarnHeader() {\n\n\tlet now = moment.utc()\n\tlet fmtTtl = \"DD-MMM-YYYY HH:mm\"\n\tlet fmtPub = \"ddd, DD MMM YYYY HH:mm:ss\"\r\n\tlet fmtDate = \"YYYY-MM-DDTHH:mm:ss\"\n\n\tlet hObj = {\n\t\ttype: \"rss 2.0\",\n\t\ttitle: \"Met Office Warnings - dummy data generated \" + now.format(fmtTtl),\n\t\tlink: \"https://www.metoffice.gov.uk/public/weather/warnings/?regionName=gr\",\n\t\tdescription: \"Weather Warnings of severe and extreme weather from the Met Office\",\n\t\tlanguage: \"en-gb\",\n\t\tcopyright: \"(c) Crown copyright\",\n\t\tpubdate: now.format(fmtPub) + \" GMT\",\n\t\t\"dc:creator\": \"[email protected]\",\n\t\t\"dc:date\": now.format(fmtDate) + \"Z\",\n\t\t\"dc:language\": \"en-gb\",\n\t\t\"dc:rights\": \"(c) Crown copyright\",\n\t\timage:\n { text: \"\\r\\n \\r\\n \\r\\n \\r\\n \",\n \ttitle: \"Met Office Warnings for Grampian\",\n \turl: \"https://www.metoffice.gov.uk/lib/template/logo_crop.gif\",\n \tlink: \"https://www.metoffice.gov.uk/public/weather/warnings/?regionName=gr\" },\n\t\titems: []\n\t}\n\treturn hObj\n}", "function getOmniTopSection() {\n\n splitURL = getOmniSplitUrl();\n\t\n\tvar section = splitURL[2];\n\n\tif (section)\n\t{\n\t\tif (section.indexOf(\"business\") != -1) {\n\t\t\treturn \"business\";\n\t\t} else if (section.indexOf(\"support\") != -1) {\n\t\t\treturn \"support\";\n\t\t} else {\n\t\t\treturn \"\";\n\t\t}\n\t}\n\t\n\treturn \"\";\n}", "function getStreamHeaderHTML() {\n\t\t\tvar joinCommunity$ = $('<div/>').addClass('ASWidget-Join-Community-Div').append($('<button/>').attr('type', 'button').attr('rel', 'sendjoin').addClass('ASWidgetCnxBtn ASWidgetjoinCommunityBtn')),\n\t\t\t\tshareSomething$,\n\t\t\t\tstreamHeader,\n\t\t\t\tisCommunityModeAndNotMember = isCommunityMode() && !currentAccess.isMember,\n\t\t\t\tshareAllowed = !isCommunityModeAndNotMember;\n\n\t\t\tif (isCommunityModeAndNotMember) {\n\t\t\t\tif (currentAccess.canSendJoinRequest) {\n\t\t\t\t\tjoinCommunity$.find('.ASWidgetjoinCommunityBtn').text(localizeString(\"ASWidget-join-community-text\", \"Join this community to post a message.\"));\n\t\t\t\t} else {\n\t\t\t\t\tjoinCommunity$.find('.ASWidgetjoinCommunityBtn')\n\t\t\t\t\t\t.remove().end()\n\t\t\t\t\t\t.append($(createAlert(localizeString(\"ASWidget-join-community-private\", \"The selected community is private. Please ask a community owner to add you.\"), 'info')));\n\t\t\t\t\tcurrentAccess.noSearch = true; // it does not make sense to search in an empty stream\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!savedSettings.showJoinComBtn) {\n\t\t\t\tjoinCommunity$.hide();\n\t\t\t}\n\n\t\t\tshareSomething$ = (savedSettings.showShareBox && shareAllowed) ? getShareBoxDiv$(savedSettings.useDefaultStyle) : $('<p style=\"display:none !important;\"></p>');\n\n\t\t\tstreamHeader = ((isCommunityMode() && !currentAccess.isMember) ? joinCommunity$[0].outerHTML : shareSomething$.append(shareArea$)[0].outerHTML) +\n\t\t\t\t'<div class=\"ASWidgetAlertMainDiv\"></div>';\n\n\t\t\tshareArea$ = (savedSettings.showShareBox && shareAllowed) ? $('<div class=\"ASWidgetWrappedDiv\">' +\n\t\t\t\tgetShareDivWrapper$()[0].outerHTML +\n\t\t\t\tgetActionDiv$(savedSettings.useDefaultStyle)[0].outerHTML +\n\t\t\t\t'</div>') : $('<p style=\"display:none !important;\"></p>');\n\n\t\t\tif (savedSettings.showNavigation) {\n\t\t\t\tstreamHeader += '<nav class=\"ASWidgetMainNavi navbar navbar-default\"> <div class=\"container-fluid\">' +\n\t\t\t\t\t' <!-- Brand and toggle get grouped for better mobile display --> <!-- Collect the nav links, forms, and other content for toggling --> ' +\n\t\t\t\t\t'<div class=\"\" id=\"bs-example-navbar-collapse-1\"> <ul class=\"ASWidgetLeftNaviPart nav navbar-nav\"' + (savedSettings.useDefaultStyle ? '' : 'rel=\"orientme\"') + '> ';\n\n\t\t\t\t(function checkIfCommunityHeaderGenerate() {\n\t\t\t\t\tif (!isCommunityMode()) {\n\t\t\t\t\t\tstreamHeader += '<li class=\"ASWidgetImFollowing oM-mainNaviItem active\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-imfollowing\", \"I'm Following\") + '<span class=\"sr-only\">(current)</span></a></li> ' +\n\t\t\t\t\t\t\t'<li class=\"ASWidgetstatusUpdates oM-mainNaviItem\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-statusupdates\", \"Status Updates\") + '</a></li>' +\n\t\t\t\t\t\t\t'<li class=\"ASWidgetdiscover oM-mainNaviItem\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-discover\", \"Discover\") + '</a></li>';\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\tstreamHeader += '<li class=\"ASWidgetImFollowing oM-mainNaviItem active\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-all\", \"All\") + ' <span class=\"sr-only\">(current)</span></a></li> ' +\n\t\t\t\t\t\t\t'<li class=\"ASWidgetstatusUpdates oM-mainNaviItem\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-statusupdates\", \"Status Updates\") + '</a></li>';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t());\n\n\t\t\t\tstreamHeader += '</ul> <ul class=\"ASWidgetRightNaviPart nav navbar-nav navbar-right\"> ' +\n\t\t\t\t\t(currentAccess.noSearch ? '' : '<li class=\"ASWidgetSearchOpen\"><a href=\"javascript:;\"><i class=\"fa fa-search\" aria-hidden=\"true\"></i></a></li>') +\n\t\t\t\t\t'<li class=\"ASWidgetRefresh\"><a href=\"javascript:;\"><i class=\"fa fa-refresh\" aria-hidden=\"true\"></i></a></li>' +\n\t\t\t\t\t'<li class=\"dropdown\"> <a href=\"javascript:;\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" role=\"button\" aria-haspopup=\"true\" aria-expanded=\"false\">' +\n\t\t\t\t\tlocalizeString(\"ASWidget-navigation-dropdown-all\", \"All\") + '<span class=\"caret\"></span></a> <ul class=\"ASWidgetActionDropdown dropdown-menu\">' +\n\t\t\t\t\t'<li class=\"ASWidgetFilterAll\"><a href=\"javascript:;\">' +\n\t\t\t\t\tlocalizeString(\"ASWidget-navigation-dropdown-all\", \"All\") + '</a></li> ' +\n\t\t\t\t\t'<li role=\"separator\" class=\"divider\"></li>' +\n\t\t\t\t\t'<li class=\"ASWidgetStatusUpdatesNaviPoint ASWidgetFilterStatusUpdatesAll\"><a href=\"javascript:;\">' +\n\t\t\t\t\tlocalizeString(\"ASWidget-navigation-dropdown-statusupdatesall\", \"All\") + '</a></li>' +\n\n\t\t\t\t\t'<li class=\"ASWidgetStatusUpdatesNaviPoint ASWidgetFilterStatusUpdatesMyNetworkAndPeople\"><a href=\"javascript:;\">' +\n\t\t\t\t\tlocalizeString(\"ASWidget-navigation-dropdown-mynetworkandpeopleifollowcommunities\", \"My Network and People I Follow\") + '</a></li>' +\n\n\t\t\t\t\t'<li class=\"ASWidgetStatusUpdatesNaviPoint ASWidgetFilterStatusUpdatesMyNetwork\"><a href=\"javascript:;\">' +\n\t\t\t\t\tlocalizeString(\"ASWidget-navigation-dropdown-mynetworkcommunities\", \"My Network\") + '</a></li>' +\n\t\t\t\t\t'<li class=\"ASWidgetStatusUpdatesNaviPoint ASWidgetFilterStatusUpdatesPeopleIFollow\"><a href=\"javascript:;\">' +\n\t\t\t\t\tlocalizeString(\"ASWidget-navigation-dropdown-peopleifollowcommunities\", \"People I Follow\") + '</a></li>' +\n\t\t\t\t\t'<li class=\"ASWidgetStatusUpdatesNaviPoint ASWidgetFilterStatusUpdatesMyUpdates\"><a href=\"javascript:;\">' +\n\t\t\t\t\tlocalizeString(\"ASWidget-navigation-dropdown-myupdatescommunities\", \"My Updates\") + '</a></li>' +\n\t\t\t\t\t'<li class=\"ASWidgetStatusUpdatesNaviPoint ASWidgetFilterStatusUpdatesCommunities\"><a href=\"javascript:;\">' +\n\t\t\t\t\tlocalizeString(\"ASWidget-navigation-dropdown-statusupdatescommunities\", \"Communities\") + '</a></li>' +\n\n\t\t\t\t\t'<li class=\"ASWidgetFilterStatusUpdates\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-dropdown-statusupdates\", \"Status Updates\") +\n\t\t\t\t\t'</a></li> <li class=\"ASWidgetFilterActivities\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-dropdown-activities\", \"Activities\") +\n\t\t\t\t\t'</a></li> ' + '<li class=\"ASWidgetFilterBlogs\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-dropdown-blogs\", \"Blogs\") +\n\t\t\t\t\t'</a></li> <li class=\"ASWidgetFilterBookmarks\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-dropdown-bookmarks\", \"Bookmarks\") +\n\t\t\t\t\t'</a></li> <li class=\"ASWidgetFilterCommunities\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-dropdown-communities\", \"Communities\") +\n\t\t\t\t\t'</a></li><li class=\"ASWidgetFilterFiles\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-dropdown-files\", \"Files\") + '</a></li>' +\n\t\t\t\t\t'<li class=\"ASWidgetFilterForums\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-dropdown-forums\", \"Forums\") +\n\t\t\t\t\t'</a></li><li class=\"ASWidgetFilterPeople\"><a href=\"javascript:;\">' + (X.S.cloud ? localizeString(\"ASWidget-navigation-dropdown-people\", \"People\") : localizeString(\"ASWidget-navigation-dropdown-profiles\", \"Profiles\")) +\n\t\t\t\t\t'</a></li><li class=\"ASWidgetFilterWikis\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-dropdown-wikis\", \"Wikis\") +\n\t\t\t\t\t'</a></li><li class=\"ASWidgetFilterTags\"><a href=\"javascript:;\">' + localizeString(\"ASWidget-navigation-dropdown-tags\", \"Tags\") + '</a></li> </ul> </li> </ul> ' +\n\t\t\t\t\t'</div><!-- /.navbar-collapse --> ' +\n\n\t\t\t\t\t' <div class=\"form-group ASWidgetSearchStreamDiv\"> <input type=\"text\" class=\"form-control searchInputBox\" placeholder=\"' +\n\t\t\t\t\tlocalizeString(\"ASWidget-streamitems-searchstreamplaceholder\", \"Search this stream\") + '\"> <i class=\"fa fa-search searchStreamReq\" aria-hidden=\"true\"></i> </div>' +\n\t\t\t\t\t'</div>' +\n\t\t\t\t\t'<!-- /.container-fluid --></nav>';\n\t\t\t}\n\t\t\treturn streamHeader;\n\t\t}", "function createHeader() {\n var caption = [];\n\n caption.push('<span class=\"table-caption\">Master&nbsp;Status</span><br>');\n\n $('<caption/>', {\n html: caption.join('')\n }).appendTo('#masterStatus');\n\n var items = [];\n\n var columns = ['Master&nbsp;', '#&nbsp;Online<br>Tablet&nbsp;Servers&nbsp;',\n '#&nbsp;Total<br>Tablet&nbsp;Servers&nbsp;', 'Last&nbsp;GC&nbsp;',\n '#&nbsp;Tablets&nbsp;', '#&nbsp;Unassigned<br>Tablets&nbsp;',\n 'Entries&nbsp;', 'Ingest&nbsp;', 'Entries<br>Read&nbsp;',\n 'Entries<br>Returned&nbsp;', 'Hold&nbsp;Time&nbsp;',\n 'OS&nbsp;Load&nbsp;'];\n\n var titles = [descriptions['Master'], descriptions['# Online Tablet Servers'],\n descriptions['# Total Tablet Servers'], descriptions['Last GC'],\n descriptions['# Tablets'], '', descriptions['Total Entries'],\n descriptions['Total Ingest'], descriptions['Total Entries Read'],\n descriptions['Total Entries Returned'], descriptions['Max Hold Time'],\n descriptions['OS Load']];\n\n /*\n * Adds the columns, add sortTable function on click,\n * if the column has a description, add title taken from the global.js\n */\n for (i = 0; i < columns.length; i++) {\n var first = i == 0 ? true : false;\n items.push(createHeaderCell(first, 'sortMasterTable(' + i + ')',\n titles[i], columns[i]));\n }\n\n $('<tr/>', {\n html: items.join('')\n }).appendTo('#masterStatus');\n}", "function overallWebHealthTable() {\n //Displays the previous results in a table\n var serverRPSNum = new TableView({\n id: \"overallStats\",\n managerid: \"webOverall\",\n data: \"results\",\n el: $(\"#webOverall\")\n });\n\n //Icons to monitor the servers\n var ICONS = {\n GREEN: 'check-circle',\n YELLOW: 'alert',\n RED: 'alert-circle'\n };\n\n //Replaces the status with icons based on the status of the server.\n var CustomIconCellRenderer = TableView.BaseCellRenderer.extend({\n canRender: function(cell) {\n return cell.field === 'Status';\n },\n\n render: function($td, cell) {\n var icon = 'question';\n if(ICONS.hasOwnProperty(cell.value)) {\n icon = ICONS[cell.value];\n }\n $td.addClass('icon').html(_.template('<i class=\"icon-<%-icon%> <%- Status %>\" title=\"<%- Status %>\"></i>', {\n icon: icon,\n Status: cell.value\n }));\n }\n });\n\n serverRPSNum.table.addCellRenderer(new CustomIconCellRenderer());\n serverRPSNum.table.render();\n }", "function Header(calendar) {\n\t\tvar t = this;\n\t\t\n\t\t// exports\n\t\tt.render = render;\n\t\tt.removeElement = removeElement;\n\t\tt.updateTitle = updateTitle;\n\t\tt.activateButton = activateButton;\n\t\tt.deactivateButton = deactivateButton;\n\t\tt.disableButton = disableButton;\n\t\tt.enableButton = enableButton;\n\t\tt.getViewsWithButtons = getViewsWithButtons;\n\t\tt.el = null; // mirrors local `el`\n\t\t\n\t\t// locals\n\t\tvar el;\n\t\tvar viewsWithButtons = [];\n\t\tvar tm;\n\n\n\t\t// can be called repeatedly and will rerender\n\t\tfunction render() {\n\t\t\tvar options = calendar.options;\n\t\t\tvar sections = options.header;\n\n\t\t\ttm = options.theme ? 'ui' : 'fc';\n\n\t\t\tif (sections) {\n\t\t\t\tif (!el) {\n\t\t\t\t\tel = this.el = $(\"<div class='fc-toolbar'/>\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tel.empty();\n\t\t\t\t}\n\t\t\t\tel.append(renderSection('left'))\n\t\t\t\t\t.append(renderSection('right'))\n\t\t\t\t\t.append(renderSection('center'))\n\t\t\t\t\t.append('<div class=\"fc-clear\"/>');\n\t\t\t}\n\t\t\telse {\n\t\t\t\tremoveElement();\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction removeElement() {\n\t\t\tif (el) {\n\t\t\t\tel.remove();\n\t\t\t\tel = t.el = null;\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction renderSection(position) {\n\t\t\tvar sectionEl = $('<div class=\"fc-' + position + '\"/>');\n\t\t\tvar options = calendar.options;\n\t\t\tvar buttonStr = options.header[position];\n\n\t\t\tif (buttonStr) {\n\t\t\t\t$.each(buttonStr.split(' '), function(i) {\n\t\t\t\t\tvar groupChildren = $();\n\t\t\t\t\tvar isOnlyButtons = true;\n\t\t\t\t\tvar groupEl;\n\n\t\t\t\t\t$.each(this.split(','), function(j, buttonName) {\n\t\t\t\t\t\tvar customButtonProps;\n\t\t\t\t\t\tvar viewSpec;\n\t\t\t\t\t\tvar buttonClick;\n\t\t\t\t\t\tvar overrideText; // text explicitly set by calendar's constructor options. overcomes icons\n\t\t\t\t\t\tvar defaultText;\n\t\t\t\t\t\tvar themeIcon;\n\t\t\t\t\t\tvar normalIcon;\n\t\t\t\t\t\tvar innerHtml;\n\t\t\t\t\t\tvar classes;\n\t\t\t\t\t\tvar button; // the element\n\n\t\t\t\t\t\tif (buttonName == 'title') {\n\t\t\t\t\t\t\tgroupChildren = groupChildren.add($('<h2>&nbsp;</h2>')); // we always want it to take up height\n\t\t\t\t\t\t\tisOnlyButtons = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif ((customButtonProps = (options.customButtons || {})[buttonName])) {\n\t\t\t\t\t\t\t\tbuttonClick = function(ev) {\n\t\t\t\t\t\t\t\t\tif (customButtonProps.click) {\n\t\t\t\t\t\t\t\t\t\tcustomButtonProps.click.call(button[0], ev);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\toverrideText = ''; // icons will override text\n\t\t\t\t\t\t\t\tdefaultText = customButtonProps.text;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ((viewSpec = calendar.getViewSpec(buttonName))) {\n\t\t\t\t\t\t\t\tbuttonClick = function() {\n\t\t\t\t\t\t\t\t\tcalendar.changeView(buttonName);\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\tviewsWithButtons.push(buttonName);\n\t\t\t\t\t\t\t\toverrideText = viewSpec.buttonTextOverride;\n\t\t\t\t\t\t\t\tdefaultText = viewSpec.buttonTextDefault;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if (calendar[buttonName]) { // a calendar method\n\t\t\t\t\t\t\t\tbuttonClick = function() {\n\t\t\t\t\t\t\t\t\tcalendar[buttonName]();\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\toverrideText = (calendar.overrides.buttonText || {})[buttonName];\n\t\t\t\t\t\t\t\tdefaultText = options.buttonText[buttonName]; // everything else is considered default\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (buttonClick) {\n\n\t\t\t\t\t\t\t\tthemeIcon =\n\t\t\t\t\t\t\t\t\tcustomButtonProps ?\n\t\t\t\t\t\t\t\t\t\tcustomButtonProps.themeIcon :\n\t\t\t\t\t\t\t\t\t\toptions.themeButtonIcons[buttonName];\n\n\t\t\t\t\t\t\t\tnormalIcon =\n\t\t\t\t\t\t\t\t\tcustomButtonProps ?\n\t\t\t\t\t\t\t\t\t\tcustomButtonProps.icon :\n\t\t\t\t\t\t\t\t\t\toptions.buttonIcons[buttonName];\n\n\t\t\t\t\t\t\t\tif (overrideText) {\n\t\t\t\t\t\t\t\t\tinnerHtml = htmlEscape(overrideText);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (themeIcon && options.theme) {\n\t\t\t\t\t\t\t\t\tinnerHtml = \"<span class='ui-icon ui-icon-\" + themeIcon + \"'></span>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse if (normalIcon && !options.theme) {\n\t\t\t\t\t\t\t\t\tinnerHtml = \"<span class='fc-icon fc-icon-\" + normalIcon + \"'></span>\";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tinnerHtml = htmlEscape(defaultText);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tclasses = [\n\t\t\t\t\t\t\t\t\t'fc-' + buttonName + '-button',\n\t\t\t\t\t\t\t\t\ttm + '-button',\n\t\t\t\t\t\t\t\t\ttm + '-state-default'\n\t\t\t\t\t\t\t\t];\n\n\t\t\t\t\t\t\t\tbutton = $( // type=\"button\" so that it doesn't submit a form\n\t\t\t\t\t\t\t\t\t'<button type=\"button\" class=\"' + classes.join(' ') + '\">' +\n\t\t\t\t\t\t\t\t\t\tinnerHtml +\n\t\t\t\t\t\t\t\t\t'</button>'\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t\t.click(function(ev) {\n\t\t\t\t\t\t\t\t\t\t// don't process clicks for disabled buttons\n\t\t\t\t\t\t\t\t\t\tif (!button.hasClass(tm + '-state-disabled')) {\n\n\t\t\t\t\t\t\t\t\t\t\tbuttonClick(ev);\n\n\t\t\t\t\t\t\t\t\t\t\t// after the click action, if the button becomes the \"active\" tab, or disabled,\n\t\t\t\t\t\t\t\t\t\t\t// it should never have a hover class, so remove it now.\n\t\t\t\t\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\t\t\t\t\tbutton.hasClass(tm + '-state-active') ||\n\t\t\t\t\t\t\t\t\t\t\t\tbutton.hasClass(tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\t\t\t\t\tbutton.removeClass(tm + '-state-hover');\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.mousedown(function() {\n\t\t\t\t\t\t\t\t\t\t// the *down* effect (mouse pressed in).\n\t\t\t\t\t\t\t\t\t\t// only on buttons that are not the \"active\" tab, or disabled\n\t\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-active')\n\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t\t.addClass(tm + '-state-down');\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.mouseup(function() {\n\t\t\t\t\t\t\t\t\t\t// undo the *down* effect\n\t\t\t\t\t\t\t\t\t\tbutton.removeClass(tm + '-state-down');\n\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t.hover(\n\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\t// the *hover* effect.\n\t\t\t\t\t\t\t\t\t\t\t// only on buttons that are not the \"active\" tab, or disabled\n\t\t\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-active')\n\t\t\t\t\t\t\t\t\t\t\t\t.not('.' + tm + '-state-disabled')\n\t\t\t\t\t\t\t\t\t\t\t\t.addClass(tm + '-state-hover');\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\tfunction() {\n\t\t\t\t\t\t\t\t\t\t\t// undo the *hover* effect\n\t\t\t\t\t\t\t\t\t\t\tbutton\n\t\t\t\t\t\t\t\t\t\t\t\t.removeClass(tm + '-state-hover')\n\t\t\t\t\t\t\t\t\t\t\t\t.removeClass(tm + '-state-down'); // if mouseleave happens before mouseup\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\t\tgroupChildren = groupChildren.add(button);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n\t\t\t\t\tif (isOnlyButtons) {\n\t\t\t\t\t\tgroupChildren\n\t\t\t\t\t\t\t.first().addClass(tm + '-corner-left').end()\n\t\t\t\t\t\t\t.last().addClass(tm + '-corner-right').end();\n\t\t\t\t\t}\n\n\t\t\t\t\tif (groupChildren.length > 1) {\n\t\t\t\t\t\tgroupEl = $('<div/>');\n\t\t\t\t\t\tif (isOnlyButtons) {\n\t\t\t\t\t\t\tgroupEl.addClass('fc-button-group');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tgroupEl.append(groupChildren);\n\t\t\t\t\t\tsectionEl.append(groupEl);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tsectionEl.append(groupChildren); // 1 or 0 children\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\treturn sectionEl;\n\t\t}\n\t\t\n\t\t\n\t\tfunction updateTitle(text) {\n\t\t\tif (el) {\n\t\t\t\tel.find('h2').text(text);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction activateButton(buttonName) {\n\t\t\tif (el) {\n\t\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t\t.addClass(tm + '-state-active');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction deactivateButton(buttonName) {\n\t\t\tif (el) {\n\t\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t\t.removeClass(tm + '-state-active');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction disableButton(buttonName) {\n\t\t\tif (el) {\n\t\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t\t.prop('disabled', true)\n\t\t\t\t\t.addClass(tm + '-state-disabled');\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tfunction enableButton(buttonName) {\n\t\t\tif (el) {\n\t\t\t\tel.find('.fc-' + buttonName + '-button')\n\t\t\t\t\t.prop('disabled', false)\n\t\t\t\t\t.removeClass(tm + '-state-disabled');\n\t\t\t}\n\t\t}\n\n\n\t\tfunction getViewsWithButtons() {\n\t\t\treturn viewsWithButtons;\n\t\t}\n\n\t}", "function showMonthHeader() {\n return true;\n var vS = viewStart;\n var vE = viewEnd;\n var mS = vS.getMonth();\n var mE = vE.getMonth();\n var headerDiv = monthHeaderNode;\n var str = '';\n\n // Format like 'March-April, 2006'\n if (mS < mE) {\n str += dojox.date.posix.strftime(vS, '%B-');\n str += dojox.date.posix.strftime(vE, '%B %Y');\n }\n // Format like 'December 2006-January 2007'\n else if (mS > mE) {\n str += dojox.date.posix.strftime(vS, '%B %Y-');\n str += dojox.date.posix.strftime(vE, '%B %Y');\n }\n // Format like 'April 2-8, 2006'\n else {\n str += dojox.date.posix.strftime(vS, '%B %Y');\n }\n if (headerDiv.firstChild) {\n headerDiv.removeChild(headerDiv.firstChild);\n }\n headerDiv.appendChild(document.createTextNode(str));\n }", "function createTableHeader() {\n var talks = \"<tr><th></th>\";\n var contests = \"<tr><th></th>\";\n\tvar teams = \"<tr><th></th>\";\n\n for (var key in rooms) {\n if (roomType(rooms[key]) == \"contests\") {\n contests += \"<th>\" + rooms[key].name;\n if(rooms[key].link != undefined && rooms[key].link != \"\"){\n contests += \"<br><a href='\" + rooms[key].link + \"' target='_blank'>Join the stream</a>\";\n }\n\n contests += \"</th>\";\n } else {\n\t\tif(roomType(rooms[key]) == \"teams\"){\n \t\tteams += \"<th>\" + rooms[key].name;\n if(rooms[key].link != undefined && rooms[key].link != \"\"){\n teams += \"<br><a href='\" + rooms[key].link + \"' target='_blank'>Join the stream</a>\";\n }\n teams += \"</th>\";\n\t\t} else {\n\t\t talks += \"<th>\" + rooms[key].name;\n if(rooms[key].link != undefined && rooms[key].link != \"\"){\n talks += \"<br><a href='\" + rooms[key].link + \"' target='_blank'>Join the stream</a>\";\n }\n talks += \"</th>\";\n\t\t}\n }\n }\n\n $(\"#talks\").find(\"table.day > thead\").append(talks);\n\n $(\"#contests\").find(\"table.day > thead\").append(contests);\n\n\t$(\"#teams\").find(\"table.day > thead\").append(teams);\n\n }" ]
[ "0.584325", "0.5758501", "0.56495047", "0.5590754", "0.55593395", "0.55400544", "0.5511161", "0.5413188", "0.541224", "0.5384257", "0.5368736", "0.5340161", "0.53301626", "0.52918506", "0.5262265", "0.5225106", "0.5218821", "0.52079785", "0.52040243", "0.5198885", "0.51890826", "0.5175131", "0.5174569", "0.51415336", "0.5139817", "0.51185477", "0.5117473", "0.5116501", "0.5098684", "0.505845", "0.5056831", "0.5052219", "0.505182", "0.5038643", "0.50380003", "0.50363415", "0.50353855", "0.50298005", "0.50046724", "0.49993527", "0.4993974", "0.49785933", "0.49780595", "0.49663186", "0.49660662", "0.49594867", "0.4952275", "0.4946771", "0.49440387", "0.4939772", "0.4939556", "0.49390948", "0.4938981", "0.49371454", "0.49364805", "0.49357823", "0.4930854", "0.49244717", "0.4924173", "0.49123338", "0.49034062", "0.49012867", "0.48972714", "0.48815718", "0.4877599", "0.48761448", "0.487541", "0.48752388", "0.48752388", "0.48728898", "0.4850863", "0.48311317", "0.48311317", "0.48311317", "0.48311317", "0.48311317", "0.48311317", "0.4830553", "0.48275462", "0.48169374", "0.48096234", "0.48086962", "0.48082608", "0.4807194", "0.48062852", "0.47773886", "0.47743416", "0.4767129", "0.47632244", "0.47617093", "0.4761158", "0.47555873", "0.47545746", "0.47512922", "0.475037", "0.4748005", "0.47446212", "0.47429776", "0.47398293", "0.47339183" ]
0.6235454
0
Passes the proper actions to ListControls depending on which tab is currently filtering the alerts list
function getActions() { const actions = [] if (filter !== 'closed' && filter !== 'acknowledged') { actions.push({ icon: <AcknowledgeIcon />, label: 'Acknowledge', onClick: makeUpdateAlerts('StatusAcknowledged'), }) } if (filter !== 'closed') { actions.push( { icon: <CloseIcon />, label: 'Close', onClick: makeUpdateAlerts('StatusClosed'), }, { icon: <EscalateIcon />, label: 'Escalate', onClick: makeUpdateAlerts('StatusUnacknowledged'), }, ) } return actions }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onListBoxAction (data) {\n if (data.index < 0) return;\n\n switch (data.action) {\n case 'navigate':\n if (debug) console.log(`navigate: ${data.index}`);\n updateButton(false);\n break;\n case 'activate':\n if (debug) console.log(`activate: ${data.index}`)\n sendButtonActivationMessage({\n id: 'find',\n index: data.index\n });\n break;\n }\n}", "function tabChangeEvent(tabpanel, tab) { \r\n\ttab.doLayout();\r\n\ttab.syncSize();\r\n\t// WS-1805: find the add contacts tab and hide the result list\r\n\tvar tabTitle = getLocalizationValue('application.javascript.contactList.searchTabTitle');\r\n\tvar searchTab = findTab(tabTitle);\r\n\tif (searchTab != null) {\r\n\t\tsearchTab.getComponent(0).collapse();\r\n\t}\r\n\t\r\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 }", "listAction() {}", "function setMenuEvents($list, dp_table) {\n\n // Hide a row\n $list.on('click', 'a[href=hide]', function (e) {\n e.preventDefault();\n var selected = getSelectedRows(dp_table);\n selected.forEach(function (row) {\n row.$row.addClass(\"hiddenrow\");\n })\n if (selected.length > 0) {\n $(this).closest('.header').find('.alert').text('There are ' + selected.length + ' hidden rows!');\n }\n });\n\n // Unhide all hidden rows\n $list.on('click', 'a[href=unhide]', function (e) {\n e.preventDefault();\n dp_table.rows.forEach(function (row) {\n row.$row.removeClass(\"hiddenrow\");\n });\n $(this).closest('.header').find('.alert').empty();\n });\n\n // Delete a row.\n // Sends a request to delete flows and hides the rows until table is refreshed.\n // The drawback is that the entry will be hiddeneven if delete is not successful.\n $list.on('click', 'a[href=delete]', function (e) {\n e.preventDefault();\n var selected = getSelectedRows(dp_table);\n var flows = [];\n selected.forEach(function (row) {\n flows.push(row.dataitem)\n });\n if (flows.length > 0) {\n $.post(\"/flowdel\", JSON.stringify(flows))\n .done(function (response) {\n displayMessage(response);\n selected.forEach(function (row) {\n row.$row.addClass(\"hiddenrow\"); //temp\n })\n })\n .fail(function () {\n var msg = \"No response from controller.\";\n displayMessage(msg);\n })\n }\n });\n\n // Sends a request to monitor flows.\n $list.on('click', 'a[href=monitor]', function (e) {\n e.preventDefault();\n var selected = getSelectedRows(dp_table);\n var flows = [];\n selected.forEach(function (row) {\n flows.push(row.dataitem)\n });\n if (flows.length > 0) {\n $.post(\"/flowmonitor\", JSON.stringify(flows))\n .done(function (response) {\n displayMessage(response);\n selected.forEach(function (row) {\n row.$row.addClass(\"monitorrow\"); //temp\n })\n })\n .fail(function () {\n var msg = \"No response from controller.\";\n displayMessage(msg);\n })\n }\n });\n\n // Saves the row to session storage\n $list.on('click', 'a[href=edit]', function (e) {\n e.preventDefault();\n var selected = getSelectedRows(dp_table);\n if (selected.length > 0) {\n sessionStorage.setItem(category, JSON.stringify(selected[0].dataitem));\n var msg = \"Table entry copied to session storage.\";\n displayMessage(msg);\n }\n });\n\n $list.on('click', 'a', function (e) {\n e.preventDefault();\n var selected = getSelectedRows(dp_table);\n });\n }", "function listaAlertas(){\n\tvar lista = Widget.createController('listaAlertas').getView();\n\tlista.open();\n}", "function filterList(trigger) {\n trigger.each(function () {\n var self = $(this),\n target = self.data('filter-list'),\n search = self.find('input[type=text]'),\n filters = self.find('input[type=radio]'),\n list = $(target).find('.list-group-item');\n\n // Search\n search.keyup(function () {\n var searchQuery = search.val();\n list.each(function () {\n var text = $(this).text().toLowerCase();\n (text.indexOf(searchQuery.toLowerCase()) == 0) ? $(this).show() : $(this).hide();\n });\n });\n\n // Filters\n filters.on('click', function (e) {\n var targetItem = $(this).val();\n if (targetItem !== 'all') {\n list.hide();\n $('[data-filter-item=' + targetItem + ']').show();\n } else {\n list.show();\n }\n\n });\n });\n }", "showListDialog() {\n if (this.listDialogModule && !this.isReadOnlyMode && this.viewer) {\n this.listDialogModule.showListDialog();\n }\n }", "function buttonFilterEvent(type) {\n \n var filter, ul, li, i, txtValue, txtValue1, txtValue2;\n filter = type.toUpperCase();\n input = document.getElementById(\"filterInputName\");\n input.value = '';\n ul = document.getElementsByClassName(\"eventListTable\");\n li = ul[0].getElementsByTagName(\"li\");\n\n for (i = 0; i < li.length; i++) {\n \n p = li[i].getElementsByTagName(\"p\")[1];\n p2 = li[i].getElementsByTagName(\"p\")[2];\n \n txtValue = p.textContent.split(':')[1];\n txtValue2 = p2.textContent.split(':')[1];\n txtValue1 = txtValue.split('-')[0];\n txtValue2 = txtValue2.split('-')[0];\n\n if (txtValue1.toUpperCase().indexOf(filter) > -1 || txtValue2.toUpperCase().indexOf(filter) > -1) {\n li[i].style.display = \"\";\n } else {\n li[i].style.display = \"none\";\n }\n if (filter==\"ALL\"){\n li[i].style.display = \"\";\n }\n }\n}", "function commonFilter(e) {\r\n let filter = e.value.toUpperCase();\r\n\r\n for (let i = 0; i < li.length; i++) {\r\n if (e.name === \"footer_filter\") { // Footer filter by status\r\n if (filter === \"COMPLETED\" && !data[i].done) {\r\n li[i].style.display = \"none\";\r\n } else if (filter === \"ACTIVE\" && data[i].done) {\r\n li[i].style.display = \"none\";\r\n } else {\r\n li[i].style.display = \"\";\r\n }\r\n } else if (e.name === \"category_dropdown\") { // Category/type Dropdown filter\r\n let taskCategoryName = li[i].getElementsByClassName(\"task-category\")[0];\r\n let taskNameValue = taskCategoryName.textContent || taskCategoryName.innerText;\r\n if (taskNameValue.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n }\r\n } else { // Search textbox filter\r\n let taskNameTag = li[i].getElementsByTagName(\"h3\")[0];\r\n let txtValue = taskNameTag.textContent || taskNameTag.innerText;\r\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\r\n li[i].style.display = \"\";\r\n } else {\r\n li[i].style.display = \"none\";\r\n }\r\n }\r\n }\r\n}", "function updateAlertsList(){\n $( \"#traffic_alerts_list\" ).html(\"\");\n $.each(traffic.alerts, function( index, item ) {\n if ($.inArray(item.type, alertsType) < 0) {\n alertsType.push(item.type); \n }\n if (item.type == 'WEATHERHAZARD'){\n if ($.inArray(item.subtype, WEATHERHAZARD_SubType) < 0) {\n WEATHERHAZARD_SubType.push(item.subtype); \n } \n }\n });\n\n $.each(alertsType, function( index, item ) { \n if (item == 'WEATHERHAZARD'){\n $( \"#traffic_alerts_list\" ).append( \"<li data-to-show='\"+ item +\"'><a>\" + item + \"</a><ul id='traffic_alerts_weatherhazard_list' class='nav child_menu' style='display:block'></ul></li>\" );\n }else{\n $( \"#traffic_alerts_list\" ).append( \"<li data-to-show='\"+ item +\"'><a>\" + item + \"</a></li>\" );\n }\n });\n $('#traffic_alerts_list li').on( 'click', function () {\n specific_alert = $(this).attr('data-to-show');\n $('#title').html('Traffic Alerts <small>' + specific_alert + '</small>'); \n subtype_alert = \"NO_SUBTYPE\";\n showAlerts(true);\n updateMap();\n });\n\n $.each(WEATHERHAZARD_SubType, function( index, item ) {\n if (item.indexOf(\"HAZARD_ON_ROAD_\") < 0 && item.indexOf(\"HAZARD_ON_SHOULDER_\") < 0 && item.indexOf(\"HAZARD_WEATHER_\") < 0){\n if (item.trim() == \"\"){\n $( \"#traffic_alerts_weatherhazard_list\" ).append( \"<li data-to-show='\"+ item +\"'><a>NO_SUBTYPE</a></li>\" );\n }else{\n $( \"#traffic_alerts_weatherhazard_list\" ).append( \"<li data-to-show='\"+ item +\"'><a>\" + item.substring(0, 20) + \"</a></li>\" );\n }\n \n }else{\n if (item.indexOf(\"HAZARD_ON_ROAD_\") >= 0){\n var pos = \"HAZARD_ON_ROAD_\".length;\n var li_text = item.substring(pos,item.length);\n $( \"#traffic_alerts_weatherhazard_list\" ).append( \"<li data-to-show='\"+ item +\"'><a>\" + li_text + \"</a></li>\" );\n }\n if (item.indexOf(\"HAZARD_ON_SHOULDER_\") >= 0){\n var pos = \"HAZARD_ON_SHOULDER_\".length;\n var li_text = item.substring(pos,item.length);\n $( \"#traffic_alerts_weatherhazard_list\" ).append( \"<li data-to-show='\"+ item +\"'><a>\" + li_text + \"</a></li>\" );\n }\n if (item.indexOf(\"HAZARD_WEATHER_\") >= 0){\n var pos = \"HAZARD_WEATHER_\".length;\n var li_text = item.substring(pos,item.length);\n $( \"#traffic_alerts_weatherhazard_list\" ).append( \"<li data-to-show='\"+ item +\"'><a>\" + li_text + \"</a></li>\" );\n }\n }\n \n });\n\n $('#traffic_alerts_weatherhazard_list li').on( 'click', function () {\n specific_alert = \"WEATHERHAZARD\";\n subtype_alert = $(this).attr('data-to-show');\n $('#title').html('Traffic Alerts <small>' + subtype_alert +'</small>');\n showAlerts(true);\n updateMap();\n });\n \n }", "function InvAccFilter(listItems, filterOn, newFBFilterOn) {\n if(filterOn) {\n for(var i = 0; i < listItems.length; i++) {\n if(listItems[i].getAttribute('data-invAccepted') == 'false')\n ElemDyns.HideUnregOne(listItems[i]);\n }\n }\n else {\n for(var i = 0; i < listItems.length; i++) {\n if(listItems[i].getAttribute('data-invAccepted') == 'false')\n ElemDyns.ShowUnregOne(listItems[i]);\n }\n }\n }", "function onFiltersChanged()\r\n{\r\n\tchrome.tabs.query(\r\n\t\t{\r\n\t\t\tactive: true,\r\n\t\t\tcurrentWindow: true\r\n\t\t},\r\n\t\tfunction(tabs)\r\n\t\t{\r\n\t\t\tchrome.tabs.sendMessage(\r\n\t\t\t\ttabs[0].id,\r\n\t\t\t\t{\r\n\t\t\t\t\tcommand: \"caman-filters-changed\",\r\n\t\t\t\t\tfilters: caman_filters\r\n\t\t\t\t},\r\n\t\t\t\tfunction(response)\r\n\t\t\t\t{\r\n \t\t\t\t// Don't really care about responses\r\n \t\t\t\t});\r\n\t\t});\r\n}", "function inviteOthers() {\n //specify inviteContacts as tab so it will customize button\n showTab(\"inviteContacts\");\n}", "function selectProductListInteraction() {\n\n var TriggeredAction = request.triggeredFormAction;\n if (TriggeredAction !== null) {\n if (TriggeredAction.formId === 'select') {\n\n\n //var ProductList = TriggeredAction.object;\n\n // where to continue now?\n return;\n }\n }\n\n\n}", "function editor_tools_handle_list()\n{\n // Create the list picker on first access.\n if (!editor_tools_list_picker_obj)\n {\n // Create a new popup.\n var popup = editor_tools_construct_popup('editor-tools-list-picker', 'l');\n editor_tools_list_picker_obj = popup[0];\n var content_obj = popup[1];\n\n // Populate the new popup.\n var wrapper = document.createElement('div');\n wrapper.style.marginLeft = '1em';\n for (var i = 0; i < editor_tools_list_picker_types.length; i++)\n {\n var type = editor_tools_list_picker_types[i];\n\n var list;\n if (type == 'b') {\n list = document.createElement('ul');\n } else {\n list = document.createElement('ol');\n list.type = type;\n }\n list.style.padding = 0;\n list.style.margin = 0;\n var item = document.createElement('li');\n\n var a_obj = document.createElement('a');\n a_obj.href = 'javascript:editor_tools_handle_list_select(\"' + type + '\")';\n a_obj.innerHTML = editor_tools_translate('list type ' + type);\n\n item.appendChild(a_obj);\n list.appendChild(item);\n wrapper.appendChild(list);\n }\n content_obj.appendChild(wrapper);\n\n // Register the popup with the editor tools.\n editor_tools_register_popup_object(editor_tools_list_picker_obj);\n }\n\n // Display the popup.\n var button_obj = document.getElementById('editor-tools-img-list');\n editor_tools_toggle_popup(editor_tools_list_picker_obj, button_obj);\n}", "function onListchange ( event ) {\n alert(\"list changed!\");\n }", "function listSelector(event) {\n // highlight selected cat's name in dropdown list\n highlightList(event);\n // set selected cat's name in header\n setName(event);\n // hide drop-down list after selection\n hideList();\n}", "function filterList(listId) {\r\n\r\n window.location.href = (\"index.php?filterList=\" + listId + \"&openList=\" + listId);\r\n}", "function applyMylistState() {\r\n\tvar actionRow = getElementsByClassName(document.getElementsByTagName('tr'), 'mylistaction', true)[0];\r\n\tif (!actionRow) return;\r\n\t// now find everthing i want to act upon\r\n\t// first get data in the fieldset\r\n\tvar fieldset = actionRow.getElementsByTagName('fieldset')[0];\r\n\t//if (!fieldset) return;\r\n\tvar href = fieldset.form.action;\r\n\tvar inputs = fieldset.getElementsByTagName('input');\r\n\tif (inputs.length) href += '?';\r\n\tfor (var i = 0; i < inputs.length; i++)\r\n\t\thref += inputs[i].name + '=' + inputs[i].value + \"&\";\r\n\t// now get the select value\r\n\tvar selectType = getElementsByName(actionRow.getElementsByTagName('select'), 'myamod.type', false)[0];\r\n\tif (!selectType) return;\r\n\thref += selectType.name + '=' + selectType.value + '&';\r\n\thref += 'myamod.doit=1'; // forgot this\r\n\t// yei, i have the full action defined\r\n\tpostData(href);\r\n\tvar userReply = window.confirm('Submited mylist action change.\\nPlease note that you need to reload this page to see the changes.\\nDo you wish to reload now?');\r\n\tif (userReply) window.location = window.location;\r\n}", "function searchByCriteria() {\n \n $.mobile.changePage(\"#cont_list_page\", { transition : \"pop\" });\n if (typeof Contact !== \"undefined\") {\n var searchCriteria = getElement(\"searchby_chooser_input\").options[getElement(\"searchby_chooser_input\").selectedIndex].value;\n var searchVal = getElement(\"search_val_input\").value;\n getElement(\"search_val_input\").value = \"\";\n \n var addF = [];\n addF.push(searchCriteria);\n displContactList.updateList(searchVal, searchCriteria, addF);\n \n var div = getElement(\"full_list_button_container\");\n if (div) {\n div.innerHTML = '<a href=\"#\" id=\"full_list_button\" data-role=\"button\" data-mini=\"true\" class=\"ui-btn-left\" data-theme=\"c\" >Show full list</a>';\n $(\"#full_list_button\").bind(\"click\", function() { displContactList.updateList(); div.innerHTML = \"\"; });\n $(\"#full_list_button\").button();\n }\n }\n}", "function afterAlertsLoad() {\n if (sessionStorage.getItem(\"search_all_selected_obj\") !== null) {\n var obj,\n index;\n obj = JSON.parse(sessionStorage.getItem(\"search_all_selected_obj\"));\n index = TableUtil.getTableIndexById('#tblAlerts', obj.Id);\n $(\"#tblAlerts\").bootstrapTable(\"check\", index);\n showEditDialog();\n sessionStorage.removeItem(\"search_all_selected_obj\");\n }\n }", "function activateValidationCaseSetControllerButtonsEvent(){\r\n $(\"#rdr-ka-validate-case-list-controller-button-except\").click(function(){\r\n //go to tab 4\r\n changeTab(\"rdr-tab-3\");\r\n });\r\n \r\n $(\"#rdr-ka-validate-case-list-controller-button-accept\").click(function(){\r\n //remove selected case\r\n var newArray = new Array();\r\n for(var i=0; i<validationCaseSet.length; i++){\r\n if(i !== validatingCaseIndex){\r\n newArray.push(validationCaseSet[i]);\r\n }\r\n }\r\n \r\n if(newArray.length === 0){\r\n var r = confirm(\"모든 사례들을 수락하셨습니다. 새로운 지식을 생성하시겠습니까? \");\r\n if (r == true) {\r\n //add rule\r\n addRuleAjax();\r\n } else {\r\n\r\n }\r\n } else {\r\n validationCaseSet = newArray;\r\n\r\n var attributeText = $(\"#rdr-ka-validate-case-list-search-input\").val();\r\n drawValidationCaseSetTable(validationCaseSet, attributeText);\r\n\r\n //select the case on top of the list\r\n $(\"#rdr-ka-validate-case-list-table\").find(\"tr:first\").next().addClass(\"tr-selected\");\r\n var cornerstoneCaseId =$(\"#rdr-ka-validate-case-list-table\").find(\"tr:first\").next().find(\"td\").first().text();\r\n \r\n getOtherConclusionsAjax(cornerstoneCaseId);\r\n validatingCaseIndex = 0;\r\n }\r\n });\r\n \r\n $(\"#rdr-ka-validate-case-list-controller-button-accept-all\").click(function(){\r\n var r = confirm(\"모든 사례들을 수락하시고 새로운 지식을 생성하시겠습니까? \");\r\n if (r == true) {\r\n //add rule\r\n addRuleAjax();\r\n } else {\r\n \r\n }\r\n });\r\n}", "function displaySelectedCPCompTab(){\n var url = parent.location.href;\n s=url.indexOf(\"summary\");\n if (s!=-1){\n obj= document.getElementById('summary-li');\n if(obj){\n document.getElementById('summary').style.display=\"\";\n }\n }\n if (url.indexOf(\"basiccontrol\")!=-1){\n obj= document.getElementById('basiccontrol-li');\n if(obj){\n document.getElementById('basiccontrol').style.display=\"\";\n }\n }\n if (url.indexOf(\"auditreadyasmt\")!=-1){\n obj= document.getElementById('auditreadyasmt-li');\n if(obj){\n document.getElementById('auditreadyasmt').style.display=\"\";\n }\n }\n if (url.indexOf(\"riskmsdcommit\")!=-1){\n obj= document.getElementById('riskmsdcommit-li');\n if(obj){\n document.getElementById('riskmsdcommit').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"auditreview\")!=-1){\n obj= document.getElementById('auditreview-li');\n if(obj){\n document.getElementById('auditreview').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"kctest\")!=-1){\n obj= document.getElementById('kctest-li');\n if(obj){\n document.getElementById('kctest').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"opmetric\")!=-1){\n obj= document.getElementById('opmetric-li');\n if(obj){\n document.getElementById('opmetric').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"other\")!=-1){\n obj= document.getElementById('other-li');\n if(obj){\n document.getElementById('other').style.display=\"\";\n }\n }\n}", "function displaySelectedCUPortfolioCompTab(){\n var url = parent.location.href;\n s=url.indexOf(\"summary\");\n if (s!=-1){\n obj= document.getElementById('summary-li');\n if(obj){\n document.getElementById('summary').style.display=\"\";\n }\n }\n if (url.indexOf(\"basiccontrol\")!=-1){\n obj= document.getElementById('basiccontrol-li');\n if(obj){\n document.getElementById('basiccontrol').style.display=\"\";\n }\n }\n if (url.indexOf(\"auditreadyasmt\")!=-1){\n obj= document.getElementById('auditreadyasmt-li');\n if(obj){\n document.getElementById('auditreadyasmt').style.display=\"\";\n }\n }\n if (url.indexOf(\"riskmsdcommit\")!=-1){\n obj= document.getElementById('riskmsdcommit-li');\n if(obj){\n document.getElementById('riskmsdcommit').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"auditreview\")!=-1){\n obj= document.getElementById('auditreview-li');\n if(obj){\n document.getElementById('auditreview').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"kctest\")!=-1){\n obj= document.getElementById('kctest-li');\n if(obj){\n document.getElementById('kctest').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"opmetric\")!=-1){\n obj= document.getElementById('opmetric-li');\n if(obj){\n document.getElementById('opmetric').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"accountrating\")!=-1){\n obj= document.getElementById('accountrating-li');\n if(obj){\n document.getElementById('accountrating').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"other\")!=-1){\n obj= document.getElementById('other-li');\n if(obj){\n document.getElementById('other').style.display=\"\";\n }\n }\n}", "openOnwerFilter(){\n\n var selected = this.template.querySelector(\".selected-owner\");\n var optionsContainer = this.template.querySelector(\".options-container-owner\");\n var optionsList =this.template.querySelectorAll(\".option-owner\");\n selected.addEventListener(\"click\", () => {\n optionsContainer.classList.toggle(\"active\");\n }); \n //selected.addEventListener(\"click\", () => {\n //});\n\n /* optionsList.forEach(o => {\n o.addEventListener(\"click\", () => {\n selected.innerHTML = o.querySelector(\"label\").innerHTML;\n optionsContainer.classList.remove(\"active\");\n });\n });\n */\n }", "function showList() {\n \n if (!!tabLista.length) {\n getLastTaskId();\n for (var item in tabLista) {\n var task = tabLista[item];\n //addTaskToList(task);\n }\n syncEvents();\n }\n \n }", "ChangeSearchInput(event) {\n \n \n this.listOpened = true;\n this.comboClass = 'slds-combobox slds-dropdown-trigger slds-dropdown-trigger_click slds-is-open'; \n\n\n this.searchInput = event.target.value.toLowerCase();\n \n this.displayList = []; //initialize the array before assigning values coming from apex\n \n //filter the global list and repolulating the display options\n let filterList = this.allList.filter(\n item => item.value.toLowerCase().includes(this.searchInput.trim()) == true\n );\n \n filterList.map(allListElement => {\n this.displayList = [\n ...this.displayList,\n {\n label: allListElement.label,\n value: allListElement.value,\n selected: this.selectedList.find(element => element.value == allListElement.value) != null\n }\n ];\n\n \n });\n }", "function initialiseModalWidgetsApplications(list1,list2) {\n $(list1+', '+list2).sortable({\n connectWith: \".connectedSortable\",\n items: \"li:not(.title)\",\n cancel: \".title\",\n change: function (event, ui) {\n //var currPos2 = ui.item.index();\n },\n update: function(event, ui) {\n $(\".box-applications select\").change();\n // update input of if item to set new position\n $(list2).find('li').each( function(e) {\n var input= $(this).find('input');\n if (input){\n input.attr('value',$(this).index() + 1);\n }\n })\n }\n }).disableSelection();\n /* filtrage de la liste en fonction du persona en edition */\n $(\".box-applications select\").change(function() {\n var applicationPersona = \"\";\n $(this).find(\"option:selected\" ).each(function() {\n applicationPersona += $(this).val();\n /* filtrage */\n $(this).parents('.box-applications').find('li').each(function (index) {\n var itemPersona = $(this).attr('data-persona');\n if ((itemPersona.indexOf(applicationPersona) > -1)||(applicationPersona==\"all\")){\n $(this).show();\n }\n else { \n $(this).hide();\n }\n })\n });\n });\n }", "function initElementGroupFilter(){\n\t$('ul.elementGroupFilter').each(function() { //get the ul elements having elementGroupFilter class(filtering tabs)\n\t\t\n\t\t// For each set of tabs, we want to keep track of which tab is active and it's associated content\n\t\tvar active, links = $(this).find('a');\n\n\t\t// If the location.hash matches one of the links, use that as the active tab.\n\t\t// If no match is found, use the first link as the initial active tab.\n\t\tactive = $(links.filter('[href=\"' + location.hash + '\"]')[0]|| links[0]);\n\t\tactive.parent().addClass('NSelect');\t\t\n\n\t\t// Bind the click event handler\n\t\t$(this).on('click', 'a', function(e) {\n\t\t\t// Make the old tab inactive.\n\t\t\tactive.parent().removeClass('NSelect');\n\n\t\t\t// Update the variables with the new link and content\n\t\t\tactive = $(this);\t\t\t\n\n\t\t\t// Make the tab active.\n\t\t\tactive.parent().addClass('NSelect');\n\t\t\t// $content.show();\n\n\t\t\t// Prevent the anchor's default click action\n\t\t\te.preventDefault();\n\n\t\t\tdoElementGroupFiltering($(this).attr('id'));\n\t\t});\n\t\tactive.click();\n\t});\n}", "function listenToEvents() {\n // only one tab list is allowed per page\n $('.tab-list').on('click', '.tab-control', function () {\n //var tab_id = $(this).attr('data-tab');\n var tab_id = $(this).data('tab');\n\n $('.tab-control').removeClass('active');\n $('.tab-panel').removeClass('active');\n\n $(this).addClass('active');\n $(\"#\" + tab_id).addClass('active');\n\n // Save active tab per category\n saveInSession('activetab', '', tab_id);\n })\n }", "onTabChange(evt) {\n const win = evt.target.ownerGlobal;\n const currentURI = win.gBrowser.currentURI;\n // Don't show the page action if page is not http or https\n if (currentURI.scheme !== \"http\" && currentURI.scheme !== \"https\") {\n this.hidePageAction(win.document);\n return;\n }\n\n const currentWin = Services.wm.getMostRecentWindow(\"navigator:browser\");\n\n // If user changes tabs but stays within current window we want to update\n // the status of the pageAction, then reshow it if the new page has had any\n // resources blocked.\n if (win === currentWin) {\n this.hidePageAction(win.document);\n // depending on the treatment branch, we want the count of timeSaved\n // (\"fast\") or blockedResources (\"private\")\n const counter = this.treatment === \"private\" ?\n this.state.blockedResources.get(win.gBrowser.selectedBrowser) :\n this.state.timeSaved.get(win.gBrowser.selectedBrowser);\n if (counter) {\n this.showPageAction(win.document, counter);\n this.setPageActionCounter(win.document, counter);\n }\n }\n }", "function addListenerShowMyLists() {\n\t\t$(\"#myLists\").on('click', '.myList-main', function() {\n\t\t\tcurrentMyList = $(this).closest(\".myLists-item\").data(\"list\");\n\t\t\tshowCurrentListItems();\n\t\t\t$(\".myList-main\").removeClass(\"highlight\");\n\t\t\t$(this).addClass(\"highlight\");\n\t\t\tupdateListItemTitle();\n\t\t\tresetNewItemForm();\n\t\t\ttoggleListItemTitleButton();\n\t\t});\n\t}", "function initFirstFilter(){\n var firstFilterWrap = getComponent('first-filter');\n var filterArrays = firstFilterWrap.getElementsByTagName('li');\n\n [].forEach.call(filterArrays,function (item) {\n item.addEventListener('click',selected)\n })\n\n function selected(e){\n if(this.firstElementChild.classList.contains('selected')){\n return;\n }\n removeSelected();\n console.log(e);\n this.firstElementChild.classList.add('selected');\n if(this.innerText === 'All'){\n window.firstFilterStatus = 0;\n }else if(this.innerText === 'Active'){\n window.firstFilterStatus = 1;\n }else{\n window.firstFilterStatus = 2;\n }\n update();\n }\n\n function removeSelected(){\n [].forEach.call(filterArrays,function (item) {\n if(item.firstElementChild.classList.contains('selected')){\n item.firstElementChild.classList.remove('selected');\n }\n })\n }\n}", "function loadLists() {\r\n\t\tlistItems();\r\n\t\taddCheckButtonEvents();\r\n\t\taddDeleteButtonEvents();\r\n\t}", "updateListShow() {\n }", "_clickHandlerFilterButton(elementClassList, itemId, target) {\n const that = this;\n\n if (target.closest('.jqx-editors-container')) {\n return;\n }\n\n that._closeEditor();\n that._editedItem = that._getItemById(itemId);\n\n if (!elementClassList.contains('jqx-filter-field-name') && (!that._editedItem.data || !that._editedItem.data.length)) {\n return;\n }\n\n if (elementClassList.contains('jqx-filter-group-operation')) {\n prepareContextMenu(target, that._groupOperationDescriptions, that._editedItem.data);\n return;\n }\n else if (elementClassList.contains('jqx-filter-add-btn')) {\n prepareContextMenu(target, that._groupOperationDescriptions);\n }\n else if (elementClassList.contains('jqx-filter-field-name')) {\n if (!that._fields) {\n that._mapFieldsToMenu();\n }\n\n prepareContextMenu(target, that._fields, that._editedItem.data[0]);\n return;\n }\n else if (elementClassList.contains('jqx-filter-operation')) {\n const selectedField = that._getFieldByFieldName(that._editedItem.data[0]);\n\n if (!selectedField) {\n return;\n }\n\n let filteredOptions = that._filterOperationDescriptions.slice();\n\n if (selectedField && selectedField.filterOperations) {\n filteredOptions = that._filterOperationDescriptions.filter(item => {\n return selectedField.filterOperations.indexOf(item.value) > -1;\n });\n }\n else {\n let filterOperationsByType;\n\n switch (selectedField.dataType) {\n case 'number':\n filterOperationsByType = ['=', '<>', '<', '>', '<=', '>=', 'isblank', 'isnotblank'];\n break;\n case 'date':\n filterOperationsByType = ['=', '<>', '<', '>', '<=', '>=', 'isblank', 'isnotblank'];\n break;\n case 'datetime':\n filterOperationsByType = ['=', '<>', '<', '>', '<=', '>=', 'isblank', 'isnotblank'];\n break;\n case 'boolean':\n filterOperationsByType = ['=', '<>', 'isblank', 'isnotblank'];\n break;\n case 'object':\n filterOperationsByType = ['isblank', 'isnotblank'];\n break;\n case 'string':\n filterOperationsByType = ['contains', 'notcontains', 'startswith', 'endswith', '=', '<>', 'isblank', 'isnotblank'];\n break;\n default:\n filterOperationsByType = ['contains', 'notcontains', 'startswith', 'endswith', '=', '<>', '<', '>', '<=', '>=', 'isblank', 'isnotblank'];\n break;\n }\n\n filteredOptions = that._filterOperationDescriptions.filter(item => {\n return filterOperationsByType.indexOf(item.value) > -1;\n });\n }\n\n if (that.showIcons) {\n filteredOptions = filteredOptions.map(item => {\n item.label = '<div class=\"jqx-filter-builder-icon\">' + that.icons[item.value] + '</div><div class=\"jqx-filter-builder-menu-item\">' + that.localize(item.value) + '</div>';\n\n return item;\n });\n }\n\n prepareContextMenu(target, filteredOptions.slice(), that._editedItem.data[1]);\n return;\n }\n else {\n that._openEditor(target);\n return;\n }\n\n function deSelectMenuItem() {\n const alredySelectedItem = that.$.conditionsMenu.querySelector('.jqx-selected-menu-item');\n\n if (alredySelectedItem) {\n alredySelectedItem.classList.remove('jqx-selected-menu-item');\n }\n }\n\n function prepareContextMenu(target, dataSource, selectedItem) {\n deSelectMenuItem();\n that._contextMenuOptions = dataSource.length === 0 ? that._defaultFilterOperationDescriptions : dataSource;\n that._handleContextMenu(target);\n\n const selectedField = selectedItem,\n chosenMenuItem = that.$.conditionsMenu.querySelector('jqx-menu-item[value=\"' + selectedField + '\"]');\n\n if (!that.$.conditionsMenu.opened || !chosenMenuItem) {\n return;\n }\n\n chosenMenuItem.classList.add('jqx-selected-menu-item');\n }\n }", "function performCCListingAction(thisElement)\n{\n\t$(\"#HorizontalTab\"+activeHorizontalTabInfoID).removeClass(\"jsButton-disabled\");\n\t$(thisElement).addClass(\"jsButton-disabled\");\n\n\tvar chosenHorizontalInfoID = $(thisElement).attr(\"data-infoId\");\n\tactiveHorizontalTabInfoID = chosenHorizontalInfoID;\n\tsetActiveHorizontalLine(\"#horizontalActiveLine\",chosenHorizontalInfoID);\n\n\t//update url and send ajax request\n\tvar postParams = \"infoTypeId=\"+chosenHorizontalInfoID;\n\tvar infoArr = {};\n\tinfoArr[\"action\"] = \"stayOnPage\";\n\tclearTimedOutVar = setTimeout(function(){sendProcessCCRequest(postParams,infoArr) },20);\n}", "function openCaseList() {\n displayElement('leftPanel');\n}", "function filterTasks(e){\n console.log(\"Task filter...\")\n var searchFilter, listItem, txtValue;\n searchFilter = filter.value.toUpperCase();\n listItem = document.querySelectorAll('.collection-item');\n //looping through the list items, and hiding unmatching results\n listItem.forEach(function(element){\n txtValue = element.textContent || element.innerText;\n if(txtValue.toUpperCase().indexOf(searchFilter) > -1){\n element.style.display = \"\";\n }else{\n element.style.display = \"none\";\n }\n });\n}", "function initCriteriaList() {\n jQuery(\"#progContainer\").hide();\n var critListElement = jQuery(\"#sideBarCriterias\");\n onEventMap = (mapTitle.indexOf(\"Veranstaltungen Ehrenamt\") != -1) ? true : false;\n onProjectMap = (mapTitle.indexOf(\"Ehrenamt Berlin\") != -1) ? true : false;\n var tabsHtml = \"\";\n if (onBerlinDe && onEventMap) {\n tabsHtml = '<div id=\"navigation-helper\" '\n + 'style=\"border-bottom: 1px dashed #e8e8e8; padding-left: 7px; padding-bottom: 8px; padding-top:3px; padding-right: 4px;\">'\n + '<a href=\"'+ baseUrl +'ehrenamt\" title=\"Zum Einsatzstadtplan wechseln\">Einsatzorte</a>&nbsp;|&nbsp;'\n + 'Veranstaltungen Heute</div>';\n } else if (onBerlinDe && onProjectMap) {\n tabsHtml = '<div id=\"navigation-helper\" '\n + 'style=\"border-bottom: 1px dashed #e8e8e8; padding-left: 7px; padding-bottom: 8px; padding-top:3px; padding-right: 4px;\">'\n + 'Einsatzorte&nbsp;|&nbsp;'\n + '<a href=\"'+ baseUrl +'veranstaltungen-ehrenamt\" title=\"Zum Veranstaltungsstadtplan wechseln\">Veranstaltungen Heute</a></div>';\n }\n var critLinkList = '';\n if (onBerlinDe && (onEventMap || onProjectMap)) {\n critLinkList += tabsHtml; // render special tab selection for inner ehrenamtsnetz navigation\n }\n critLinkList += '<table width=\"95%\" cellpadding=\"0\" border=\"0\"><tbody>';\n critLinkList += '<tr valign=\"top\">'; // TODO: onclick\n critLinkList += '<td rowspan=\"'+workspaceCriterias.result.length+1+'\" align=\"left\">';\n // rebuild upper part of the sideBar stub\n critLinkList += '<a id=\"sideBarLogoLink\" href=\"http://www.kiezatlas.de\">'\n + ' <img id=\"sideBarLogo\" src=\"'+IMAGES_URL +'kiezatlas-logo.png\" alt=\"Das Kiezatlas Logo\" '\n + ' border=\"0\" text=\"Das Kiezatlas Logo\"/></a></td>';\n critLinkList += '<td></td><td></td>';\n critLinkList += '</tr>';\n for (var i = 0; i < workspaceCriterias.result.length; i++) {\n var critName = [workspaceCriterias.result[i].critName];\n if ( i == 0 && workspaceCriterias.result.length == 2) {\n critLinkList += '<tr valign=\"center\">';\n } else {\n critLinkList += '<tr valign=\"top\">';\n }\n if (onBerlinDe && crtCritIndex == i) {\n critLinkList += '<td onclick=\"javascript:updateCategoryList(' + i + ');\" class=\"critLinkNormal selectedCriteria\">'\n + '<img src=\"http://www.berlin.de/_bde/css/list_bullet.png\"/>&nbsp;' + critName + '</td>';\n } else {\n critLinkList += '<td onclick=\"javascript:updateCategoryList(' + i + ');\" class=\"critLinkNormal\">'\n + critName + '</td>';\n }\n if (!onBerlinDe && crtCritIndex == i) {\n critLinkList += '<td align=\"left\">&#8226;</td></tr>';\n } else {\n critLinkList += '<td></td></tr>';\n }\n }\n critLinkList += '</tbody>';\n critLinkList += '</table>';\n // do append the concatenated html\n critListElement.html(critLinkList);\n if (!onBerlinDe) {\n var breadCrumpHtml = '<div id=\"navigation-helper\">'\n + '<a href=\"http://www.kiezatlas.de/tipps_und_tricks.pdf\" style=\"float: left;\" title=\"Tipps und Tricks zur Nutzung vom KiezAtlas (PDF)\">Tipps & Tricks</a>&nbsp;&nbsp;&nbsp;'\n + '&nbsp;&nbsp;&nbsp;<a href=\"http://www.kiezatlas.de/browse/'+mapAlias+'\" title=\"Zur klassichen Stadtplanoberfl&auml;che wechseln\">Zur klassischen Ansicht</a></div>';\n critListElement.append(breadCrumpHtml);\n }\n // set the correct images\n // if (workspaceInfos != null) setCustomWorkspaceInfos(); else setDefaultWorkspaceInfos();\n setWorkspaceInfos(workspaceHomepage, workspaceLogo, workspaceImprint, mapTitle);\n if (onEventMap) {\n // ### FIXME: make use of kiezatlas.mapTopics and thereofre initalize them earlier...\n var countHtml = '&nbsp;&nbsp;&nbsp;Insgesamt <b>' + mapTopics.result.topics.length + '</b> Veranstaltungen Heute<p></p>';\n jQuery(\"#sideBarCriterias\").append(countHtml);\n }\n }", "function addListenerMyListEdit() {\n\t\t$(\".myList-itemEdit\").on(\"click\", function(event) {\n\t\t\tevent.stopPropagation();\n\t\t\tvar myList = $(this).closest(\".myLists-item\");\n\t\t\tvar currentTitle = myList.find(\".myList-title\").html();\n\t\t\t// TODO; annotate\n\t\t\tresetMyListEditMode( $(this) );\n\t\t\ttoggleToMyListButton();\n\t\t\t// Open current My List edit mode\n\t\t\tmyList.find(\".myList-main\").hide();\n\t\t\tmyList.find(\".myList-editTemplate\").show();\n\t\t\tmyList.find(\".myList-editTitle\").val(currentTitle);\n\t\t\tmyList.find(\".myList-editTitle\").focus();\n\t\t});\n\t}", "function onSelectedIndexChanged(args) {\n if (args.oldIndex !== -1) {\n const tabSelectedIndex = args.object.selectedIndex;\n const page = args.object.page;\n const vm = page.bindingContext;\n if (tabSelectedIndex === 0) {\n vm.set(\"tabSelectedIndexResult\", \"Profile Tab (tabSelectedIndex = 0 )\");\n } else if (tabSelectedIndex === 1) {\n vm.set(\"tabSelectedIndexResult\", \"Stats Tab (tabSelectedIndex = 1 )\");\n } else if (tabSelectedIndex === 2) {\n vm.set(\"tabSelectedIndexResult\", \"Settings Tab (tabSelectedIndex = 2 )\");\n }\n dialogs.alert(`Selected index has changed ( Old index: ${args.oldIndex} New index: ${args.newIndex} )`)\n .then(() => {\n console.log(\"Dialog closed!\");\n });\n }\n}", "onTriggerClick() {\n const me = this;\n\n if (me.pickerVisible) {\n me.hidePicker();\n } else {\n if (!me.readOnly && !me.disabled) {\n switch (me.triggerAction) {\n case this.constructor.queryAll:\n me.doFilter(null);\n break;\n\n case comboQueryLast:\n me.doFilter(me.lastQuery);\n break;\n\n default:\n me.doFilter(me.input.value);\n }\n }\n }\n }", "function eventListSelection(requestParams, isPersistentFromAPI) {\n\t\tconst overlayContent = $(overlay.iframe);\n\n\t\t$(document).off('mouseover touchend', 'div#listSummaryContainer > div')\n\t\t\t.on('mouseover touchend', 'div#listSummaryContainer > div', function (event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\toverlayContent.find('div#listSummaryContainer > div').removeClass('selected');\n\t\t\t\t$(this).addClass('selected');\n\t\t\t});\n\n\t\t$(document).off('click touchend', 'div#listSummaryContainer > div > button')\n\t\t\t.on('click touchend', 'div#listSummaryContainer > div > button', function (event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar $parent = $(this).parent(),\n\t\t\t\t\tlistName = $.trim($parent.data('name')),\n\t\t\t\t\tlistId = $.trim($parent.data('id'));\n\t\t\t\tif ($parent.hasClass('selected')) {\n\t\t\t\t\tif (listId !== '') {\n\t\t\t\t\t\taddItemToList(OP_CODE_UPDATE, {\n\t\t\t\t\t\t\tlistName: listName,\n\t\t\t\t\t\t\tlistId: listId\n\t\t\t\t\t\t}, requestParams);\n\t\t\t\t\t} else {\n\t\t\t\t\t\taddItemToList(OP_CODE_CREATE, {\n\t\t\t\t\t\t\tlistName: listName\n\t\t\t\t\t\t}, requestParams);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t$(document).off('click', 'div#twoClickCreateList')\n\t\t\t.on('click', 'div#twoClickCreateList', function (event) {\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\t// Modifying the overlay title\n\t\t\t\toverlay.setTitle('Create a List');\n\t\t\t\toverlayContent.find('div#listSaveExternal div#listContent').html($(createListTemplate));\n\n\t\t\t\toverlayContent.find('div#listSaveExternal div#listContent')\n\t\t\t\t\t.find('input#twoClickListName').focus();\n\n\t\t\t\t//Analytics\n\t\t\t\tanalytics.trackCreateListOverlay();\n\t\t\t});\n\n\t\t//Handling the enter in the create list field\n\t\t$(document).off('keypress', 'input#twoClickListName')\n\t\t\t.on('keypress', 'input#twoClickListName', function (event) {\n\t\t\t\tif (event.keyCode === 13) {\n\t\t\t\t\toverlayContent.find('button#twoClickSave').trigger('click');\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t}\n\t\t\t});\n\n\t\t$(document).off('click', 'button#twoClickSave')\n\t\t\t.on('click', 'button#twoClickSave', function (event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\toverlayContent.find('span#twoClickCreateListForm').removeClass('form-input--error');\n\t\t\t\tvar listName = $('#twoClickListName').val();\n\t\t\t\tif (validateListName(listName)) {\n\t\t\t\t\taddItemToList(OP_CODE_CREATE, {\n\t\t\t\t\t\tlistName: listName\n\t\t\t\t\t}, requestParams);\n\t\t\t\t}\n\t\t\t});\n\n\t\t$('div#listSummaryContainer').scroll(function (event) {\n\t\t\tif (Math.floor($(this)[0].scrollHeight - $(this).scrollTop()) <= ($(this).outerHeight() + 5)) {\n\t\t\t\t$(this).removeClass('list--save__scroll');\n\t\t\t} else if (!$(this).hasClass('list--save__scroll')) {\n\t\t\t\t$(this).addClass('list--save__scroll');\n\t\t\t}\n\t\t});\n\n\t\t$(document).off('click', 'div#listSaveFooter a')\n\t\t\t.on('click', 'div#listSaveFooter a', function (event) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tvar isRegisterTab = ($(this).data('action') === 'register') ? true : false;\n\t\t\t\tauthenticateUser(isMobile, parameters, isRegisterTab);\n\t\t\t});\n\t}", "function _renderList(caseSensitive){\n\t\t\t_clear();\n\n\t\t\tlet rerenderOnEachItem = false;\n\t\t\tlet $listItems = $([]);\n\t\t\tconst textFilter = _formatText(caseSensitive, _$filter.val())\n\n\t\t\t_items.forEach( item => {\n\t\t\t\tconst text = _formatText(caseSensitive, item.text)\n\t\t\t\tif(text.indexOf(textFilter) != -1){\n\t\t\t\t\tlet $listItem = _addItem(item, rerenderOnEachItem);\n\t\t\t\t\t$listItems = $listItems.add( $listItem );\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t_$content.append( $listItems );\n\t\t\t_$content.one('click', function (event) {\n\t\t\t\tconst item = $(event.target).data('item')\n\t\t\t\t_properties.onSelect(item, event);\n\t\t\t\t_onSelectCallback( item );\n\t\t\t\thide(event);\n\t\t\t});\n\t\t\tlet popupHeight = _calculatePopupHeight();\n\t\t\tlet titleHeight = _$title.outerHeight();\n\t\t\t_$content.outerHeight( (popupHeight - titleHeight) );\n\t\t}", "function clickableDefaultAndPlus() { // Function needed, as they are dynamically deleted and recreated when the List changes\n // -- Click: Plustab (for new Tab) -- (reworked)\n $('#plustab').on('click', function() {\n var name = prompt('Enter list name (max. 8 char)','listname'); // Do a promt to enter a new list\n if (name !== '') { // Was someting entered?\n addList(name); // Add the list\n }\n });\n\n // --Click: tab (for changing List) -- (reworked)\n $('#default').on('click', function() {\n tabClicked($(this));\n });\n }", "optionClickedStatusBooking(optionsList) {\r\n this.getGroupStatusBooking(optionsList);\r\n }", "onTriggerClick() {\n const me = this;\n\n if (me.pickerVisible) {\n me.hidePicker();\n } else {\n if (!me.readOnly && !me.disabled) {\n switch (me.triggerAction) {\n case comboQueryAll:\n me.doFilter(null);\n break;\n case comboQueryLast:\n me.doFilter(me.lastQuery);\n break;\n default:\n me.doFilter(me.input.value);\n }\n }\n }\n }", "_listBoxChangeHandler(event) {\n const that = this;\n\n //Stop listBox's change event. TextBox will throw it's own 'change' event\n event.stopPropagation();\n\n if (event.detail.selected) {\n const label = that.$.listBox._items[event.detail.index][that.inputMember];\n\n that.$.listBox.$.filterInput.value = label;\n\n that.$.input.value = that.displayMode === 'escaped' ?\n that._toEscapedDisplayMode(label) : that._toDefaultDisplayMode(label);\n that.set('value', that._toDefaultDisplayMode(that.$.input.value));\n }\n\n if (that.autoComplete !== 'none' && typeof that.dataSource !== 'function') {\n that._autoComplete(true);\n }\n }", "function displaySelectedCUHybridCompTab(){\n var url = parent.location.href;\n s=url.indexOf(\"summary\");\n if (s!=-1){\n obj= document.getElementById('summary-li');\n if(obj){\n document.getElementById('summary').style.display=\"\";\n }\n }\n if (url.indexOf(\"basiccontrol\")!=-1){\n obj= document.getElementById('basiccontrol-li');\n if(obj){\n document.getElementById('basiccontrol').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"cprating\")!=-1){\n obj= document.getElementById('cprating-li');\n if(obj){\n document.getElementById('cprating').style.display=\"\";\n }\n }\n if (url.indexOf(\"auditreadyasmt\")!=-1){\n obj= document.getElementById('auditreadyasmt-li');\n if(obj){\n document.getElementById('auditreadyasmt').style.display=\"\";\n }\n }\n if (url.indexOf(\"riskmsdcommit\")!=-1){\n obj= document.getElementById('riskmsdcommit-li');\n if(obj){\n document.getElementById('riskmsdcommit').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"auditreview\")!=-1){\n obj= document.getElementById('auditreview-li');\n if(obj){\n document.getElementById('auditreview').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"kctest\")!=-1){\n obj= document.getElementById('kctest-li');\n if(obj){\n document.getElementById('kctest').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"opmetric\")!=-1){\n obj= document.getElementById('opmetric-li');\n if(obj){\n document.getElementById('opmetric').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"other\")!=-1){\n obj= document.getElementById('other-li');\n if(obj){\n document.getElementById('other').style.display=\"\";\n }\n }\n}", "function loadFilterOptions(elem) {\n var value = $(elem).val();\n\n if (value == 0) {\n $('#FilterOptionDiv').hide();\n } else if (value == 1) {\n GetActionList();\n } else if (value == 2) {\n GetStatusList();\n }\n}", "function dashboardSortbyStatus(change,from){\n if(change != 'All'){\n changeSortbyStatus(change,from);\n }\n $(\"#ordtab\").trigger('click');\n}", "function displayAllFilters(bwFilters) {\n if (bwFilters.length) {\n $.each(bwFilters, function (i, value) {\n if (value.length) {\n if(bwPage == \"eventList\" || bwPage == \"eventscalendar\") {\n // only construct filter listings on these two views.\n var navId = value[0].substr(0,value[0].indexOf(\"-\"));\n var navName = $(\"#\" + navId + \" .bwMenuTitle\").text().trim();\n refreshFilterList(i,navName);\n }\n // make our selected navigational items bold on every page\n $.each(value, function (j, val) {\n $(\"#\" + val).css(\"font-weight\",\"bold\").attr(\"aria-selected\",\"true\");\n });\n }\n });\n }\n}", "updateFilterList(filter){\n\n\t\t$(\"li[data-filter='\" + filter + \"']\").show();\n\n\n\t}", "function ticketListMenuActions(configPass, key){\n\t$('#jPanelMenu-menu li p#logout').on('click', function(){ logOut(); });\n\t$('#jPanelMenu-menu li p#orgInst').on('click', function(){ changeOrgs(); });\n\t$('#jPanelMenu-menu li p#queues').on('click', function(){ SherpaDesk.getTicketsQueues(configPass) });\n\t//Ticket Detail view\n\t$('#jPanelMenu-menu li p#transfer').on('click', function(){ SherpaDesk.getTicketDetailTransfer(configPass, key) });\n\t$('#jPanelMenu-menu li p#pickup').on('click', function(){ SherpaDesk.postTicketDetailPickup(configPass, key) });\n\t$('#jPanelMenu-menu li p#edit').on('click', function(){ SherpaDesk.getTicketDetailEdit(configPass, key) });\t\n\t$('#jPanelMenu-menu li p#close').on('click', function(){ SherpaDesk.getTicketDetailClose(configPass, key) });\n\t$('#jPanelMenu-menu li p#response').on('click', function(){ SherpaDesk.getTicketDetailResponse(configPass, key) });\t\n\t$('#jPanelMenu-menu li p#time').on('click', function(){ SherpaDesk.getTicketDetailAddTime(configPass, key) });\t\t\n\t}", "performAction() {\n const oldValue = this.activeId;\n const oldTab = oldValue !== undefined && oldValue !== null ? this.childItems.filter(i => i.newValue === oldValue)[0] : this.items[0];\n\n if (oldTab && this.activeItem) {\n oldTab.deactivate(this.activeItem.index);\n this.activeItem.activate(oldTab.index);\n }\n }", "function buttonsControl() {\n if ( localStorage.exsist ) {\n $('.create-list-side-popup').remove(); // remove create a list side button \n $('#my-list-link').show(); // show my list button\n }\n}", "function configureWatchers(){$scope.$watch('$mdTabsCtrl.selectedIndex',handleSelectedIndexChange);}", "onTabOpened(aTab, aFirstTab, aOldTab) {\n if (aTab.mode.name == \"folder\" || aTab.mode.name == \"glodaList\") {\n let modelTab = this.tabmail.getTabInfoForCurrentOrFirstModeInstance(\n aTab.mode\n );\n let oldFilterer =\n modelTab && \"quickFilter\" in modelTab._ext\n ? modelTab._ext.quickFilter\n : undefined;\n aTab._ext.quickFilter = new QuickFilterState(oldFilterer);\n this.updateSearch(aTab);\n this._updateToggle(aTab);\n }\n }", "_addOpenFiltersEvents() {\n for (let filter of FILTERS) {\n const filterLabel = document.getElementById(`${filter}-filter-label`);\n const filterIcon = document.getElementById(`${filter}-filter-icon`);\n const filterInput = document.getElementById(`${filter}`);\n const itemsList = document.getElementById(`${filter}-list`);\n\n filterLabel.onclick = (e) => {\n e.stopPropagation();\n e.preventDefault();\n\n this._closeAllFiltersExceptClicked(filter);\n\n filterLabel.classList.toggle(\"clicked\");\n filterIcon.classList.toggle(\"fa-chevton-down\");\n filterIcon.classList.toggle(\"fa-chevron-up\");\n itemsList.classList.toggle(\"closed\");\n\n this._sizeFilterList(filter);\n\n filterInput.focus();\n };\n\n filterInput.onclick = (e) => {\n e.stopPropagation();\n };\n }\n }", "_applySelection() {\n const that = this;\n\n if (that.selectionDisplayMode === 'placeholder' || that.selectedIndexes.length === 0) {\n that.$.actionButton.innerHTML = that.placeholder;\n return;\n }\n\n if (!that.$.listBox._items || that.$.listBox._items.length === 0) {\n return;\n }\n\n that.$.actionButton.innerHTML = '';\n that.$.actionButton.appendChild(that._createToken());\n }", "showAllFilterOptions(){\n\n\t\t$('ul'+this.styles.filters_list+' li').each(function(){\n\n\t\t\tif($(this).data('type')!='text'){\n\t\t\t\t$(this).show();\n\t\t\t}\t\n\n\t\t});\n\t}", "function dropDownListController() {\n attachEventListener([DOMelements.navMenuItems.logedIn.dropDownList.myProfile,\n DOMelements.navMenuItems.logedIn.dropDownList.myRuns,\n DOMelements.navMenuItems.logedIn.dropDownList.analytics,\n DOMelements.navMenuItems.logedIn.dropDownList.logout],\n 'click',\n [myProfileViewSubController,\n myRunsViewSubController,\n analyticsViewSubController,\n logoutSubController]);\n}", "function listOnClick(event) {\n var elem = event.target;\n var name = elem.innerText;\n var index;\n\n // to find out which feed list is being click\n for (var i = 0; i < feeds.length; i++) {\n if (name == feeds[i].name) {\n index = i;\n }\n }\n // call to loadFeed function to load the new feed\n loadFeed(index);\n $('.admin-content').toggleClass('visible');\n}", "function selectedAction(action) {\n switch (action) {\n case \"View Products for Sale\":\n displayProducts();\n break;\n case \"View Low Inventory\":\n displayLowStock();\n break;\n case \"Add to Inventory\":\n addMore();\n break;\n default:\n addProduct();\n break;\n };\n}", "get focusedList()\n {\n return E(\"tabs\").selectedPanel.getElementsByTagName(\"richlistbox\")[0];\n }", "function setTitle(){\n\tvar title = getMessage('title_abEditAction_list');\n\tView.panels.get('abEditAction_list').setTitle(title);\n}", "function onPageBeforeShow(e){\n\t\t\t\t\t\t\t\t\n\t\t\t\t//adding content from lstest data selection\n\t\t\t\tpopulateListContent(App.data.selection);\n\t\t\t\t\n\t\t\t}", "function applyFilter(type){\n\t\tvar container = $(document).find('.filter-container').first();\n\t\tvar url = getBaseURL()+'lists/load/t/'+type;\n\t\t\n\t\tcontainer.find('input, select').each(function(){\n\t\t\tif($(this).data('final') && $(this).val() != '') url += '/'+$(this).data('final')+'/'+replaceBadChars($(this).val());\n\t\t});\n\t\t\n\t\t//Update the pagination action\n\t\t// a) first get the real container stub\n\t\tvar homeListTable = $('#paginationdiv__'+type+'_action', window.parent.document).parents('.home-list-table').first();\n\t\tvar listContainer = homeListTable.find('.page-list-div, .home-list-div').first();\n\t\t\n\t\tvar listId = listContainer.find('div').first().attr('id');\n\t\tvar listStub = listId.substr(0, listId.indexOf('__'));\n\t\t// b) then update the action\n\t\twindow.parent.document.getElementById('paginationdiv__'+listStub+'_action').value = url;\n\t\thomeListTable.find('#refreshlist').first().click();\n\t\t\n\t\twindow.parent.document.getElementById('__shadowbox_closer').click();\n\t}", "function twpro_showList() {\r\n\t\tif (TWPro.twpro_failure) return;\r\n\t\t$('twpro_jobsort_link_name').addMousePopup(new MousePopup(TWPro.lang.SORTBYNAME, 100, {opacity:0.95}));\r\n\t\t$('twpro_jobsort_link_erfahrung').addMousePopup(new MousePopup(TWPro.lang.SORTBYXP, 100, {opacity:0.95}));\r\n\t\t$('twpro_jobsort_link_lohn').addMousePopup(new MousePopup(TWPro.lang.SORTBYWAGES, 100, {opacity:0.95}));\r\n\t\t$('twpro_jobsort_link_glueck').addMousePopup(new MousePopup(TWPro.lang.SORTBYLUCK, 100, {opacity:0.95}));\r\n\t\t$('twpro_jobsort_link_comb').addMousePopup(new MousePopup(TWPro.lang.SORTBYCOMB, 100, {opacity:0.95}));\r\n\t\t$('twpro_jobsort_link_gefahr').addMousePopup(new MousePopup(TWPro.lang.SORTBYDANGER, 100, {opacity:0.95}));\r\n\t\t$('twpro_jobsort_link_laborp').addMousePopup(new MousePopup(TWPro.lang.SORTBYLABORP, 100, {opacity:0.95}));\r\n\t\t$('twpro_jobsort_filter').addMousePopup(new MousePopup(TWPro.lang.FILTERJOBS, 100, {opacity:0.95}));\r\n\t\t$('twpro_clothingfilter').addMousePopup(new MousePopup(TWPro.lang.FILTERCLOTHING, 100, {opacity:0.95}));\r\n\t\t$('twpro_search_help').addMousePopup(new MousePopup(TWPro.lang.SEARCHHELP, 100, {opacity:0.95}));\r\n\r\n\t\tfor (var twpro_wear in Wear.wear) {\r\n\t\t if (Wear.wear[twpro_wear].obj.set != null){\r\n\t\t TWPro.twpro_setBonus[Wear.wear[twpro_wear].obj.set.key][1].name = Wear.wear[twpro_wear].obj.set.name;\r\n\t\t }\r\n\t\t}\r\n\t\tvar bagitems = Bag.getInstance().items;\r\n\t\tfor (var twpro_bag in bagitems) {\r\n\t\t if (bagitems[twpro_bag].obj.set != null){\r\n\t\t\tTWPro.twpro_setBonus[bagitems[twpro_bag].obj.set.key][1].name = bagitems[twpro_bag].obj.set.name;\r\n\t\t }\r\n\t\t}\t\r\n\t\tfor (var twpro_set in TWPro.twpro_setBonus) {\r\n\t\t if (TWPro.twpro_setBonus[twpro_set][1].name){\r\n\t\t\t$('twpro_set_filters_'+twpro_set).addMousePopup(new MousePopup('<b>'+TWPro.twpro_setBonus[twpro_set][1].name+'</b>', 100, {opacity:0.95})); \r\n\t\t }\r\n\t\t else{\r\n\t\t\t$('twpro_set_filters_'+twpro_set).setOpacity(0.05);\r\n\t\t\t$('twpro_set_filters_'+twpro_set).style.cursor=\"default\";\r\n\t\t\t$('twpro_set_filters_'+twpro_set).onclick=\"void(0)\";\r\n\t\t }\r\n\t\t}\r\n\r\n\t\tTWPro.twpro_bag.twpro_bagPopup = new MousePopup('', 100, {opacity:0.95});\r\n\t\tTWPro.twpro_bag.twpro_bagPopup.twpro_refresh = function () {\r\n\t\t\tthis.setXHTML(TWPro.twpro_getBagPopup());\r\n\t\t};\r\n\t\tTWPro.twpro_bag.twpro_bagPopup.twpro_refresh();\r\n\t\t$('twpro_bag').addMousePopup(TWPro.twpro_bag.twpro_bagPopup);\r\n\r\n\t\t//TWPro.twpro_invHash = [];\r\n\t\tif (TWPro.twpro_invHash == TWPro.twpro_invHashTest.join(',')) {\r\n\t\t\tfor (var twpro_wear in Wear.wear) {\r\n\t\t\t\tTWPro.twpro_prepareItem(Wear.wear[twpro_wear].obj);\r\n\t\t\t\tif (Wear.wear[twpro_wear].obj.twpro_bonus) {\r\n\t\t\t\t\tWear.wear[twpro_wear].obj.twpro_jobbonus = TWPro.twpro_itemStorage[Wear.wear[twpro_wear].obj.item_id].twpro_jobbonus;\r\n\t\t\t\t\t// for(var twpro_i=0;twpro_i<TWPro.twpro_jobs.length;twpro_i++)\r\n\t\t\t\t\t// {\r\n\t\t\t\t\t// Wear.wear[twpro_wear].obj.twpro_jobbonus[TWPro.twpro_jobs[twpro_i].shortName] = TWPro.twpro_itemStorage[Wear.wear[twpro_wear].obj.item_id].twpro_jobbonus[TWPro.twpro_jobs[twpro_i].shortName];\r\n\t\t\t\t\t// }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvar bagitems = Bag.getInstance().items;\r\n\t\t\tfor (var twpro_bag in bagitems) {\r\n\t\t\t\tTWPro.twpro_prepareItem(bagitems[twpro_bag].obj);\r\n\t\t\t\tif (bagitems[twpro_bag].obj.twpro_bonus) {\r\n\t\t\t\t\tbagitems[twpro_bag].obj.twpro_jobbonus = TWPro.twpro_itemStorage[bagitems[twpro_bag].obj.item_id].twpro_jobbonus;\r\n\t\t\t\t\t// for(var twpro_i=0;twpro_i<TWPro.twpro_jobs.length;twpro_i++)\r\n\t\t\t\t\t// {\r\n\t\t\t\t\t// Bag.getInstance().items[twpro_bag].obj.twpro_jobbonus[TWPro.twpro_jobs[twpro_i].shortName] = TWPro.twpro_itemStorage[Bag.getInstance().items[twpro_bag].obj.item_id].twpro_jobbonus[TWPro.twpro_jobs[twpro_i].shortName];\r\n\t\t\t\t\t// }\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tTWPro.twpro_insertListItems();\r\n\t\t\tdocument.getElementById('twpro_wait').text = TWPro.lang.CHOOSEJOB;\r\n\t\t}\r\n\t\tdocument.getElementById('twpro_jobDisplay').style.visibility = 'visible';\r\n\t}", "function filterListener(){\n $(\"#colorFilter\").change(function(){\n populateBikeList();\n });\n $(\"#statusFilter\").change(function(){\n populateBikeList();\n });\n }", "function showActions(elem){\n \n if(elem instanceof HTMLLIElement){\n console.dir(elem);\n if(actionBox == null){\n actionBox = document.getElementById(\"itemActions\")\n }\n actionBox.style.display = 'block';\n currentLi = elem;\n currentLi.appendChild(actionBox)\n var ul = elem.querySelector('ul');\n if(ul){\n \n }\n }\n }", "function showTab(tabName, tableGroup, tableName){\n\n // store the index of tablegroup that was selected\n switch (tableGroup) {\n case \"owner2grpRestriction\":\n tabsFrame.selectedTableGroup = 2;\n break;\n case \"ownergrpRestriction\":\n tabsFrame.selectedTableGroup = 1;\n break;\n case \"datagrpRestriction\":\n tabsFrame.selectedTableGroup = 0;\n break;\n //\t\tdefault: tabsFrame.selectedTableGroup = 0;\n }\n \n // navigate to desired tab, applying appropriate restriction based on table name selected. \n switch (tabName) {\n case \"page4b\":\n // If the target frame is page4b (Select Fields), then restrict the records\n // according to the table name \n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"afm_flds.table_name\", tableName, \"=\");\n tabsFrame.restriction = restriction;\n myTabsFrame.selectTab('page4b');\n break\n case \"page4c\":\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"afm_flds.table_name\", tableName, \"=\");\n tabsFrame.restriction = restriction;\n myTabsFrame.selectTab('page4c', restriction);\n break\n case \"page4d\":\n var restriction = new Ab.view.Restriction(); \n var inValues = []; \t\t\t\t\t\n // restriction = \"afm_flds.table_name IN (\";\n \n var parameters = {\n tableName: 'afm_flds',\n fieldNames: toJSON(['afm_flds.table_name', 'afm_flds.field_name', 'afm_flds.ref_table']),\n restriction: '{\"afm_flds.table_name\":' + tableName + '}',\n recordLimit: 0\n };\n var result = Workflow.runRuleAndReturnResult('AbCommonResources-getDataRecords', parameters);\n \n if (result.code == 'executed') { \n for (var i = 0; i < result.data.records.length; i++) {\n var record = result.data.records[i];\n if (record['afm_flds.ref_table'] != '') {\n inValues.push( record['afm_flds.ref_table']);\n }\n }\n }\n //restriction += \"' ')\";\n restriction.addClause(\"afm_flds.table_name\", inValues, \"IN\");\n \n var listOfRestrictedFields = tabsFrame.listOfRestrictionFields;\n if(listOfRestrictedFields){\n \trestriction = addFieldsToRestriction(restriction, listOfRestrictedFields);\n \t}\n myTabsFrame.refTable = tableName;\n tabsFrame.restriction = restriction;\n myTabsFrame.selectTab('page4d', restriction);\n break\n case \"page4e\":\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"afm_flds.table_name\", tableName, \"=\");\n tabsFrame.restriction = restriction;\n myTabsFrame.selectTab('page4e', restriction);\n break\n case \"page4f\":\n myTabsFrame.selectTab('page4f');\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"afm_flds.table_name\", tableName, \"=\");\n tabsFrame.restriction = restriction;\n myTabsFrame.selectTab('page4f', restriction);\n break\n }\n}", "filterTodo(tabLink) {\r\n this._currentTab = tabLink;\r\n this._changeList(tabLink);\r\n }", "function handleFilters() {\n console.log(this.value);\n var index = filters.indexOf(this.value);\n if (index === -1) filters.push(this.value);\n else filters.splice(index, 1);\n console.log(filters);\n renderApplicants(Object.values(allApplicants[currJobIndex] || {}), currJobIndex, searchVal, filters);\n}", "function activateListEditing() {\n\tactivateEditing();\n\tcreateEditingElements(\"#list\");\n\t$(\"#list\").on(\"click\", \"a\", function(e){e.preventDefault();}); //disable the links\n\t$(\".list_entry\").find(\"p\").addClass(\"editable\");\n\t$(\"#list\").on(\"mouseenter\", \".list_entry\", showCloseButton).on(\"mouseleave\", \".list_entry\", hideCloseButton);\t\n}", "handleFiltersSelect() {\n this.filters.forEach((item) => {\n item.addEventListener('click', () => {\n this.searchResultsModule.submitSearch()\n })\n })\n }", "function listingo_appointment_tabs(current) {\n //Tab Items\n jQuery('.tg-navdocappointment li').removeClass('active');\n var _navitems = jQuery(\".tg-navdocappointment li\");\n _navitems.each(function (index, li) {\n if (parseInt(index) < parseInt(current)) {\n jQuery(this).addClass('active');\n }\n });\n\n //Tab Contents\n jQuery('.tg-appointmenttabcontent .tab-pane').hide();\n\n if (current == 1) {\n jQuery('.tg-appointmenttabcontent .step-one-contents').show();\n } else if (current == 2) {\n jQuery('.tg-appointmenttabcontent .step-two-contents').show();\n } else if (current == 3) {\n jQuery('.tg-appointmenttabcontent .step-three-contents').show();\n } else if (current == 4) {\n jQuery('.tg-appointmenttabcontent .step-four-contents').show();\n } else if (current == 5) {\n jQuery('.tg-appointmenttabcontent .step-five-contents').show();\n }\n\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 }", "function getContactListTab() {\r\n\t// like the privileges request - can be moved to jsp\r\n\tconn.request({\r\n url: CONTACT_LIST_JSON_URL,\r\n method: 'POST',\r\n params: { method: \"isMultiChatEnabled\"},\r\n success: function(responseObject) {\r\n isMultiChatEnabled = responseObject.responseText;\r\n },\r\n failure: function() {\r\n Ext.Msg.alert(getLocalizationValue('application.javascript.contactList.alert.errorTitle'), getLocalizationValue('application.javascript.contactList.alert.errorMsg'));\r\n }\r\n });\r\n \tsearchStore.load();\r\n\r\n\tvar agentsGrid = new Ext.grid.GridPanel({\r\n store:agentsStore, \r\n id: 'agentsGrid',\r\n columns: [\r\n {renderer:nameRender, dataIndex: 'name', id: 'name'},\r\n {width: 30, renderer: statusRender, dataIndex: 'status'},\r\n {width: 30, renderer: deleteFavoriteRender, dataIndex: 'name'}\r\n ],\r\n autoExpandColumn: 'name',\r\n anchor: '100%, 100%',\r\n autoHeight:true,\r\n hideHeaders: true,\r\n iconCls: 'icon-grid'\r\n });\r\n var agentsPanel = new Ext.Panel({\r\n \tid: 'agentsPanel',\r\n \tlayout: 'anchor',\r\n title:getLocalizationValue('application.javascript.contactList.favoritesTitle'),\r\n collapsible:true,\r\n collapsed: true,\r\n anchor: '100%',\r\n items: [agentsGrid]\r\n });\r\n\t\r\n \r\n var peersGrid = new Ext.grid.GridPanel({\r\n store:peersStore, \r\n columns: [\r\n {renderer:nameRender, dataIndex: 'name', id: 'name'},\r\n {width: 30, renderer: statusRender, dataIndex: 'status'},\r\n {width: 30, renderer: deletePeerRender, dataIndex: 'id'}\r\n ],\r\n autoExpandColumn: 'name',\r\n anchor: '100%, 100%',\r\n autoHeight:true,\r\n hideHeaders: true,\r\n iconCls: 'icon-grid'\r\n });\r\n var peersPanel = new Ext.Panel({\r\n title:getLocalizationValue('application.javascript.contactList.peersTitle'),\r\n collapsible:true,\r\n collapsed: true,\r\n layout: 'anchor',\r\n anchor: '100%',\r\n items: [peersGrid]\r\n });\r\n\t\r\n \r\n var expertsGrid = new Ext.grid.GridPanel({\r\n store:expertsStore, \r\n columns: [\r\n {renderer:nameRender, dataIndex: 'name', id: 'name'},\r\n {width: 30, renderer: statusRender, dataIndex: 'status'}\r\n ],\r\n autoExpandColumn: 'name',\r\n anchor: '100%, 100%',\r\n autoHeight:true,\r\n hideHeaders: true,\r\n iconCls: 'icon-grid'\r\n });\r\n var expertsPanel = new Ext.Panel({\r\n title:getLocalizationValue('application.javascript.contactList.expertsTitle'),\r\n collapsible:true,\r\n collapsed: true,\r\n layout: 'anchor',\r\n anchor: '100%',\r\n items: [expertsGrid]\r\n });\r\n \r\n var supersGrid = new Ext.grid.GridPanel({\r\n store:supervisorsStore, \r\n columns: [\r\n {renderer: superNameRender, dataIndex: 'name', id: 'name'},\r\n {width: 30, renderer: statusRender, dataIndex: 'status'}\r\n ],\r\n autoExpandColumn: 'name',\r\n anchor: '100%, 100%',\r\n autoHeight:true,\r\n hideHeaders: true,\r\n iconCls: 'icon-grid'\r\n });\r\n var supersPanel = new Ext.Panel({\r\n title:getLocalizationValue('application.javascript.contactList.supervisorsTitle'),\r\n collapsible:true,\r\n collapsed: true,\r\n layout: 'anchor',\r\n anchor: '100%',\r\n items: [supersGrid]\r\n });\r\n \r\n var searchLinkPanel = new Ext.Panel({\r\n id:'searchLinkPanel',\r\n html: '<a href=\"#searchLinkPanel\" onclick=\"openSearchTab()\" id=\"searchLinkPanel\" style=\"float: left;\">' + getLocalizationValue('application.javascript.contactList.searchLink') + '</a>'\r\n });\r\n \r\n var container = new Ext.Panel({\r\n header:false,\r\n\t\ttabTip: getLocalizationValue('application.javascript.contactList.title'),\r\n title:getLocalizationValue('application.javascript.contactList.title'),\r\n id:\"ContactList\",\r\n frame: true,\r\n\t hideMode:'offsets',\r\n autoScroll: false,\r\n layout: 'anchor',\r\n items: [agentsPanel, peersPanel, expertsPanel, supersPanel, searchLinkPanel]\r\n });\r\n \r\n return container;\r\n}", "function showTabListing(){\n\tvar tabList = \"<ul class='list-group' id='\"+gTabListId+\"'>\";\n\tvar tempFocus = 0;\n chrome.tabs.query({}, function(tabs) { // blah \n \tfor(var i=0;i<tabs.length;i++){\n \t\tvar title = tabs[i].title.substring(0, 70)+\"..\" //only length x title is added\n \t\ttabList+=\"<li class='list-group-item un-selected' id='\"+tabs[i].id+\"'>\";\n \t\ttabList+=\"<img src='\"+tabs[i].favIconUrl+\"' class='tabFavicon'>&nbsp;\";\n \t\ttabList+=\"<span>\"+title+\"</span>\";\t\n \t\ttabList+=\"<a class='pull-right' id='\"+tabs[i].windowId+\"|\"+tabs[i].id+\t\"' href='\"+tabs[i].url+\"'>Open</a></li>\"; \t\t\t \n\t\ttempFocus++;\n \t}\n \ttabList+=\"</ul>\"\n\n \tdocument.getElementById('tabContents').innerHTML = tabList;\n \t//apply cosmetic improvements for user accessibility\n \tfinalize();\n\n });\n}", "function fnCtrlFunction(mode, listId, objVal) {\n var obj = eval(objVal)[0];\n\n switch (listId) {\n case S_LIST_ID:\n\n if (mode == 'PAGING') {\n // 페이징\n jQuery('#fmSrch #pageNumber').val(obj.pageNumber);\n fnSearch();\n } else if (mode == 'PAGING_LIMIT') {\n // 한페이지 레코드 수\n jQuery('#fmSrch #pageNumber').val('1');\n jQuery('#fmSrch #pageLimit').val(obj.pageLimit);\n fnSearch();\n } else if (mode == 'SORTING') {\n // 정렬\n jQuery('#fmSrch #orderById').val(obj.colId);\n jQuery('#fmSrch #orderByType').val(obj.orderType);\n\n fnSearch();\n } else if (mode == 'LIST_CLICK') {\n // LIST 클릭\n fnList_onClick(obj.listId, obj.colId, obj.rowIndex, obj.colIndex);\n } else if (mode == 'LIST_DBCLICK') {\n // LIST 더블클릭\n fnList_onDbClick(obj.listId, obj.colId, obj.rowIndex, obj.colIndex);\n } else if (mode == 'GALLERY_CLICK') {\n // GALLERY 클릭\n fnGallery_onClick(obj.listId, obj.colId, obj.rowIndex);\n } else if (mode == 'GALLERY_DBCLICK') {\n // GALLERY 더블클릭\n fnGallery_onDbClick(obj.listId, obj.colId, obj.rowIndex);\n } else if (mode == 'CHECK_ALL') {\n // 체크박스 전체\n\n }\n\n break;\n default:\n break;\n }\n}", "function clickList(ev) {\n\t\n\tvar sel = elList.selection.file_object;\n\tif(sel instanceof File) {\n\t\tpreview.image = thumbPath(sel);\n\t} else if(sel instanceof Folder) {\n\t\tsearch.text = \"\";\n\t\tcurrentFolder = sel;\n\t\tloadSubElements(sel);\n\t}\n\n}", "function displaySelectedCUHybridPortfolioCompTab(){\n var url = parent.location.href;\n s=url.indexOf(\"summary\");\n if (s!=-1){\n obj= document.getElementById('summary-li');\n if(obj){\n document.getElementById('summary').style.display=\"\";\n }\n }\n if (url.indexOf(\"basiccontrol\")!=-1){\n obj= document.getElementById('basiccontrol-li');\n if(obj){\n document.getElementById('basiccontrol').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"cprating\")!=-1){\n obj= document.getElementById('cprating-li');\n if(obj){\n document.getElementById('cprating').style.display=\"\";\n }\n }\n if (url.indexOf(\"auditreadyasmt\")!=-1){\n obj= document.getElementById('auditreadyasmt-li');\n if(obj){\n document.getElementById('auditreadyasmt').style.display=\"\";\n }\n }\n if (url.indexOf(\"riskmsdcommit\")!=-1){\n obj= document.getElementById('riskmsdcommit-li');\n if(obj){\n document.getElementById('riskmsdcommit').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"auditreview\")!=-1){\n obj= document.getElementById('auditreview-li');\n if(obj){\n document.getElementById('auditreview').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"kctest\")!=-1){\n obj= document.getElementById('kctest-li');\n if(obj){\n document.getElementById('kctest').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"opmetric\")!=-1){\n obj= document.getElementById('opmetric-li');\n if(obj){\n document.getElementById('opmetric').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"accountrating\")!=-1){\n obj= document.getElementById('accountrating-li');\n if(obj){\n document.getElementById('accountrating').style.display=\"\";\n }\n }\n\tif (url.indexOf(\"other\")!=-1){\n obj= document.getElementById('other-li');\n if(obj){\n document.getElementById('other').style.display=\"\";\n }\n }\n}", "function onFilterClick(){\r\n\t\t\r\n\t\tvar objFilterSetActive = g_objWrapper.find(\".uc-filter-set-active\");\r\n\t\tg_ucAdmin.validateDomElement(objFilterSetActive, \"filter set - active\");\r\n\t\t\r\n\t\t//update filters\r\n\t\tvar filterCatalog = getFilterCatalog();\r\n\t\t\r\n\t\tif(filterCatalog == \"installed\")\r\n\t\t\tobjFilterSetActive.show();\r\n\t\telse\r\n\t\t\tobjFilterSetActive.hide();\r\n\t\t\r\n\t\tgetSelectedCatAddons();\r\n\t\t\r\n\t}", "function bwFilterClickHandler(event) {\n event.preventDefault();\n var curFilter = $(this).attr(\"id\").substr(1); // strip off the first character (\"f\") to get the same ID as found in the menu anchor\n var navIndex = $(this).attr(\"id\").substr(6,1); // get the nav index from the ID\n var navName = $(\"#bwNav\" + navIndex + \" .bwMenuTitle\").text().trim();\n var itemIndex = $.inArray(curFilter, bwFilters[navIndex]);\n if (itemIndex != -1) {\n bwFilters[navIndex].splice(itemIndex, 1);\n bwFilterPaths[navIndex].splice(itemIndex, 1);\n }\n var bwFiltersStr = buildFilterString();\n\n // save the new state information:\n var qstring = new Array();\n qstring.push(\"setappvar=bwFilters(\" + bwFiltersStr + \")\");\n\n // retrieve the filter expression:\n bwFilterPaths = buildFilterPaths();\n var fexpr = bwMainEventList.getFilterExpression(bwFilterPaths);\n\n // refresh the list for the filters we have\n if (bwPage == \"eventList\") {\n refreshFilterList(navIndex,navName);\n $(\"#\" + curFilter).css(\"font-weight\", \"normal\");\n var reqData = new Object; // for refreshing the center event list\n reqData.fexpr = fexpr;\n sendAjax(qstring); // pass back the state parameters\n launchAjax(bwMainEventList, reqData); // refresh the bwMainEventList display\n } else { // day, week, month views\n if (bwFilters[navIndex].length == 0) { // we have no more filters\n qstring.push(\"viewName=All\");\n } else { // we have filters\n qstring.push(\"fexpr=\" + fexpr);\n }\n launch(bwUrls.setSelection, qstring); // full request / response - includes state parameters\n }\n}", "function controlContentList(type){\n\n if(type == \"People\"){\n if(people.results.length) constructProfileList(people);\n }\n else{\n switch(type){\n case \"TV Shows\": if(tv.results.length) constructContentList(tv, \"tv\"); break;\n case \"Movies\": if(movies.results.length) constructContentList(movies, \"movie\"); break;\n case \"Collections\": if(collections.results.length) constructContentList(collections); break;\n }\n }\n\n if(currentList.total_pages > 1) updatePageNumbers();\n}", "function evtHandler() {\n // console.log(\"event handler initialized\");\n //jQuery('#editbox').dialog({'autoOpen': false});\n\n jQuery('#list-usePref li').click(function () {\n\n resetClass(jQuery(this), 'active');\n jQuery(this).addClass('active');\n // console.log(\"colorSelector: \",colorSelector);\n triggerViz(styleVal);\n\n });\n\n }", "function initSecondFilter(){\n var secondFilterWrap = getComponent('second-filter');\n var secondArrays = secondFilterWrap.getElementsByTagName('li');\n\n [].forEach.call(secondArrays,function (item) {\n item.addEventListener('click',selected);\n })\n\n function selected(){\n if(this.firstElementChild.classList.contains('hidbc')){\n this.firstElementChild.classList.remove('hidbc');\n secondFilterStatus.push(this.innerText[0]);\n }else{\n this.firstElementChild.classList.add('hidbc');\n secondFilterStatus.splice(secondFilterStatus.indexOf(this.innerText[0]),1);\n }\n update();\n }\n}", "function onListButtonClick() {\r\n\r\n if (isFlex) return;\r\n\r\n if (!isSlideOpen) {\r\n openSlideList();\r\n showBlackPanel();\r\n\r\n } else {\r\n closeSlideList();\r\n hideBlackPanel();\r\n }\r\n }", "function handleOnButtonClick(btn) {\r\n switch (btn) {\r\n case 'FILTER':\r\n var dividendEventId = dividendReportListGrid1.recordset(\"ID\").value;\r\n var policyNo = getObjectValue(\"policyNoCriteria\");\r\n var filterStr;\r\n if (dti.oasis.page.useJqxGrid()) {\r\n filterStr = \"CDIVIDENDEVENTID='\" + dividendEventId + \"' and \" +\r\n \" contains(CPOLICYNO,'\" + policyNo +\"')\";\r\n } else {\r\n filterStr = \"CDIVIDENDEVENTID='\" + dividendEventId + \"' and \" +\r\n \"CPOLICYNO[contains(.,'\" + policyNo + \"')]\";\r\n }\r\n\r\n dividendReportDetailListGrid_filter(filterStr);\r\n if (isEmptyRecordset(dividendReportDetailListGrid1.recordset)) {\r\n hideEmptyTable(getTableForXMLData(dividendReportDetailListGrid1));\r\n } else {\r\n showNonEmptyTable(getTableForXMLData(dividendReportDetailListGrid1));\r\n }\r\n break;\r\n case 'SEARCH':\r\n document.forms[0].process.value = \"loadAllDividendReport\";\r\n submitFirstForm();\r\n break;\r\n default:break;\r\n }\r\n}", "_listBoxChangeHandler(event) {\n const that = this;\n\n if ((that.dropDownAppendTo && that.dropDownAppendTo.length > 0) || that.enableShadowDOM) {\n that.$.fireEvent('change', event.detail);\n }\n\n if (that.autoComplete === 'list' && event.detail) {\n const lastSelectedItem = that.$.listBox._items[event.detail.index];\n\n that._lastSelectedItem = lastSelectedItem && lastSelectedItem.selected ? lastSelectedItem : undefined;\n }\n\n that._applySelection(that.selectionMode, event.detail);\n }", "function filterChange() {\n updateFilter();\n pullEvents();\n //put events in page\n}", "function WodUiActionList(skills, actions) {\n\n WodUiWidget.call(this, 'div')\n\n this.setStyleProperty('width', '950px')\n\n this.actions = actions\n\n var _this = this\n\n this.modBox = new WodUiWidget('div')\n this.modBox.setStyleProperty('width', '300px')\n this.modBox.setStyleProperty('paddingBottom', '10px')\n this.modBox.setStyleProperty('float', 'right')\n this.appendChild(this.modBox)\n\n this.list = new WodUiList()\n this.list.table.setStyleProperty('width', '640px')\n this.list.table.setStyleProperty('height', '400px')\n this.list.setSelectionChangeListener(function() {\n _this.actionSelectionChanged()\n })\n this.appendChild(this.list)\n\n this.list.addButton(\n new WodUiImage('button-up.png', 24, 24, WOD_STR.ActionList.buttons.up),\n function(event) {\n _this.list.moveUp()\n _this.rebuildModel()\n }\n )\n\n this.list.addButton(\n new WodUiImage('button-toggle.png', 24, 24, WOD_STR.ActionList.buttons.toggle),\n function() {\n var item = _this.list.getSelectedItem()\n if (item) {\n item.toggleEnabled()\n }\n }\n )\n\n this.list.addButton(\n new WodUiImage('button-down.png', 24, 24, WOD_STR.ActionList.buttons.down),\n function() {\n _this.list.moveDown()\n _this.rebuildModel()\n }\n )\n\n this.list.addButton(\n new WodUiImage('button-add.png', 24, 24, WOD_STR.ActionList.buttons.add),\n function() {\n _this.addAction(new WodAction())\n _this.rebuildModel()\n }\n )\n\n this.list.addButton(\n new WodUiImage('button-del.png', 24, 24, WOD_STR.ActionList.buttons.remove),\n function() {\n _this.list.removeItem()\n\n if (_this.list.getItemCount()==0){\n _this.addAction(new WodAction())\n }\n\n _this.rebuildModel()\n }\n )\n\n this.list.addButton(\n new WodUiImage('button-copy.png', 24, 24, WOD_STR.ActionList.buttons.copy),\n function() {\n\n\n var src = _this.getSelectedAction()\n\n if (typeof src != 'undefined') {\n var dst = new WodAction()\n\n dst.copyFrom(src)\n _this.addAction(dst)\n _this.rebuildModel()\n _this.list.setSelectedIndex( _this.list.getItemCount()-1 )\n }\n }\n )\n\n\n\n //\n // Fertigkeit (Dropdown)\n //\n\n this.skillHeading = new WodUiHeading(4, WOD_STR.ActionList.skill)\n this.modBox.appendChild(this.skillHeading)\n\n this.skillDropdown = new WodUiSkillDropdown(skills)\n this.skillDropdown.setStyleProperty('width', '100%')\n this.skillDropdown.setSelectionChangeListener(function() {\n _this.skillSelectionChanged()\n })\n this.modBox.appendChild(this.skillDropdown)\n\n //\n // Gegenstände (Dropdown(s))\n //\n\n this.itemHeading = new WodUiHeading(4, WOD_STR.ActionList.item)\n this.modBox.appendChild(this.itemHeading)\n\n this.itemDropdown = new WodUiItemDropdown()\n this.itemDropdown.setStyleProperty('width', '100%')\n this.itemDropdown.setSelectionChangeListener(function() {\n _this.itemSelectionChanged()\n })\n this.modBox.appendChild(this.itemDropdown)\n\n var itemGemLabel = new WodUiHeading(4, WOD_STR.Wod.item.socket + ' ')\n this.modBox.appendChild( itemGemLabel )\n\n var isInline = false\n this.itemGemSelect = new WoDUiGemDropDown( itemGemLabel, isInline )\n this.itemGemSelect.setSelectionChangeListener(function() {\n _this.itemSelectionChanged()\n })\n\n this.modBox.appendChild( this.itemGemSelect )\n\n this.ammoHeading = new WodUiHeading(4, WOD_STR.ActionList.ammo)\n this.modBox.appendChild(this.ammoHeading)\n\n\n this.ammoDropdowns = new Object()\n this.ammoGemSelects = new Object()\n\n for (var itemClassId in THE_ENV.ammoClasses) {\n\n var dropdown = new WodUiItemDropdown(THE_ENV.ammoClasses[itemClassId], false)\n dropdown.setStyleProperty('width', '100%')\n dropdown.setSelectionChangeListener(function(itemClassId) {\n _this.ammoSelectionChanged(itemClassId)\n }, itemClassId)\n this.ammoDropdowns[itemClassId] = dropdown\n this.modBox.appendChild(dropdown)\n\n var itemGemLabel = false\n var isInline = false\n\n var itemGemSelect = new WoDUiGemDropDown( itemGemLabel, isInline )\n itemGemSelect.setSelectionChangeListener(function( aItemClassId ) {\n _this.ammoSelectionChanged( aItemClassId )\n }, itemClassId )\n\n this.modBox.appendChild(itemGemSelect)\n this.ammoGemSelects[itemClassId] = itemGemSelect\n this.modBox.appendChild(itemGemSelect)\n }\n\n //\n // Positionen (Dropdown und Liste)\n //\n\n this.positionHeading = new WodUiHeading(4, WOD_STR.ActionList.position)\n this.modBox.appendChild(this.positionHeading)\n\n this.positionDropdown = new WodUiPositionDropdown(wod_createPositions(true, true))\n this.positionDropdown.setStyleProperty('width', '100%')\n this.positionDropdown.setSelectionChangeListener(function() {\n _this.positionSelectionChanged()\n })\n this.modBox.appendChild(this.positionDropdown)\n\n this.positionsHeading = new WodUiHeading(4, WOD_STR.ActionList.positions)\n this.modBox.appendChild(this.positionsHeading)\n\n this.customPositionsDropdown = new WodUiDropdown()\n this.customPositionsDropdown.addOption(WOD_POSOPTS_DEFAULT, WOD_STR.ActionList.customPositions.no)\n this.customPositionsDropdown.addOption(WOD_POSOPTS_CUSTOM, WOD_STR.ActionList.customPositions.yes)\n this.customPositionsDropdown.addOption(WOD_POSOPTS_RAND, WOD_STR.ActionList.customPositions.rand)\n\n\n this.customPositionsDropdown.setStyleProperty('width', '100%')\n this.customPositionsDropdown.setSelectionChangeListener(function() {\n _this.customPositionsSelectionChanged()\n })\n this.modBox.appendChild(this.customPositionsDropdown)\n\n this.positionList = new WodUiPositionList(wod_createPositions(true))\n this.positionList.setStyleProperty('width', '100%')\n this.positionList.setPositionsChangeListener(function() {\n _this.positionsChanged()\n })\n this.modBox.appendChild(this.positionList)\n\n\n\n this.repeatHeading = new WodUiHeading(4, WOD_STR.ActionList.repeat_hl)\n this.modBox.appendChild(this.repeatHeading)\n\n\n this.repeatDropdown = new WodUiDropdown()\n this.repeatDropdown.addOption(WOD_EXEC_DEFAULT, WOD_STR.ActionList.defaction)\n this.repeatDropdown.addOption(WOD_EXEC_REPEAT, WOD_STR.ActionList.repeat)\n this.repeatDropdown.addOption(WOD_EXEC_ONCEONLY, WOD_STR.ActionList.onceonly)\n this.repeatDropdown.addOption(WOD_EXEC_RANDOM, WOD_STR.ActionList.random)\n\n this.repeatDropdown.setStyleProperty('width', '100%')\n this.repeatDropdown.setSelectionChangeListener(function() {\n _this.getSelectedAction().repeat = _this.repeatDropdown.getSelectedOption()\n _this.list.getSelectedItem().refresh()\n })\n this.modBox.appendChild(this.repeatDropdown)\n\n\n\n\n this.refreshModVisibility()\n\n}", "_addSearchWithFiltersEvents() {\n for (let filter of FILTERS) {\n const filterInput = document.getElementById(`${filter}`);\n const itemsList = document.getElementById(`${filter}-list`);\n const itemsLines = document.querySelectorAll(`#${filter}-list li`);\n\n filterInput.oninput = () => {\n let itemsListsToDisplay = {};\n Object.assign(itemsListsToDisplay, this._filtersItems);\n\n itemsListsToDisplay[filter] = itemsListsToDisplay[filter].filter(\n (item) =>\n keepOnlyLettersAndRemoveAccents(item).startsWith(\n keepOnlyLettersAndRemoveAccents(filterInput.value)\n )\n );\n\n this._renderFiltersOptions(itemsListsToDisplay);\n this._sizeFilterList(filter);\n };\n\n filterInput.onsubmit = () => {\n filterInput.blur();\n };\n\n filterInput.addEventListener(\"focusout\", () => {\n filterInput.value = \"\";\n });\n\n itemsList.onclick = (e) => e.stopPropagation();\n\n for (let itemLine of itemsLines) {\n itemLine.onclick = () => {\n if (!this._badgesList.includes(itemLine.textContent)) {\n this._createFilterBadge(filter, itemLine.textContent);\n\n const recipesListToDisplay = this.getRecipesListToDisplay();\n\n this._renderFiltersOptions(\n this.getItemsListsToDisplay(recipesListToDisplay)\n );\n this._displaySearchResultMessage(recipesListToDisplay);\n this._renderCards(recipesListToDisplay);\n\n window.scrollTo(0, 0);\n }\n };\n }\n }\n }", "function filterMenu(e) {\n if (e.field == \"tar_dat_fchlimite\") {\n var beginOperator = e.container.find(\"[data-role=dropdownlist]:eq(0)\").data(\"kendoDropDownList\");\n beginOperator.value(\"gte\");\n beginOperator.trigger(\"change\");\n\n var endOperator = e.container.find(\"[data-role=dropdownlist]:eq(2)\").data(\"kendoDropDownList\");\n endOperator.value(\"lte\");\n endOperator.trigger(\"change\");\n e.container.find(\".k-dropdown\").hide()\n }\n if (e.field == \"tar_dat_fchcreacion\") {\n var beginOperator = e.container.find(\"[data-role=dropdownlist]:eq(0)\").data(\"kendoDropDownList\");\n beginOperator.value(\"gte\");\n beginOperator.trigger(\"change\");\n\n var endOperator = e.container.find(\"[data-role=dropdownlist]:eq(2)\").data(\"kendoDropDownList\");\n endOperator.value(\"lte\");\n endOperator.trigger(\"change\");\n e.container.find(\".k-dropdown\").hide()\n }\n if (e.field == \"tar_int_estado\") {\n //e.container.find(\"k-widget.k-dropdown.k-header\").css(\"display\", \"none\");\n // Change the text field to a dropdownlist in the Role filter menu.\n e.container.find(\".k-textbox:first\")\n //.removeClass(\"k-textbox\")\n .kendoDropDownList({\n dataSource: new kendo.data.DataSource({\n data: [\n {\n title: \"Pendiente\",\n value: 1\n },\n {\n title: \"Cerrado\",\n value: 0\n }\n ]\n }),\n dataTextField: \"title\",\n dataValueField: \"value\"\n });\n }\n if (e.field == \"tar_int_prioridad\") {\n //e.container.find(\"k-widget.k-dropdown.k-header\").css(\"display\", \"none\");\n // Change the text field to a dropdownlist in the Role filter menu.\n e.container.find(\".k-textbox:first\")\n //.removeClass(\"k-textbox\")\n .kendoDropDownList({\n dataSource: new kendo.data.DataSource({\n data: [\n {\n title: \"Alta\",\n value: 3\n },\n {\n title: \"Media\",\n value: 2\n },\n {\n title: \"Baja\",\n value: 1\n }\n ]\n }),\n dataTextField: \"title\",\n dataValueField: \"value\"\n });\n }\n\n }", "function setFilterAction(){\n\t$(\".data-filter\").keyup(function(){\n\t\tvar options=$(\"#\"+$(this).data(\"filter\") + \" option\");\n\t\tvar filterValue=$(this).val().toLowerCase();\n\t\toptions.each(function(){\n\t\t\tif($(this).text().toLowerCase().includes(filterValue)) $(this).show();\n\t\t\telse $(this).hide();\n\t\t})\n\t});\n}", "function filterMessage2(what){\n var log = document.getElementById(\"log\");\n\n displayed = (AutoTrimpsDebugTabVisible) ? false : true;\n AutoTrimpsDebugTabVisible = displayed;\n\n var toChange = document.getElementsByClassName(what + \"Message\");\n var btnText = (displayed) ? what : what + \" off\";\n var btnElem = document.getElementById(what + \"Filter\");\n btnElem.innerHTML = btnText;\n btnElem.className = \"\";\n btnElem.className = getTabClass(displayed);\n displayed = (displayed) ? \"block\" : \"none\";\n for (var x = 0; x < toChange.length; x++){\n toChange[x].style.display = displayed;\n }\n log.scrollTop = log.scrollHeight;\n}", "function WorksheetAddAnalysesView() {\n\n var that = this;\n\n that.load = function() {\n\n // search form - selecting a category fills up the service selector\n $('[name=\"list_getCategoryTitle\"]').live(\"change\", function(){\n val = $('[name=\"list_getCategoryTitle\"]').val();\n if(val == 'any'){\n $('[name=\"list_Title\"]').empty();\n $('[name=\"list_Title\"]').append(\"<option value='any'>\"+_('Any')+\"</option>\");\n return;\n }\n $.ajax({\n url: window.location.href.split(\"?\")[0].replace(\"/add_analyses\",\"\") + \"/getServices\",\n type: 'POST',\n data: {'_authenticator': $('input[name=\"_authenticator\"]').val(),\n 'getCategoryTitle': val},\n dataType: \"json\",\n success: function(data, textStatus, $XHR){\n current_service_selection = $('[name=\"list_Title\"]').val();\n $('[name=\"list_Title\"]').empty();\n $('[name=\"list_Title\"]').append(\"<option value='any'>\"+_('Any')+\"</option>\");\n for(i=0; i<data.length; i++){\n if (data[i] == current_service_selection){\n selected = 'selected=\"selected\" ';\n } else {\n selected = '';\n }\n $('[name=\"list_Title\"]').append(\"<option \"+selected+\"value='\"+data[i]+\"'>\"+data[i]+\"</option>\");\n }\n }\n });\n });\n $('[name=\"list_getCategoryTitle\"]').trigger(\"change\");\n\n // add_analyses analysis search is handled by bika_listing default __call__\n $('.ws-analyses-search-button').live('click', function (event) {\n // in this context we already know there is only one bika-listing-form\n var form_id = \"list\";\n var form = $(\"#list\");\n\n // request new table content by re-routing bika_listing_table form submit\n $(form).append(\"<input type='hidden' name='table_only' value='\" + form_id + \"'>\");\n // dropdowns are printed in ../templates/worksheet_add_analyses.pt\n // We add <formid>_<index>=<value>, which are checked in bika_listing.py\n var filter_indexes = ['getCategoryTitle', 'Title', 'getClientTitle'];\n var i, fi;\n for (i = 0; i < filter_indexes.length; i++) {\n fi = form_id + \"_\" + filter_indexes[i];\n var value = $(\"[name='\" + fi + \"']\").val();\n if (value == undefined || value == null || value == 'any') {\n $(\"#list > [name='\" + fi + \"']\").remove();\n $.query.REMOVE(fi);\n }\n else {\n $(form).append(\"<input type='hidden' name='\" + fi + \"' value='\" + value + \"'>\");\n $.query.SET(fi, value);\n }\n }\n\n var options = {\n target: $('.bika-listing-table'),\n replaceTarget: true,\n data: form.formToArray(),\n success: function () {\n }\n }\n var url = window.location.href.split(\"?\")[0].split(\"/add_analyses\")[0];\n url = url + \"/add_analyses\" + $.query.toString();\n window.history.replaceState({}, window.document.title, url);\n\n var stored_form_action = $(form).attr(\"action\");\n $(form).attr(\"action\", window.location.href);\n form.ajaxSubmit(options);\n\n for (i = 0; i < filter_indexes.length; i++) {\n fi = form_id + \"_\" + filter_indexes[i];\n $(\"#list > [name='\" + fi + \"']\").remove();\n }\n $(form).attr(\"action\", stored_form_action);\n $(\"[name='table_only']\").remove();\n\n return false;\n });\n }\n}", "function TabList (id, trigger_fct, init_tabs)\n{\n\tthis.id = id;\n\tthis.trigger_fct = trigger_fct;\n\tthis.tc = new Array; // Tab Collection\n\tthis.selected = null; // Selected tab\n\t\n\tfor (var init_tab in init_tabs)\n\t{\n\t\tthis.Add(init_tab, init_tabs[init_tab]);\n\t}\n}" ]
[ "0.59621215", "0.5920585", "0.58055854", "0.5698286", "0.5674853", "0.55854994", "0.5548058", "0.5524902", "0.55244935", "0.552068", "0.5477944", "0.5459252", "0.54030263", "0.54017365", "0.5384792", "0.53840965", "0.5382668", "0.5337101", "0.53353786", "0.5330947", "0.53273094", "0.5265558", "0.526129", "0.5253842", "0.52360076", "0.52245206", "0.5206643", "0.51967543", "0.5183377", "0.5181817", "0.51692474", "0.5168468", "0.51586497", "0.5156079", "0.5153432", "0.51446855", "0.51382667", "0.51319635", "0.5130741", "0.5129626", "0.5128957", "0.5128848", "0.5123443", "0.51231635", "0.5122155", "0.5119954", "0.5113676", "0.51127064", "0.51045376", "0.51020336", "0.51008517", "0.50999755", "0.50997436", "0.5096805", "0.5094183", "0.5093072", "0.50894576", "0.5083444", "0.5079246", "0.50716317", "0.50587356", "0.505641", "0.5056229", "0.505613", "0.5053954", "0.5053759", "0.505241", "0.50429237", "0.5041817", "0.50415444", "0.5038338", "0.5032263", "0.5030545", "0.5023863", "0.5023523", "0.5020895", "0.50197387", "0.5018508", "0.50159436", "0.50147206", "0.50139725", "0.5012298", "0.5007133", "0.49992922", "0.49903056", "0.49900773", "0.4986722", "0.4981637", "0.4979416", "0.49769178", "0.49741298", "0.49658066", "0.49657565", "0.49633437", "0.49614862", "0.4950691", "0.4950465", "0.49496257", "0.49495438", "0.4947945", "0.49471873" ]
0.0
-1
can't use beforeEach b/c some tests include multiple requests, in between each of which we need to call this.
function reset() { resSpy.status.reset(); unauthenticatedHandler.reset(); unauthorizedHandler.reset(); routeHandler.reset(); firewallAdapter.reset(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "beforeAll() {}", "beforeEach() {}", "function commonBeforeSteps() {\n cy.stubAuth();\n cy.login({ isStubbed: true });\n cy.stubRequest({\n url: `api/v1/billing/subscription`,\n fixture: 'billing/subscription/200.get.json',\n requestAlias: 'billingReq',\n });\n cy.stubRequest({\n url: 'api/v1/account?include=usage',\n fixture: 'account/200.get.include-usage.json',\n requestAlias: 'accountUsageReq',\n });\n cy.stubRequest({\n url: '/api/v1/usage/history',\n fixture: 'usage/history/200.get.json',\n requestAlias: 'usageHistoryReq',\n });\n}", "beforeEach()\n {\n }", "afterEach() {}", "before()\n {\n }", "beforeEach() {\n App = startApp();\n }", "after(configs) {\n console.log('mock request finished', configs);\n }", "afterEach()\n {\n }", "before(app) {\n app.get('/api/test', (req, res) => {\n res.json({\n code: 200,\n message: 'hello world'\n })\n })\n }", "before (callback) {\n\t\tBoundAsync.series(this, [\n\t\t\tsuper.before,\t\t\t// run standard setup for test of fetching users\n\t\t\tthis.createForeignTeam,\t// create another team where the current user will not be a member of the team\n\t\t\tthis.setPath\t\t\t// set the path to use when issuing the test request\n\t\t], callback);\n\t}", "before(app) {\n apiMocker(app, path.resolve(__dirname, '../public/mock.js'));\n }", "before (callback) {\n\t\tthis.testBegins = Date.now();\n\t\tthis.init(callback);\n\t}", "_apiMock(apiData = {}) {\n mockServer(apiData);\n }", "function setUp() {\n}", "function before() {\n\n server = sinon.fakeServer.create();\n }", "beforeEach() {\n server = new Pretender();\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 setUp()/* : void*/\n {\n }", "function setupForTesting() {\n if (!Test) {\n Test = requireModule('ember-testing/test')['default'];\n }\n\n _emberMetalCore.default.testing = true;\n\n // if adapter is not manually set default to QUnit\n if (!Test.adapter) {\n Test.adapter = _emberTestingAdaptersQunit.default.create();\n }\n\n requests = [];\n Test.pendingAjaxRequests = requests.length;\n\n _emberViewsSystemJquery.default(document).off('ajaxSend', incrementAjaxPendingRequests);\n _emberViewsSystemJquery.default(document).off('ajaxComplete', decrementAjaxPendingRequests);\n _emberViewsSystemJquery.default(document).on('ajaxSend', incrementAjaxPendingRequests);\n _emberViewsSystemJquery.default(document).on('ajaxComplete', decrementAjaxPendingRequests);\n }", "function setUp(){\n return app.env.IS_TESTING = true;\n}", "expectAllConsumed() {\n return this.getTest().then((result) => {\n result.expectations.forEach((expectation) => {\n if (expectation.repeat !== -1 && expectation.requestCount < expectation.repeat) {\n throw new Error(`Expected url ${expectation.request.url} to be called `\n + `${expectation.repeat} times but was called ${expectation.requestCount} times`);\n }\n });\n });\n }", "function mockRequestScope() {\n Object.assign(global, makeServiceWorkerEnv());\n Object.assign(global, { __STATIC_CONTENT_MANIFEST: (0, exports.mockManifest)() });\n Object.assign(global, { __STATIC_CONTENT: (0, exports.mockKV)(store) });\n Object.assign(global, { caches: (0, exports.mockCaches)() });\n}", "setupForMultiRequest(responses) {\n\t\tthis.request = (options, success, error) => {\n\t\t\tfor (var response in responses) {\n\t\t\t\tif (options.host === response) {\n\t\t\t\t\tsuccess(responses[response]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function mockXHR () {\n mockXHRStart(mocks)\n}", "function setupForTesting() {\n (0, _emberDebug.setTesting)(true);\n\n var adapter = (0, _adapter.getAdapter)();\n // if adapter is not manually set default to QUnit\n if (!adapter) {\n (0, _adapter.setAdapter)(typeof self.QUnit === 'undefined' ? new _adapter2.default() : new _qunit.default());\n }\n\n if (_emberViews.jQuery) {\n (0, _emberViews.jQuery)(document).off('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).off('ajaxComplete', _pending_requests.decrementPendingRequests);\n\n (0, _pending_requests.clearPendingRequests)();\n\n (0, _emberViews.jQuery)(document).on('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).on('ajaxComplete', _pending_requests.decrementPendingRequests);\n }\n }", "function setupForTesting() {\n (0, _emberDebug.setTesting)(true);\n\n var adapter = (0, _adapter.getAdapter)();\n // if adapter is not manually set default to QUnit\n if (!adapter) {\n (0, _adapter.setAdapter)(typeof self.QUnit === 'undefined' ? new _adapter2.default() : new _qunit.default());\n }\n\n if (_emberViews.jQuery) {\n (0, _emberViews.jQuery)(document).off('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).off('ajaxComplete', _pending_requests.decrementPendingRequests);\n\n (0, _pending_requests.clearPendingRequests)();\n\n (0, _emberViews.jQuery)(document).on('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).on('ajaxComplete', _pending_requests.decrementPendingRequests);\n }\n }", "function setupForTesting() {\n (0, _emberDebug.setTesting)(true);\n\n var adapter = (0, _adapter.getAdapter)();\n // if adapter is not manually set default to QUnit\n if (!adapter) {\n (0, _adapter.setAdapter)(typeof self.QUnit === 'undefined' ? new _adapter2.default() : new _qunit.default());\n }\n\n if (_emberViews.jQuery) {\n (0, _emberViews.jQuery)(document).off('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).off('ajaxComplete', _pending_requests.decrementPendingRequests);\n\n (0, _pending_requests.clearPendingRequests)();\n\n (0, _emberViews.jQuery)(document).on('ajaxSend', _pending_requests.incrementPendingRequests);\n (0, _emberViews.jQuery)(document).on('ajaxComplete', _pending_requests.decrementPendingRequests);\n }\n }", "function setUp() {\n this.popupClient = new bite.client.BugDetailsPopup();\n this.mockCaller = new mockCallBack();\n}", "function beforeTesting(suite, options) {\n // extra time to prime the 'requires'\n suite.timeout(500);\n\n app = express();\n host = options.hostname;\n process.env.CLAY_ACCESS_KEY = 'testKey';\n stubSiteConfig(options.sandbox);\n stubFiles(options.sandbox);\n stubMeta(options.sandbox);\n stubSchema(options.sandbox);\n stubRenderExists(options.sandbox);\n stubRenderComponent(options.sandbox);\n stubRenderPage(options.sandbox);\n stubUid(options.sandbox);\n routes.addHost({\n router: app,\n hostname: host,\n sites: null\n });\n\n return storage.clearMem().then(function () {\n return bluebird.all([\n request(app).put('/_components/valid', JSON.stringify(options.data)),\n request(app).get('/_components/valid'),\n request(app).post('/_components/valid', JSON.stringify(options.data)),\n request(app).delete('/_components/valid')\n ]);\n });\n}", "beforeRun() {}", "function test_request_filter_on_request_page() {}", "function beforeEach() {\n totalLintErrors = 0;\n totalFelintErrors = 0;\n exitCode = 0;\n }", "setup() {\n this.enqueueTearDownTask(() => this.clearStubs())\n }", "init() {\n this.testMainPage('/api/v1');\n\n this.artistTest = new ArtistTest(this._app, '/api/v1/artists');\n this.testArtists();\n\n this.albumTest = new AlbumTest(this._app, '/api/v1/albums', new Artist(this.artistTest.getArtistContent()));\n this.testAlbums();\n }", "async function handleEnvironmentSetup(request, h) {\n logger(`Test environment setup request recerived from: ${request.info.remoteAddress}:${request.info.remotePort}`);\n\n let reply;\n let success;\n\n if(request.payload && request.payload.code) {\n const code = request.payload.code;\n\n switch(code) {\n case testCodes.A_01:\n request.server.methods.testMockLevels(svEnvironment.SVA_01);\n success = true;\n break;\n case testCodes.A_02:\n request.server.methods.testMockLevels(svEnvironment.SVA_02);\n success = true;\n break; \n case testCodes.A_03:\n request.server.methods.testMockLevels(svEnvironment.SVA_03);\n success = true;\n break;\n case testCodes.F_01:\n request.server.methods.testMockPlayers(svEnvironment.SVF_01);\n success = await dbEnviromentSetup(dbEnvironment.DBF_01);\n break;\n case testCodes.F_02:\n request.server.methods.testMockPlayers(svEnvironment.SVF_02);\n success = await dbEnviromentSetup(dbEnvironment.DBF_03);\n break;\n case testCodes.F_03:\n request.server.methods.testMockPlayers(svEnvironment.SVF_02);\n success = await dbEnviromentSetup(dbEnvironment.DBF_02);\n break;\n case testCodes.F_04:\n break;\n case testCodes.F_05:\n request.server.methods.testMockPlayers(svEnvironment.SVF_03);\n success = await dbEnviromentSetup(dbEnvironment.DBF_01);\n break;\n case testCodes.F_06:\n request.server.methods.testMockPlayers(svEnvironment.SVF_04);\n success = await dbEnviromentSetup(dbEnvironment.DBF_03);\n break;\n case testCodes.G_01:\n request.server.methods.testMockPlayers(svEnvironment.SVG_01);\n success = true;\n break;\n case testCodes.G_02:\n request.server.methods.testMockPlayers(svEnvironment.SVG_02);\n success = true;\n break;\n case testCodes.G_03:\n request.server.methods.testMockPlayers(svEnvironment.SVG_03);\n success = true;\n break;\n case testCodes.H_01:\n success = await dbEnviromentSetup(dbEnvironment.DBH_01);\n break;\n case testCodes.H_02:\n success = await dbEnviromentSetup(dbEnvironment.DBH_02);\n break;\n case testCodes.H_03:\n success = await dbEnviromentSetup(dbEnvironment.DBH_03);\n break;\n case testCodes.SERVER_INIT:\n success = await dbEnviromentSetup(dbEnvironment.RESET);\n break;\n default:\n break;\n }\n\n if(success) {\n reply = buildTestRequestSuccessReply();\n } else {\n reply = buildFailureReply();\n }\n\n } else {\n reply = buildBadRequestReply();\n }\n\n return h.response(reply);\n}", "async setUp () {\n throw new NotImplemented('setUp')\n }", "function setupChromeApis() {\n new MockChromeStorageAPI();\n}", "afterAll() {//\n }", "testMainPage(mainPageApiUrl) {\n describe ('Main page', () => {\n it('Main page content', (done) => {\n chai.request(this._app)\n .get(mainPageApiUrl)\n .end((err, res) => {\n res.should.have.status(200);\n done();\n });\n });\n });\n }", "setupHandler() {\n let handler = function(settings) {\n if (!this.basicRequestMatches(settings)) {\n return false;\n }\n if (!this.extraRequestMatches(settings)) {\n return false;\n }\n this.timesCalled++;\n return this.getResponse();\n }.bind(this);\n\n Ember.$.mockjax(handler);\n\n return handler;\n }", "function testSetupCalled() {\n assertEquals(true, setUpCalled);\n}", "function setUpMocks() {\n\n global.window = {\n self: 'https://me.edu',\n top: 'https://you.edu',\n name: 'DCE-iframe-API-ZYXABC',\n parent: {\n postMessage: (msg) => {}\n }\n };\n global.paella = _.cloneDeep(mockPaellaObject);\n global.class = function (classDef) {\n function createClass() {\n return _.cloneDeep(classDef);\n };\n global.paella.plugins['test'] = createClass();\n };\n}", "function _testSuiteInit() {\n return ImptTestHelper.retrieveDeviceInfo(PRODUCT_NAME, DEVICE_GROUP_NAME).\n then(() => ImptTestHelper.createDeviceGroup(PRODUCT_NAME, DEVICE_GROUP_NAME)).\n then((dgInfo) => { dg_id = dgInfo.dgId; }).\n then(() => ImptTestHelper.deviceAssign(DEVICE_GROUP_NAME)).\n then(() => Shell.cp('-Rf', `${__dirname}/fixtures/devicecode.nut`, ImptTestHelper.TESTS_EXECUTION_FOLDER)).\n then(() => Shell.cp('-Rf', `${__dirname}/fixtures/agentcode.nut`, ImptTestHelper.TESTS_EXECUTION_FOLDER));\n }", "function setAllScenariosToPassThrough() {\n var deferred = protractor.promise.defer();\n var response = request('PUT', baseUrl + '/mocks/passthroughs', {\n headers: {\n 'Content-Type': 'application/json',\n 'ngapimockid': ngapimockid\n }\n });\n\n if (response.statusCode !== 200) {\n deferred.reject('Could not set scenarios to passthroughs');\n } else {\n deferred.fulfill();\n }\n return deferred.promise;\n }", "function init() {\n\t\tuserAgentCheck();\n\t\ttestThis();\n\t}", "function test5() {\n\tvar start = new Date();\n\n\tvar allThings = $.when(\n\t\tgetJsonWithPromise('vessels.json?$parameter=a'),\n\t\tgetJsonWithPromise('vessels.json?$parameter=b'),\n\t\tgetJsonWithPromise('vessels.json?$parameter=c'),\n\t\tgetJsonWithPromise('vessels.json?$parameter=d'),\n\t\tgetJsonWithPromise('vessels.json?$parameter=e'));\n\n\tallThings.done(function(a, b, c, d, e, f) {\n\t\tvar diff = (new Date()) - start;\n\t\tconsole.log('Did 5 API calls in ' + diff + ' millis');\n\t});\n}", "init() {\n ['post', 'get', 'put', 'patch', 'delete'].forEach((method) => {\n moduleUtils.patchModule(\n 'superagent',\n method,\n superagentWrapper\n );\n });\n }", "function commonSetUp() {\n\t\tvar self = this;\n\t\tself.oHTMLTestObject\n\t}", "before (callback) {\n\t\tthis.expectedTeamVersion = 5;\n\t\tthis.init(callback);\n\t}", "function tests() {\n // before\n beforeEach(function () {\n // mock a request\n this.request = new MockExpressRequest(testRawSettings);\n // write to the stream\n this.request.write(testRawBody);\n // end the stream\n this.request.end();\n // mock an empty request\n this.emptyRequest = new MockExpressRequest();\n // mock a response\n this.response = new MockExpressReponse();\n });\n // get raw body\n context(\"when no data sent\", function () {\n it(\"should not error\", emptyNoErrors);\n });\n context(\"when data sent\", function () {\n it(\"should not error\", noErrors);\n it(\"should have raw body property\", hasBody);\n });\n}", "before (callback) {\n\t\tBoundAsync.series(this, [\n\t\t\tsuper.before,\t// do the usual test prep\n\t\t\tthis.changePath,\n\t\t], callback);\n\t}", "before (callback) {\n\t\tBoundAsync.series(this, [\n\t\t\tsuper.before, // do the usual test prep\n\t\t\tthis.createSecondCompany, // prevent user from getting deleted\n\t\t\tthis.deleteCompany // perform the actual deletion\n\t\t], callback);\n\t}", "multiCheckGetUrl(expected, responses) {\n\t\tthis.get = (url, success, error) => {\n\t\t\tthis.checkPath(expected[this.requests], url);\n\t\t\tsuccess(responses[this.requests++]);\n\t\t}\n\t}", "function resetHttpSpy () {\n fakeHttp.post.resetHistory();\n }", "function resetHttpSpy () {\n fakeHttp.post.resetHistory();\n }", "before (callback) {\n\t\tBoundAsync.series(this, [\n\t\t\tCodeStreamAPITest.prototype.before.bind(this),\n\t\t\tthis.init\n\t\t], callback);\n\t}", "before (callback) {\n\t\tBoundAsync.series(this, [\n\t\t\tsuper.before,\t// do the usual test prep\n\t\t\tthis.updateCodeError\t// perform the actual update\n\t\t], callback);\n\t}", "constructor() {\n this._requests = {};\n }", "function beforeEachTest (assert) {\n\t// Re-initialise our classes\n\tmapModel = new MapModel(TEST_TILECOUNT);\n\tpixiMapView = new PixiMapView(mapModel, renderer, TEST_WINDOW_SIZE, DEFAULT_TILE_SIZE, ASSET_PATHS);\n}", "function beforeEach() public {\r\n al = new AnimeLoot();\r\n alpc = new AnimeLootPhysicalCharacteristics(address(al));\r\n }", "async function requestWrapper() {\n // ...\n expect(error).toBeDefined();\n expect(error.message).toBe('Server Error');\n done();\n }", "function setUp() {\nbitgo = new BitGoJS.BitGo({ env: 'test', accessToken: configData.accessToken });\n}", "function initTesting() {\n return Promise\n .all(allSpecFiles.map(moduleName => System.import(moduleName)))\n .then(__karma__.start, __karma__.error);\n}", "function suite(name, app) {return function() {\n\n before(function() {\n this.app = app;\n this.lr = new Server();\n\n this.app\n .use(connect.query())\n .use(connect.bodyParser())\n .use(this.lr.handler.bind(this.lr));\n\n this.server = http.createServer(this.app);\n debug('Start %s suite, listen on %d', name, port);\n this.server.listen(port);\n });\n\n\n after(function(done) {\n this.server.close(done);\n });\n\n describe('GET /', function() {\n it('respond with nothing, but respond', function(done){\n request(this.server)\n .get('/')\n .expect('Content-Type', /json/)\n .expect(/\\{\"tinylr\":\"Welcome\",\"version\":\"0.0.[\\d]+\"\\}/)\n .expect(200, done);\n });\n\n it('unknown route are noop with middlewares, next-ing', function(done){\n request(this.server)\n .get('/whatev')\n .expect('Content-Type', 'text/plain')\n .expect('Cannot GET /whatev')\n .expect(404, done);\n });\n });\n\n\n describe('GET /changed', function() {\n it('with no clients, no files', function(done) {\n request(this.server)\n .get('/changed')\n .expect('Content-Type', /json/)\n .expect(/\"clients\":\\[\\]/)\n .expect(/\"files\":\\[\\]/)\n .expect(200, done);\n });\n\n it('with no clients, some files', function(done) {\n request(this.server)\n .get('/changed?files=gonna.css,test.css,it.css')\n .expect('Content-Type', /json/)\n .expect('{\"clients\":[],\"files\":[\"gonna.css\",\"test.css\",\"it.css\"]}')\n .expect(200, done);\n });\n });\n\n describe('POST /changed', function() {\n it('with no clients, no files', function(done) {\n request(this.server)\n .post('/changed')\n .expect('Content-Type', /json/)\n .expect(/\"clients\":\\[\\]/)\n .expect(/\"files\":\\[\\]/)\n .expect(200, done);\n });\n\n it.skip('with no clients, some files', function(done) {\n var data = { clients: [], files: ['cat.css', 'sed.css', 'ack.js'] };\n\n var r = request(this.server)\n .post('/changed')\n .send({ files: data.files })\n .expect('Content-Type', /json/)\n .expect(JSON.stringify(data))\n .expect(200, done);\n });\n });\n\n describe('GET /livereload.js', function() {\n it('respond with livereload script', function(done) {\n request(this.server)\n .get('/livereload.js')\n .expect(/LiveReload/)\n .expect(200, done);\n });\n });\n\n describe.skip('GET /kill', function() {\n it('shutdown the server', function(done) {\n var server = this.server;\n request(server)\n .get('/kill')\n .expect(200, function(err) {\n if(err) return done(err);\n assert.ok(!server._handle);\n done();\n });\n });\n });\n\n}}", "function tryRequest() {\n self.xapp.install()\n\n request.get('/api').end(function(err, res) {\n if(err) { return done(err) }\n expect(res.ok).to.equal(true)\n done()\n })\n }", "setupRequest(request_body) {\n throw new Error('setupRequest - not implemented');\n }", "function initBDD () {\n var postmanBDD = new PostmanBDD();\n before = postmanBDD.before;\n after = postmanBDD.after;\n beforeEach = postmanBDD.beforeEach;\n afterEach = postmanBDD.afterEach;\n describe = postmanBDD.describe;\n it = postmanBDD.it;\n}", "function RUN_ALL_TESTS() {\n console.log('> itShouldGetConnections');\n getConnections();\n console.log('> itShouldGetSelf'); // Requires the scope userinfo.profile\n getSelf();\n console.log('> itShouldGetAccount');\n getAccount('me');\n}", "function setUpAssertingMocks(t) {\n global.base.Timer = timer;\n global.XMLHttpRequest = createMockXHR();\n\n function timer(callback, time, params) {\n t.equal(\n typeof callback,\n 'function',\n 'Passes a function to the timer.'\n );\n t.equal(\n time,\n mockConfig.heartBeatTime,\n 'Sets the timer to run at the interval specified in the config.'\n );\n\n callNextTick(callback, global.base.Timer);\n callNextTick(checkRepeatValue);\n\n var instance = this;\n\n function checkRepeatValue() {\n t.equal(instance.repeat, true, 'Sets the timer to repeat.');\n }\n }\n\n function createMockXHR() {\n function mockXHR() {\n debugger;\n this.open = createMockOpen();\n this.send = createMockSend();\n }\n return mockXHR;\n }\n\n function createMockOpen() {\n function mockOpen(method, URL) {\n t.equal(method, 'GET', 'Opens a request with the GET method.');\n // t.equal(URL, )\n checkHeartbeatURL(URL);\n }\n return mockOpen;\n }\n\n function createMockSend() {\n function mockSend() {\n t.pass('The xhr is actually sent.');\n }\n return mockSend;\n }\n\n function checkHeartbeatURL(URL) {\n var urlParts = url.parse(URL, true);\n var query = urlParts.query;\n\n t.equal(urlParts.pathname, '/usertracking/', 'Request pathname is correct.');\n\n t.equal(\n query._method, 'PUT', 'Sends \"PUT\" as the \"_method\" query param.'\n );\n t.equal(\n query.id,\n mockPaellaObject.player.videoIdentifier,\n 'id query param is set to the value of paella.player.videoIdentifier.'\n );\n t.equal(query.type, 'HEARTBEAT', 'type query param is correct.');\n\n t.equal(\n parseInt(query['in'], 10),\n (mockCurrentTime() + mockTrimStart()),\n '\"in\" query param is set to currentTime + trimStart.'\n );\n t.equal(\n parseInt(query.out, 10),\n (mockCurrentTime() + mockTrimStart()),\n '\"out\" query param is also set to currentTime + trimStart.'\n );\n t.equal(\n query.resource,\n mockPaellaObject.opencast.resourceId,\n 'resource query param is set to the value of paella.opencast.resourceId.'\n );\n\n var timestamp = new Date(query._);\n t.equal(\n typeof timestamp,\n 'object',\n 'The timestamp (\"_\") query param is a valid date.'\n );\n\n t.equal(\n query.playing,\n 'true',\n 'The playing query param should be set to the string \"true\".'\n );\n }\n}", "before (callback) {\n\t\t// replace the test email with something random...\n\t\tsuper.before((error) => {\n\t\t\tif (error) { return callback(error); }\n\t\t\tthis.data.email = this.userFactory.randomEmail();\n\t\t\tcallback();\n\t\t});\n\t}", "function tearDown() {\n}", "before (callback) {\n\t\tthis.init(callback);\n\t}", "before (callback) {\n\t\tthis.init(callback);\n\t}", "before (callback) {\n\t\tthis.init(callback);\n\t}", "before (callback) {\n\t\tthis.init(callback);\n\t}", "function testGetBase() {\n\n var yoke = new Yoke();\n // all resources are OK\n yoke.use(function (request) {\n request.response.end('OK');\n });\n\n new YokeTester(yoke).request('GET', '/', function(resp) {\n vassert.assertTrue(200 == resp.statusCode);\n vassert.testComplete();\n });\n}", "beforeHandling() {}", "function _testSuiteInit() {\n return ImptTestHelper.retrieveDeviceInfo(PRODUCT_NAME, DEVICE_GROUP_NAME).\n then(() => ImptTestHelper.createDeviceGroup(PRODUCT_NAME, DEVICE_GROUP_NAME));\n }", "function new_test_request() {\n return new Request(test_url)\n}", "function setUp() {\n setupChromeApis();\n installTestLogger();\n\n testFileSystem = new MockFileSystem('abc-123', 'filesystem:abc-123');\n\n testFileEntry = new MockFileEntry(\n testFileSystem, FILE_PATH,\n /** @type Metadata */ ({\n size: FILE_SIZE,\n modificationTime: FILE_LAST_MODIFIED\n }));\n\n testFileSystem.entries[FILE_PATH] = testFileEntry;\n\n storage = new TestRecordStorage();\n\n const history = new importer.PersistentImportHistory(\n importer.createMetadataHashcode, storage);\n\n historyProvider = history.whenReady();\n}", "allow() {\n beforeEach(() => throwing = false);\n afterEach(() => throwing = true);\n }", "async init(env) {\n // driver is a class property\n // env is Mocha env\n this.driver = await env.builder().build();\n }", "initialize () {\n return Promise.all([\n lib.Utils.buildShopFixtures(this.app)\n .then(fixtures => {\n this.shopFixtures = fixtures\n return lib.Utils.loadShopFixtures(this.app)\n }),\n lib.Utils.buildCountryFixtures(this.app)\n .then(fixtures => {\n this.countryFixtures = fixtures\n return lib.Utils.loadCountryFixtures(this.app)\n })\n ])\n }", "function getMockDependencies() {\n MOCKS.navigateToNextstate = function(){\n return 'navigateToNextstateSuccess'\n };\n MOCKS.navigateToProcessedState = function(){\n return 'navigateToProcessedStateSuccess'\n };\n MOCKS.getNextItemOnReasonSelection = function(){\n return 'getNextItemOnReasonSelectionSuccess'\n };\n MOCKS.orderPageOnReasonSelection = function(){\n return 'orderPageOnReasonSelectionSuccess'\n };\n MOCKS.redirectToCartOnReasonSelection = function(){\n return 'redirectToCartOnReasonSelectionSuccess'\n };\n\n MOCKS.RETURN_EXCHANGE_CONSTS ={\n RETURN_ELIGIBLE: 'returnEligible',\n EXCHANGE_ELIGIBLE: 'remorseExchangeEligible',\n RETURN_FLAG: 'returnFlag',\n EXCHANGE_FLAG: 'exchangeFlag',\n CANCELLED_STATUS: 'Cancelled',\n PARENT_STATE: 'returnWarrantyExchange',\n ORDER_FORM: '.order',\n PROCESSED_ARRAY: 'processedArray',\n POST_VOID_LABEL :'PostVoid',\n CANCEL:'Cancel',\n MY_ACCOUNT : 'myAccount',\n PRINT_SHIPPING : 'shippingLabel',\n EXCHANGE : 'Exchange',\n DEVICE_TYPE_PHONE: 'phone',\n TABLET : 'tablet'\n };\n\n MOCKS.facadeApiFactory = {\n getRequest : function() { var defer = $q.defer(); defer.resolve(); return defer.promise; },\n postRequest : sinon.stub(),\n getRequestWithQueryOptions : sinon.stub()\n };\n MOCKS.returnFormDataService = {\n createCart : sinon.stub()\n };\n\n MOCKS.returnExchangeService ={\n getFromSession : sinon.stub(),\n isAllEnabled : function(data){\n return true;\n },\n setInSession : sinon.stub()\n };\n MOCKS.returnExchangeChangeService ={\n persistState : function(data){\n return data;\n },\n restoreCheck : function(data){\n return data;\n },\n restoreApprovedItems : function(data){\n return data;\n },\n restoreAssessedItems : function(data){\n return data;\n },\n restoreReturnExchangeCheck : function(data){\n return data;\n }\n };\n MOCKS.returnExchangeHelperService ={\n checkItems : function(data){\n return data;\n },\n populateParentId : function(data){\n return data;\n },\n getWarrantyStatus : sinon.stub(),\n setGrandCentralIneligibilityResultFlag : sinon.stub(),\n getResponseData : sinon.stub()\n };\n MOCKS.ENV = {\n 'apigeeRoot': 'http://rebelliondev-dev01.apigee.net/'\n };\n MOCKS.SessionService = {\n data : {'authlogindata' : {'customerId' : '12345', 'accountId' : '123123' }},\n get : function(key) {\n return this.data[key];\n }\n };\n MOCKS.FACADE_API_ENDPOINTS={\n API_347_getPrintReceipt: 'v1/utility/printReceipt?orderId={orderId}'\n };\n MOCKS.ChannelConfigService = {\n channel : 'Retail',\n setDefaults : sinon.stub()\n };\n MOCKS.commonUtils = {\n nullable : sinon.stub()\n };\n MOCKS.SOFTGOODS_CONSTANTS ={\n REQUEST_TYPE_RETURN_EXCHANGE : 'returnExchange'\n };\n MOCKS.cartService = {\n getCartRequest : function() { var defer = $q.defer(); defer.resolve(); return defer.promise; },\n postCartDetails : sinon.stub\n };\n\n\n}", "_before() {\n this.world = new World();\n }", "function $httpBackend(method, url, data, callback, headers) {\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data))\n throw Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n\n if (!expectation.matchHeaders(headers))\n throw Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(function() {\n var response = expectation.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(function() {\n var response = definition.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers);\n } else throw Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n Error('No response defined !') :\n Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "function $httpBackend(method, url, data, callback, headers) {\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data))\n throw Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n\n if (!expectation.matchHeaders(headers))\n throw Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(function() {\n var response = expectation.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(function() {\n var response = definition.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers);\n } else throw Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n Error('No response defined !') :\n Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "function $httpBackend(method, url, data, callback, headers) {\n var xhr = new MockXhr(),\n expectation = expectations[0],\n wasExpected = false;\n\n function prettyPrint(data) {\n return (angular.isString(data) || angular.isFunction(data) || data instanceof RegExp)\n ? data\n : angular.toJson(data);\n }\n\n if (expectation && expectation.match(method, url)) {\n if (!expectation.matchData(data))\n throw Error('Expected ' + expectation + ' with different data\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.data) + '\\nGOT: ' + data);\n\n if (!expectation.matchHeaders(headers))\n throw Error('Expected ' + expectation + ' with different headers\\n' +\n 'EXPECTED: ' + prettyPrint(expectation.headers) + '\\nGOT: ' +\n prettyPrint(headers));\n\n expectations.shift();\n\n if (expectation.response) {\n responses.push(function() {\n var response = expectation.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n return;\n }\n wasExpected = true;\n }\n\n var i = -1, definition;\n while ((definition = definitions[++i])) {\n if (definition.match(method, url, data, headers || {})) {\n if (definition.response) {\n // if $browser specified, we do auto flush all requests\n ($browser ? $browser.defer : responsesPush)(function() {\n var response = definition.response(method, url, data, headers);\n xhr.$$respHeaders = response[2];\n callback(response[0], response[1], xhr.getAllResponseHeaders());\n });\n } else if (definition.passThrough) {\n $delegate(method, url, data, callback, headers);\n } else throw Error('No response defined !');\n return;\n }\n }\n throw wasExpected ?\n Error('No response defined !') :\n Error('Unexpected request: ' + method + ' ' + url + '\\n' +\n (expectation ? 'Expected ' + expectation : 'No more request expected'));\n }", "setupForSuccess(response, headers) {\n\t\tvar executeHeaders = (exe) => exe(response, headers);\n\t\tvar executeVanilla = (exe) => exe(response, HEADERS_SUCCESS);\n\t\tvar execute = (exe) => (headers ? executeHeaders(exe) : executeVanilla(exe));\n\n\t\tthis.get = (url, success, error) => execute(success);\n\t\tthis.request = (options, success, error) => execute(success);\n\t}", "function setUpMockData() {\n fetch('/source/Backend/MockData.json')\n .then((res) => {\n return res.json();\n })\n .then((data) => {\n mockData = data;\n console.log('here is the mock Data', mockData);\n console.log('setting up mock data');\n createDay(mockData.sampleDay1);\n createDay(mockData.sampleDay2);\n createMonthlyGoals(mockData.sampleMonthlyGoals);\n createYearlyGoals(mockData.sampleYearlyGoals);\n createSettings(mockData.sampleSetting);\n });\n\n /* sample way to update the monthly goals\n let month = mockData.sampleMonthlyGoals;\n month.goals[0].text = 'run some laps';\n updateMonthGoals(month);\n */\n\n /* sample way to delete day\n \n deleteDay('05/20/2021');\n */\n\n /* sample way to get the monthly goals\n let req = getMonthlyGoals('12/2021');\n req.onsuccess = function (e) {\n console.log('got monthly goals');\n console.log(e.target.result);\n };\n */\n}", "toss() {\n // Use `self` in order to preserve the Mocha context.\n const self = this\n\n let describeFn\n if (this._shouldSkip) {\n describeFn = describe.skip\n } else if (this._only) {\n describeFn = describe.only\n } else {\n describeFn = describe\n }\n\n describeFn(self._message, function () {\n before(function () {\n if (self.current.useApp) {\n const { app, basePath } = self.current.useApp\n const { server, uri } = startApp(app, basePath)\n self.current.server = server\n self._requestArgs.uri = uri + self._requestArgs.uri\n }\n })\n after(function (done) {\n if (self.current.server) {\n self.current.server.close(() => {\n done()\n })\n } else {\n done()\n }\n })\n\n it(`\\n\\t[ ${self.testInfo} ]`, async function () {\n await self.run()\n }).timeout(self._mochaTimeout())\n })\n }", "function global_setup() {\n\t// don't use i, because global value conlicts with test runner\n\tfor(xyz = 0; xyz < 10; xyz++) {\n\t\tfoo->();\n\t}\n\ttrace(xyz);\n}", "function _testSuiteInit() {\n return ImptTestHelper.getAccountAttrs().\n then((account) => { email = account.email; userid = account.id; }).\n then(() => ImptTestHelper.runCommand(`impt product create -n ${PRODUCT_NAME}`, ImptTestHelper.emptyCheck)).\n then(() => ImptTestHelper.runCommand(`impt dg create -n ${DEVICE_GROUP_NAME} -p ${PRODUCT_NAME}`, (commandOut) => {\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt product create -n ${PRODUCT2_NAME}`, (commandOut) => {\n product_id = ImptTestHelper.parseId(commandOut);\n if (!product_id) fail(\"TestSuitInit error: Failed to create product\");\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt dg create -n ${DEVICE_GROUP2_NAME} -p ${PRODUCT2_NAME}`, (commandOut) => {\n dg_id = ImptTestHelper.parseId(commandOut);\n if (!dg_id) fail(\"TestSuitInit error: Failed to create device group\");\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt dg create -n ${DEVICE_GROUP3_NAME} -p ${PRODUCT2_NAME}`, (commandOut) => {\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => Shell.cp('-Rf', `${__dirname}/fixtures/devicecode.nut`, ImptTestHelper.TESTS_EXECUTION_FOLDER)).\n then(() => ImptTestHelper.runCommand(`impt build deploy -g ${DEVICE_GROUP_NAME} -t ${BUILD_TAG}`, (commandOut) => {\n build_id = ImptTestHelper.parseId(commandOut);\n if (!build_id) fail(\"TestSuiteInit error: Failed to create build\");\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt build deploy -g ${DEVICE_GROUP2_NAME} -f -t ${BUILD2_TAG} -x devicecode.nut`, (commandOut) => {\n build2_id = ImptTestHelper.parseId(commandOut);\n if (!build2_id) fail(\"TestSuiteInit error: Failed to create build\");\n build2_sha = ImptTestHelper.parseSha(commandOut);\n if (!build2_sha) fail(\"TestSuiteInit error: Failed to parse build sha\");\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt build deploy -g ${DEVICE_GROUP3_NAME} -t ${BUILD3_TAG}`, (commandOut) => {\n build3_id = ImptTestHelper.parseId(commandOut);\n if (!build3_id) fail(\"TestSuiteInit error: Failed to create build\");\n ImptTestHelper.emptyCheck(commandOut);\n })).\n then(() => ImptTestHelper.runCommand(`impt dg delete -g ${DEVICE_GROUP3_NAME} -q`, ImptTestHelper.emptyCheck));\n }", "function setAllScenariosToDefault() {\n var deferred = protractor.promise.defer();\n var response = request('PUT', baseUrl + '/mocks/defaults', {\n headers: {\n 'Content-Type': 'application/json',\n 'ngapimockid': ngapimockid\n }\n });\n\n if (response.statusCode !== 200) {\n deferred.reject('Could not set scenarios to default');\n } else {\n deferred.fulfill();\n }\n return deferred.promise;\n }", "before(callback) {\n\t\tBoundAsync.series(this, [\n\t\t\tsuper.before,\n\t\t\tthis.setTeamSettings,\n\t\t\tthis.setRepoSignupData\n\t\t], callback);\n\t}", "before (callback) {\n\t\tsuper.before(error => {\n\t\t\tif (error) { return callback(error); }\n\t\t\tthis.path = `/provider-host/${this.provider}/${ObjectId()}`; // substitute an ID for a non-existent team\n\t\t\tcallback();\n\t\t});\n\t}", "function MockXMLHttpRequest() {\n }", "function test2() {\n\tvar start = new Date();\n\n\tgetJsonWithCallback('vessels.json?parameter=a', function(a) {\n\t\tgetJsonWithCallback('vessels.json?parameter=b', function(a) {\n\t\t\tgetJsonWithCallback('vessels.json?parameter=c', function(a) {\n\t\t\t\tgetJsonWithCallback('vessels.json?parameter=d', function(a) {\n\t\t\t\t\tgetJsonWithCallback('vessels.json?parameter=e', function(a) {\n\t\t\t\t\t\tvar diff = (new Date()) - start;\n\t\t\t\t\t\tconsole.log('Did 5 API calls in ' + diff + ' millis');\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t});\n\t\t});\n\t});\n}", "init() {\n\t\tthis.replaceData(\n\t\t\tthis.manager.get(\"noReq\"),\n\t\t\tthis.endpoints.get,\n\t\t\tthis.data.get\n\t\t);\n\t}", "function apply() {\n if (!global.zone) {\n throw new Error('zone.js does not seem to be installed');\n }\n if (!global.zone.isRootZone()) {\n throw new Error('The jasmine patch should be called from the root zone');\n }\n // When you have in async test (test with `done` argument) jasmine will\n // execute the next test synchronously in the done handle. This makes sense\n // for most tests, but now with zones. With zones running next test\n // synchronously means that the current zone does not get cleared. This\n // results in a chain of nested zones, which makes it hard to reason about\n // it. We override the `clearStack` method which forces jasmine to always\n // drain the stack before next test gets executed.\n jasmine.QueueRunner = (function (SuperQueueRunner) {\n // Subclass the `QueueRunner` and override the `clearStack` mothed.\n function alwaysClearStack(fn) {\n global.zone.setTimeoutUnpatched(fn, 0);\n }\n function QueueRunner(options) {\n options.clearStack = alwaysClearStack;\n SuperQueueRunner.call(this, options);\n }\n QueueRunner.prototype = SuperQueueRunner.prototype;\n return QueueRunner;\n })(jasmine.QueueRunner);\n}" ]
[ "0.731295", "0.71643686", "0.685737", "0.6684625", "0.6493349", "0.64181364", "0.6324952", "0.63198364", "0.6247152", "0.6150687", "0.6052109", "0.604136", "0.5993027", "0.5988895", "0.5986733", "0.5959852", "0.5921636", "0.59150916", "0.58547735", "0.58437544", "0.5820899", "0.58164525", "0.58151734", "0.5793977", "0.57692105", "0.57536757", "0.57536757", "0.57536757", "0.574948", "0.5732951", "0.5730709", "0.5677982", "0.5656632", "0.5628411", "0.5603692", "0.55994636", "0.5599173", "0.5560199", "0.55525595", "0.55292434", "0.5528902", "0.5501513", "0.5493223", "0.54531974", "0.54494524", "0.5448493", "0.5447291", "0.54425937", "0.5442526", "0.5426063", "0.5418959", "0.5413969", "0.5405205", "0.5404063", "0.5399643", "0.5399643", "0.5392577", "0.5391808", "0.53864664", "0.5377844", "0.537223", "0.5371688", "0.5361335", "0.53513455", "0.53479904", "0.5343312", "0.53431386", "0.53419304", "0.53344595", "0.53156704", "0.5305089", "0.53048223", "0.5297811", "0.5297811", "0.5297811", "0.5297811", "0.5290126", "0.52784765", "0.52692145", "0.52642745", "0.5260728", "0.5237258", "0.5212774", "0.52077705", "0.5196476", "0.5195073", "0.51937217", "0.51937217", "0.51937217", "0.5184006", "0.5178222", "0.5176115", "0.51392746", "0.5135843", "0.5125323", "0.5124055", "0.512301", "0.511162", "0.51086545", "0.51057714", "0.5100612" ]
0.0
-1
The express router doesn't let us register a callback to run when the last middleware is done. So, instead, we have our final handlers trigger events, which we listen to in the fns below. Note: the Router will let you provide a callback that's run if next() is called from the last middleware ( but some of our final functions (i.e. the unauthenticated/unauthorizedHandlers) are inten tionally called without next as an argument, to make sure the user doesn't accidentally let the request through the firewall. Hence our EventEmitter test pattern.
function expectStatusPromise(req, status, additionalExpectations) { return Q.promise(function(resolve, reject) { reset(); emitter.once('done', function() { try { expect(routeHandler.callCount).to.equal(status === 200 ? 1 : 0); expect(unauthenticatedHandler.callCount).to.equal(status === 401 ? 1 : 0); expect(unauthorizedHandler.callCount).to.equal(status === 403 ? 1 : 0); if(status !== 200) { expect(resSpy.status.calledWith(status)).to.be.true; } if(typeof additionalExpectations == 'function') { additionalExpectations(); } resolve(); } catch(e) { reject(e); } }); //dispatch the request mainRouter(req, resSpy); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addRoutes(app) {\n\n app.all('*', (req, res, next) => {\n console.log(req.method + ' ' + req.url);\n next();\n });\n\n //register users\n /*\n param 1: api endpong\n param 2: middleware that uses a controller function \n */\n app.post('/api/register', authController.register);\n\n //login users\n /*\n param 1: api endpoint\n param 2: middleware that uses a controller function \n */\n app.post('/api/login', authController.login);\n\n app.post('/api/account-activate', authController.accountActivate);\n app.post('/api/resend-activation-link', authController.resendActivationLink);\n app.post('/api/reset-password-link', authController.resetPasswordLink);\n app.post('/api/reset-password', authController.resetPassword);\n\n //authorize your user - check that the user sending requests to server is authorized to view this route\n\n /*\n summary of this route:\n 1. call route\n 2. run first middleware, checkAuth \n - checkAuth uses the jwtAuth strategy defined in lib/passport.js\n - remember that this jwt auth strategy compares the JWT token saved to the client, \n either stored in a cookie or sent via an Authorization Header, \n with the JWT token that was created when the user logged in.\n - checkAuth, if successful, returns the user object from the DB\n 3. run second middleware, authController.testAuth\n - returns a {isLoggedIn: true/false} based on whether or not previous middleware\n successfully returned a user object\n */\n app.get('/api/test-auth', checkAuth, authController.testAuth);\n //if you ahve other protected routes, you can use the same middleware,\n //e.g: app.get('/api/protected-route', checkAuth, authController.testAuth);\n //e.g: app.get('/api/another-protected-route', checkAuth, authController.testAuth);\n\n}", "getMiddleware() {\n const router = express.Router();\n router.options(this.path, (request, response, next) => {\n if (!this.handleAbuseProtectionRequests(request, response)) {\n next();\n }\n });\n router.post(this.path, (request, response, next) => __awaiter(this, void 0, void 0, function* () {\n try {\n if (!(yield this._cloudEventsHandler.processRequest(request, response))) {\n next();\n }\n }\n catch (err) {\n next(err);\n }\n }));\n return router;\n }", "function middleware(req, res, next) {\n\tns.run(() => next());\n}", "function middle(req, res, next)\n{\n console.log(`Incoming request: ${request.original}`)\n\n\n next();//always at end of middleware function\n}", "function middleware(request, response, next) {}", "requestHandler(req, res) {\n // All requests are assumed to be \"Express-like\" and have the bodyParser run\n // before it. Express doesn't have a good way (that I'm aware of) to specify\n // \"run this middleware if it hasn't already been run\".\n this.emit('message', req.body)\n this.handler(req.body, this.responseHandler.bind(this, res))\n }", "async function middleware1(event, next) {\n console.log('before');\n await next();\n console.log('after');\n}", "appMiddleware(req, res, next) {\n const plugins = this.plugins.filter((plugin) => {\n return \"function\" === typeof plugin.appMiddleware;\n });\n if (!plugins.length) {\n return next();\n }\n else {\n const _recursiveNext = (i = 1) => {\n if (i >= plugins.length) {\n return next;\n }\n else {\n return () => {\n return plugins[i].appMiddleware(req, res, _recursiveNext(i + 1));\n };\n }\n };\n return plugins[0].appMiddleware(req, res, _recursiveNext());\n }\n }", "function log(req,res,next){\n\n // console.log('hello osho middleware function is running');\n next();// next function helps to change in req,res cycle\n}", "function my_middleware(req, res, next){\n\tconsole.log('Hello Middleware');\n\tnext();\n}", "function lMiddleware1(requestObject, responseObject, nextMiddleware) {\n // nextMiddleware passed in by express framework\n console.log('In lMiddleware1');\n nextMiddleware(); // must be called else browser hangs\n}", "function authenticationMiddleware(req, res, next) {\n //1.check if user sent a token in the headers | body | query \n var token = req.body.token || req.query.token || req.get('Authorization');\n Logger_1.Logger.d(TAG, '=============== Authentication Middleware ===============', 'gray');\n Logger_1.Logger.d(TAG, 'the token > ' + token, 'gray');\n // decode token\n if (token) {\n //2.verify user token and its exp.\n jwt.verify(token, 'mySecretForJWTtoken', (err, decoded) => __awaiter(this, void 0, void 0, function* () {\n if (err) {\n Logger_1.Logger.d(TAG, 'Failed to authenticate token > ' + err, 'red');\n return res.status(401).json({ success: false, message: 'Failed to authenticate token.' });\n }\n else {\n let userId = decoded.userId;\n /*\n 3.check that userId exist in db and if so save the user in req.user\n using userId from decrypted token - to check if there is such user in db*/\n try {\n let userRep = new user_rep_1.UserRepository();\n let user = yield userRep.getUserById(userId);\n Logger_1.Logger.d(TAG, `user is authenticated, userId > ${userId} `, 'green');\n Logger_1.Logger.d(TAG, JSON.stringify(user), 'green');\n Logger_1.Logger.d(TAG, '=============== / Authentication Middleware ===============', 'gray');\n req.user = user;\n next();\n }\n catch (e) {\n Logger_1.Logger.d(TAG, 'ERR=========>' + e, 'red');\n res.status(401).json({\n success: false,\n message: e\n });\n }\n }\n }));\n }\n else {\n Logger_1.Logger.d(TAG, 'token not exist on Header | url | querystring', 'red');\n Logger_1.Logger.d(TAG, '=============== / Authentication Middleware ===============', 'gray');\n // if there is no token\n // return an error\n return res.status(401).json({\n success: false,\n message: 'No token provided.'\n });\n }\n}", "async function middleware2(event, next) {\n event.greeting = 'hello';\n await next();\n}", "function withCallbackHandler(ctx, connectMiddleware, next) {\n return new Promise((resolve, reject) => {\n connectMiddleware(ctx.req, ctx.res, err => {\n if (err) reject(err)\n else resolve(next())\n })\n })\n}", "function eachMiddleware(middleware, cb) {\n // skip middleware if completed\n if (isComplete) return cb();\n // run individual middleware\n middleware(req, res, next, end);\n\n function next(returnHandler) {\n // add return handler\n allReturnHandlers.push(returnHandler);\n cb();\n }\n function end(err) {\n if (err) return cb(err);\n // mark as completed\n isComplete = true;\n cb();\n }\n }", "function eachMiddleware(middleware, cb) {\n // skip middleware if completed\n if (isComplete) return cb();\n // run individual middleware\n middleware(req, res, next, end);\n\n function next(returnHandler) {\n // add return handler\n allReturnHandlers.push(returnHandler);\n cb();\n }\n function end(err) {\n if (err) return cb(err);\n // mark as completed\n isComplete = true;\n cb();\n }\n }", "function onRequest(req, res) {\n // Uncomment this if you want to see the raw request logged\n // logRequest(req);\n\n // Setup a handy helper function for everybody to send errors\n // back\n res.error = function _error(code, err) {\n res.setHeader('content-type', 'text/plain');\n res.writeHead(code || 500);\n res.end(err ? (err.stack || err) : null);\n };\n\n // A poor man's request router\n if (req.method === 'POST') {\n if (req.url !== '/sign') {\n res.error(405, 'POST /sign');\n } else {\n handleSign(req, res);\n }\n } else if (req.method === 'GET' || req.method === 'HEAD') {\n if (req.url !== '/index.html') {\n if (req.url === '/favicon.ico') {\n res.error(404);\n } else {\n res.setHeader('location', '/index.html');\n res.error(302);\n }\n } else {\n handleGet(req, res);\n }\n } else {\n res.error(405);\n }\n}", "function validateAuthentication(req, res, next) {\n\tnext(); //continue processing the request\n}", "function eventsHandler(req, res, next) {\n // Mandatory headers and http status to keep connection open\n const headers = {\n 'Content-Type': 'text/event-stream',\n 'Connection': 'keep-alive',\n 'Cache-Control': 'no-cache'\n };\n res.writeHead(200, headers);\n\n // After client opens connection send current state as string\n const data = `data: ${JSON.stringify(state)}\\n\\n`;\n res.write(data);\n\n // Generate an id based on timestamp and save res\n // object of client connection on clients list\n // Later we'll iterate it and send updates to each client\n const clientId = Date.now();\n const newClient = {\n id: clientId,\n res\n };\n console.log(`${clientId} Connection opened`);\n // console.log(req);\n clients.push(newClient);\n\n // When client closes connection we update the clients list\n // avoiding the disconnected one\n req.on('close', () => {\n console.log(`${clientId} Connection closed`);\n clients = clients.filter(c => c.id !== clientId);\n });\n}", "function next(err, cb) {\n if (typeof err === 'function') {\n debug('pushed filter callback');\n cb = err;\n err = null;\n }\n if (typeof cb === \"function\") callbacks.push(cb);\n\n debug('call middleware index', index);\n var layer = stack[index++];\n\n // No more middlewares or early end.\n if (!layer || ended) {\n debug('middleware-s call done');\n fn = callbacks.pop();\n while (fn) {\n err = fn(err, ctx);\n if (err) break;\n fn = callbacks.pop();\n }\n if (out) return out(err, ctx);\n if (err) throw err;\n return;\n }\n\n // Check if middleware type matches or if it has no type.\n if (layer.type.length > 0 && layer.type.indexOf(type) < 0) {\n return next(err);\n }\n\n try {\n var arity = layer.handle.length;\n //if err, only execute error middlewares\n if (err) {\n //error middlewares have an arity of 3, the first\n //arg being the error\n if (arity === 3) {\n layer.handle(err, ctx, next);\n } else {\n next(err);\n }\n } else if (arity < 2) {\n layer.handle(ctx);\n if (!ended) next();\n } else if (arity < 3) {\n layer.handle(ctx, next);\n } else {\n next();\n }\n }\n catch (e) {\n next(e);\n }\n }", "protect(callback) {\n // if the callback isn't defined default to one which just makes sure \n // someone is logged in.\n let middleware = callback ? callback : (request, response, next) => {\n if (!request.isAuthenticated())\n return response.redirect('/login');\n \n return next();\n }\n // get local this because of fucked up scope.\n let that = this;\n return {\n get(path, method) {\n that.router.get(path, method, middleware);\n },\n post(path, method) {\n that.router.post(path, method, middleware);\n },\n put(path, method) {\n that.router.put(path, method, middleware);\n },\n delete(path, method) {\n that.router.delete(path, method, middleware);\n }\n }\n }", "function loggingMiddleware(req, res, next) {\n loggers_1.logger.debug(req.method + \" Request from \" + req.ip + \" to \" + req.path);\n next(); //tells function to move on to next matching piece of middleware\n}", "handle(req, res, out) {\n const protohost = getProtohost(req.url) || '';\n const stack = this.stack;\n let index = 0;\n let removed = '';\n let slashAdded = false;\n\n // final function handler\n const done = out || finalhandler(req, res, {env, onerror: logerror});\n\n // store the original URL\n req.originalUrl = req.originalUrl || req.url;\n\n /**\n * Next handler\n * @param err\n * @returns {*}\n */\n function next(err) {\n if (slashAdded) {\n req.url = req.url.substr(1);\n slashAdded = false;\n }\n\n if (removed.length !== 0) {\n req.url = protohost + removed + req.url.substr(protohost.length);\n removed = '';\n }\n\n // next callback\n const layer = stack[index++];\n\n // all done\n if (!layer) {\n defer(done, err);\n return;\n }\n\n // route data\n const path = parseUrl(req).pathname || '/';\n const route = layer.route;\n\n // skip this layer if the route doesn't match\n if (path.toLowerCase().substr(0, route.length) !== route.toLowerCase()) {\n return next(err);\n }\n\n // skip if route match does not border \"/\", \".\", or end\n const c = path[route.length];\n if (c !== undefined && c !== '/' && c !== '.') {\n return next(err);\n }\n\n // trim off the part of the url that matches the route\n if (route.length !== 0 && route !== '/') {\n removed = route;\n req.url = protohost + req.url.substr(protohost.length + removed.length);\n\n // ensure leading slash\n if (!protohost && req.url[0] !== '/') {\n req.url = `/${req.url}`;\n slashAdded = true;\n }\n }\n\n // call the layer handle\n call(layer.handle, route, err, req, res, next);\n }\n\n next();\n }", "function middleware(req, res, next) {\n if (req.url === '/log') {\n var level = req.body.level,\n message = req.body.message,\n meta = req.body.meta;\n\n if (level && message && log[level]) {\n if (meta) {\n log[level](message, meta);\n } else {\n log[level](message);\n }\n }\n res.end();\n } else {\n next();\n }\n}", "function Middleware(app, middleware, action){\n var args;\n action = action || \"invoke\";\n \n if (typeof middleware === 'function')\n {\n switch(middleware.length)\n {\n //fn() with this=app and fn.invoke(next) with this = context\n case 0:\n middleware.call(app);\n return function (context, next) {return middleware.invoke.call(context, next);};\n break;\n \n //fn(next) or fn(app) and fn.invoke(context, next) \n case 1:\n args =private_getParamNames(middleware);\n if (arrayEqual(args,[\"next\"]))\n return function (context, next) { return middleware.call(context, next);}; \n \n else\n {\n var mw = Object.create(middleware.prototype); \n middleware.call(mw, app);\n \n return mw.invoke.bind(mw);\n \n if (typeof mw[action] === 'function')\n return mw[action].bind(mw);\n else\n throw(\"no \" + action +\" function exists on middleware \" + middleware.toString());\n \n }\n \n //fn(req,res) or fn(context, next)\n case 2: \n args =private_getParamNames(middleware);\n if (arrayEqual(args,[\"req\",\"res\"]))\n {\n throw(\"must require 'iopa-connect' to use Connect/Express style middleware\");\n } else\n {\n return middleware;\n }\n \n //fn(req,res,next)\n case 3:\n throw(\"must require 'iopa-connect' to use Connect/Express style middleware\");\n \n //fn(err,req,res,next)\n case 4:\n throw(\"must require 'iopa-connect' to use Connect/Express style middleware\");\n \n default:\n throw(\"unknown middleware\");\n \n }\n }\n else\n {\n app.log.error(\"middleware must be a function\");\n throw(\"middleware must be called on a function\");\n }\n \n}", "handleEvent(ctx, fnMiddleware) {\n return (\n fnMiddleware(ctx)\n // .then(() => console.log(\"done?\")) // would be used for a final action\n .catch(console.error)\n );\n }", "function routeMiddleWare(req, res, next) {\n console.warn(req.method + ' ' + req.url + ' with ' + JSON.stringify(req.body))\n next()\n}", "async handleRequest (req, res) {\n try {\n // First run the handlers assigned with \"server.use\"\n await this.callHandlers(this.handlers, req, res)\n\n // Then run process the request for the provied route\n await this.handleRoute(req, res)\n } catch (err) {\n // Call the error listener if an error is thrown\n this.errorListener.call(this, err, req)\n\n // Return HTTP 500 if error is not caught within handlers\n res.error(err.message)\n }\n }", "function middleware1 (req, res, next) {\n console.log(req.url)\n\n // res.send('middleware1 function called')\n\n next() // if next() not called then server will hang\n}", "useMiddlewares(router, middlewares) {\n if (this.serverModule.options.deaf) return;\n\n _.forOwn(middlewares, (options, name) => {\n let middleware = this.getMiddleware(name);\n\n if (typeof middleware !== 'function') {\n throw new Error.ServerError('Unregistered middleware: ' + name);\n }\n\n let middlewareFunctions = _.castArray(middleware(options, this));\n middlewareFunctions.forEach(m => {\n //walk around the fix: https://github.com/alexmingoia/koa-router/issues/182\n if (router.register && middleware.__metaMatchMethods && middleware.__metaMatchMethods.length) {\n router.register('(.*)', middleware.__metaMatchMethods, m, {end: false});\n } else {\n router.use(m);\n }\n });\n\n this.log('verbose', `Attached middleware [${name}].`);\n });\n }", "function authenticationMiddleware () {\r\n return function (req, res, next) {\r\n if (req.isAuthenticated()) {\r\n console.log(\"is authenticated\")\r\n return next()\r\n }\r\n console.log(\"not authenticated\")\r\n res.redirect('/?login=false')\r\n }\r\n}", "function logger(req, res, next){\n // log the path of the request\n // console.log('Request received:', req.originalUrl);\n // console.log(req.headers);\n // VERIFY json web token\n let tokenToValidate = req.headers.authorization;\n\n jwt.verify(tokenToValidate, env.EPIC_ROADTRIPS_SECRET_KEY, (err, decodedPayload) => {\n if(err){\n\n // turn request away if not validated\n return res.status(403);\n }\n // continue with request if validated\n // console.log(decodedPayload);\n next();\n });\n}", "async callHandlers (handlers, req, res) {\n for (let handler of handlers) {\n // Stop the middleware chain if a response has been sent\n if (!res.response.headersSent) {\n await handler.call(this, req, res)\n }\n }\n }", "_eventEmitterListen() {\n\t\t\n\t\tObject.keys (allowedRoutes).map ((eventRoute) => {\n\t\t\t\n\t\t\tthis.debug ('now listening for eventRoute : ' + eventRoute);\n\t\t\t\n\t\t\teventEmitter.on (eventRoute, (data) => {\n\t\t\t\tif ( !data.payload ) {\n\t\t\t\t\tthis.debug ('dataEvent:PAYLOAD_MISSING');\n\t\t\t\t\treturn;\n\t\t\t\t\t// throw new Error ('dataEvent:PAYLOAD_MISSING');\n\t\t\t\t}\n\t\t\t\tif ( data.payload.roles ) {\n\t\t\t\t\tthis._eventEmitterDispatch (eventRoute, data);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.debug ('dataEvent:PAYLOAD_ROLE_MISSING');\n\t\t\t\t\treturn;\n\t\t\t\t\t// throw new Error ('dataEvent:PAYLOAD_ROLE_MISSING');\n\t\t\t\t}\n\t\t\t});\n\t\t})\n\t}", "function authenticationMiddleware(req, res, next) {\n if (req.isAuthenticated() && require('./permissions')(req))\n // se o usuario tiver autenticado e a funcao do permissions der TRUE ele consegue seguir adiante, se não ele é direcionado para /off\n return next()\n res.redirect('/off')\n }", "function dispatch(req, res, next) {\n console.log(util.format('Request received from %s: %s, %s',\n req.ip, req.method, req.url));\n if (argv.a == 'basic') {\n var isAuthorized = (typeof req.headers['authorization'] != 'undefined') && \n check_authorization(req.headers['authorization'].split(' ')[1]);\n console.log('isAuthorized=' + isAuthorized);\n if (!isAuthorized) {\n res.writeHead(401 , {'WWW-Authenticate': 'Basic realm=\"FLM\"'});\n res.end();\n return;\n }\n }\n switch(req.method) {\n case \"GET\":\n if (req.url == '/') {\n req_GetFacList(req, res, next);\n } else\n req_GetFac(req, res, next);\n break;\n case \"POST\":\n if (req.url == '/') {\n req_AddUpdate(req, res, next);\n } else {\n res.type('application/xml');\n res.status(405).send(gen_error('MethodNotAllowed', 'Method not allowed').toString());\n }\n break;\n case \"DELETE\":\n req_Delete(req, res, next);\n break;\n default:\n res.type('application/xml');\n res.status(405).send(gen_error('MethodNotAllowed', 'Method not allowed').toString());\n break;\n }\n}", "static _runMiddleware(req, res, middleware, returnHandlers) {\n return new Promise((resolve) => {\n const end = (err) => {\n const error = err || res.error;\n if (error) {\n res.error = eth_rpc_errors_1.serializeError(error);\n }\n // True indicates that the request should end\n resolve([error, true]);\n };\n const next = (returnHandler) => {\n if (res.error) {\n end(res.error);\n }\n else {\n if (returnHandler) {\n if (typeof returnHandler !== 'function') {\n end(new eth_rpc_errors_1.EthereumRpcError(eth_rpc_errors_1.errorCodes.rpc.internal, `JsonRpcEngine: \"next\" return handlers must be functions. ` +\n `Received \"${typeof returnHandler}\" for request:\\n${jsonify(req)}`, { request: req }));\n }\n returnHandlers.push(returnHandler);\n }\n // False indicates that the request should not end\n resolve([null, false]);\n }\n };\n try {\n middleware(req, res, next, end);\n }\n catch (error) {\n end(error);\n }\n });\n }", "function authMiddleware(req, res, next) {\n // Check token validity\n const authHeader = req.headers.authorization;\n const token = authHeader && authHeader.split(\" \")[1];\n if (token == null) return res.sendStatus(403);\n\n // Verify token\n const verify = authToken(token);\n if (verify && verify.exp > Date.now()) {\n next();\n } else {\n return res.sendStatus(401);\n }\n}", "initRoutes(app, ctx) {\n app.get(\"/register\", async (req, res, ctx) => {\n res.send(\n await ctx.call(\"webhooks.register\", {\n targetUrl: ctx.params.targetUrl,\n })\n );\n });\n app.get(\"/list\", async (req, res, ctx) => {\n res.send(await ctx.call(\"webhooks.list\"));\n });\n app.get(\"/update\", async (req, res, ctx) => {\n res.send(await ctx.call(\"webhooks.update\", { id: ctx.params.id }));\n });\n app.get(\"/delete\", async (req, res, ctx) => {\n res.send(\n await ctx.call(\"webhooks.delete\", {\n id: ctx.params.id,\n targetUrl: ctx.params.targetUrl,\n })\n );\n });\n app.get(\"/ip\", async (req, res, ctx) => {\n res.send(\n await ctx.call(\"webhooks.trigger\", {\n ip:\n req.headers[\"x-forwarded-for\"] ||\n req.socket.remoteAddress ||\n null,\n })\n );\n });\n // debug\n app.get(\"/helloTest\", async (req, res, ctx) => {\n res.send(await ctx.call(\"webhooks.hello\"));\n });\n app.get(\"/exptest\", (req, res) => {\n res.send(\"express routing\");\n });\n }", "validate(req, res, next) {\n\n // check header or url parameters or post parameters for token\n let token = req.headers['x-access-token'];\n let url = req.url.split('/');\n // console.log('headers => ',req.headers);\n // console.log('url = ',req.url);\n\n /**\n * Exclude validation on all routes with auth, status and public\n */\n if ( url.includes('auth')\n || url.includes('status')\n || url.includes('public')\n || url.includes('register')\n || url.includes('dashboard')\n || url.includes('apidoc')\n || url.includes('login') || req.url==='/') {\n next();\n } else {\n /**\n * Decode user from token and add to request if request has a valid token\n */\n if (token) {\n // verifies secret and checks exp\n jwt.verify(token, config.jwtSecret, (err, decoded) => {\n if (err) {\n // console.log(err)\n return res.status(403).send({success: false, message: err.message});\n\n } else {\n // if everything is good, save to request for use in other routes\n req.user = decoded;\n // console.log(decoded);\n next();\n }\n });\n } else {\n /**\n * Return 403 - Forbidden status if there's no token or token is valid\n */\n return res.status(403).send({\n success: false,\n message: 'You are not allowed access',\n reason: 'No token provided.'\n });\n }\n }\n }", "validateHandler(req, res, next) {\n let errors = validationResult(req);\n if (errors.isEmpty()) {\n next();\n } else {\n res.status(400).send({ message: \"Validation Errors\", status: 0, errors: errors });\n }\n }", "function next(err) {\n if (err) return on500(req, res, err);\n handle();\n }", "asMiddleware() {\n return async (req, res, next, end) => {\n try {\n const [middlewareError, isComplete, returnHandlers,] = await JsonRpcEngine._runAllMiddleware(req, res, this._middleware);\n if (isComplete) {\n await JsonRpcEngine._runReturnHandlers(returnHandlers);\n return end(middlewareError);\n }\n return next(async (handlerCallback) => {\n try {\n await JsonRpcEngine._runReturnHandlers(returnHandlers);\n }\n catch (error) {\n return handlerCallback(error);\n }\n return handlerCallback();\n });\n }\n catch (error) {\n return end(error);\n }\n };\n }", "run (req, res, next) {}", "function addHanldeOnAuthenticated(rtm, handler) {\n rtm.on(\"authenticated\", handler);\n}", "function unifiedServer(req, res) {\n const parsedUrl = new URL(req.url, `http://${req.headers.host}`);\n\n const path = parsedUrl.pathname;\n const trimmedPath = path.replace(/^\\/+|\\/$/g, '');\n\n const method = req.method;\n const requestQuery = parsedUrl.searchParams;\n\n const headers = req.headers;\n\n // decoder for decoding buffers\n const decoder = new StringDecoder('utf8');\n let buffer = '';\n\n // called only for requests with body to handle incomming chunks from the stream\n req.on('data', (chunk) => {\n buffer += decoder.write(chunk); // decode each chunk and append to the earlier received chunks\n });\n\n // called for all requests regardless if they contain a body\n req.on('end', () => {\n buffer += decoder.end();\n\n // check if request path is among the available routes\n const selectedCallback = handlers[trimmedPath] || handlers.notFound\n\n // construct data to be sent to all handlers\n const data = {\n 'path': trimmedPath,\n 'method': method,\n 'query': requestQuery,\n headers,\n 'payload': buffer\n }\n\n selectedCallback(data, function(statusCode = 200, payload = {}) {\n const responseData = JSON.stringify(payload);\n\n res.setHeader('Content-Type', 'application/json')\n res.writeHead(statusCode);\n res.end(responseData);\n })\n })\n}", "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) { \n next();\n } else {\n req.flash(\"info\", \"Hey, you've got to be logged in to do that!\");\n res.redirect(\"/login\");\n }\n}", "function log (req,res,next){\n // console.log('logging..');\n next();\n}", "function sessionHandler(req, res, next) {\n winston.info(req.url);\n if(req.url === '/login' ||\n req.url === '/forgotpassword' ||\n req.url === '/logout' ||\n req.url.startsWith('/verifytoken') ||\n req.url === '/admin' ||\n req.url === '/resetpassword'\n ) {\n winston.info(\"skip on session check\")\n next()\n }else {\n if (req.session.sessionID) {\n next()\n } else {\n res.status(401).json({message:\"Access is forbidden\"})\n }\n }\n}", "middleware(req, res, next) {\n this.tokens.push({ method: req.method, at: Date.now() });\n this.handleLimiting(req, res, next, this.tokens);\n }", "function middlewareTest(req, res, next){\n //message to check if session is expired\n console.log('middleware accessed');\n// qimulate an expired session - send a status code or a message to the user\n if(!session){\n res.send('Your session expired');\n } // if (session === false)\n else{\n next(); // in case the session is not expired, go ahead in the route\n // next method is used when\n }\n}", "async function adminMiddleware(req, res, next){\n let cookie = req.cookies.authorization;\n\n if (!cookie) {\n console.debug(\"Redirecting to login - no cookie\")\n res.redirect('/');\n return;\n }\n try {\n const decryptedUserId = jwtFunctions.verify(cookie, secret);\n db.User.findOne({ where: { username: decryptedUserId } }).then((user, error) => {\n if (user) {\n res.locals.user = user.get({ plain: true });\n\n let adminRole = await db.Role.findOne({where: {name: \"admin\"}});\n adminRole = adminRole.get({plain: true});\n let ownerRole = await db.Role.findOne({where: {name: \"owner\"}});\n ownerRole = ownerRole.get({plain: true});\n\n if (user.roleId != adminRole.id && user.roleId != ownerRole.id){\n console.debug(\"Redirecting to login - non-admin cannot access admin routes.\");\n res.redirect('/');\n return;\n }\n } \n else\n {\n console.debug(\"Redirecting to login - invalid cookie\")\n res.redirect('/');\n return;\n }\n });\n } catch (e) {\n res.status(400).send(e.message);\n }\n next();\n}", "function authRequired(req, res, next) {\n console.log(req.path);\n if (req.user || req.path === '/api/me' || req.path === '/auth/login' || req.path === '/auth/logout' || req.path === '/auth/google/callback') {\n next();\n return;\n }\n\n if (!req.user) {\n req.session.oauth2return = req.originalUrl;\n return res.redirect('/auth/login');\n }\n\n next();\n}", "function wrapHandler(handler) {\n\treturn async function(req, res, next) {\n\t\ttry {\n\t\t\tif (req.body.result.action && req.body.result.action === handler.action) {\n\t\t\t\treq.log.info('ACTION: %s', handler.action);\n\t\t\t\treq.log.debug({ body: req.body });\n\t\t\t\tawait handler.handler(req, res, next);\n\t\t\t\treq.log.info('SUCCESS: %s', handler.action);\n\t\t\t\treturn next(false);\n\t\t\t}\n\t\t\treturn next();\n\t\t} catch(err) {\n\t\t\tlet errObj;\n\t\t\tif (err.response && err.response.status)\n\t\t\t\terrObj = errs.makeErrFromCode(err.response.status);\n\t\t\telse if (err.code && err.code === 'ECONNABORTED')\n\t\t\t\terrObj = new errs.RequestTimeoutError();\n\t\t\telse\n\t\t\t\terrObj = new errs.InternalServerError();\n\n\t\t\terrObj.message = 'req_id=' + req.id();\n\t\t\tres.send({\n\t\t\t\tfollowupEvent: {\n\t\t\t\t\tname: 'SERVER_ERROR',\n\t\t\t\t\tdata: {\n\t\t\t\t\t\terror: errObj\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcontextOut: [\n\t\t\t\t\t{\n\t\t\t\t\t\tname: 'eventTriggered',\n\t\t\t\t\t\tlifespan: 1\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t});\n\t\t\treq.log.error(errObj);\n\t\t\treturn next(false);\n\t\t}\n\t};\n}", "function isAuthenticate(req, resp, next){\n console.log(\"autenticando\")\n next()\n}", "_initMainListeners() {\n if (process.env.NODE_ENV !== 'production') {\n console.log(chalk.cyan.bold('\\nExpress is now listening to the following routes :'));\n }\n\n Object.entries(this.routes).forEach(([routeName, routeConfig]) => {\n this._pushRouteListener(removeUrlLastSlash(routeName), routeConfig, routeName);\n });\n\n if (process.env.NODE_ENV !== 'production') {\n console.log('\\n');\n }\n }", "async _processRequest(req, res) {\n const [error, isComplete, returnHandlers,] = await JsonRpcEngine._runAllMiddleware(req, res, this._middleware);\n // Throw if \"end\" was not called, or if the response has neither a result\n // nor an error.\n JsonRpcEngine._checkForCompletion(req, res, isComplete);\n // The return handlers should run even if an error was encountered during\n // middleware processing.\n await JsonRpcEngine._runReturnHandlers(returnHandlers);\n // Now we re-throw the middleware processing error, if any, to catch it\n // further up the call chain.\n if (error) {\n throw error;\n }\n }", "function authentication(req, res, next) {\n\n var auth = req.headers.authorization;\n var user,pass,clearText,i;\n delete req.user; // Remove if anything here.\n\n if (auth) {\n\n // First check if there is a HTTP Authorization header and set\n // user based on that.\n\n log('auth', \"Start HTTP authentication\");\n clearText = atob(auth.substring(\"Basic \".length));\n i = clearText.indexOf(\":\");\n\n if (i == -1) {\n\n log('auth', \"Invalid authorization header \" + auth);\n unauthorized('Invalid authorization header');\n\n } else {\n\n user = clearText.substring(0,i);\n pass = clearText.substring(i+1);\n log('auth', \"Basic auth of: \" + user + \"/\" + pass);\n\n if (!user) {\n\n log('auth', \"Authentication failed, no user\");\n unauthorized('No user in authorization header');\n\n } else {\n\n storage.getNode(user,user)\n .done (nodeLoaded)\n .fail (nodeLoadFailed);\n\n }\n\n }\n\n } else if (req.session && req.session.user) {\n\n // No authorization header, set user from session\n\n req.user = req.session.user;\n log('auth', \"Set user from session. \" + req.user);\n next();\n\n } else {\n\n // No authorization header, nor session.\n\n log('auth', \"No session or authorization header, \" +\n \"proceeding as unauthenticated\");\n delete req.user;\n next();\n\n }\n\n function nodeLoaded (node) {\n\n authorizeAgainstNode(node,user,pass).\n done(compareOk).\n fail(compareFail);\n\n }\n\n function nodeLoadFailed (err) {\n\n log('auth', \"Cannot load user node\");\n unauthorized();\n\n }\n\n function compareOk () {\n\n log('auth', \"Password comparison succeeded\");\n req.user = user;\n next();\n\n }\n\n function compareFail (err) {\n\n log('auth', \"Error: \" + err);\n unauthorized(err);\n\n }\n\n function unauthorized (msg) {\n res.statusCode = 401;\n if (msg === undefined) msg = 'Unauthorized';\n res.end(msg);\n // don't call next here, request handling stops.\n }\n\n}", "function set_routes() {\n\n // Check your current user and roles\n app.get( '/status/:id', function( request, response ) {\n acl.userRoles( request.params.id || false, function( error, roles ){\n response.json( {'User': request.user ,\"Roles\": roles });\n });\n });\n\n // Only for users and higher\n app.all( '/secret', [ acl.middleware( 1, get_user_id) ],function( request, response ) {\n\n response.send( 'Welcome Sir!' +request.params.id);\n }\n );\n\tapp.use('/user',require('./routers/userR.js'));\n app.use('/event',require('./routers/eventR.js'));\n //accept error\n app.use(acl.middleware.errorHandler('json')); \n \n}", "function myLoggingMiddleWare(req, res, next){\n var url = req.url;\n var method = req.method;\n\n console.log('%s request at %s', url, method); //, first %s is the url, second %s is the method. %s everytime a route is hit, it will print what url and method is being used, e.g., get or post\n next();\n}", "function isLoggedIn(req, res, next) {\n console.log('isLoggedIn middleware'); \n if (req.isAuthenticated()) {\n console.log(\"successful login!\")\n return next(); \n } else { \n console.log(\"BAD LOGIN\")\n res.redirect('/');\n }\n}", "function Application() {\n var me = this;\n\n me.verbs = {};\n me.errorHandlers = {\n 403: function(req, res) {\n res.writeHead(403, {\n 'Content-type' : 'text/html'\n });\n res.end(html('Access denied', 'Access Denied'));\n },\n 404 : function(req, res) {\n res.writeHead(404, {\n 'Content-type' : 'text/html'\n });\n res.end(html('Not Found', 'Not found'));\n }\n\n };\n me.listeners = {};\n me.server = http.createServer(function(req, res) {\n var verb,\n verbs = me.verbs,\n errorHandlers = me.errorHandlers,\n config,\n status;\n\n try {\n req.args = req.uri.substr(1).split('/');\n verb = req.verb = req.args.shift();\n if (req.uri.endsWith('/')) {\n req.args.pop();\n }\n if (!verb.length) {\n req.verb = '/';\n }\n\n me.fire('beginRequest', req, res);\n // in case beginRequest handler changed it!\n verb = req.verb;\n config = verbs[verb] || verbs[404] || 404;\n if (config !== 404) {\n status = config.handler(config, req, res);\n }\n else {\n status = 404;\n }\n config = errorHandlers[status];\n if (config) {\n if (config.handler) {\n config.handler(config, req, res);\n }\n else {\n errorHandlers[status](req, res);\n }\n }\n }\n catch (e) {\n if (e === 'RES.STOP') {\n throw e;\n }\n else if (e === 'EOF') {\n throw e;\n }\n me.fire('exception', e, req, res);\n res.error = e;\n config = errorHandlers[500];\n if (config) {\n if (config.handler) {\n config.handler(config, req, res, internalServerError);\n }\n else {\n config(req, res, internalServerError);\n }\n }\n else {\n internalServerError(req, res);\n }\n }\n me.fire('endRequest', req, res);\n });\n}", "function server(req, res) {\r\n var self = this;\r\n req.startTime = Date.now();\r\n req.query = qs.parse(url.parse(req.url).query);\r\n // Hack to make it work with weird paths and encoding types, especial\r\n // File names with spaces like \"Hi world.pdf\" or \"niña.pdf\"\r\n // Hat tip to @mathias\r\n req.url = decodeURIComponent(url.parse(req.url).pathname);\r\n //\r\n // Emit the method to the parent if I can't handle it yep before of anything else.\r\n // So you can do:\r\n // var myapp = require('nhouston')(options);\r\n // myapp.on('POST', function(req,res){ /* my codez */});\r\n //\r\n res.error = function(code, msg) {\r\n res.statusCode = code || 500;\r\n res.setHeader('Content-type', 'text/html');\r\n return res.end(\r\n '<div style=\"text-align:center\"><h1> ' + code + ' - ' + msg + ' </h1><hr>' +\r\n '<p> node-' + process.version + ' running on ' + cfg.port + '</p></div>'\r\n );\r\n };\r\n\r\n res.setHeader('Server', 'node/' + process.version.replace('v', '') + ' (' + os + ')');\r\n res.setHeader('X-Powered-By', pkg.name + '/' + pkg.version);\r\n\r\n if (self.listeners(req.url).length) {\r\n return self.emit(req.url, req, res)\r\n }\r\n if (req.method != 'GET' && self.listeners(req.method).length) {\r\n return self.emit(req.method, req, res);\r\n } else if (req.method != 'GET') {\r\n return res.error(501, 'Not Implemented');\r\n }\r\n\r\n var absolute = path.join(cfg.path, req.url),\r\n isPublic = req.url.substr(0, 8) == '/public/',\r\n rabpub = '';\r\n\r\n req.isPublic = isPublic;\r\n\r\n req.once('error', function() {\r\n res.error(500, 'Internal Server Error');\r\n });\r\n\r\n var ext = path.extname(req.url).replace('.', '');\r\n\r\n if (req.url == '/favicon.ico')\r\n return pipeStream(__dirname + '/../public/img.png', req, res);\r\n if (isPublic) rabpub = path.join(__dirname, '..', req.url);\r\n\r\n if (req.url === '/') {\r\n readContents(cfg.path, req, res);\r\n } else if (req.url !== '/favicon.ico' && !isPublic) {\r\n\r\n if (existsSync(absolute)) {\r\n var stats = fs.statSync(absolute);\r\n if (res.statusCode == 304) return res.end();\r\n if (stats.isDirectory()) {\r\n readContents(absolute, req, res);\r\n } else {\r\n pipeStream(absolute, req, res);\r\n }\r\n csl.log(req.method + req.url, (Date.now() - req.startTime) + 'ms');\r\n } else {\r\n var raw = req.query.raw === false || req.query.raw == 'false';\r\n if (!req.query.raw) raw = true;\r\n // Custom actions for your files\r\n if (actions[ext] && raw) {\r\n if (typeof actions[ext] == 'function') {\r\n return actions[ext].call(actions, req, res);\r\n }\r\n }\r\n else\r\n res.error(404, 'Not found');\r\n }\r\n } else if (isPublic && existsSync(rabpub) && !fs.statSync(rabpub).isDirectory()) {\r\n\r\n pipeStream(rabpub, req, res);\r\n\r\n } else if (isPublic && existsSync(req.url)) {\r\n\r\n if (path.extname(req.url) === '') {\r\n res.writeHeader(200, {\r\n 'Content-type': 'text/html'\r\n });\r\n return res.end(readDir(rabpub));\r\n }\r\n } else if (isPublic) {\r\n pipeStream(__dirname + '/../public/default.png', req, res);\r\n } else {\r\n var raw = req.query.raw === false || req.query.raw == 'false';\r\n if (!req.query.raw) raw = true;\r\n // Custom actions for your files\r\n if (actions[ext] && raw) {\r\n if (typeof actions[ext] == 'function') {\r\n return actions[ext].call(actions, req, res);\r\n }\r\n } else \r\n return res.error(404, 'Not found');\r\n }\r\n}", "function ensureAnyLogin(req, res, next) {\n try {\n if (!req.user) {\n console.log('in ensureAnyLogin. You are not logged in!')\n res.status(401).send('You must be logged in to perform this action.')\n } else {\n next()\n }\n } catch (err) {\n next(err)\n }\n}", "function IsAuthenticated(req,res,next){\n if(req.isAuthenticated()){\n next();\n }else{\n // next(new Error(401));\n res.send(\"unauthorized\");\n }\n}", "function log (req, res, next) {\n console.log('Logging...');\n next(); // passes control to the next middleware function in the RPP\n}", "function isLoggedIn(req, res, next) {\n\t\tif(req.isAuthenticated()) { // if user is logged in, then run next() which\n\t\treturn next(); // refers to everything after isLoggedIn function\n\t}\n\tres.redirect('/unauthenticated'); // else redirect to login page if not logged in \n}", "function authMiddleware(req, res, next, options = {}) {\n\n // Match the auth header with RegExp\n let bearer = /Bearer (.+)/.exec(req.headers.authorization);\n\n // Check match of the header\n if(!bearer) {\n res.status(401).send({ error: \"invalid_authorization_header\" }).end();\n return;\n }\n // Get jwt from match\n let token = bearer[1];\n\n // Try to verify the jwt\n try {\n token = jwt.verify(token, Config.config.jwt.secret);\n } catch(err) {\n res.status(401).send({ error: \"unauthorized\" }).end();\n return;\n }\n\n // Check permissions\n if(options.admin && !token.admin) {\n res.status(403).send({ error: \"no_admin\" }).end();\n return;\n }\n\n // Set token payload to req.user\n req.user = token;\n\n next();\n\n}", "function ensureAuthenticated (req, res, next) {\r\n if (req.isAuthenticated()) {\r\n console.log('access granted')\r\n return next()\r\n }\r\n console.log('denied')\r\n res.redirect('/auth/facebook')\r\n}", "function handler(req, res){\n\n var remoteAddress = req.socket.remoteAddress;\n\n // Only process IPs in our authorised list\n if(authorisedIPs.indexOf(remoteAddress) >= 0) {\n\n try{\n if(req.method == 'POST'){\n var body = '';\n\n req.on('error',function(){\n res.writeHead(500, {\"Content-Type\": \"text/plain\"});\n res.end(\"Error\");\n });\n\n req.on('data',function(data){\n body += data;\n\n // Kill the connection if it's too large to handle\n if(body.length > 1e6){\n response.writeHead(413, {'Content-Type': 'text/plain'});\n req.connection.destroy();\n }\n });\n\n req.on('end',function(){\n var parsedBody = qs.parse(body);\n var json = JSON.stringify(parsedBody);\n\n // Emit a socket.io message to all current clients\n clients.forEach(function(client) {\n client.emit('data', json);\n });\n });\n }\n\n res.writeHead(200, {\"Content-Type\": \"text/plain\"});\n res.end(\"Ok\");\n }\n catch(error){\n res.writeHead(500, {\"Content-Type\": \"text/plain\"});\n res.end(\"Error\");\n }\n }\n else{\n res.writeHead(401, {\"Content-Type\": \"text/plain\"});\n res.end(\"Unauthorised\");\n }\n}", "useMiddlewareStack () {\n if (!this.server) throw new Error('Create server first')\n this._setStack()\n const middlewares = this.stack.getMiddlewareFunctions(this.config, this)\n this.server.on('request', this._getRequestHandler(middlewares))\n }", "function authenticatedUser(req, res, next) {\n // If the user is authenticated, then we continue the execution\n if (req.isAuthenticated()) return next();\n \n // Otherwise the request is always redirected to the home page\n res.redirect('/');\n }", "function ensureAuthenticated(req, res, next){\r\n\tif(req.isAuthenticated()){\r\n\t\treturn next();\r\n\t} else {\r\n\t\treq.flash('error_msg','You are not logged in');\r\n\t\tres.redirect('/users/login');\r\n\t}\r\n}", "function ensureAuthenticated(req, res, next) {\n\tif(req.isAuthenticated()){\n\t\treturn next();\n\t}\n\tconsole.log(\"redirected\");\n\tres.redirect('/');\n}", "use (middleware) {\n this.app.use(middleware)\n }", "middleware (opts={}) {\n let correlationHeader = opts.correlationHeader || this.correlationHeader;\n let formatReq = opts.formatReq || this.formatReq;\n let formatRes = opts.formatRes || this.formatRes;\n let correlationGen = opts.correlationGen || this.correlationGen;\n let requestIdHeader = opts.requestIdHeader || this.requestIdHeader;\n\n return async (ctx, next) => {\n let res = ctx.res;\n let reqTime = new Date();\n let reqId = UUID.v4();\n let classname = (ctx.request.headers[correlationHeader]) ? 'service_request' : 'client_request';\n let correlationId = ctx.request.headers[correlationHeader] || correlationGen();\n ctx.request.headers[correlationHeader] = correlationId;\n ctx.request.headers[requestIdHeader] = correlationId;\n\n let done = (evt) => {\n let resTime = new Date();\n res.removeListener('finish', onFinish);\n res.removeListener('close', onClose);\n let logBase = {\n requestId : reqId,\n classname : classname,\n correlationId : correlationId,\n resolutionTime : resTime - reqTime,\n requestTime : reqTime.toString(),\n responseTime : res.toString(),\n formatRes : formatReq,\n formatRes : formatRes,\n };\n\n logBase.message = formatReq(ctx);\n this.log('informational', this.buildReqLog(ctx, logBase));\n let resLevel = (ctx.response.status >= 400 ? 'informational' : 'error');\n logBase.message = formatRes(ctx);\n this.log(resLevel, this.buildResLog(ctx, logBase));\n };\n\n let onFinish = done.bind(null, 'finish');\n let onClose = done.bind(null, 'close');\n res.once('finish', onFinish);\n res.once('close', onClose);\n\n try {\n await next();\n } catch (err) {\n throw err;\n }\n }\n }", "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n } else {\n req.flash('error_msg', 'You are not logged in yet. Please register/login and try again.');\n res.redirect('/users/login');\n }\n}", "middleware(req, res, next) {\n if (res.locals.breadcrumbHandler) {\n if (typeof res.locals.breadcrumbHandler === 'function') {\n return res.locals.breadcrumbHandler(req, res, next);\n } else if (req.we.router.breadcrumb.middlewares[res.locals.breadcrumbHandler]) {\n return req.we.router.breadcrumb.middlewares[res.locals.breadcrumbHandler](req, res, next);\n }\n }\n\n next();\n }", "function rootHandler(req, res, next) {\n groupMapper.getAll((err, groups) => {\n if (err) {\n //do something\n next(err);\n }\n //groups this user and write access to\n let writeGroups = [];\n let currUser = req.user.username;\n groups.forEach((group) => {\n if (group.master === currUser) {\n return;\n }\n group.writePermissions.forEach((u) => {\n if (u === currUser) {\n writeGroups.push(group);\n }\n });\n });\n res.render('user_profile', {\n 'title': 'Profile',\n 'user': req.user,\n 'writeGroups': writeGroups\n });\n });\n}", "function setupRoutes(app, passport) {\n var loginWithLinkedIn = require('./routes/login/login-linkedin');\n var loginWithLGoogle = require('./routes/login/login-google');\n var loginWithLMicrosoft = require('./routes/login/login-microsoft');\n var loginWithPassword = require('./routes/login/login-with-password');\n var getCurrentUser = require('./routes/get-current-user');\n app.use('/login/linkedin', loginWithLinkedIn);\n app.use('/login/google', loginWithLGoogle);\n app.use('/login/microsoft', loginWithLMicrosoft);\n app.use('/technician/login', loginWithPassword);\n app.use('/getCurrentUser', getCurrentUser);\n /* router.get('/', function(req, res, next) {\n res.send('respond with a resource');\n }); */\n\n\n}", "function setupServerMiddleware (app) {\n\n\t// General middleware.\n\tapp.use(compression({ threshold: 0 }));\n\tapp.use(cookieParser(config.authentication.cookie.secret));\n\tapp.use(bodyParser.urlencoded({ // This will let us get the data from a POST.\n\t\textended: true,\n\t}));\n\tapp.use(bodyParser.json());\n\n\t// Static files (must come before logging to avoid logging out every request for a static file e.g. favicon).\n\tconst staticDirectory = path.resolve(__dirname, `..`, `..`, `frontend`, `build`, `static`);\n\tapp.use(`/public`, express.static(staticDirectory, { maxAge: config.caching.maxAge, index: false }));\n\n\t// Temporary favicon.\n\tapp.use(`/favicon.ico`, (req, res) => res.status(404).end(`NOT_ADDED_YET`));\n\n\t// Health check endpoint.\n\tapp.use(`/health-check`, middleware.healthCheck);\n\n\t// Redirect to HTTPS.\n\tapp.use(middleware.enforceHttps);\n\n\t// Authentication.\n\tapp.use(basicAuth({\n\t\tusers: config.authentication.basicAuth.users,\n\t\tchallenge: true,\n\t\trealm: packageJson.name,\n\t\tunauthorizedResponse: req => JSON.stringify({\n\t\t\tsuccess: false,\n\t\t\terror: (req.auth ? `Invalid credentials.` : `No credentials provided.`),\n\t\t}),\n\t}));\n\n}", "executeMiddlewares(ctx, route) {\n this.MiddlewareHandler._executeMiddlewares(ctx, route)\n }", "function isAuthenticated(){\n return function(req, res, next){\n if (req.isAuthenticated()){\n return next();\n }\n res.redirect('/signin');\n }\n}", "async function middleware (ctx, next) {\n\n}", "handler(req, res, callback) {\n if (this.options.inited !== true) {\n const echostr = this._verify(req);\n if (!echostr) {\n debug('verify with wechat server failed');\n return callback('verify failed');\n }\n debug(`verify with wechat echostr '${echostr}' correct`);\n res.writeHead(200, { 'content-type': 'text/html' });\n res.end(echostr);\n return;\n }\n // The implementation is different\n this._parsePayload(req).then(payload => {\n res.writeHead(200, { 'content-type': 'application/json' });\n res.end('{\"ok\": true}');\n // Just reuse the same naming\n this.emit('push', {\n payload,\n host: req.headers.host,\n event: 'wechat-push'\n });\n });\n }", "useMiddleware() {\n const keys = Object.keys(this.eventMap);\n for (let keyIndex in keys) {\n let composition = compose(this.eventMap[keys[keyIndex]]);\n\n // Create a middleware to exec the composition if the event matches what was registered.\n const handlingOfKey = async (ctx, next) => {\n if (ctx.event == keys[keyIndex]) {\n return await composition(ctx);\n } else {\n return await next();\n }\n }\n\n super.use(handlingOfKey)\n }\n }", "onAuth(handler) {\n this.authHandlers.push(handler);\n }", "function ensureAuthenticated(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/log');\n}", "function routeHandler(callback, res) {\n try {\n callback()\n .catch((err) => {\n const { message, extra } = err;\n\n if (err instanceof AuthError || err instanceof NotAllowedError) {\n res.status(401);\n } else if (err instanceof NotFoundError) {\n res.status(404);\n } else {\n res.status(500);\n }\n\n res.json({\n code: res.statusCode,\n error: message,\n data: extra,\n });\n });\n } catch (err) {\n const { message } = err;\n\n if (err instanceof TypeError || err instanceof ValueError) {\n res.status(400);\n } else {\n res.status(500);\n }\n\n res.json({\n code: res.statusCode,\n error: message,\n });\n }\n}", "function isLoggedIn (req, res, next) {\n if (req.isAuthenticated()) {\n //console.log('yes');\n //next() calls the next callback function\n return next();\n } else {\n //console.log('no');\n res.redirect('/nightlife/login');\n }\n}", "checkAuthenticated(req, res, next) {\n // NOTE: I've added below to show how to Authenticate\n\n\n // if (!req.header('authorization')) {\n // res.status(constants.ResCodes.UNAUTHORIZED)\n // .json({\n // status: constants.ResCodes.UNAUTHORIZED,\n // message: 'Unauthorized. Missing Auth Header',\n // data: null\n // });\n\n // return;\n // }\n\n // const token = req.header('authorization'),\n // payload = jwt.decode(token, bcryptCreds.password);\n\n // let unauthorized = false;\n // if (!payload) {\n // unauthorized = true;\n // }\n\n // if (unauthorized) {\n // res.status(constants.ResCodes.UNAUTHORIZED)\n // .json({\n // status: constants.ResCodes.UNAUTHORIZED,\n // message: 'Unauthorized. Auth Header Invalid',\n // data: null\n // });\n\n // return;\n // }\n\n // req.userId = payload.orgUserId;\n\n next();\n }", "function abortOnError(err, req, res, next) {\n if (err) {\n console.error(\"abortOnError Couldn't validate the signature.\");\n } else {\n console.log(\"next\");\n next();\n }\n}", "function ensureAuthenticated(req, res, next){\r\n\tif(req.isAuthenticated()){\r\n\t\treturn next();\r\n\t} else {\r\n\t\t//req.flash('error_msg','You are not logged in');\r\n\t\tres.redirect('/users/login');\r\n\t}\r\n}", "function call(handle, route, err, req, res, next) {\n const arity = handle.length;\n const hasError = Boolean(err);\n let error = err;\n\n debug(`${handle.name || '<anonymous>'} ${route} : ${req.originalUrl}`);\n\n try {\n if (hasError && arity === 4) {\n // error-handling middleware\n handle(err, req, res, next);\n return;\n } else if (!hasError && arity < 4) {\n // request-handling middleware\n handle(req, res, next);\n return;\n }\n } catch (e) {\n // replace the error\n error = e;\n }\n\n // continue\n next(error);\n}", "function bootApplication(app, config, passport) {\n app.set('showStackError', true)\n app.use(express.static(__dirname + '/../public'))\n app.use(express.logger(':method :url :status'))\n\n // set views path, template engine and default layout\n console.log(__dirname + '/../app/views');\n app.set('views', __dirname + '/../app/views')\n app.set('view engine', 'jade')\n\n app.configure(function () {\n // dynamic helpers\n app.use(function (req, res, next) {\n res.locals.appName = 'XbeeCordinator'\n res.locals.title = 'Xbee Cordiator'\n res.locals.showStack = app.showStackError\n res.locals.req = req\n next()\n })\n\n\n // bodyParser should be above methodOverride\n app.use(express.bodyParser())\n app.use(express.methodOverride())\n\n // cookieParser should be above session\n app.use(express.cookieParser());\n app.use(express.session({\n secret: 'sessionstore',\n store: new MemoryStore(),\n key: 'blah'\n })\n );\n\n app.use(passport.initialize())\n app.use(passport.session())\n\n app.use(express.favicon())\n app.use(express.errorHandler({showStack: true, dumpExceptions: true}));\n // routes should be at the last\n app.use(app.router)\n\n // assume \"not found\" in the error msgs\n // is a 404. this is somewhat silly, but\n // valid, you can do whatever you like, set\n // properties, use instanceof etc.\n app.use(function(err, req, res, next){\n // treat as 404\n if (~err.message.indexOf('not found')) return next()\n\n // log it\n console.error(err.stack)\n\n // error page\n res.status(500).render('500')\n })\n\n // assume 404 since no middleware responded\n app.use(function(req, res, next){\n res.status(404).render('404', { url: req.originalUrl })\n })\n\n })\n\n app.set('showStackError', true)\n\n}", "setupAppMiddleware() {\n\t\t// small security protections by adjusting request headers\n\t\tthis.app.use(helmet());\n\n\t\t// adding the request's client ip\n\t\tthis.app.use(requestIp.mw());\n\n\t\tif(Config.isDev) {\n\t\t\t// Log requests in the console in dev mode\n\t\t\tthis.app.use(morgan('dev'));\n\t\t}\n\t\telse {\n\t\t\t// Compress responses in prod mode\n\t\t\tthis.app.use(compression());\n\t\t}\n\n\t\t// decode json-body requests\n\t\tthis.app.use(bodyParser.json());\n\n\t\t// TODO: Move mongo sanitation to save actions\n\t\t// sanitizing request data for mongo-injection attacks\n\t\tthis.app.use(mongoSanitize());\n\n\t\t// any internal data that is needed to be attached to the request must be attached to the \"internalAppVars\" object\n\t\tthis.app.use((req, res, next) => {\n\t\t\treq.internalAppVars = {};\n\t\t\tnext();\n\t\t});\n\t}", "function isLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on\n console.log(next());\n if (req.isAuthenticated()) \n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n}", "_registerHandlers(target, becameInvalid, becameValid) {\n this.on('becameInvalid', target, becameInvalid);\n this.on('becameValid', target, becameValid);\n }", "function auth(req, res, next) {\n jwt(clientConfig)(req, res, (err, res) => {\n if (!err) return next();\n if (err && err.name === 'UnauthorizedError') {\n\n return jwt(serverConfig)(req, res, next);\n } else {\n return next(err);\n }\n });\n}", "function ensureAuthenticated(req, res, next) {\n console.log('\\n\\nensureAuthenticated\\n\\n');\n // console.log(req);\n if (req.isAuthenticated()) {\n console.log('\\n\\nisAuthenticated');\n return next();\n }\n console.log('\\n\\nnot isAuthenticated');\n res.redirect('/login');\n}", "function authMiddleWare() {\n return function(req, res, next) {\n console.log(req.headers);\n if (req.headers['authorization']) {\n let token = req.headers['authorization'];\n\n try {\n let verifed = JWT.verify(token, SECRET);\n\n if (verifed.username === 'santRaju') {\n next();\n } else {\n throw 'unauthorized';\n }\n } catch (err) {\n res.json({\n status: 403,\n success: false,\n message: 'unauthorized access'\n });\n }\n } else {\n res.json({\n status: 403,\n success: false,\n message: 'unauthorized access'\n });\n }\n };\n}" ]
[ "0.6111899", "0.6021228", "0.59849405", "0.594324", "0.5840282", "0.5802005", "0.5753676", "0.5717004", "0.5644498", "0.5612919", "0.55918926", "0.5570199", "0.5565379", "0.555367", "0.5545879", "0.5545879", "0.5544523", "0.5480617", "0.54683644", "0.5458201", "0.54506254", "0.5446472", "0.5438962", "0.54245466", "0.54052186", "0.54047465", "0.5363452", "0.53464824", "0.5342082", "0.5341998", "0.53327304", "0.5318025", "0.5302616", "0.52885747", "0.52852243", "0.52728045", "0.52702665", "0.52565914", "0.52359235", "0.5226829", "0.5220506", "0.5209548", "0.52045965", "0.5188781", "0.5188023", "0.5186963", "0.5184325", "0.5170165", "0.51617295", "0.51555926", "0.5152143", "0.5145354", "0.51449686", "0.5142857", "0.51413333", "0.5136242", "0.5134744", "0.51327837", "0.51250947", "0.51213133", "0.5117269", "0.511348", "0.50968385", "0.50944304", "0.50884676", "0.50845253", "0.508304", "0.50827724", "0.5082125", "0.50807446", "0.50718766", "0.5068438", "0.5067802", "0.5062497", "0.50548506", "0.50533307", "0.50516164", "0.50483114", "0.50481516", "0.50477564", "0.50466317", "0.50406724", "0.5034516", "0.5028247", "0.5026878", "0.50263464", "0.5025398", "0.5023092", "0.50227845", "0.50165814", "0.50163484", "0.50158274", "0.5009746", "0.5008937", "0.5008521", "0.5006836", "0.500188", "0.50000906", "0.49991497", "0.4997034", "0.49967936" ]
0.0
-1
==== Button Events : Main ====
function click_lyrMenu_업로드(ui) { var args = { targetid: "lyrServer", control: { by: "DX", id: ctlUpload } }; gw_com_module.uploadFile(args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleButton() {}", "_buttonClickHandler() { }", "function onButton(){\n input();\n output();\n\n}", "function addButtonEvent() {\n\t\t\tbtnList.begin.click(API.begin);\n\t\t\tbtnList.fastBackward.click(function () {API.backward(FAST_STEP_NUM); });\n\t\t\tbtnList.backward.click(function () {API.backward(1); });\n\t\t\tbtnList.forward.click(function () {API.forward(1); });\n\t\t\tbtnList.fastForward.click(function () {API.forward(FAST_STEP_NUM); });\n\t\t\tbtnList.end.click(API.end);\n\t\t\tbtnList.flag.click(API.flag);\n\t\t\tbtnList.auto.click(API.setAuto);\n\t\t}", "function _buttonListener(event) {\n codeMirror.focus();\n var msgObj;\n try {\n msgObj = JSON.parse(event.data);\n } catch (e) {\n return;\n }\n\n if(msgObj.commandCategory === \"menuCommand\"){\n CommandManager.execute(Commands[msgObj.command]);\n }\n else if (msgObj.commandCategory === \"viewCommand\") {\n ViewCommand[msgObj.command](msgObj.params);\n }\n }", "function handleBtnClick(event) {\n handleEvent(event);\n}", "buttonClicked() {\n alert(\"buttonclicked of button\");\n }", "function handleButtons () {\n handleStartButton();\n handleSubmitButton();\n handleNextButton();\n handleShowAllQandA();\n handleRestartButton();\n }", "function ButtonControl() {\n}", "buttonClick(ev) {\n\n\t\t// Get the button using the index\n\t\tvar btn = this.props.buttons[ev.currentTarget.dataset.index];\n\n\t\t// If there's a callback\n\t\tif(typeof btn.callback == 'function') {\n\t\t\tbtn.callback(btn);\n\t\t} else {\n\t\t\tthis.props.close();\n\t\t}\n\t}", "function buttonClick() {\n\tvar id = event.target.id;\n\tswitch(id) {\n\tcase \"Load\":\n\t\tbtRead.disabled = false;\n\t\tloadParams();\n\tbreak;\n\tcase \"Read\":\n\t\tbtStart.disabled = false;\n\t\treadParams();\n\tbreak;\n\tcase \"Start\":\n\t\tif(btStart.innerHTML == \"Start\") {\n\t\t\tbtLoad.disabled = true;\n\t\t\tbtRead.disabled = true;\n\t\t\tbtInfo.disabled = true;\n\t\t\tbtStart.innerHTML = \"Stop\";\n\t\t\tproc = setInterval(simulate, Tproc);\n\t\t} else {\n\t\t\tbtLoad.disabled = false;\n\t\t\tbtRead.disabled = false;\n\t\t\tbtInfo.disabled = false;\n\t\t\tbtStart.innerHTML = \"Start\";\n\t\t\tclearInterval(proc);\n\t\t}\n\tbreak;\n\tcase \"Info\":\n\t\tvar info = \"\";\n\t\tinfo += \"cppcmf.js\\n\";\n\t\tinfo += \"Charged particle in perpendicular \";\n\t\tinfo += \"constant magnetic field\\n\";\n\t\tinfo += \"Sparisoma Viridi\\n\";\n\t\tinfo += \"https://github.com/dudung/butiran.js\\n\"\n\t\tinfo += \"Load load parameters\\n\";\n\t\tinfo += \"Read read parameters\\n\";\n\t\tinfo += \"Start start simulation\\n\";\n\t\tinfo += \"Info show this messages\\n\";\n\t\tinfo += \"\\n\";\n\t\taddText(info).to(taOut);\n\tbreak;\n\tdefault:\n\t}\n}", "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tconsole.log('both');\n\t\t\t\ttag.disconnect();\n\t\t\t} else\t\t\t\t// if left, send the left key\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t\trunFile('left.scpt');\n\t\t\t} else\n\t\t\tif (right) {\t\t// if right, send the right key\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t\trunFile('right.scpt');\n\t\t\t}\n\t });\n\t}", "function whenButtonPressed(){\n\tconsole.log(\"you pushed button!\");\n}", "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tconsole.log('both');\n\t\t\t\ttag.disconnect();\n\t\t\t} else\t\t\t\t// if left, send the left key\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t\trunFile('applescript/left.scpt');\n\t\t\t} else\n\t\t\tif (right) {\t\t// if right, send the right key\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t\trunFile('applescript/right.scpt');\n\t\t\t}\n\t });\n\t}", "function actionButton() {\n\t\t\tif ($('#status').hasClass('play')) {\n\t\t\t\tif (common.type == 'blockly') {\n\t\t\t\t\t// capture screenshot\n\t\t\t\t\tvar xml = capture.captureXml();\n\n\t\t\t\t\t// log screenshot data to database\n\t\t\t\t\tdbService.saveProgram(xml);\n\n\t\t\t\t\t// capture blockly and run generated code\n\t\t\t\t\tvar code = Blockly.JavaScript.workspaceToCode(vm.workspace);\n\t\t\t\t\teval(code);\n\t\t\t\t} else {\n\t\t\t\t\t// capture screenshot and save to database\n\t\t\t\t\tcapture.capturePng('.program-inner');\n\n\t\t\t\t\t// convert program in to list of instructions\n\t\t\t\t\tvar program = [];\n\n\t\t\t\t\tfor (var i = 0; i < vm.program.length; i++) {\n\t\t\t\t\t\tvar ins = vm.program[i];\n\t\t\t\t\t\tprogram.push(ins.name);\n\t\t\t\t\t}\n\n\t\t\t\t\tdbService.saveProgram(program);\n\t\t\t\t}\n\n\t\t\t\t// run program\n\t\t\t\trun();\n\n\t\t\t\t// log button press\n\t\t\t\tdbService.buttonPress('play');\n\n\t\t\t} else if ($('#status').hasClass('stop')) {\n\n\t\t\t\t// stop program\n\t\t\t\tstate.current = state.STOPPED;\n\n\t\t\t\tif (common.type == 'blockly') {\n\t\t\t\t\tvm.program.length = 0;\n\t\t\t\t}\n\n\t\t\t\t// log button press\n\t\t\t\tdbService.buttonPress('stop');\n\n\t\t\t} else if ($('#status').hasClass('rewind')) {\n\t\t\t\trewind();\n\t\t\t}\n\t\t}", "function buttonClick() {\n\tvar id = event.target.id;\n\tswitch(id) {\n\tcase \"Load\":\n\t\tbtRead.disabled = false;\n\t\tloadParams();\n\tbreak;\n\tcase \"Read\":\n\t\tbtStart.disabled = false;\n\t\treadParams();\n\tbreak;\n\tcase \"Start\":\n\t\tif(btStart.innerHTML == \"Start\") {\n\t\t\tbtLoad.disabled = true;\n\t\t\tbtRead.disabled = true;\n\t\t\tbtInfo.disabled = true;\n\t\t\tbtStart.innerHTML = \"Stop\";\n\t\t\tproc = setInterval(simulate, Tproc);\n\t\t} else {\n\t\t\tbtLoad.disabled = false;\n\t\t\tbtRead.disabled = false;\n\t\t\tbtInfo.disabled = false;\n\t\t\tbtStart.innerHTML = \"Start\";\n\t\t\tclearInterval(proc);\n\t\t}\n\tbreak;\n\tcase \"Info\":\n\t\tvar info = \"\";\n\t\tinfo += \"windpend.js\\n\";\n\t\tinfo += \"Wind blows a simple pendulum\\n\";\n\t\tinfo += \"Sparisoma Viridi\\n\";\n\t\tinfo += \"https://github.com/dudung/butiran.js\\n\"\n\t\tinfo += \"Load load parameters\\n\";\n\t\tinfo += \"Read read parameters\\n\";\n\t\tinfo += \"Start start simulation\\n\";\n\t\tinfo += \"Info show this messages\\n\";\n\t\tinfo += \"\\n\";\n\t\taddText(info).to(taOut);\n\tbreak;\n\tdefault:\n\t}\n}", "function buttonClickListener(event) {\n var element = event.target;\n\n // Pop up and alert to say which button was pressed.\n \t/*if (element.type && element.type === \"button\") {\n \t\talert(\"You clicked the \" + element.id + \" button with value \" + element.value);\n \t}\n\t*/\n\tif(element.value==3)\n\t{\n\t\t\n\t\tdoMandala();\n\t}\n\telse if(element.value==4)\n\t{\n\t\t\n\t\tdoPolygon();\n\t}\n\telse if(element.value==8)\n\t{\n\t\t\n\t\tdoOctagon();\n\t}\n \t //Call the generic event logging function\n \tlogDrawings( event );\n}", "initButtons() {\n this.setupButton(\"efecBtn\", (e) => {\n\n })\n\n }", "function init() {\n\tbutton.addEventListener('click', function(event) {\n\t\tbuttonClicked(event.target.innerText);\n\t});\n}", "function do_btn( )\n{ \n\n g_button2 = createButton( \"Save Image\" );\n g_button2.position( 150, 900 );\n g_button2.mousePressed( save_image ); // the callback // will call mousePressed( ) function below\n}", "menuButtonClicked() {}", "function clickHandler() {\n console.log(\"Button 2 Pressed\");\n }", "initButtonEvents() {\n let allButtons = document.querySelectorAll('#buttons > g, #parts > g');\n Array.from(allButtons).forEach((btn, index) => {\n this.addEventListenerAll(btn, 'click drag', e => {\n let textBtn = btn.className.baseVal.replace('btn-', '');\n this.execBtn(textBtn);\n });\n\n this.addEventListenerAll(btn, 'mouseover mouseup mousedown', e => {\n btn.style.cursor = 'pointer';\n });\n })\n }", "function button0() {buttonAll(0, c0);}", "handleButtonClick(){\n\t\tconsole.log(\"handleButtonClick\");\n\n\t\teventsActions.createEvent(this.state.event);\n\t}", "function setupButtons(){\n //speak(quiz[currentquestion]['question'])\n\t\t$('.choice').on('click', function(){\n\t\tsynth.cancel();\n is_on = 0;\n\t\tpicked = $(this).attr('data-index');\n\t\tspeak(quiz[currentquestion]['choices'][picked], LINGUA_RISPOSTA);\n\t\tshow_button();\n\t\t// risposte in francese\n\t\t$('.choice').removeAttr('style').off('mouseout mouseover');\n\t\t$(this).css({'font-weight':'900', 'border-color':'#51a351', 'color':'#51a351', 'background' : 'gold'});\n\t\tif(submt){\n\t\t\t\tsubmt=false;\n\t\t\t\t$('#submitbutton').css({'color':'#fff','cursor':'pointer'}).on('click', function(){\n\t\t\t\t$('.choice').off('click');\n\t\t\t\t$(this).off('click');\n\t\t\t\tprocessQuestion(picked);\n //\n\t\t\t\t});\n\t\t\t}\n\t\t})\n\t}", "function runCalculator() {\n document.querySelector(\".main\").addEventListener(\"click\", function(event) {\n if (event.target.tagName === \"BUTTON\") {\n buttonClick(event.target.innerText);\n }\n });\n}", "function markButton(event){\n// $(\"#qwerty button\").on(\"click\", (event) => {\nevent.target.disabled = true;\nevent.target.classList.add (\"chosen\")\n// if (event.target.tagName === \"BUTTON\")\napp.handleInteraction(event.target.innerHTML.toLowerCase());\n}", "function button1Click(button) {\r\n\t//debugOut(\"button 1 click, button=\"+button);\r\n}", "function activateButtons()\r\n\t{ \t\r\n\r\n\t\t// B Button\r\n\t\tbButton.addListeners(\"rgba(64, 64, 64, 0.9)\");\r\n\t\tbButton.changeColor();\r\n\r\n\t\tbButton.newContainer.addEventListener(\"click\", function(event)\r\n\t\t{\r\n\t\t\tupdateFrequencyText(\"63 Hz\", compareFrequency(63));\r\n\t\t});\r\n\r\n\t\t// C Button\r\n\t\tcButton.addListeners(\"rgba(64, 64, 64, 0.9)\");\r\n\t\tcButton.changeColor();\t\r\n\r\n\t\tcButton.newContainer.addEventListener(\"click\", function(event)\r\n\t\t{\r\n\t\t\tupdateFrequencyText(\"125 Hz\", compareFrequency(125));\r\n\t\t});\r\n\r\n\t\t// D Button\r\n\t\tdButton.addListeners(\"rgba(64, 64, 64, 0.9)\");\r\n\t\tdButton.changeColor();\t\r\n\r\n\t\tdButton.newContainer.addEventListener(\"click\", function(event)\r\n\t\t{\r\n\t\t\tupdateFrequencyText(\"250 Hz\", compareFrequency(250));\r\n\t\t});\r\n\r\n\t\t//E Button\r\n\t\teButton.addListeners(\"rgba(64, 64, 64, 0.9)\");\r\n\t\teButton.changeColor();\r\n\r\n\t\teButton.newContainer.addEventListener(\"click\", function(event)\r\n\t\t{\r\n\t\t\tupdateFrequencyText(\"500 Hz\", compareFrequency(500));\r\n\t\t});\t\r\n\t\t\r\n\t\t// F Button\r\n\t\tfButton.addListeners(\"rgba(64, 64, 64, 0.9)\");\r\n\t\tfButton.changeColor();\r\n\r\n\t\tfButton.newContainer.addEventListener(\"click\", function(event)\r\n\t\t{\r\n\t\t\tupdateFrequencyText(\"1000 Hz\", compareFrequency(1000));\r\n\t\t});\r\n\t\t\r\n\t\t// G Button\r\n\t\tgButton.addListeners(\"rgba(64, 64, 64, 0.9)\");\r\n\t\tgButton.changeColor();\r\n\r\n\t\tgButton.newContainer.addEventListener(\"click\", function(event)\r\n\t\t{\r\n\t\t\tupdateFrequencyText(\"2000 Hz\", compareFrequency(2000));\r\n\t\t});\r\n\t\t\r\n\t\t// H Button\r\n\t\thButton.addListeners(\"rgba(64, 64, 64, 0.9)\");\r\n\t\thButton.changeColor();\r\n\r\n\t\thButton.newContainer.addEventListener(\"click\", function(event)\r\n\t\t{\r\n\t\t\tupdateFrequencyText(\"4000 Hz\", compareFrequency(4000));\r\n\t\t});\r\n\r\n\t\t// I Button\r\n\t\tiButton.addListeners(\"rgba(64, 64, 64, 0.9)\");\r\n\t\tiButton.changeColor();\r\n\t\t\r\n\t\tiButton.newContainer.addEventListener(\"click\", function(event)\r\n\t\t{\r\n\t\t\tupdateFrequencyText(\"8000 Hz\", compareFrequency(8000));\r\n\t\t});\r\n\r\n\t}", "function clickBtn(ev){\r\n\r\n //Brightspace ref: week 6\r\n let clickedButton = ev.target;\r\n\r\n let btnsArray=[\r\n ctrlBtns[0],\r\n ctrlBtns[1],\r\n ctrlBtns[2],\r\n ];\r\n\r\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf\r\n let index = btnsArray.indexOf(clickedButton);\r\n p(index);\r\n\r\n // /MDN ref:https://developer.mozilla.org/en-US/docs/Web/API/Element\r\n p(clickedButton.id);\r\n //handle moving id-active to the currently clicked button\r\n //remove currently present id 'active'\r\n for(let i=0; i < ctrlBtns.length ; i++){\r\n if(ctrlBtns[i].id){\r\n //MDN ref:https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute\r\n ctrlBtns[i].removeAttribute('id')\r\n }\r\n }\r\n //assign id=\"active\" to currently clicked button\r\n clickedButton.id=\"active\";\r\n //Load corresponding data into the container div\r\n cntnr.innerHTML = `<h2>${pages[index].heading}</h2> \r\n <img src=\"${pages[index].img}\" alt=\"${pages[index].alt}\">\r\n <p>${pages[index].bodyText}</p>\r\n `;\r\n\r\n }", "handleClick() {}", "function Procedure_button(main, str){\n\n\t//creat button, set class\n\tvar btn = document.createElement(\"button\");\n\tbtn.classList.add(\"ui\", \"circular\",\"icon\",\"button\",\"procedure\",\n\t\t\t\t\t main.stepObject.length.toString());\n\tbtn.setAttribute ('id', \"ui circular icon button procedure \" + \n\t\t\t\t\t main.stepObject.length.toString())\n\t//set button string\n\tvar t = document.createTextNode(str);\n\tbtn.appendChild(t);\n\t\n //add button to Web\n document.getElementById(\"Procedure_List\").appendChild(btn);\n\n //record scene object\n RecordObjects(main);\n main.stepNumber += 1;\n\n //set the click action\n btn.addEventListener(\"click\", function(){\n\n \t//if is the last step, create the step button\n\t if(main.lastStep == true){\n\t \tmain.lastStep = false;\n\t \tProcedure_button(main, main.stepOperationName);\n\t }\n\n\t //console.log(btn.classList[5]);\n\t buttonClicked(main, btn.classList[5]);\n\t main.stepNumber = btn.classList[5];\n\t main.stepOperationName = btn.firstChild.nodeValue;\n\n\t //Initialise the model button\n\t main.processor.executeDesign(\"MODEL_ALIGN\", \"initial\");\n\t main.processor.executeDesign(\"MODEL_PAINTING\", \"initial\");\n main.processor.executeDesign(\"MODEL_WRAP\", \"initial\");\n main.processor.executeDesign(\"MODEL_ROTATION\", \"initial\");\n main.processor.executeDesign(\"MODEL_ADDBETWEEN\", \"initial\");\n main.processor.executeDesign(\"MODEL_CUT\", \"initial\");\n main.processor.executeDesign(\"MODEL_ADD\", \"initial\");\n\t //show the control buttons\n\t if(btn.firstChild.nodeValue != 'Initial')\n\t \t$('#parameter_control_tool_' + btn.firstChild.nodeValue).show();\t \n\n\t});\n\t\n}", "function setupAPIButtons(){\n\taddMessage(\"Event listeners console...\");\n\tFWDPageSimpleButton.setPrototype();\n\tplayButton = new FWDPageSimpleButton(\"play\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tplayButton.getStyle().marginRight = \"14px\";\n\tplayButton.getStyle().marginTop = \"6px\";\n\tplayButton.addListener(FWDPageSimpleButton.CLICK, playClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tpauseButton = new FWDPageSimpleButton(\"pause\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tpauseButton.getStyle().marginRight = \"14px\";\n\tpauseButton.getStyle().marginTop = \"6px\";\n\tpauseButton.addListener(FWDPageSimpleButton.CLICK, pauseClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tstopButton = new FWDPageSimpleButton(\"stop\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tstopButton.getStyle().marginRight = \"14px\";\n\tstopButton.getStyle().marginTop = \"5px\";\n\tstopButton.addListener(FWDPageSimpleButton.CLICK, stopClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tscrubbButton = new FWDPageSimpleButton(\"scrub to 50%\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tscrubbButton.getStyle().marginRight = \"14px\";\n\tscrubbButton.getStyle().marginTop = \"6px\";\n\tscrubbButton.addListener(FWDPageSimpleButton.CLICK, scrubbClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tvolumeButton = new FWDPageSimpleButton(\"set volume to 50%\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tvolumeButton.getStyle().marginRight = \"14px\";\n\tvolumeButton.getStyle().marginTop = \"6px\";\n\tvolumeButton.addListener(FWDPageSimpleButton.CLICK, volumeClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tmp4Button = new FWDPageSimpleButton(\"change mp4 source\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tmp4Button.getStyle().marginRight = \"14px\";\n\tmp4Button.getStyle().marginTop = \"6px\";\n\tmp4Button.addListener(FWDPageSimpleButton.CLICK, setMp4ClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tgetCurrentTimeButton = new FWDPageSimpleButton(\"get time\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tgetCurrentTimeButton.getStyle().marginRight = \"14px\";\n\tgetCurrentTimeButton.getStyle().marginTop = \"6px\";\n\tgetCurrentTimeButton.addListener(FWDPageSimpleButton.CLICK, getCurrentTimeClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tgetTotalTimeButton = new FWDPageSimpleButton(\"get duration\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tgetTotalTimeButton.getStyle().marginRight = \"14px\";\n\tgetTotalTimeButton.getStyle().marginTop = \"6px\";\n\tgetTotalTimeButton.addListener(FWDPageSimpleButton.CLICK, getTotalTimeClickHandler);\n\t\n\tapiButtonsHolder_el.appendChild(playButton.screen);\n\tapiButtonsHolder_el.appendChild(pauseButton.screen);\n\tapiButtonsHolder_el.appendChild(stopButton.screen);\n\tapiButtonsHolder_el.appendChild(scrubbButton.screen);\n\tapiButtonsHolder_el.appendChild(volumeButton.screen);\n\tapiButtonsHolder_el.appendChild(mp4Button.screen);\n\tapiButtonsHolder_el.appendChild(getCurrentTimeButton.screen);\n\tapiButtonsHolder_el.appendChild(getTotalTimeButton.screen);\n}", "function addExitButton()\n{\n //Add the button\n exitBtn = game.add.button(930, 20, 'exit');\n //Add hover affect which changes the button if the mouse is hovering over the button or not\n exitBtn.events.onInputOver.add(function(){ exitBtn.frame = 1;});\n exitBtn.events.onInputOut.add(function(){ exitBtn.frame = 0;});\n\n //When the button is clicked, quitExercise() and loadHomePage() are called \n exitBtn.events.onInputDown.add(quitExercise);\n exitBtn.events.onInputDown.add(loadHomePage);\n}", "function fButtonPress( vButtonName )\r\n{\r\n\tmain_onRemoteControl(vButtonName);\r\n}", "function buttonClick(){\r\n\r\n var buttonTriggered = this.innerHTML;\r\n clickPress(buttonTriggered);\r\n buttonAnimation(buttonTriggered);\r\n\r\n}", "function setupAPIButtons(){\n\taddMessage(\"Event listeners console...\");\n\tFWDPageSimpleButton.setPrototype();\n\tplayButton = new FWDPageSimpleButton(\"play\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tplayButton.getStyle().marginRight = \"14px\";\n\tplayButton.getStyle().marginTop = \"6px\";\n\tplayButton.addListener(FWDPageSimpleButton.CLICK, playClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tpauseButton = new FWDPageSimpleButton(\"pause\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tpauseButton.getStyle().marginRight = \"14px\";\n\tpauseButton.getStyle().marginTop = \"6px\";\n\tpauseButton.addListener(FWDPageSimpleButton.CLICK, pauseClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tstopButton = new FWDPageSimpleButton(\"stop\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tstopButton.getStyle().marginRight = \"14px\";\n\tstopButton.getStyle().marginTop = \"5px\";\n\tstopButton.addListener(FWDPageSimpleButton.CLICK, stopClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tscrubbButton = new FWDPageSimpleButton(\"scrub to 50%\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tscrubbButton.getStyle().marginRight = \"14px\";\n\tscrubbButton.getStyle().marginTop = \"6px\";\n\tscrubbButton.addListener(FWDPageSimpleButton.CLICK, scrubbClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tvolumeButton = new FWDPageSimpleButton(\"set volume to 50%\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tvolumeButton.getStyle().marginRight = \"14px\";\n\tvolumeButton.getStyle().marginTop = \"6px\";\n\tvolumeButton.addListener(FWDPageSimpleButton.CLICK, volumeClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tfullscreenButton = new FWDPageSimpleButton(\"go fullscreen\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tfullscreenButton.getStyle().marginRight = \"14px\";\n\tfullscreenButton.getStyle().marginTop = \"6px\";\n\tfullscreenButton.addListener(FWDPageSimpleButton.CLICK, fullscreenClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tsetPosterButton = new FWDPageSimpleButton(\"set poster src\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tsetPosterButton.getStyle().marginRight = \"14px\";\n\tsetPosterButton.getStyle().marginTop = \"6px\";\n\tsetPosterButton.addListener(FWDPageSimpleButton.CLICK, setPosterClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tsetYoutubeButton = new FWDPageSimpleButton(\"set youtube src\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tsetYoutubeButton.getStyle().marginRight = \"14px\";\n\tsetYoutubeButton.getStyle().marginTop = \"6px\";\n\tsetYoutubeButton.addListener(FWDPageSimpleButton.CLICK, setYoutubeClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tvimeoYoutubeButton = new FWDPageSimpleButton(\"set vimeo src\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tvimeoYoutubeButton.getStyle().marginRight = \"14px\";\n\tvimeoYoutubeButton.getStyle().marginTop = \"6px\";\n\tvimeoYoutubeButton.addListener(FWDPageSimpleButton.CLICK, setVimeoClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tmp4Button = new FWDPageSimpleButton(\"set mp4 source\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tmp4Button.getStyle().marginRight = \"14px\";\n\tmp4Button.getStyle().marginTop = \"6px\";\n\tmp4Button.addListener(FWDPageSimpleButton.CLICK, setMp4ClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tmp4Button = new FWDPageSimpleButton(\"set mp4 source\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tmp4Button.getStyle().marginRight = \"14px\";\n\tmp4Button.getStyle().marginTop = \"6px\";\n\tmp4Button.addListener(FWDPageSimpleButton.CLICK, setMp4ClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tgetCurrentTimeButton = new FWDPageSimpleButton(\"get time\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tgetCurrentTimeButton.getStyle().marginRight = \"14px\";\n\tgetCurrentTimeButton.getStyle().marginTop = \"6px\";\n\tgetCurrentTimeButton.addListener(FWDPageSimpleButton.CLICK, getCurrentTimeClickHandler);\n\t\n\tFWDPageSimpleButton.setPrototype();\n\tgetTotalTimeButton = new FWDPageSimpleButton(\"get duration\", \"#FFFFFF\", \"#000000\", \"#000000\", \"#FFFFFF\");\n\tgetTotalTimeButton.getStyle().marginRight = \"14px\";\n\tgetTotalTimeButton.getStyle().marginTop = \"6px\";\n\tgetTotalTimeButton.addListener(FWDPageSimpleButton.CLICK, getTotalTimeClickHandler);\n\t\n\tapiButtonsHolder_el.appendChild(playButton.screen);\n\tapiButtonsHolder_el.appendChild(pauseButton.screen);\n\tapiButtonsHolder_el.appendChild(stopButton.screen);\n\tapiButtonsHolder_el.appendChild(scrubbButton.screen);\n\tapiButtonsHolder_el.appendChild(volumeButton.screen);\n\tapiButtonsHolder_el.appendChild(fullscreenButton.screen);\n\tapiButtonsHolder_el.appendChild(setPosterButton.screen);\n\tapiButtonsHolder_el.appendChild(setYoutubeButton.screen);\n\tapiButtonsHolder_el.appendChild(vimeoYoutubeButton.screen);\n\tapiButtonsHolder_el.appendChild(mp4Button.screen);\n\tapiButtonsHolder_el.appendChild(getCurrentTimeButton.screen);\n\tapiButtonsHolder_el.appendChild(getTotalTimeButton.screen);\n}", "function initiateButtons() {\r\n\tmainButton.addEventListener(\"mouseover\", e => {\r\n\t\tTweenMax.to(mainButton, 0.1, {scaleY: 1.1, ease: Expo.easeOut});\r\n\t\tTweenMax.to(mainButton, 0.1, {scaleX: 1.1, ease: Expo.easeOut});\r\n\t});\r\n\tmainButton.addEventListener(\"mouseout\", e => {\r\n\t\tTweenMax.to(mainButton, 0.1, {scaleY: 1, ease: Expo.easeOut});\r\n\t\tTweenMax.to(mainButton, 0.1, {scaleX: 1, ease: Expo.easeOut});\r\n\t});\r\n\r\n\tmainButton.addEventListener(\"contextmenu\", e => {\r\n\t\te.preventDefault();\r\n\t\tanimateMainButton();\r\n\t\tclick();\r\n\t\treturn false;\r\n\t}, false);\r\n\r\n\tmainButton.addEventListener(\"click\", e => {\r\n\t\tanimateMainButton();\r\n\t\tclick();\r\n\t});\r\n\r\n\tmenus.forEach(menuItem => {\r\n\t\tmenuItem.HTMLbutton.addEventListener(\"click\", e => {\r\n\t\t\tmenuItem.HTMLwindow.style.display = \"block\";\r\n\t\t\tdocument.getElementsByClassName(\"log-overlay-middle grid-item\")[0].scrollTop = document.getElementsByClassName(\"log-overlay-middle grid-item\")[0].scrollHeight;\r\n\t\t});\r\n\t\tmenuItem.HTMLclose.addEventListener(\"click\", e => menuItem.HTMLwindow.style.display = \"none\");\r\n\t\tmenuItem.HTMLwindow.addEventListener(\"click\", e => menuItem.HTMLwindow.style.display = \"none\");\r\n\t\tmenuItem.HTMLcontent.addEventListener(\"click\", e => e.stopPropagation()); //clicking inside the window does not close it\r\n\t});\r\n\r\n\tfor (let i = skills.length - 1; i >= 0; i--) {\r\n\t\tskills[i].HTMLelement.addEventListener(\"click\", e => {\r\n\t\t\tskillsCooldownAnimation(i);\r\n\t\t});\r\n\t}\r\n\r\n\tbirds.forEach( bird => {\r\n\t\tbird.HTMLelement.addEventListener(\"click\", e => buyUpgrade(birds, bird));\r\n\t});\r\n\t\r\n\tmachines.forEach( machine => {\r\n\t\tmachine.HTMLelement.addEventListener(\"click\", e => buyUpgrade(machines, machine));\r\n\t});\r\n\r\n\tchartZoom.addEventListener(\"click\", e => {\r\n\t\tchartWindow.style.display = \"block\";\r\n\t});\r\n\r\n\tchartWindow.addEventListener(\"click\", e => {\r\n\t\tchartWindow.style.display = \"none\";\r\n\t});\r\n\r\n\tchartClose.addEventListener(\"click\", e => {\r\n\t\tmarketOverlayWindow.style.display = \"none\";\r\n\t\tchartWindow.style.display = \"none\";\r\n\t});\r\n\r\n\t//Market Overlay Events\r\n\tchartOverlayContent.addEventListener(\"click\", e => e.stopPropagation());\r\n\tmarketOverlayClose.addEventListener(\"click\", e => marketOverlayWindow.style.display = \"none\");\r\n\tmarketOverlayWindow.addEventListener(\"click\", e => marketOverlayWindow.style.display = \"none\");\r\n\tmarketOverlayContent.addEventListener(\"click\", e => {\r\n\t\te.stopPropagation();\r\n\t\toverlayBuyStockButton.startPropagation();\r\n\t\toverlaySellStockButton.startPropagation();\r\n\t});\r\n\r\n\tmarketHistoryButton.addEventListener(\"click\", e => marketOverlayWindow.style.display = \"block\");\r\n\r\n\tbuyStockButton.addEventListener(\"click\", e => buyEggStock());\r\n\toverlayBuyStockButton.addEventListener(\"click\", e => buyEggStock());\r\n\tsellStockButton.addEventListener(\"click\", e => sellEggStock());\r\n\toverlaySellStockButton.addEventListener(\"click\", e => sellEggStock());\r\n}", "function handleButtons(event) {\r\n // the button pressed in found in the click event under the value of event.target.dataset.value\r\n // using the data attribute included for this purpose in the HTML\r\n let buttonPressed = event.target.dataset.value;\r\n\r\n // trigger different functions based on the button pressed\r\n if(buttonPressed == \"ec\") {\r\n clearMainDisplay();\r\n }\r\n else if(buttonPressed == \"ac\") {\r\n clearMainDisplay(); \r\n clearChainDisplay();\r\n }\r\n else if(regexDigits.test(buttonPressed)) {\r\n displayDigit(buttonPressed);\r\n }\r\n else if(buttonPressed == \".\") {\r\n displayDecimalPoint();\r\n }\r\n else if(regexOperators.test(buttonPressed)) {\r\n displayOperator(buttonPressed);\r\n } \r\n else if(buttonPressed == \"=\") {\r\n displayResult();\r\n }\r\n else {\r\n fourOhFour();\r\n }\r\n}", "function onClick( event ) {\n for( var i = 0; i < _buttons.length; i++ ) {\n var button = _buttons[i];\n \n if( button.contains( event.layerX, event.layerY ) ) {\n actionPerformed( button.getActionCommand() );\n return;\n }\n }\n \n if( event.which == 1 ) {\n location.href = linkHref;\n }\n }", "function events() {\r\n\taddition();\r\n\tcounter();\r\n\tcheckForm();\r\n}", "function handleUi() {\n var buttonText = 'Copy event URL';\n // create button copy url node\n var button = (function () {\n var buttonTemplate = `<div id=\":999.copy_url_top\" class=\"ep-ea-btn-wrapper\">&nbsp;<div class=\"goog-inline-block goog-imageless-button\" role=\"button\" tabindex=\"0\" style=\"-webkit-user-select: none;\"><div class=\"goog-inline-block goog-imageless-button-outer-box\"><div class=\"goog-inline-block goog-imageless-button-inner-box\"><div class=\"goog-imageless-button-pos\"><div class=\"goog-imageless-button-top-shadow\">&nbsp;</div><div class=\"goog-imageless-button-content\">${buttonText}</div></div></div></div></div></div>`;\n var button = document.createElement('div');\n button.innerHTML = buttonTemplate;\n return button.childNodes[0];\n })();\n\n // container where all the action buttons are in like save, discard etc\n var buttonContainer = document.querySelector('.ep-ea');\n var lastButton = buttonContainer.querySelector('.ep-ea-btn-wrapper:last-of-type');\n\n // insert button after the last button\n buttonContainer.insertBefore(button, lastButton.nextSibling);\n var buttonTextContainer = button.querySelector('.goog-imageless-button-content');\n\n button.addEventListener('click', function () {\n var eventUrl = retrieveEventUrl();\n var confirmButtonText = buttonText + ' ✔';\n copyToClipboard(eventUrl);\n buttonTextContainer.textContent = confirmButtonText;\n\n window.setTimeout(function () {\n buttonTextContainer.textContent = buttonText;\n }, 5000);\n });\n\n }", "function createButtons() {\n lat = createSlider(-90,90,40).position(10,10);\n long = createSlider(-180,180,-75).position(560,10);\n speed = createSlider(-40,40,0).position(10,height-20);\n createButton(\"toggle constellations\").mousePressed(()=>bigSphere.constellations = !bigSphere.constellations).position(10,60);\n createButton(\"now\").mousePressed(()=>bigSphere.resetTime()).position(10,120);\n createButton(\"stop\").mousePressed(()=>speed.value(0)).position(10,90);\n}", "function clickOnGameButton(event)\n{\n // Hier coderen we alles wat moet worden gedaan zodra een speler op de game button clicked\n // @TODO: Click event van de game button programmeren. Wat moet er allemaal gebeuren na een klik?\n}", "function bindButtons() {\n $('button', context).click(function() {\n switch(this.name) {\n case 'simple':\n case 'complex':\n applySettings(_.extend({},\n autotrace.defaults,\n autotrace.presets[this.name]\n ));\n break;\n\n case 'import':\n importTrace();\n /* falls through */\n\n case 'cancel':\n mainWindow.overlay.toggleWindow('autotrace', false);\n break;\n\n case 'transparent-pick':\n autotrace.$webview.send.pickColor();\n break;\n\n case 'clone-1':\n case 'clone-2':\n case 'clone-4':\n case 'clone-8':\n autotrace.settings.cloneCount = parseInt(this.name.split('-')[1]);\n\n // Only mixed tracetype needs to re-render the trace.\n if (autotrace.settings.tracetype === 'mixed') {\n autotrace.renderUpdate();\n } else {\n clonePreview();\n }\n break;\n }\n });\n\n // Bind ESC key exit.\n // TODO: Build this off data attr global bind thing.\n $(context).keydown(function(e){\n if (e.keyCode === 27) { // Global escape key exit window\n if (autotrace.pickingColor) {\n // Cancel picking color if escape pressed while picking.\n autotrace.$webview.send.pickColor(true);\n } else {\n $('button[name=cancel]', context).click();\n }\n }\n });\n\n // Bind special action on outline checkbox.\n $('input[name=outline]', context).change(function() {\n if ($(this).prop('checked')) {\n if (autotrace.settings.posterize === '5') {\n autotrace.settings.posterize = 4;\n applySettings(autotrace.settings);\n }\n $('#posterize-4').prop('disabled', true);\n } else {\n $('#posterize-4').prop('disabled', false);\n }\n });\n }", "function startButtons() {\n document.getElementById('legwork-add-button').addEventListener('click', addButtonClick);\n document.getElementById('legwork-back-button').addEventListener('click', backButtonClick);\n document.getElementById('legwork-is-highlight').addEventListener('click', toggleHighlightClick);\n document.getElementById('legwork-search-button').addEventListener('click', searchButtonClick);\n}", "function attachButtonEvents() {\n $(\"#joinBtn\").click(function (event) {\n openJoinScreen();\n });\n $(\"#joinCancelBtn\").click(function (event) {\n openHomeScreen($(\"#joinGameScreen\"));\n });\n $(\"#codeForm\").submit(function (event) {\n event.preventDefault();\n joinGame();\n });\n $(\"#leaveGameBtn\").click(function (event) {\n leaveGame();\n });\n $(\"#chatForm\").submit(function (event) {\n event.preventDefault();\n sendMessage();\n });\n}", "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\tif (left) console.log('left: ' + left);\n\t\t\tif (right) console.log('right: ' + right);\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) tag.disconnect();\n });\n }", "function button2 (event) {\n\talert('clicked button2');\n}", "function pressed(num){\n\tif (num == 1) {\n\t\teensButton.style.background = \"green\";\n\t\toneensButton.style.background = \"grey\";\n\t\thuidig = true;\n\t\tsubmitButton.style.display = \"inline-block\"\n\t}\n\telse if (num == 2) {\n\t\teensButton.style.background = \"grey\";\n\t\toneensButton.style.background = \"green\";\n\t\thuidig = false;\n\t\tsubmitButton.style.display = \"inline-block\"\n\t}\n\telse {\n\t\teensButton.style.background = \"grey\";\n\t\toneensButton.style.background = \"grey\";\n\t\thuidig = null;\n\t\tsubmitButton.style.display = \"none\"\n\t}\n}", "function __clickhandler() {\n buttonfunc(elemnode); return false;\n }", "function buttonPublish(evt) {\n var btn = evt.currentTarget;\n btn.blur(); // Allow button to be defocused without clicking elsewhere\n $.publish(btn.id);\n }", "function buttonClicked(){\n if (isShowingOverlays) {\n removeOverlays();\n isShowingOverlays = false;\n } else {\n isShowingOverlays = true;\n }\n\n button.writeProperty('buttonState', isShowingOverlays ? 0 : 1);\n button.writeProperty('defaultState', isShowingOverlays ? 0 : 1);\n button.writeProperty('hoverState', isShowingOverlays ? 2 : 3);\n}", "function buttonClicked () {\n let clickedButton = event.target;\n\n valueHTML();\n\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\t\tconsole.log(\"buttonId \"+buttonId);\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function clickedTheButton(){\r\n greet();\r\n}", "function listenForButton() {\n tag.on('simpleKeyChange', function (left, right) {\n if (left && right) {\n console.log('both: Black');\n if(effects[effectnr] == 'none') {\n var x = new A().add({0: 255, 1: 0, 2: 0, 3: 0}).run(universe, done);\n }else {\n var x = new A().add({0: 255, 1: 0, 2: 0, 3: 0}, 3000, effects[effectnr]).run(universe, done);\n }\n return;\n } else\t\t\t\t// if left, send the left key\n if (left) {\n if (colornr < colors.length - 1) {\n colornr++;\n } else {\n colornr = 0;\n }\n console.log('Color: ' + colornr + \" \" + left);\n\n if(effects[effectnr] == 'none') {\n var x = new A().add(colors[colornr]).run(universe, done);\n }else {\n var x = new A().add(colors[colornr], 3000, effects[effectnr]).run(universe, done);\n }\n\n } else if (right) {\t\t// if right, send the right key\n if (effectnr < effects.length - 1) {\n effectnr++;\n } else {\n effectnr = 0;\n }\n console.log('EasingMode: ' + effects[effectnr] + \" \" + right);\n }\n });\n }", "click(btn) {\r\n\r\n canvas.addEventListener(\"click\",\r\n function buttonClick(e) {\r\n\r\n let x = fix_X(e.clientX);\r\n let y = fix_Y(e.clientY);\r\n\r\n // Check for collision.\r\n if (x >= btn.x - btn.w / 2 & x <= btn.x + btn.w / 2) {\r\n if (y >= btn.y - btn.h / 2 & y <= btn.y + btn.h / 2) {\r\n btn.click_extra();\r\n btn.action();\r\n }\r\n\r\n }\r\n });\r\n }", "function btnDown() {\n //dbg(\"mousedown\");\n lastBtn = this.id;\n //add graphical feed back here\n dbg({ keydown: this.id });\n rokupost(\"keydown\", this.id);\n}", "function btnClick(e) {\n\t\n\t// Variables for storing mouse position on click\n\tvar mx = e.pageX,my = e.pageY; //-225 559\n\t//$(\"#isReadyPlayer\").append(\"ep:\"+e.pageX+\",mx:\"+mx+\",H:\"+H);\n\t// Click start button\n\tif( verifyClick(mx,my,startBtn) && usuario_id !== -1 ){\n\t\tplayerReady();\n\t\t//animloop();\n\t\t\n\t\t// Delete the start button after clicking it\n\t\tstartBtn = {};\n\t}\n\t\n\t// If the game is over, and the restart button is clicked\n\tif(over == 1) {\n\n\t\tif( verifyClick(mx,my,restartBtn) && usuario_id !== -1 ) {\n\t\t\tball.x = 20;\n\t\t\tball.y = 20;\n\t\t\tpoints = 0;\n\t\t\tball.vx = 4;\n\t\t\tball.vy = 8;\n\t\t\t//animloop();\n\t\t\t\n\t\t\tover = 0;\n\t\t\tplayerReady();\n\t\t}\n\t}\n}", "function buttonClick() {\n alert(\"see me!\");\n}", "function makeButtons() {\n\t// attach script to reset button\n\tvar resetObject = GameObject.CreatePrimitive(PrimitiveType.Quad);\n\tvar resetScript = resetObject.AddComponent(resetButtonMouse);\n\tresetScript.init(this);\n\t\n\t// attach script to menu button\n\tvar menuObject = GameObject.CreatePrimitive(PrimitiveType.Quad);\n\tvar menuScript = menuObject.AddComponent(menuButtonMouse);\n\tmenuScript.init(this);\n\t\n\t// attach script to help button\n\tvar helpObject = GameObject.CreatePrimitive(PrimitiveType.Quad);\n\tvar helpScript = helpObject.AddComponent(helpButtonMouse);\n\thelpScript.init(this);\n\n\t// attach script to mute button\n\tvar muteObject = GameObject.CreatePrimitive(PrimitiveType.Quad);\n\tvar muteScript = muteObject.AddComponent(muteButtonMouse);\n\tmuteScript.init(this);\n\n\tvar tempheight: int =Screen.height/500;\n\t\tmenuObject.transform.position = Vector3(-2, 7, 0);\n\t\tresetObject.transform.position = Vector3(-2, 6, 0);\n\t\tmuteObject.transform.position = Vector3(-2, 5, 0);\n\t\thelpObject.transform.position = Vector3(-2, 4, 0);\n}", "processButtonEvent( buttonEvent )\n {\n this.transport.processButtonEvent( buttonEvent );\n }", "function click() {\n\n setName('Ram')\n setAge(21)\n // console.log(\"button clicked\")\n console.log(name,age)\n }", "function buttonHandler(event) {\n event.preventDefault();\n if (event.target.id == \"post-btn\") {\n show();\n } else if (event.target.id == \"submit-btn\") {\n submit(event);\n } else if (event.target.id == \"cancel-btn\") {\n cancel(event);\n } else if (\n String(event.target.id).substring(0, 4) == \"edit\" &&\n event.target.tagName == \"BUTTON\"\n ) {\n editPost(event);\n } else if (event.target.id.substring(0, 6) == \"delete\") {\n deletePost(event);\n }\n}", "function mousePressed() {\n\n CheckButtons(Buttons);\n CheckHover(Buttons);\n\n}", "function commandButtonHandle(){\n\t\tswitch(this.id){\n\t\t\tcase \"commandbutton_1\":\n\t\t\t\tonDealCardsClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_2\":\n\t\t\t\tonMaxBetClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_3\":\n\t\t\t\tonAddFiveClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_4\":\n\t\t\t\tonRemoveFiveClicked();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function delegateButtonClicks(evt, that, theSenderName, locObj) {\n\n if (!locObj.theTarget.disabled) {\n // console.log(\"delegateButtonClicks> evt: \" + evt + \" that: \" + that + \" theSenderName: \" + theSenderName + \"locObj.theTarget : \" + locObj.theTarget + \"locObj.theTargetType: \" + locObj.theTargetType);\n\n //var theSource = locObj.theTargetName;\n // The Image of Button\n //var str = locObj.theTarget.firstChild;\n\n switch (theSenderName) {\n case \"previous\":\n case \"next\":\n toggleSequence(theSenderName);\n break;\n case \"notesb\":\n handleNotes(theSenderName);\n break;\n case \"goBack\" :\n UpALevel();\n break;\n case \"audiopl\":\n case \"audiorew\":\n case \"audiofor\":\n handleAudio(theSenderName);\n break;\n case \"tapescr\":\n tapescriptShow(theSenderName);\n break;\n case \"checkB\" :\n case \"showB\" :\n case \"resetB\" :\n case \"showtext\" :\n case \"showjust\" :\n case \"showgrammar\" :\n case \"showLF\" :\n case \"showUE\" :\n case \"showCU\" :\n case \"videoB\" :\n case \"showaudio\" :\n assignFooterExtraTextButtons(locObj);\n break;\n\t\t\tcase \"showgrade\" :\n\t\t\t\t$(\"#grade\").toggle();\n\t\t\t\tbreak;\n default :\n }\n }\n}", "buttonHandler(button) {\n console.log(button);\n switch (button) {\n // game buttons\n case 'green':\n this.addToPlayerMoves('g');\n break;\n case 'red':\n this.addToPlayerMoves('r');\n break;\n case 'yellow':\n this.addToPlayerMoves('y');\n break;\n case 'blue':\n this.addToPlayerMoves('b');\n break;\n // control buttons\n case 'c-blue':\n this.controlButtonPressed('power');\n break;\n case 'c-yellow':\n this.controlButtonPressed('start');\n break;\n case 'c-red':\n this.controlButtonPressed('strict');\n break;\n case 'c-green':\n this.controlButtonPressed('count');\n break;\n // default\n default:\n break;\n }\n }", "activateButton(){\n //If the button already exists, we want to remove and rebuilt it\n if(this.button)\n this.button.dispose();\n\n //Create button called but with Activate SpeedBoost as its text\n this.button = Button.CreateSimpleButton(\"but\", \"Activate\\nSpeedBoost\");\n this.button.width = 0.8;\n this.button.height = 0.8;\n this.button.color = \"white\";\n this.button.background = \"red\";\n this.button.alpha = 0.8;\n this.stackPanel.addControl(this.button);\n //Scope these attributes so they can be used below\n var button = this.button;\n var app = this.app;\n\n //Function for if they click it\n //Function is a member of the button object, not of this class\n this.button.onPointerDownObservable.add(function() {\n if(button.textBlock.text != \"Activate\\nSpeedBoost\")\n return;\n app.buttonPressed(\"speedBoost\");\n button.textBlock.text = \"SpeedBoost\\nActivated\";\n }); \n }", "makeButtonHandler() {\n\t\tconst filter = (interaction) => true;\n\n\t\tvar collector = this.globalScrollUpdateMessage.createMessageComponentCollector({filter, time: 120000})\n\n\t\tcollector.on(\"collect\", interaction => {\n\t\t\tconsole.log(interaction);\n\n\t\t\tif(interaction.customId == \"next\") {\n\t\t\t\tinteraction.update(this.getOffsetGlobalScrollIndex(1))\n\t\t\t} else if (interaction.customId == \"back\") {\n\t\t\t\tinteraction.update(this.getOffsetGlobalScrollIndex(-1));\n\t\t\t}\n\t\t})\n\t\n\t}", "buttonTwoClick(evt) {\n alert(\"Button Two Clicked\");\n }", "function listenForClick() {\n loopThroughGrid();\n clickTurnBtn();\n }", "function sayThings() {\n console.log(\"this button is clicked!\")\n}", "function bindButtons() {\n $('button', context).click(function() {\n switch(this.name) {\n case 'cancel':\n mainWindow.overlay.toggleWindow('export', false);\n break;\n\n case 'reset':\n mainWindow.resetSettings();\n break;\n\n case 'reselect':\n exportData.pickFile(function(filePath) {\n if (filePath) {\n exportData.filePath = filePath;\n mainWindow.overlay.toggleWindow('overlay', true);\n }\n });\n break;\n\n case 'export':\n exportData.saveData();\n break;\n\n case 'print':\n exportData.enqueueData();\n break;\n }\n });\n\n // Bind ESC key exit.\n // TODO: Build this off data attr global bind thing.\n $(context).keydown(function(e){\n if (e.keyCode === 27) { // Global escape key exit window\n $('button[name=cancel]', context).click();\n }\n });\n }", "function button2Click(button) {\r\n\t//debugOut(\"button 2 click, button=\"+button);\r\n}", "function buttonClick(event){\n //Conditional to limit click triggering to the buttons only\n if(event.target.tagName != \"BUTTON\"){\n return\n }\n //Conditional determining the behavior when the correct answer is selected\n else if (event.target.id === \"a\"){\n colorButtons();\n score++;\n // localStorage.setItem(\"score\", score);\n clearDelay()\n }\n //Conditional determining the behavior when the wrong answer is selected\n else if(event.target.id === \"f\"){\n colorButtons();\n score--; \n // localStorage.setItem(\"score\", score);\n secondsLeft -= 10;\n clearDelay();\n }\n}", "function guiLoop() {\n updateCustomButtons();\n}", "pressed()\n {\n emitter.emit(this.config.event);\n }", "function instructionHandler(event)\n\t\t{\n\t\t\tg.instruct();\n\t\t\thideButtons(this);\n\t\t}", "handleJDotterClick() {}", "function buildGameButton(){\n\tbuttonStart.cursor = \"pointer\";\n\tbuttonStart.addEventListener(\"click\", function(evt) {\n\t\tplaySound('soundClick');\n\t\tgoPage('select');\n\t});\n\t\n\tbuttonContinue.cursor = \"pointer\";\n\tbuttonContinue.addEventListener(\"click\", function(evt) {\n\t\tplaySound('soundClick');\n\t\tgoPage('select');\n\t});\n\t\n\tbuttonFacebook.cursor = \"pointer\";\n\tbuttonFacebook.addEventListener(\"click\", function(evt) {\n\t\tshare('facebook');\n\t});\n\tbuttonTwitter.cursor = \"pointer\";\n\tbuttonTwitter.addEventListener(\"click\", function(evt) {\n\t\tshare('twitter');\n\t});\n\tbuttonWhatsapp.cursor = \"pointer\";\n\tbuttonWhatsapp.addEventListener(\"click\", function(evt) {\n\t\tshare('whatsapp');\n\t});\n\t\n\tbuttonSoundOff.cursor = \"pointer\";\n\tbuttonSoundOff.addEventListener(\"click\", function(evt) {\n\t\ttoggleGameMute(true);\n\t});\n\t\n\tbuttonSoundOn.cursor = \"pointer\";\n\tbuttonSoundOn.addEventListener(\"click\", function(evt) {\n\t\ttoggleGameMute(false);\n\t});\n\t\n\tbuttonFullscreen.cursor = \"pointer\";\n\tbuttonFullscreen.addEventListener(\"click\", function(evt) {\n\t\ttoggleFullScreen();\n\t});\n\t\n\tbuttonExit.cursor = \"pointer\";\n\tbuttonExit.addEventListener(\"click\", function(evt) {\n\t\tif(!$.editor.enable){\n\t\t\ttoggleConfirm(true);\n\t\t}\n\t});\n\t\n\tbuttonSettings.cursor = \"pointer\";\n\tbuttonSettings.addEventListener(\"click\", function(evt) {\n\t\ttoggleOption();\n\t});\n\t\n\tbuttonConfirm.cursor = \"pointer\";\n\tbuttonConfirm.addEventListener(\"click\", function(evt) {\n\t\ttoggleConfirm(false);\n\t\tstopGame(true);\n\t\tgoPage('main');\n\t\ttoggleOption();\n\t});\n\t\n\tbuttonCancel.cursor = \"pointer\";\n\tbuttonCancel.addEventListener(\"click\", function(evt) {\n\t\ttoggleConfirm(false);\n\t});\n\t\n\tbuttonTutContinue.cursor = \"pointer\";\n\tbuttonTutContinue.addEventListener(\"click\", function(evt) {\n\t\ttoggleTutorial(false);\n\t});\n}", "function buildGameButton(){\r\n\tbtnPlay.cursor = \"pointer\";\r\n\tbtnPlay.addEventListener(\"click\", function(evt) {\r\n\t\tplaySound('soundChalk');\r\n\t\tgoPage('game');\r\n\t});\r\n\t\r\n\tbtnServe.cursor = \"pointer\";\r\n\tbtnServe.addEventListener(\"click\", function(evt) {\r\n\t\tif(serveEnable){\r\n\t\t\tplaySound('soundChalk');\r\n\t\t\tplaySound('soundCashier');\r\n\t\t\tincreaseScore();\r\n\t\t\tcreateOrder();\r\n\t\t}\r\n\t});\r\n\t\r\n\tbtnPlayAgain.cursor = \"pointer\";\r\n\tbtnPlayAgain.addEventListener(\"click\", function(evt) {\r\n\t\tplaySound('soundChalk');\r\n\t\tgoPage('game');\r\n\t});\r\n\t\r\n\tfor(n=0;n<ingredients_arr.length;n++){\r\n\t\t$.icons[n].clicknum = n;\r\n\t\t$.icons[n].cursor = \"pointer\";\r\n\t\t$.icons[n].addEventListener(\"click\", function(evt) {\r\n\t\t\tcheckSelectIngredient(evt.target.clicknum);\r\n\t\t});\r\n\t}\r\n\t\r\n\tbtnFacebook.cursor = \"pointer\";\r\n\tbtnFacebook.addEventListener(\"mousedown\", function(evt) {\r\n\t\tshare('facebook');\r\n\t});\r\n\tbtnTwitter.cursor = \"pointer\";\r\n\tbtnTwitter.addEventListener(\"mousedown\", function(evt) {\r\n\t\tshare('twitter');\r\n\t});\r\n\tbtnGoogle.cursor = \"pointer\";\r\n\tbtnGoogle.addEventListener(\"mousedown\", function(evt) {\r\n\t\tshare('google');\r\n\t});\r\n}", "function ActiveButton(Root)\r\n{\r\n Root.start_btn.addEventListener(\"click\", ChangePage);\r\n window.addEventListener(\"keydown\", keyboardHandle);\r\n \r\n //audioTag();\r\n}", "initButtonsEventClick(){\n let buttons = document.querySelectorAll(\".row > button\");\n buttons.forEach(btn=>{\n btn.addEventListener(\"click\", e=>{\n let txtBtn = btn.innerHTML;\n this.excBtn(txtBtn);\n //console.log(txtBtn+\" \"+e.type);\n //console.log(txtBtn);\n });\n });\n }", "function startButton(){\n hunger();\n happy();\n knowledge();\n \n}", "handleClick( event ){ }", "buttonClick(event, type) {\n let self = this;\n if (self.stateService.statusRunning) { // if running disallow interaction with the board\n return false;\n } else if (type === 'go' && self.stateService.statusStart && self.stateService.statusEnd) { // if it's the go button and there are start and end tiles on the board\n self.stateService.statusRunning = true;\n self.stateService.currentSelectedTile = self.stateService.statusStart; // set the currently selected tile to the start tile\n self.stateService.statusPath.push(self.stateService.currentSelectedTile); // mark x,y as part of solution path\n self.setPathClass(self.stateService.currentSelectedTile);\n self.setClass(document.getElementById('go-button'), 'active');\n self.stateService.startTime = moment().format('HH:mm:ss.SSS');\n self.loopDir();// run calculation\n } else { // if start or end buttons\n let otherType = type === 'start' ? 'end' : 'start';\n let buttonFlag = `${type}ButtonFlag`;\n let otherButtonFlag = `${otherType}ButtonFlag`;\n let otherButton = document.getElementById(otherType + '-button');\n let button = event.srcElement;\n \n if (self.stateService[buttonFlag] === true) { // if already clicked\n self.unsetClass(button, 'active');\n } else { // if not clicked\n self.setClass(button, 'active');\n self.unsetClass(otherButton, 'active');\n self.stateService[otherButtonFlag] = false; // reset the other button\n }\n \n self.stateService.currentSelectedTile = null; // set the currently selected tile\n self.stateService[buttonFlag] = !self.stateService[buttonFlag];\n }\n \n }", "function buttonsClick(e) {\n var target = e.target;\n while (target.id != \"story_content\") {\n switch (target.className) {\n case \"top\":\n moveBlockUp(target);\n return;\n case \"bottom\":\n moveBlockDown(target);\n return;\n case \"delete\":\n deleteBlock(target);\n return;\n case \"addmarker\":\n setactiveMarker(target);\n return;\n case \"addmarkerArtifact\":\n setactiveMarker(target);\n return;\n case \"removemarker\":\n removeMarker(target);\n return;\n case \"image_story gallery\":\n galleryChangePicture(target);\n return;\n case \"block_story\":\n editBlock(target);\n return;\n }\n target = target.parentNode;\n }\n}", "function buttons() {\n\t$('#cardForm').on('click', '#newGame', function() {\n\t\tevent.preventDefault();\n\t\tgetCard();\n\t\t$('#newGame').hide();\n $('#newCard').show();\n $('#prevCard').show();\n $('#btnRules').show();\n $('#answerBtn').show();\n\t\t$('#rules').hide();\n\t});\n\n\t$('#cardForm').on('click', '#newCard', function() {\n\t\tevent.preventDefault();\n\t\tflipped=false;\n\t\tgetCard();\n });\n \n $('#cardForm').on('click', '#prevCard', function() {\n\t\tevent.preventDefault();\n\t\tflipped=false;\n\t\tgetPrevCard();\n });\n \n $('#cardForm').on('click', '#answerBtn', function() {\n event.preventDefault();\n\t\tdisplayAnswer();\n\t});\n\n\t$('#cardForm').on('click', '#btnRules', function() {\n\t\tevent.preventDefault();\n\t\t$('#rules').toggle();\n\t});\n}", "function buttonSetup() {\n for (var i = 0; i < domButtons.length; i++) {\n domButtons[i].addEventListener('click', buttonHandler);\n }\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n console.log(buttonId);\n\n\t //$(this).closest(\"form\").submit();\n \n });\n}", "function setClickBehaviour(){\n\t\t\tbutton.on(\"click\", changeButtonLabelAndSendEvent);\n\t\t}", "initButtons() {\n let buttons = document.querySelectorAll('.btn');\n buttons.forEach(btn => { \n btn.addEventListener('click', e => {\n let btnClick = btn.innerHTML;\n this.actionCalc(btnClick); \n }, false);\n }); \n }", "click(btn) {\r\n\r\n canvas.addEventListener(\"click\",\r\n function buttonClick(e) {\r\n \r\n let x = fix_X(e.clientX);\r\n let y = fix_Y(e.clientY);\r\n \r\n // Check for collision.\r\n if (x >= btn.x - btn.w / 2 & x <= btn.x + btn.w / 2) {\r\n if (y >= btn.y - btn.h / 2 & y <= btn.y + btn.h / 2) {\r\n btn.action();\r\n canvas.removeEventListener(\"click\", buttonClick);\r\n }\r\n \r\n }\r\n });\r\n }", "function startButton() {\n let buttonWidth = 500;\n let buttonHeight = 200;\n let leftSide = width / 2 - buttonWidth / 2;\n let rightSide = leftSide + buttonWidth;\n let topSide = height / 2 - buttonHeight / 2 + 150;\n let bottomSide = topSide + buttonHeight;\n\n noStroke();\n\n if (mouseX >= leftSide &&\n mouseX <= rightSide &&\n mouseY >= topSide &&\n mouseY <= bottomSide) {\n\n fill(0, 140, 174);\n\n if (mouseIsPressed) {\n background(intro);\n state = 2;\n }\n }\n else {\n fill(0, 45, 72);\n }\n rect(leftSide, topSide, buttonWidth, buttonHeight, 20);\n buttonText();\n}", "function eventForClick() {\n\t\n\t\n\tinterval = setInterval(function(){\n\t\tdisableEnableButtons(\"disable\");\n\t\tcomputerButtons[previousIndex].style.display = \"none\";\n\t\tpreviousIndex = Math.floor(Math.random()*5);\n\t\tcomputerButtons[previousIndex].style.display = \"block\";\t}, 100);\n\tsetTimeout(function () {\n\t\tclearInterval(interval);\n\t\tdisableEnableButtons(\"enable\");\n\t}, 2000);\n\t\n}", "function increment() {\n console.log(\"The button was clicked\")\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function() {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "clickHandler() {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // No click 'action' for input - text is removed in visualEffectOnActivation\n }\n }" ]
[ "0.7730056", "0.7438477", "0.72790486", "0.7250599", "0.7226155", "0.7060203", "0.70438385", "0.7027095", "0.694591", "0.6932067", "0.6881592", "0.6870841", "0.6844013", "0.6800175", "0.67989445", "0.67986614", "0.67956746", "0.6793432", "0.6785744", "0.6775591", "0.67663187", "0.6760387", "0.6756332", "0.67267114", "0.6711683", "0.6705671", "0.6643695", "0.6641853", "0.6640968", "0.6640207", "0.663233", "0.6592194", "0.65884006", "0.65773994", "0.6575431", "0.65750146", "0.6574538", "0.6571464", "0.65641165", "0.6554536", "0.655012", "0.65451294", "0.65399927", "0.65309244", "0.65265125", "0.6525864", "0.65040076", "0.65024203", "0.65021837", "0.65016615", "0.649954", "0.64989996", "0.64980024", "0.64932156", "0.64858484", "0.64832485", "0.6479844", "0.6479613", "0.64784867", "0.6478268", "0.64770776", "0.6476727", "0.64762133", "0.64711374", "0.64702684", "0.6464914", "0.64634347", "0.6463078", "0.6462852", "0.64581335", "0.64508414", "0.6445345", "0.64440906", "0.64440143", "0.6439448", "0.64387554", "0.64387023", "0.6435911", "0.64182025", "0.64180684", "0.64153314", "0.64123076", "0.6411085", "0.6408678", "0.63965446", "0.63946074", "0.63895774", "0.6384852", "0.6377746", "0.63773775", "0.6376022", "0.6368843", "0.63649267", "0.6361547", "0.6359517", "0.63565224", "0.6353356", "0.6352822", "0.63467276", "0.6337656", "0.6336896" ]
0.0
-1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ custom function. (program section) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
function processRetrieve(param) { var args = { source: { type: "INLINE", argument: [ { name: "arg_file_id", value: param.key } ] }, target: [ { type: "GRID", id: "grdData_List", focus: true, select: true } ], key: param.key, handler_complete: processRetrieveEnd }; gw_com_module.objRetrieve(args); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Main()\n {\n \n }", "setupProgram(program) {\n }", "function main(){\n\n\n}", "function main(){\n\t\n}", "function main(){\r\n}", "function main() {\n\n}", "enterProgram(ctx) { console.log(\" %s: %s\", __function, ctx.getText()); }", "function main(){\n//CODE//\n}", "function main() {\n}", "getOutput(full) {\nlet program = this._progam;\nlet text = '';\nlet blockIndex = -1;\nlet lastBlockId = -1;\nif (full) {\ntext += 'Wheel VM Program\\n';\ntext += '#VERSION\\n' +\n' 1\\n';\ntext += '#NAME\\n' +\n' ' + program.getTitle() + '\\n';\ntext += '#LAYERS\\n' +\n' ' + program.getLayerCount() + '\\n';\ntext += '#HEAP\\n' +\n' ' + program.getHeap() + '\\n';\nlet stringList = program.getStringList();\ntext += '#STRINGS\\n' +\n' ' + program.getStringCount() + ',' + program.getStringLength() + '\\n' +\n' ' + stringList.length + '\\n';\nstringList.forEach((string) => {\ntext += ' \"' + string + '\"\\n';\n});\nlet constants = program.getConstants();\ntext += '#CONSTANTS\\n' +\n' ' + constants.length + '\\n';\nconstants.forEach((constant) => {\ntext += ' offset: ' + ('0000' + constant.offset).substr(-4) + '\\n';\nlet s = ' data: [';\nlet first = true;\nconstant.data.forEach((n) => {\nif (first) {\nfirst = false;\n} else {\ns += ',';\n}\ns += n;\n});\ntext += s + ']\\n';\n});\ntext += '#REG_CODE\\n' +\n' ' + program.getEntryPoint() + '\\n';\ntext += '#REG_STACK\\n' +\n' ' + program.getGlobalSize() + '\\n';\ntext += '#CODE\\n';\n}\nthis._commands.forEach(\nfunction(command, i) {\nif (lastBlockId !== command.getBlockId()) {\nlastBlockId = command.getBlockId();\nblockIndex++;\n}\ntext += this.getCommandText(command, i, blockIndex) + '\\n';\n},\nthis\n);\nif (full) {\nlet eventInfo = program.getEventInfo();\ntext += '#PROC\\n';\ntext += ' ' + Object.keys(eventInfo).length + '\\n';\nfor (let event in eventInfo) {\ntext += ' proc: \"' + event + '\"\\n';\ntext += ' offset: ' + eventInfo[event] + '\\n';\n}\ntext += '\\n';\n}\nreturn text;\n}", "function Expt() {\r\n}", "function exercise11() {}", "Program() {\n return {\n type: 'Program',\n body: this.StatementList(),\n };\n }", "function exercise07() {}", "loadProgram (program) {\n console.log(program)\n\n // Load the program in memory\n // Chip 8 programs start in 0x200 memory location\n let memPosCounter = 0x200\n for (let byte of program) {\n this.memory[memPosCounter] = byte\n memPosCounter++\n }\n }", "function addProgramHandler() {\n const currentCode = document.getElementById(\"program-code-inpt\").value;\n const currentValue = document.getElementById(\"program-value-inpt\").value;\n\n if (currentCode) {\n updateProgramArray(currentCode, currentValue ? currentValue : currentCode);\n } else {\n eventEmmitter.emit(\"message\", \"No Program Information Entered\");\n }\n}", "function Instruction() {\r\n}", "Program() {\n return {\n type: 'Program',\n body: this.StatementList(),\n }\n }", "function exercise06() {}", "function read_program(program) {\n if (checkOSVersion(210)) {\n return read_program21(program);\n } else {\n return read_program183(program);\n }\n}", "function MainFunction()\n{\n 'use strict';\n\n Steps(7);\n\n}", "function program(){\n\t\ttoggleOnOff(programSwitch);\n\t\tmemplace_data[activeMemPlace] = [];\n\t\tmemplace_addr[activeMemPlace] = [];\n\t\tfor(var i=0; i<=15; i++){\n\t\t\tif (i<=7){ memplace_data[activeMemPlace].push(temp_data[i]); }\n\t\t\tmemplace_addr[activeMemPlace].push(temp_addr[i]);\n\t\t}\n\t\tconsole.log(\"> computer programmed\");\n\t\tconsole.log(\"wrote in memspace : \"+activeMemPlace);\n\t\tconsole.log(\"memory for data (in memspace \"+activeMemPlace+\") : \"+memStat(\"data\"));\n\t\tconsole.log(\"memory for addr (in memspace \"+activeMemPlace+\") : \"+memStat(\"addr\"));\n\t\tconsole.log(\"\");\n\t}", "getCpp(){ return this.program.generateCpp(); }", "function Main()\n {\n console.log(\"%cMain Program Body\", \"color: green;\")\n }", "loadBasicProgram(basicProgram) {\n // Find address to load to.\n let addr = this.readMemory(0x40A4) + (this.readMemory(0x40A5) << 8);\n if (addr < 0x4200 || addr >= 0x4500) {\n console.error(\"Basic load address (0x\" + z80_base_1.toHexWord(addr) + \") is uninitialized\");\n return;\n }\n // Terminate current line (if any) and set up the new one.\n let lineStart;\n const newLine = () => {\n if (lineStart !== undefined) {\n // End-of-line marker.\n this.writeMemory(addr++, 0);\n // Update previous line's next-line pointer.\n this.writeMemory(lineStart, z80_base_1.lo(addr));\n this.writeMemory(lineStart + 1, z80_base_1.hi(addr));\n }\n // Remember address of next-line pointer.\n lineStart = addr;\n // Next-line pointer.\n this.writeMemory(addr++, 0);\n this.writeMemory(addr++, 0);\n };\n // Write elements to memory.\n for (const e of basicProgram.elements) {\n if (e.offset !== undefined) {\n if (e.elementType === trs80_base_1.ElementType.LINE_NUMBER) {\n newLine();\n }\n // Write element.\n addr = this.writeMemoryBlock(addr, basicProgram.binary, e.offset, e.length);\n }\n }\n newLine();\n // End of Basic program pointer.\n this.writeMemory(0x40F9, z80_base_1.lo(addr));\n this.writeMemory(0x40FA, z80_base_1.hi(addr));\n // Start of array variables pointer.\n this.writeMemory(0x40FB, z80_base_1.lo(addr));\n this.writeMemory(0x40FC, z80_base_1.hi(addr));\n // Start of free memory pointer.\n this.writeMemory(0x40FD, z80_base_1.lo(addr));\n this.writeMemory(0x40FE, z80_base_1.hi(addr));\n }", "static private internal function m121() {}", "function main() {\r\n initFlags();\r\n fixMarkup();\r\n changeLayout();\r\n initConfiguration();\r\n}", "function Section_Description() {\n}", "function run_program()\n{\n\t//Disable functions to restrict access\n\tvar data \t\t\t\t= undefined;\n\tvar checkpoint\t\t\t= undefined;\n\tvar lastprogress\t\t= undefined;\n\t\n\tvar run_program\t\t\t= undefined;\n\tvar onmessage \t\t\t= undefined;\n\tvar postMessage \t\t= undefined;\n\tvar Send\t\t\t\t= undefined;\n\tvar Run\t\t\t\t\t= undefined;\n\tvar Exception\t\t\t= undefined;\n\tvar arguments\t\t\t= undefined;\n\n\t//Run the code\n\treturn program(js);\n}", "function Proc() {}", "function decodeProgram()\n{\n var sysex = arrayfromargs(arguments);\n var decodedBytes = byteDecode(sysex);\n var decodedHeader = decodedBytes.slice(0, 56);\n var decodedContent = decodedBytes.slice(56);\n var decoder = new paramDecoder(params);\n decoder.decodedContent = decodedContent;\n\n // Output patch name to display\n var programName = decodedContent.slice(0, 14);\n var programNameText = '';\n for each (var letter in programName) {\n programNameText = programNameText + String.fromCharCode(letter);\n }\n messnamed ('programName', programNameText);\n\n paramCount = params.length;\n for (i = 0; i < paramCount; i++) {\n\n if ('dummy' == params[i][NAME].slice(0, 5)) {\n // skip dummy parameters\n continue;\n }\n\n // Lookup the value\n var rawValue = decoder.read(i);\n if (CONVERT < params[i].length) {\n // Call named conversion routine\n rawValue = this[params[i][CONVERT]](rawValue, i, decoder);\n }\n\n // Record FX type for reference by other parameter conversion routines\n if ('fx::Type[1]' === params[i][NAME]) {\n fx1Type = rawValue;\n }\n outlet(PARAMETER, params[i][NAME], rawValue);\n }\n outlet(COMPLETE, 'bang');\n}", "program() {\n /*\n PROGRAM myProgram;\n BEGIN\n ...\n END.\n */\n\n this.eat(Lexer.TokenTypes.PROGRAM);\n const nameTok = this.currentToken;\n\n this.eat(Lexer.TokenTypes.ID);\n this.eat(Lexer.TokenTypes.SEMI);\n return new AST.ProgramNode(nameTok.val, this.block())\n }", "function Scdr() {\r\n}", "function executeProgram( program = testProg, noun = 12, verb = 2 ) {\n let memory = [ ...program ]\n // memory[1] = noun\n // memory[2] = verb\n\n let ip = 0\n while ( memory[ip] !== 99 ) {\n // console.log( ip )\n // console.log( memory.slice( ip, ip + 4 ) )\n // console.log( ip )\n console.log( memory[6] )\n\n const result = executeInstruction( ip, memory )\n\n // console.log( result )\n // console.log( result.ip )\n // ip +=\n memory = result.memory\n ip = result.ip\n if ( typeof result.output === 'string' && result.out !== '0' ) {\n console.log( result.output )\n // return\n }\n // console.log( memory )\n if ( result.halt ) {\n console.log( result.halt )\n break\n }\n // console.log( 5 )\n }\n\n return memory[0]\n}", "function program(){\n \n if (mConfig===0){\n P(0);\n R();\n R();\n mConfig = 1;\n }\n else if (mConfig===1){\n P(1);\n R();\n R();\n mConfig = 0;\n }\n \n}", "function main$1 () {\n // console.log(foo);\n // console.log('version: ' + version);\n console.log('the answer is ' + index);\n}", "function exampleFunctionToRun(){\n\n }", "function main()\r\n{\r\n integerList=getIntegerList(myArgs);\r\n stringArray=getStringArray(integerList);\r\n printStringArray(stringArray);\r\n}", "function mainImpl(doc) {\n\n}", "function fresh_program() {\n return make_program(\"new\",1);\n}", "static private protected public internal function m117() {}", "function Program(node, print) {\n\t print.sequence(node.body);\n\t}", "function Program(node, print) {\n\t print.sequence(node.body);\n\t}", "function cargarpista1 (){\n \n}", "function main() {\n return 'Hello, World!';\n}", "function walkThrough(program) {\n var workingProgram = program.slice();\n \n for (var i = 0; i < workingProgram.length; ) {\n \n if (workingProgram[i] === 1) {\n var value1 = workingProgram[i + 1];\n var value2 = workingProgram[i + 2];\n var result = workingProgram[i + 3];\n \n workingProgram[result] = workingProgram[value1] + workingProgram[value2];\n i += 4;\n }\n \n if (workingProgram[i] === 2) {\n var value1 = workingProgram[i + 1];\n var value2 = workingProgram[i + 2];\n var result = workingProgram[i + 3];\n \n workingProgram[result] = workingProgram[value1] * workingProgram[value2];\n i += 4;\n }\n \n if (workingProgram[i] === 99) {\n return workingProgram;\n }\n }\n \n}", "execute_program(){\n\t// execution loop\n\twhile(!this.step()){}\n}", "function fn() {\n\t\t }", "function fuction() {\n\n}", "function Main() {\n console.log(`%c Main Function`, \"color: grey; font-size: 14px; font-weight: bold;\");\n buildInterface();\n interfaceLogic();\n }", "function program(){\n\t//initialize hashmap of scopes\n\tthis._scopes = {};\n\t//create start block (right now pass no scope owner)\n\tvar start = new block(null);\n\t//create finalizing block (right now pass no scope owner)\n\tvar end = new block(null);\n\t//create and assign global scope\n\tthis._scopes[scope.__nextId] = new scope(\n\t\tnull,\t//no parent\n\t\tSCOPE_TYPE.GLOBAL,\t//global scope type\n\t\tnull,\t//not function declaration\n\t\tnull,\t//not type object declaration\n\t\tstart,\t//pass in first block\n\t\tend,\t//pass in last block\n\t\tstart,\t//set start as the current\n\t\t{}\t//no symbols right now are defined (may change later)\n\t);\n\t//set owner for start and end blocks\n\tstart._owner = this._scopes[scope.__nextId - 1];\n\tend._owner = this._scopes[scope.__nextId - 1];\n}", "function _____SHARED_functions_____(){}", "function customFunction() {\n //Statements\n }", "function fm(){}", "function main(input) {\r\n var output = \"Hello World\";\r\n return output;\r\n}", "function fuctionPanier(){\n\n}", "function ourReusableFunction() {\n\tconsole.log(\"Heyya, world\");\n}", "function TinyLisp(){ \n}", "function exercise4(getData) {}", "function lalalala() {\n\n}", "function primary(arg1, arg2) { // primary\n // ...\n}", "function help() {\n\n}", "function Ha(){}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function run() {\n\n}", "Run() {\n\n }", "gatherOutput(text) {\n this.programOutput += text;\n }", "function generateCode(){\n\n}", "function app(nCases, input) {\n\n // code here\n \n}", "function Basic1() {\n}", "function Exercise3() {\n\n // Your code here.\n\n}", "function ApplicationProcess(){}", "start() {// [3]\n }", "function theImplementation(automata){\n\n}", "function bootlegMiddle() {\n ;\n}", "function main() {\n// Main logic goes here, use it in any way you see fit, its up to you\n const x = readline();\n var line2 = readline(); \n let num=readline().split(' ').map(x=>parseInt(x)); // Incase the input line has a space seperated values, then each of them is seperated into diff. array elements, based on ' ' present between each array item.\n /* Or something like this were also possible\n num=parseInt(readline().split(' '));\n Also note that it is inside readline() that the input is accessed, however if due to some arrangement it was already provided to us via function argument, \n refer to TCS-UI-2020 file on how to handle i/o then.\n */\n \n foo(x);\n foo(line2);\n}", "function add(code) {\n for (var l = 0; l < level; ++l) {\n Program += \" \";\n }\n Program += code + \"\\n\";\n }", "function main() {\n addHeadings();\n styleTutorialsAndArticles();\n separateAllTutorials();\n}", "function prog_test_1(){\n\tconst dst=3 // 3->out\n\tconst program0=[dst,1,1,1]\n\tconst program1=[dst,0,1,1]\n\tconst program2=[dst,1,1,1]\n\tconst program3=[dst,0,1,1]\n\tconst program=[program0,program1,program2,program3]\n\n\treturn program\n}", "run(program) \n {\n this.load(program);\n while (this.step());\n return !this.isRunning();\n }", "function exercise3(getData) {}", "function main() {\n return _main.apply(this, arguments);\n}", "function example3 () {\n console.log('Inside example 3');\n}", "function exercise5(getData) {}", "function Sread() {\r\n}", "function mainFunc() {\n\n\tif (debug) GM_log('entering MainFunc. getEquip:'+GM_getValue('getEquip',false)+' collectSlotInfo:'+GM_getValue('collectSlotInfo','potato')+' collectStripInfo:'+GM_getValue('collectStripInfo',false)+' stripping:'+GM_getValue('stripping',false)+' dressing:'+GM_getValue('dressing', false));\n\tif (GM_getValue('collectSlotInfo',false) ){\n\t\tif (debug)GM_log('collecting slot info');\n\t\tgoToInfo(equipSlot,noEquipSlot);\n\t}\n\telse if (GM_getValue('getEquip',false) ){\n\t\tif (debug)GM_log('collecting equip info');\n\t\tgoToInfo(collectEquipInfo,noEquipInfo);\n\t}\n\t// if we're going to strip, collect info.\n\telse if (GM_getValue('collectStripInfo',false)) {\n\t\tif (debug)GM_log('collecting strip info');\n\t\tgoToInfo(collectStripInfo,noEquipStrip);\n\t}\n\t// if we're stripping, get naked.\n\telse if (GM_getValue('stripping',false)) {\n\t\tif (debug)GM_log('stripping');\n\t\tstrip();\n\t}\n\t// if we're getting dressed then dress!\n\telse if (GM_getValue('dressing', false)) {\n\t\tif (debug)GM_log('dressing');\n\t\tdress();\n\t}\n\t// if we're not here for any reason, then we might have just ended stripping/dressing or something. Once more for paranoia!\n\telse {\n\t\tcancelBox();\n\t}\n\t\n}", "getBasicProgramFromMemory() {\n let addr = this.readMemory(0x40A4) + (this.readMemory(0x40A5) << 8);\n if (addr < 0x4200 || addr >= 0x4500) {\n return \"Basic load address (0x\" + z80_base_1.toHexWord(addr) + \") is uninitialized\";\n }\n // Walk through the program lines to find the end.\n const beginAddr = addr;\n while (true) {\n // Find end address.\n const nextLine = this.readMemory(addr) + (this.readMemory(addr + 1) << 8);\n if (nextLine === 0) {\n break;\n }\n if (nextLine < addr) {\n // Error, went backward.\n return `Next address 0x${z80_base_1.toHexWord(nextLine)} is less than current address 0x${z80_base_1.toHexWord(addr)}`;\n }\n addr = nextLine;\n }\n const endAddr = addr + 2;\n // Put together the binary of just the program.\n const binary = new Uint8Array(endAddr - beginAddr + 1);\n binary[0] = trs80_base_1.BASIC_HEADER_BYTE;\n binary.set(this.memory.subarray(beginAddr, endAddr), 1);\n // Decode the program.\n const basic = trs80_base_1.decodeBasicProgram(binary);\n if (basic === undefined) {\n return \"Basic couldn't be decoded\";\n }\n return basic;\n }", "function section(title) {\n console.log(\"================================================================\");\n console.log(title);\n console.log(\"================================================================\");\n}", "function run() {\n\n }", "function runit() {\n var prog = simple_coding.getTextArea().value;\n console.log(\"************code\"+prog)\n var mypre = document.getElementById(\"output\");\n console.log(\"************mypre \"+mypre)\n\n mypre.innerHTML = '';\n Sk.pre = \"output\";\n // console.log(\"-----------------1\")\n Sk.configure({output:outf, read:builtinRead});\n // console.log(\"-----------------2\" +Sk.TurtleGraphics)\n // console.log(\"-----------------3\" +Sk.TurtleGraphics)\n\n (Sk.TurtleGraphics || (Sk.TurtleGraphics = {})).target = 'mycanvas';\n var myPromise = Sk.misceval.asyncToPromise(function() {\n return Sk.importMainWithBody(\"<stdin>\", false, prog, true);\n });\n myPromise.then(function(mod) {\n console.log('success');\n },\n function(err) {\n console.log(err.toString());\n });\n }", "function fourth() {}", "function Exercise2() {\n\n // Your code here.\n\n}", "private public function m246() {}", "function ourReusableFunction() {\r\n console.log(\"Hi World\");\r\n}", "function runProgram(){\nwhatToBuy();\ngetProducts();\n}", "function main(){\r// setup some variables\rvar d = app.documents.add(); // active doc\rvar pg = d.pages.item(0); // first page\rvar tf = pg.textFrames.add(); // the one textframe that is there\r\r// the function buildBounds(app.documents.item());\r// calculates the size of the textframe\rtf.geometricBounds = buildBounds(d);\r\r\rtf.contents = \"Hello World\";\r\r// now we can loop thru the text\r\rfor(var i = 0;i < tf.characters.length; i++){\r\tvar c = tf.characters[i];\r\t// the next line loops thru all characters in the text\r\tc.pointSize = calcVal(23);\r\t}\r\r\r}", "function kata27() {\r\n // Your Code Here\r\n}", "function blabla() {\n\n}", "function genProgram (node, position) {\n return generateChildren(node.body, position);\n}", "function printHello(){\n//This code will run when the function run or is called upon\n console.log(\"This Function is working\");\n\n}" ]
[ "0.6757153", "0.6700883", "0.6666861", "0.65191114", "0.639497", "0.6344665", "0.628618", "0.6256723", "0.618383", "0.6167291", "0.6058424", "0.59891564", "0.592637", "0.5900733", "0.57633436", "0.5745933", "0.57458955", "0.5701986", "0.56928945", "0.56871843", "0.5686595", "0.56822205", "0.5675882", "0.5665336", "0.56322575", "0.5620757", "0.56078666", "0.5603654", "0.560022", "0.56002074", "0.55725235", "0.5570435", "0.55434245", "0.5539967", "0.5537194", "0.55297", "0.5488521", "0.54812616", "0.5472538", "0.54698586", "0.54503345", "0.5434893", "0.5434893", "0.5413323", "0.541176", "0.5410814", "0.54102314", "0.539464", "0.5393902", "0.536739", "0.5362226", "0.53605974", "0.535381", "0.5344362", "0.53441536", "0.5343255", "0.5341572", "0.53405946", "0.53403735", "0.53320336", "0.5325451", "0.531637", "0.53162247", "0.5315779", "0.5315779", "0.5315646", "0.5306407", "0.5289053", "0.5286204", "0.5283345", "0.52829224", "0.5282708", "0.5282224", "0.52797145", "0.52784353", "0.5266267", "0.52618504", "0.52538955", "0.525133", "0.5249382", "0.52485335", "0.52458316", "0.5241299", "0.5236827", "0.5235017", "0.5234547", "0.52342814", "0.5226051", "0.5225696", "0.52205455", "0.52196395", "0.5216213", "0.5209925", "0.52092993", "0.52083427", "0.52068317", "0.5198607", "0.5194355", "0.5193274", "0.5192496", "0.5191748" ]
0.0
-1
=========================== GESTION ADMIN ===========================
function showDashboard(){ //Cache la div create film $("#divFormFilm").hide(); $.ajax({ method: "POST", url:"template/dashboard.php", }).done((template)=>{ //Attache le contenu dans la div avec l'ID (contenu) $("#contenu").html(template); //rendreInvisible(contenu); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showAdmin(){\n addTemplate(\"admin\");\n userAdmin();\n}", "function getAdminStuff(){\n FactoryFactory.getAdminBlanks();\n FactoryFactory.getAdminThreads();\n }", "function GivenIAmAnAdmin() {}", "check_admin_status() {}", "_handleButtonAddAdmin()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__PROJECT_ADD_USER_ADMIN,\n {username: this._getSelectedUser(), project: this._project});\n }", "function requiresAdmin() {\n return true;\n}", "function requiresAdmin() {\n return true;\n}", "function add_admin_access () {\r\n // fetch the admin group ID\r\n return knex.first('ID').from('Groups').where({name: 'Administrators'})\r\n .then(function (group) {\r\n // add the admin endpoint to the admin group\r\n return knex('GroupEndpoints').insert({ GroupID: group.ID, EndpointID: 1 })\r\n })\r\n }", "function admin_init() {\n init_preferences(); // blank call to load defaults like social rendering\n GET('%sapi/preferences.lua'.format(G_apiURL), (state, json) => {\n mgmt_prefs = json\n init_preferences(state, json);\n }, null);\n let mid = decodeURIComponent(location.href.split('/').pop());\n // Specific email/list handling?\n if (mid.length > 0) {\n // List handling?\n if (mid.match(/^<.+>$/)) {\n\n }\n // Email handling?\n else {\n GET('%sapi/email.json?id=%s'.format(G_apiURL, encodeURIComponent(mid)), admin_email_preview, null);\n }\n } else { // View audit log\n GET('%sapi/mgmt.json?action=log&page=%s&size=%u'.format(G_apiURL, audit_page, audit_size), admin_audit_view, null);\n }\n}", "function requiresAdmin() {\n return false;\n}", "function requiresAdmin() {\n return false;\n}", "function GivenIAmATrustAdmin() {}", "function adminCheck(thrgfhbstdgfb,rgfrfgrgf,erthngrgf) {\n if(rgfrfgrgf.startsWith(\"admin\")){\n alert(\"Welcome \" + erthngrgf + \"!\" );\n window.location.href=\"/blog\";\n }else{\n alert(\"Welcome \" + erthngrgf + \"!\" );\n window.location.href=\"/userblog\" + thrgfhbstdgfb;\n }\n }", "function checkAdmin()\n {// only Admin can see the User managment tab\n if(sessionStorage[\"user\"] == admin)\n {\n return <li className=\"w3-bar-item w3-button tablink\"><Link to= \"/main/manageUsers\">Users Management</Link></li>\n }\n }", "function index(){\n\tif(error == 'true'){\n\t\terrors();\n\t}else if(admin == 'true'){\n\t\tadmins();\n\t}else if(admin == 'false'){\n\t\tadmins();\n\t}else if(update == 'true'){\n\t\tupdateCom();\n\t}else if(supprimer == 'true'){\n\t\tsuppresion();\n\t}else if(comment == 'true'){\n\t\tnouveauCom();\n\t}else{\n\t\tedition();\n\t}\n}", "function paginaInladen(){\n buildAdminUrenLijst();\n}", "function display_admin() {\r\n show(admin);\r\n hide(user);\r\n}", "function Actualizar() {\n llamada(true, \"GET\", \"https://lanbide-node.herokuapp.com/admins\", \"JSON\");\n}", "isAdmin() {\n return (this.get('type') === 'Admin') && !this.get('is_slumming');\n }", "function agregarBotones(){\n\t\tif(tieneRol(\"administrador\") || tieneRol(\"programador\")){\n\t\t Ext.getCmp('btNuevoMod').setDisabled(false);\n\t\t Ext.getCmp('btBorrarMod').setDisabled(false);\n\t\t Ext.getCmp('btGuardarMod').setDisabled(false);\n\t\t}\n\t\t/*if(tieneRol(\"cliente\")){\n\t\t Ext.getCmp('btNuevoMod').setDisabled(false);\n\t\t Ext.getCmp('btGuardarMod').setDisabled(false);\n\t\t}*/\n\t}", "function showAdminLoadingDiv() { tf.showAdminLoading(); }", "function Admin(){\n\n\tconsole.log(\"Initialize Admin Class\");\n\n}", "function checkAdminStatus(){ //no longer needed.\n tab = \"{e6114c50-374d-440e-8a1d-9e0f0921cf96}\";\n section = \"{e6114c50-374d-440e-8a1d-9e0f0921cf96}_section_5\";\n Xrm.Page.ui.tabs.get(tab).sections.get(section).setVisible(false);\n checkUserRole(\"System Administrator\");\n\n}", "function showMessageForAdmin(){ \n Logger.log(fillInTemplateFromObject( HtmlService.createTemplateFromFile( ADMIN_HTML_TEMPLATE_NAME ).evaluate().getContent(), getDataFromLastRow()));\n}", "function main() {\n var siteCreateGroup = \"ALFRESCO_SITE_CREATORS\";\n createSite = false\n\n var result = remote.call(\"/api/people/\" + stringUtils.urlEncode(user.name) + \"?groups=true\");\n if (result.status == 200) {\n var i;\n\n // Create javascript objects from the server response\n // This is the User and it also contains all groups.\n var userValue = eval('(' + result + ')');\n\n if (userValue.groups.length != 0) {\n\n for (i = 0; i < userValue.groups.length; i++) {\n // if (user.isAdmin) createSite = true; break;\n if (userValue.groups[i].itemName == siteCreateGroup) createSite = true;\n }\n }\n }\n sitesMenu.config.showCreateSite = createSite;\n }", "function owneradmin(res) {\n let igroup = 1; // currently only group 1 supported\n IPLGroup.findOne({ gid: 1 }, (err, grprec) => {\n if (!grprec) { senderr(res,621, \"Invalid group\"); return; }\n //console.log(grprec);\n User.findOne({ uid: grprec.owner }, (err, userrec) => {\n if (!userrec) { senderr(res,DBFETCHERR, `Could fetch record of user ${grprec.uid}`); return; }\n sendok(res,userrec);\n });\n });\n}", "GoToAdmin()\n \t{\n \t\tif(this.state.isAdmin)\n \t\t{\n \t\t\tthis.setState({ currentPage : \"AdminPage\" })\n \t\t}\n \t\telse\n \t\t{\n \t\t\talert('Sorry ! Admins only .');\n \t\t}\n \t\t\n \t}", "index ( req, res ) {\n return res.send(this.templates['admin']());\n }", "function main(){\n galleries = getGalleries();\n // localStorage.setItem('g', JSON.stringify(galleries) )\n // addNavItems(galleries);\n // handleView(galleries);\n }", "function checkAdmin() {\r\n\tvar uPlayers = players.filter(player => !player.isAi);\r\n\tif (uPlayers.length == 0) {\r\n\t\treturn;\r\n\t}\r\n\tvar adminNums = (uPlayers.filter(p => p.isAdmin)).length;\r\n\tif (adminNums == 0) {\r\n\t\tvar p = uPlayers.random();\r\n\t\tif (!p) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tp.isAdmin = true;\r\n\t\tp.conn.emit('admin', {\r\n\t\t\ttype: 'map_data',\r\n\t\t\tmaps: Maps\r\n\t\t});\r\n\t\tlog(0, 'Setting new admin to: ' + p.name);\r\n\t} else if (adminNums > 1) {\r\n\t\tlog(2, 'Too many admins detected (' + adminNums + ')');\r\n\t\tuPlayers.forEach(p => p.isAdmin = false);\r\n\t}\r\n}", "get isAdmin() {\n return this.__userAdmin__ === 'true'\n }", "function changeOrgs(){\n\t$('body').empty().addClass('login');\n\tlocalStorage.removeItem('sd_inst_key');\n\tlocalStorage.removeItem('sd_org_key');\n\tlocalStorage.removeItem('sd_from_queueid');\t\n\tSherpaDesk.init();\n\t}", "edit() {\n return this._isAdmin();\n }", "new() {\n return this._isAdmin();\n }", "function adminLoggedIn() {\n // ...\n return true;\n }", "function adminInstanzInit()\n\t{\n\t\tnavigationInit(\"adminInstanz\", \"web_admin_instanz\");\n\t}", "function checkAdmin(){\n\trol = localStorage.getItem(\"rol\");\n\tif(rol== \"admin\"){\n\t\t$('#verw').show();\n\t\t$(\"#persoonsgegevens\").attr('class', 'border-admin');\n\t\t$(\"#projecten\").attr('class', 'border-admin');\n\t};\n}", "static async getAdmin() {\n return new Promise((resolve, reject) => {\n Auth.getUser().then(user => {\n resolve(user !== undefined ? user.admin : 0);\n }).catch(() => {\n resolve(0);\n });\n });\n }", "function _init() {\n window.alert(\"admin ctrl works\");\n }", "function adminUserInit()\n\t{\n\t\tnavigationInit(\"adminUser\", \"web_admin_user\");\n\t}", "function GetAdminPermObj() { return { isAdmin: true, isMod: true, loggedIn: true, canViewTree: true, canViewFeedback: true, canViewRatings: true, canSubmitFeedback: false, canRate: true }; }", "function insertQueryAdmin() {\n var admin = $('#query-input-admin').val();\n\n databaseManager\n .query(\"SELECT ADMIN FROM gebruiker WHERE NAAM = (?)\", [admin])\n .done(function (data) {\n if (data == \"\") {\n alert(\"Gebruiker is niet gevonden\");\n } else {\n databaseManager\n .query(\"UPDATE gebruiker SET ADMIN = '1' WHERE NAAM = (?)\", [admin])\n .done(function () {\n alert(\"Gebruiker is nu admin\");\n loadController(CONTROLLER_ADMIN_HOME);\n })\n .fail(function () {\n alert(\"Gebruiker is GEEN admin\");\n });\n }\n })\n .fail(function () {\n alert('Gebruiker is niet gevonden');\n });\n }", "function Get_ADMIN(){\n return enumParams(COLUMN_ADMIN).join();\n}", "function doRegisterCommands() {\r\n GM_registerMenuCommand('Configurar ' + appName + ' ' + appVersion + '...', preferences);\r\n GM_registerMenuCommand('Ver información de depurado', showLog);\r\n }", "function admin(){\n window.location.href=\"admin.html\";\n}", "get administration() {\n\t\treturn this.__administration;\n\t}", "signUp() {\n I.fillField(this.signupLocators.fullName, 'SignUpOrgAdmin');\n I.fillField(this.signupLocators.email, '[email protected]');\n I.fillField(this.signupLocators.password, 'SECRET123');\n I.fillField(this.signupLocators.confirmPassword, 'SECRET123');\n I.click(this.signupLocators.toggleAgreeToTermsAndConditions);\n I.click(this.signupLocators.signUpRegistration);\n }", "function activate() {\n \tformValidate();\n\n\t\t\t\n \tif ($routeParams.gkey != undefined && $routeParams.gkey != \"\" && $routeParams.gkey != null) {\n \t\tvm.Title = \"Edit ab121sg\";\n \t\tvm.isNew = false;\n \t\tdataContext.getById(\"/api/ab121sg/\" + $routeParams.gkey).then(function (data) {\n \t\t\tvm.ab121sg = data;\n \t\t});\n \t}\n }", "function isAdministrador(req, res, next) {\r\n\t\t\tconsole.log(req.user.id_rol);\r\n\t\t\t//1 = gerente\r\n\t\t\tif (req.user.id_rol == 1)\r\n\t\t\t return next();\r\n\t\t\tres.render('privileges');\r\n\t\t}", "function printAdminsBox() {\n localStorage.setItem(\"Page\",1);\n delContent();\n for (var i = 0; i < obj.admins.length; i++) {\n admins = obj.admins[i];\n printBox(i);\n printBlank(admins, i);\n printAvatars(admins, i);\n btnEdit(admins, i);\n printNames(admins, i);\n printIds(admins, i);\n printUserNames(admins, i);\n printEmails(admins, i);\n printState(admins, i);\n }\n delNav();\n table = false;\n paginador();\n}", "isAdmin () {\n return this.getRole() === 'admin'\n }", "function doAdmin() {\n\n inquirer.prompt([\n {\n name: \"operation\",\n type: \"list\",\n message: \"Which product function do you want to perform?\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"]\n }\n ]).then(function (admin) {\n\n switch (admin.operation) {\n\n case \"View Products for Sale\":\n dispAll();\n break;\n\n case \"View Low Inventory\":\n dispLowInv();\n break;\n\n case \"Add to Inventory\":\n addInv();\n break;\n\n case \"Add New Product\":\n addProd()\n break;\n\n }\n });\n}", "getAdminComponent(state) {\n return state.adminComponent;\n }", "function isAdmin() {\n if((sessionStorage.uName == \"admin\") && (sessionStorage.pWord == \"password123\")) {\n document.getElementById(\"gamePage\").style = \"display:contents;\";\n }\n else {\n document.getElementById(\"gamePage\").style = \"display:none;\";\n }\n}", "function ensureAdminAccess(cb) {\n\tAdmins.find({'appname':appname}, function(err, docs) {\n\t\tif (err) throw err;\n\t\tif (! docs.length) {\n\t\t\tvar thisadm = new Admins();\n\t\t\tthisadm.login = thisadm.passwd = thisadm.name = 'admin';\n\t\t\tthisadm.appname = appname;\n\n\t\t\tthisadm.save(function(err){\n\t\t\t\tif (err) {\n\tconsole.log('ERROR creating default admin for ' + appname);\n\tconsole.log(err);\n\t\t\t\t\tthrow err;\n\t\t\t\t} else {\n\t\t\t\t\tif (cb) cb();\n\t\t\t\t}\n\t\t\t});\n\t\t} else cb();\n\t});\n}", "function manageGenes() {\n var fWorkers = Math.ceil(game.resources.trimps.realMax() / 2) - game.resources.trimps.employed;\n if(getPageSetting('ManageBreedtimer')) {\n if(game.options.menu.showFullBreed.enabled != 1) toggleSetting(\"showFullBreed\");\n \n if(game.portal.Anticipation.level == 0) autoTrimpSettings.GeneticistTimer.value = '0';\n else if(game.global.challengeActive == 'Electricity' || game.global.challengeActive == 'Mapocalypse') autoTrimpSettings.GeneticistTimer.value = '3.5';\n else if(game.global.challengeActive == 'Nom' || game.global.challengeActive == 'Toxicity') {\n \n if(getPageSetting('FarmWhenNomStacks7') && game.global.gridArray[99].nomStacks >= 5 && !game.global.mapsActive) {\n //if Improbability already has 5 nomstacks, do 30 antistacks.\n autoTrimpSettings.GeneticistTimer.value = '30';\n //actually buy them here because we can't wait.\n safeBuyJob('Geneticist',1+(autoTrimpSettings.GeneticistTimer.value - getBreedTime())*2);\n }\n else\n autoTrimpSettings.GeneticistTimer.value = '10';\n }\n else autoTrimpSettings.GeneticistTimer.value = '30';\n }\n //Set Auto genetics\n if (!game.jobs.Geneticist.locked && game.resources.trimps.soldiers > 1 && game.resources.trimps.realMax()*0.003 < game.resources.trimps.soldiers && wrapper.clientHeight > 0 && autotrimp.clientHeight < 1 && boneWrapper.clientHeight < 1 && portalWrapper.clientHeight < 1 && achievementWrapper.clientHeight < 1 && statsWrapper.clientHeight < 1 && heirloomWrapper.clientHeight < 1 && achievementPopup.clientHeight < 1 && heirloomsPopup.clientHeight < 1 && tooltipDiv.clientHeight < 1) {\n\t if (GeneticistassistSetting.innerHTML == \"Disabled\") {\n\t\t toggleGeneticistassist();\n\t }\n\t if (\n\t\t game.global.challengeActive == \"Daily\" && (typeof game.global.dailyChallenge.bogged !== 'undefined')) { //typeof game.global.dailyChallenge.weakness !== 'undefined' || typeof game.global.dailyChallenge.toxic !== 'undefined'\n\t\t autoTrimpSettings.GeneticistTimer.value = game.global.antiStacks;\n\t\t toggleSetting(\"GeneticistassistTarget\", this);\n\t\t target1.defaultValue = (game.global.antiStacks < 14) ? (game.global.antiStacks + 1) : (4) ; target2.defaultValue = (game.global.antiStacks < 14) ? (game.global.antiStacks + 1.5) : (4.1) ; target3.defaultValue = (game.global.antiStacks < 14) ? (game.global.antiStacks + 2) : (4.2);\n\t\t customizeGATargets();\n\t } else if (\n\t\t game.global.challengeActive == \"Daily\" && (typeof game.global.dailyChallenge.plague !== 'undefined')) {\n\t\t autoTrimpSettings.GeneticistTimer.value = game.global.antiStacks;\n\t\t toggleSetting(\"GeneticistassistTarget\", this);\n\t\t target1.defaultValue = 2 ; target2.defaultValue = 2.1 ; target3.defaultValue = 2.2 ;\n\t\t customizeGATargets()\n\t } else {\n\t\t autoTrimpSettings.GeneticistTimer.value = '30';\n\t\t toggleSetting(\"GeneticistassistTarget\", this);\n\t\t target1.defaultValue = '30'; target2.defaultValue = '30.1'; target3.defaultValue = '30.2';\n\t\t customizeGATargets()\n\t }\n }\n var inDamageStance = game.upgrades.Dominance.done ? game.global.formation == 2 : game.global.formation == 0;\n var inScryerStance = (game.global.world >= 60 && game.global.highestLevelCleared >= 180) && game.global.formation == 4;\n var targetBreed = (game.resources.trimps.realMax()*0.003 < game.resources.trimps.soldiers) ? parseInt(getPageSetting('GeneticistTimer')) : 0.01 ;\n //if we need to hire geneticists\n //Don't hire geneticists if total breed time remaining is greater than our target breed time\n //Don't hire geneticists if we have already reached 30 anti stacks (put off further delay to next trimp group)\n if (targetBreed > getBreedTime() && !game.jobs.Geneticist.locked && targetBreed > getBreedTime(true) && ((game.global.lastBreedTime/1000 + getBreedTime(true) < autoTrimpSettings.GeneticistTimer.value) || (targetBreed > getBreedTime() && getBreedTime(true) == 0)) && game.resources.trimps.soldiers > 0 && (inDamageStance || inScryerStance) && !breedFire) {\n //insert 10% of total food limit here? or cost vs tribute?\n //if there's no free worker spots, fire a farmer\n if (fWorkers < 1 && canAffordJob('Geneticist', false)) {\n safeBuyJob('Farmer', -1);\n }\n //hire a geneticist\n safeBuyJob('Geneticist');\n }\n //if we need to speed up our breeding\n //if we have potency upgrades available, buy them. If geneticists are unlocked, or we aren't managing the breed timer, just buy them\n if ((targetBreed < getBreedTime() || !game.jobs.Geneticist.locked || !getPageSetting('ManageBreedtimer') || game.global.challengeActive == 'Watch') && game.upgrades.Potency.allowed > game.upgrades.Potency.done && canAffordTwoLevel('Potency') && getPageSetting('BuyUpgrades')) {\n buyUpgrade('Potency');\n }\n //otherwise, if we have some geneticists, start firing them\n else if (!game.jobs.Geneticist.locked && (targetBreed*1.02 < getBreedTime() || targetBreed*1.02 < getBreedTime(true) || (game.global.challengeActive == \"Daily\" && game.global.antiStacks+1 > getPageSetting('GeneticistTimer'))) && game.jobs.Geneticist.owned > 10 && getBreedTime(true) > 2) { //&& getBreedTime(true) > 2\n safeBuyJob('Geneticist', -50);\n //debug('fired a geneticist');\n \n }\n //if our time remaining to full trimps is still too high, fire some jobs to get-er-done\n //needs option to toggle? advanced options?\n else if ((targetBreed < getBreedTime(true) || (game.resources.trimps.soldiers == 0 && getBreedTime(true) > 6)) && breedFire == false && getPageSetting('BreedFire') && game.global.world > 10) {\n breedFire = true;\n }\n //reset breedFire once we have less than 2 seconds remaining\n if(getBreedTime(true) < 2) breedFire = false;\n //force deth if max antiStacks is available\n if (!game.jobs.Geneticist.locked && game.resources.trimps.realMax()*0.003 < game.resources.trimps.soldiers && (game.global.antiStacks < 30 && (game.global.challengeActive !== \"Daily\" || (typeof game.global.dailyChallenge.bogged == 'undefined' && typeof game.global.dailyChallenge.plague == 'undefined'))) && getBreedTime(true) == 0 && game.resources.trimps.soldiers > 0 && (!game.global.preMapsActive && ((game.global.mapsActive && getCurrentMapObject().location != \"Void\") || (game.global.lastClearedMapCell < 10 || !game.global.mapsActive)))) {\n mapsClicked(true); mapsClicked(true);\n }\n\n}", "_createGrids() {\n this.settingsGridOption = this.artifactoryGridFactory.getGridInstance(this.$scope)\n .setColumns(this._getSettingsColumns())\n //.setMultiSelect(this.)\n .setDraggable(this.reorderLdap.bind(this))\n .setButtons(this._getSettingsActions());\n //.setBatchActions(this._getSettingsBatchActions());\n\n this.groupsGridOption = this.artifactoryGridFactory.getGridInstance(this.$scope)\n .setColumns(this._getGroupsColumns())\n //.setMultiSelect()\n .setRowTemplate('default')\n .setButtons(this._getGroupsActions());\n //.setBatchActions(this._getGroupsBatchActions());\n }", "function handleAdmin(req, commands, res) \n{\t\n console.log('=============commands=============');\n console.log(commands);\n\thandleCmds(commands);\n\t\n\tisConfigured = true;\n\t\n\tres.status(200).json({});\n}", "function solo_admin()\r\n{\r\n\t'domready', Sexy = new SexyAlertBox();\r\n\tSexy.error('<h1>Error</h1><p>Esta operacion solo puede ser realizada por el administrador de la aplicación.</p>')\r\n}", "function isAdmin() {\n\treturn getMe() === getAdmin();\n}", "function isAdmin() {\n return service.user && service.admin && true;\n }", "checkStateAdmin(){\n\t\tif (this.$state.current.name.includes(\"helperIndicators\") || this.$state.current.name.includes(\"clinics\")) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "async _initializeAdmins() {\n logger.info('Initializing administrators');\n const orgs = this.networkUtil.getOrganizations();\n for (const org of orgs) {\n const adminName = `admin.${org}`;\n\n // Check if the caliper config file has this identity supplied\n if (!this.networkUtil.getClients().has(adminName)) {\n logger.info(`No ${adminName} found in caliper configuration file - unable to perform admin options`);\n continue;\n }\n\n // Since admin exists, conditionally use it\n logger.info(`Administrator ${adminName} found in caliper configuration file - checking for ability to use the identity`);\n const usesOrgWallets = this.networkUtil.usesOrganizationWallets();\n if (usesOrgWallets) {\n // If a file wallet is provided, it is expected that *all* required identities are provided\n // Admin is a super-user identity, and is consequently optional\n const orgWallet = this.orgWallets.get(org);\n const hasAdmin = await orgWallet.get(adminName);\n if (!hasAdmin) {\n logger.info(`No ${adminName} found in wallet - unable to perform admin options using client specified in caliper configuration file`);\n }\n } else {\n // Build up the admin identity based on caliper client items and add to the in-memory wallet\n const cryptoContent = this.networkUtil.getAdminCryptoContentOfOrganization(org);\n if (!cryptoContent) {\n logger.info(`No ${adminName} cryptoContent found in caliper configuration file - unable to perform admin options`);\n continue;\n } else {\n await this._addToOrgWallet(org, cryptoContent.signedCertPEM, cryptoContent.privateKeyPEM, adminName);\n }\n }\n logger.info(`${org}'s admin's materials are successfully loaded`);\n }\n logger.info('Completed initializing administrators');\n }", "function checkAdminStatusPosition(){\n tab = \"tab_3\";\n section = \"{7905de18-7be8-4cd5-9eb4-dba71e481376}_section_6\";\n Xrm.Page.ui.tabs.get(tab).sections.get(section).setVisible(false);\n checkUserRole(\"System Administrator\");\n\n}", "function glo() // gregsList Object \n{\n this.user =\n\t{\n\t name : null,\n\t password : null,\n\t token : null,\n\t sessionId : null\n\t};\n this.goals = \n\t{\n\t parent: this,\n\t contents: [],\n\t filler: fillGoals,\n\t type: \"goal\",\n\t get: \"getGoals\",\n\t display: displayTable,\n\t table: $(\"#tableOfGoals\")[0],\n\t removeFunction: remover,\n\t editFunction: editGoal,\n\t updater: \"updateGoal\",\n\t destroyer: \"removeGoal\",\n\t displayKeys: [\"value\"]\n\t};\n this.industries = \n\t{\n\t parent: this,\n\t contents: [],\n\t filler: fillIndustries,\n\t type: \"industry\",\n\t get: \"getIndustries\",\n\t display: displayTable,\n\t table: $(\"#tableOfIndustries\")[0],\n\t removeFunction: remover,\n\t editFunction: editIndustry,\n\t updater: \"updateIndustry\",\n\t destroyer: \"removeIndustry\",\n\t displayKeys: [\"name\"]\n\t};\n this.postings = \n\t{\n\t parent: this,\n\t contents: [],\t\t// array of values to be filled from data store\n\t filler: fillPostings,\t// javascript function to fill contents from data store\n\t type: \"posting\",\n\t get: \"getPostings\",\t\t// php function to call\n\t display: displayTable,\t// javascript function to display\n\t table: $(\"#tableOfPostings\")[0],\t// a reference to the div container. set in setupPostings()\n\t add: null,\t\t\t// php function to add posting\n\t removeFunction: remover,\t// javascript function to remove\n\t editFunction: editPosting,\n\t updater: \"updatePosting\",\t\t// php function to update\n\t destroyer: \"removePosting\", // php function to remove\n\t displayKeys: [\"sid\",\"title\",\"url\",\"location\",\"company\",\"source\"] // values to display in table\n\t};\n this.companies =\n\t{\n\t parent: this,\n\t contents: [],\n\t filler: fillCompanies,\n\t type: \"company\",\n\t get: \"getCompanies\",\n\t display: displayTable,\n\t table: $(\"#tableOfCompanies\")[0],\n\t add: null,\n\t removeFunction: remover,\n\t destroyer: \"removeCompany\", // php function to remove\n\t displayKeys: [\"name\"] // values to display in table\n\t};\n this.locations =\n\t{\n\t parent: this,\n\t contents: [],\n\t filler: fillLocations,\n\t type: \"location\",\n\t get: \"getLocations\",\n\t display: displayTable,\n\t table: $(\"#tableOfLocations\")[0],\n\t add: null,\n\t removeFunction: remover,\n\t destroyer: \"removeLocation\", // php function to remove\n\t displayKeys: [\"name\"] // values to display in table\n\t};\n this.contacts =\n\t{\n\t parent: this,\n\t contents: [],\n\t filler: fillContacts,\n\t type: \"contact\",\n\t get: \"getContacts\",\n\t display: displayTable,\n\t table: $(\"#tableOfContacts\")[0],\n\t add: null,\n\t editFunction: editContact,\n\t updater: \"updateContact\",\t\t// php function to update\n\t removeFunction: remover,\n\t destroyer: \"removeContact\", // php function to remove\n\t displayKeys: [\"fname\",\"lname\",\"email\",\"phone\",\n\t\t\t \"facebook\",\"linkedin\",\"github\"] // values to display in table\n\n\t};\n this.schedules =\n\t{\n\t parent: this,\n\t contents: [],\n\t filler: fillSchedules,\n\t removeFunction: remover,\n\t type: \"schedule\",\n\t get: \"getSchedules\",\n\t display: displayTable,//displaySchedules,\n\t destroyer: \"removeSchedule\", // php function to remove\n\t table: $(\"#tableOfEvents\")[0],\n\t displayKeys: [\"name\",\"description\",\"contact\",\"start\",\"end\"],\n\t add: null\n\t};\n this.blog =\n\t{\n\t parent: this,\n\t contents: [],\n\t filler: fillBlog,\n\t removeFunction: remover,\n\t type: \"blog\",\n\t get: \"getBlog\",\n\t display: displayTable,//displaySchedules,\n\t destroyer: \"removeBlog\", // php function to remove\n\t table: $(\"#tableOfBlogs\")[0],\n\t displayKeys: [\"text\"],\n\t add: null\n\t};\n this.login();\n}", "function SalesUpGratis(){\n tb_show('SalesUp! Gratis', 'salesupgratis.dbsp?keepThis=false&TB_iframe=true&height=280&width=750', '');\n }", "function getListGarnish() {\n GarnishService.getList($rootScope.userLogin.token).success(function (res) {\n $scope.list_garnish = res;\n })\n }", "function loadAdmin() {\n\t\n\tvar main = document.getElementById('content');\n\t\n\t/* top section */\n\tvar top = document.createElement(\"div\");\n\ttop.setAttribute(\"class\",\"top\");\n\t\n\tvar h1 = document.createElement(\"h1\");\n\th1.innerHTML = \"Computer Forge @ CU\";\n\t\n\tvar logolink = document.createElement(\"a\");\n\tlogolink.setAttribute(\"href\", \"http://128.138.202.115/\");\n\t\n\tvar logo = document.createElement(\"img\");\n\tlogo.src = \"cuboulder.png\";\n\t\n\tlogolink.appendChild(logo);\n\t\n\ttop.appendChild(logolink);\n\ttop.appendChild(h1);\n\t\n\t/* menu section */\n\tvar menu = document.createElement(\"div\");\n\tmenu.setAttribute(\"class\", \"menu\");\n\t\n\tvar projbtn = document.createElement(\"a\");\n\tprojbtn.setAttribute(\"class\", \"menubtn\");\n\tprojbtn.setAttribute(\"onclick\", \"displayContent('updateadmin');\");\n\tprojbtn.innerHTML = \"Admin & News\";\n\t\n\tvar li0 = document.createElement(\"li\");\n\tli0.appendChild(projbtn);\n\t\n\tvar aboutbtn = document.createElement(\"a\");\n\taboutbtn.setAttribute(\"class\", \"menubtn\");\n\taboutbtn.setAttribute(\"onclick\", \"displayContent('updatemembers');\");\n\taboutbtn.innerHTML = \"Members\";\n\t\n\tvar li1 = document.createElement(\"li\");\n\tli1.appendChild(aboutbtn);\n\t\n\tvar memberbtn = document.createElement(\"a\");\n\tmemberbtn.setAttribute(\"class\", \"menubtn\");\n\tmemberbtn.setAttribute(\"onclick\", \"displayContent('updateprojects');\");\n\tmemberbtn.innerHTML = \"Projects\";\n\t\n\tvar li2 = document.createElement(\"li\");\n\tli2.appendChild(memberbtn);\n\t\n\tvar logoutbtn = document.createElement(\"a\");\n\tlogoutbtn.setAttribute(\"class\", \"menubtn logoutbtn\");\n\tlogoutbtn.setAttribute(\"onclick\", \"logOut();\");\n\tlogoutbtn.innerHTML = \"Log Out\";\n\t\n\tvar li3 = document.createElement(\"li\");\n\tli3.appendChild(logoutbtn);\n\t\n\tvar ulmenu = document.createElement(\"ul\");\n\tulmenu.setAttribute(\"class\", \"menulist\");\n\t\n\tulmenu.appendChild(li0);\n\tulmenu.appendChild(li1);\n\tulmenu.appendChild(li2);\n\tulmenu.appendChild(li3);\n\t\n\tmenu.appendChild(ulmenu);\n\t\n\t/* view error div */\n\tvar viewerror = document.createElement(\"div\");\n\tviewerror.setAttribute(\"id\", \"viewerror\");\n\tviewerror.innerHTML = \"Your Screen Is Too Narrow To View The Site\";\n\t\n\tdocument.getElementsByTagName(\"body\")[0].appendChild(viewerror);\n\t\n\t/* div for different pages */\n\t\n\tvar pagedisplay = document.createElement(\"div\");\n\tpagedisplay.setAttribute(\"class\", \"pagedisplay\");\n\tpagedisplay.setAttribute(\"id\", \"pagedisplay\");\n\t\n\t/* default landing is members page */\n\tpagedisplay.appendChild(getMembers());\n\t\n\t/* append everything to main */\n\tmain.appendChild(top);\n\tmain.appendChild(menu);\n\tmain.appendChild(pagedisplay);\n}", "function EnableMegamissions()\n{\n GoPage('missions');\n IncrementTaskIf(DocTest(\"<i>MegaMissions Active!</i>\"));\n FormSubmit('megamis', 'Enabling megamissions');\n}", "function inserirGrupo() {\n\n if ($scope.novoGrupo.Id > 0) {\n atualizarGrupo();\n } else {\n inserirGrupoModel();\n }\n\n }", "checkAdminPageAccess() {\n if (this.state.userLogged == true) {\n if (this.state.userRole == 0) {\n return true;\n }\n }\n return false;\n }", "function mostrarRegistrarseComoColaborador(){\n mostrarComo('colaborador')\n}", "getAllAdminCryptos() {\n return Api.get(\"/admin\");\n }", "function gaborController() {\n\n\n //showes a specific image by it's properties.\n\n this.get = function (req, res, next) {\n var name = generateNameFromParams(req.query);\n\n Image.getAll()\n .then(function (images) {\n\n var img = images[name];\n if (img) {\n\n res.locals.state = {\n current: img,\n currentName: name,\n images: getSorted(images)\n };\n\n next();\n\n }\n });\n\n };\n\n //generating an image using the given params, in case it doesn't exist yet.\n this.generate = function (req, res, next) {\n\n var obj = req.query, name = generateNameFromParams(req.query);\n\n Image.get(name)\n .then(function (img) {\n if (img) {\n next();\n return Promise.reject(new Error('image already exists'));\n }\n })\n .then(function () {\n return gb(\n parseInt(obj.orient),\n parseInt(obj.size),\n obj.env,\n parseInt(obj.std),\n parseFloat(obj.freq),\n parseFloat(obj.phase),\n obj.color0.split(',').map(function (val) {\n return parseInt(val)\n }),\n obj.color1.split(',').map(function (val) {\n return parseInt(val)\n }),\n obj.color2.split(',').map(function (val) {\n return parseInt(val)\n }),\n name);\n\n })\n .then(function () {\n obj = Object.assign({url: '/images/' + name + '.png'}, obj);\n delete obj['username'];\n delete obj['password'];\n return Image.add(name, obj);\n })\n .then(function () {\n next();\n });\n\n\n };\n\n //a helper function returning uuid based on the given properties.\n\n function generateNameFromParams(obj) {\n\n var value, values = [];\n\n //sorting the keys so the id would not be affected by change in the properties order.\n var keys = Object.keys(obj).sort();\n\n keys.forEach(function (key) {\n\n //ignore keys that are not part of the image properties\n if (key != 'username' && key != 'password' && key != 'url') {\n value = obj[key];\n values.push(value);\n }\n });\n\n return values.join('-');\n }\n\n //prepares the image list to be presented in the view in a sorted manner.\n function getSorted(images) {\n\n for (var key in images) {\n images[key].name = key;\n }\n\n var values = Object.values(images)\n .sort(function (a, b) {\n if (a.id > b.id) {\n return -1;\n }\n if (a.id < b.id) {\n return 1;\n }\n return 0;\n });\n\n return values;\n }\n\n\n}", "function add_registered_user_access () {\r\n // fetch the admin group ID\r\n return knex.first('ID').from('Groups').where({name: 'Registered Users'})\r\n .then(function (group) {\r\n // add the user endpoint to the group\r\n return knex('GroupEndpoints').insert({ GroupID: group.ID, EndpointID: 2 })\r\n })\r\n }", "spaceDashboard (baseUrl,username,spacename){\n browser.get(baseUrl + username + \"/\" + spacename);\n }", "function showAdminDashboard() {\n $.dashboard.setWidth('95%');\n $.dashboard.setHeight('93%');\n $.dashboard.setTop('5%');\n $.dashboard.setBottom('5%');\n $.dashboard.setRight('3%');\n $.dashboard.setLeft(20);\n $.dashboard.setOpacity('1.0');\n $.dashboard_container.setHeight(Ti.UI.FILL);\n $.dashboard_container.setWidth(Ti.UI.FILL);\n handlePageSelection({\n page : 'configurations'\n });\n}", "async init() {\n if (!this.client.gateways.guilds.schema.has(\"musicVolume\")) {\n this.client.gateways.guilds.schema.add(\"musicVolume\", { type: \"integer\", default: 90, configurable: false });\n }\n if (!this.client.gateways.guilds.schema.permissions.has(\"dj\")) {\n this.client.gateways.guilds.schema.permissions.add(\"dj\", { type: \"user\", array: true });\n }\n }", "function isAdmin (req, res, next) {\n admin(database, req, res, next);\n}", "function getAdminOptions( solution, path, filename, target, isFolder, furl, properties) {\n\n\tvar permUrl = \"PropertiesEditor?path=/\" + gRepositoryName\n + ( !StringUtils.isEmpty( solution ) ? \"/\" + solution : \"\" ) \n + ( !StringUtils.isEmpty( path ) ? \"/\" + path : \"\" ) \n + ( !StringUtils.isEmpty( filename ) ? \"/\" + filename : \"\" ) ;\n\tvar actions = \"<br/><br/><a href=\\\"\"+permUrl+\"\\\" >Permissions</a>\"\n\treturn actions;\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}", "function viewRole() {\n \n connection.query(\" SELECT * FROM role \", function (error, result) \n {\n if (error) throw error;\n console.table(result);\n mainMenu()\n\n });\n\n }", "function adminForm(){\n $('#adminForm').modal('show');\n _roles_list();\n}", "function showGoogle() {\n $(GOOGLE_LOGOUT).show();\n $(GOOGLE_AUTHORIZE).hide();\n $(GOOGLE_LOAD).show();\n $(GOOGLE_SAVE).show();\n }", "renderAdmin(admin){\n const {technical_email, helpdesk_email, priority, escalation_level} = admin;\n return (\n <div key={'admin-history-' + admin.ahid}>\n <Grid container spacing={24}>\n <Grid item xs={12} md={6}>\n <Typography type=\"title\" gutterBottom>\n {this.getTechnicalName(technical_email)}\n <br/>\n {technical_email}\n </Typography>\n <Typography type=\"caption\" gutterBottom>\n Assigned To\n </Typography>\n </Grid>\n <Grid item xs={12} md={6}>\n <Typography type=\"title\" gutterBottom>\n {helpdesk_email}\n </Typography>\n <Typography type=\"caption\" gutterBottom>\n Helpdesk Assigner\n </Typography>\n </Grid>\n\n <Grid item xs={12} md={6}>\n <Typography type=\"title\" gutterBottom>\n {priority}\n </Typography>\n <Typography type=\"caption\" gutterBottom>\n Priority\n </Typography>\n </Grid>\n\n <Grid item xs={12} md={6}>\n <Typography type=\"title\" gutterBottom>\n {escalation_level}\n </Typography>\n <Typography type=\"caption\" gutterBottom>\n Escalation Level\n </Typography>\n </Grid>\n </Grid>\n <Divider className={this.props.classes.divider}/>\n </div>\n )\n }", "function updateGroupPage() {\n showMessage(\"Users have been added to the group\");\n $rootScope.$emit(\"InitGroup\", {});\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 }", "function showConfig() {\r\n GM_config.open();\r\n}", "function get(req, res) {\n res.render(\"admin\", {\n rider: req.user\n });\n}", "async function isAdmin() {\n let isAdmin = store.getters.getLoggedInAccount.is_admin;\n\n if (isAdmin === undefined) {\n await store.dispatch(\"getAccountInfo\");\n isAdmin = store.getters.getLoggedInAccount.is_admin;\n }\n\n if (!isAdmin) {\n this.$router.push(\"/frontpage\");\n return;\n }\n}", "function openAdmin(){\n location.href = \"admin.html\";\n}", "async function opretKnappenVis() {\n let bruger = await get('../profil/profilData')\n if (bruger.admin == true)\n {\n let tabProfil = document.getElementById('liProfil')\n let htmlkodeTabOpret = '<li><a href=\"../opret.html\" id=\"Opret\"><i class=\"far fa-address-card\"></i> Opret bruger</a></li>'\n tabProfil.insertAdjacentHTML('afterend', htmlkodeTabOpret)\n }\n}", "orderAccess() {\n loginPage.open();\n loginPage.username.setValue('[email protected]');\n loginPage.password.setValue('pepito');\n loginPage.submit();\n }", "function updateAdmins() {\n // Get all players\n var players = room.getPlayerList();\n if ( players.length < 2 ) return; // No players left, do nothing.\n if ( players.find((player) => player.admin) > 1 ) return; // There's an admin left so do nothing.\n room.setPlayerAdmin(players[1].id, true); // Give admin to the first non admin player in the list\n}", "grantPrivilegesAction() {\n axios.post('http://'+hostname+':8080/privileges/create', {\n account: this.state.priv_id,\n document: this.state.id,\n read: this.state.priv_read,\n write: this.state.priv_write,\n delete: this.state.priv_delete\n })\n .then(function(res) {\n alert(\"Sucessfully granted privileges!\");\n }.bind(this))\n .catch(function(response) {\n alert(\"Something went wrong while creating privliges.\");\n }.bind(this));\n }", "function adminUpdate(data) {\n\t\t\t\n\t\t\t\n\t\t}", "_isAdmin() {\n return this.user && this.user.role == \"admin\";\n }", "function loadAdmin() {\n\tvar city = getSelectedCity();\n\tloadNews(city);\n}", "function Main() {\n configApp(roleSelection);\n}", "function antonio() {\n // Set visibility, disable controls\n $('#artGamesAvailable').show();\n var btnGetUsersWanting = $('#btnGetUsersWanting');\n btnGetUsersWanting.prop('disabled', true);\n \n // Global variables\n collectionsAvailable = {};\n readyStatusMessage = btnGetUsersWanting.html();\n \n // Display game name\n var gameID = $('#txtGameID').val();\n var gameUrl = 'http://bgg-api.herokuapp.com/api/v1/thing?id=' + gameID;\n $.getJSON(gameUrl, getGameName);\n \n // AJAX for determining which users want the input game\n setStatusMessage('Searching BGG for users that want your game…');\n var usersWantUrl = 'http://bgg-users-want.azurewebsites.net/api/game/' + gameID;\n $.getJSON(usersWantUrl, getUsersWanting);\n}", "function checkIfAdmin() {\n const profile = JSON.parse(localStorage.getItem(\"profile\"));\n\n if (profile == \"User\") {\n window.location.href = `${basepathClient}home.html`;\n }\n}" ]
[ "0.6848675", "0.6670162", "0.6404349", "0.6396092", "0.6357295", "0.6251403", "0.6251403", "0.623631", "0.6082457", "0.6002477", "0.6002477", "0.5930422", "0.59232694", "0.59164846", "0.58865255", "0.5866203", "0.5841901", "0.5838665", "0.5818297", "0.5786009", "0.576557", "0.5736303", "0.57273096", "0.57113653", "0.5699776", "0.5678976", "0.56760746", "0.56662416", "0.56632334", "0.5619468", "0.56144977", "0.5569653", "0.5548753", "0.5541376", "0.5541282", "0.5540346", "0.5531868", "0.55291617", "0.5516672", "0.5504924", "0.5504921", "0.5492483", "0.5483128", "0.5473458", "0.54660237", "0.54601854", "0.54520303", "0.54488015", "0.54441786", "0.5429234", "0.5421439", "0.541887", "0.5417625", "0.54100025", "0.54052675", "0.54025173", "0.5394632", "0.539462", "0.5393463", "0.53869146", "0.53811324", "0.5377422", "0.537731", "0.5372549", "0.5368555", "0.5357176", "0.53517777", "0.53415406", "0.5337632", "0.53190404", "0.53156626", "0.5309811", "0.5306882", "0.53033227", "0.52963316", "0.5273776", "0.527214", "0.5270337", "0.5265391", "0.5260975", "0.52551824", "0.525212", "0.5240367", "0.5240299", "0.5239947", "0.5239804", "0.5237093", "0.52364475", "0.5232669", "0.523209", "0.52268475", "0.52248", "0.5218837", "0.5208571", "0.5193889", "0.51923573", "0.5179426", "0.51669663", "0.51640767", "0.51640576", "0.5162844" ]
0.0
-1
=========================== GESTION FILM ===========================
function listerFilms() { var action = 'action=select'; //console.log(action); $.ajax({ method: "POST", url:"../../controller/filmController.php", data: action }).done((jsonString)=>{ //Va creer le template $.ajax({ method: "POST", url:"../admin/template/table-films.php", data:{ data: jsonString } //Recoit le template }).done((template)=>{ $("#contenu").html(template); }) }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadGCI() {\n return fs.readFileSync('gci.txt','utf8')\n }", "function gd(){}", "function gfg() {}", "function GCodeImporter() {}", "toGist() {\n let files = {}\n const pages = this.pages.filter(p => p.content) // gist does not accept empty files, TODO: consider giving feedback to user\n const digits = Math.ceil(Math.log10(pages.length))\n const getPageNumber = (i) => {\n return leftPad(i, digits, 0)\n }\n pages.forEach((page, i) => {\n const filename = `${getPageNumber(i+1)}. ${page.name}.md`\n const key = page.gistFilename || filename\n files[key] = page.toGistFile(filename)\n })\n this.deletedPages.filter(page => page.gistFilename).forEach(page => {\n files[page.gistFilename] = null\n })\n return {\n description: this.name || 'Untitled Notebook',\n public: this.public,\n files\n }\n }", "function IndicadorGradoAcademico () {}", "function _G() {}", "function _G() {}", "function verifGg() {\r\n verifColonne();\r\n verifLigne();\r\n verifDiagonaleSlach();\r\n verifDiagonaleBackSlash();\r\n basculeJoueur();\r\n}", "generateFile (entry) {\n this.reColorSVG('#CCCCCC');\n this.imageTemplate(this.encodedSVG());\n }", "function geraGraficos(){\n\tif(!dados)\n\t\treturn;\n\n\t$(\"#logado_main center\" ).remove();\n\tif(!dados.length)\n\t{\n\t\t//alert(\"Não há nenhum teste registrado!\");\n\t\treturn;\n\t}\n\n\tvar congruentes = 0;\n\tvar incongruentes = 0;\n\tvar graficoGlobalC = [];\n\tvar graficoGlobalI = [];\n\tvar grupos = [];\n\n\tfor(var i=0; i < dados.length; i++)\n\t{\n\t\tif(grupos.indexOf(dados[i].grupo) < 0 )\n\t\t{\n\t\t\tgrupos.push(dados[i].grupo);\n\t\t}\n\t}\n\nfor(var m=0; m<grupos.length; m++)\n{\n\tfor(var j =0; j <dados.length; j++){\n\t\tif(dados[j].grupo == grupos[m])\n\t\t{\n congruentes = 0;\n incongruentes = 0;\n\t\t\tfor( var i = 0; i < dados[0].ordemBateria.length; i++){\n\t\t\t\tif(dados[0].ordemBateria[i] == \"C\"){\n\t\t\t\t\tgraficoGlobalC.push(dados[j].stringResposta[congruentes+incongruentes]);\n\t\t\t\t\tcongruentes++;\n\t\t\t\t}\n\t\t\t\tif(dados[0].ordemBateria[i] == \"I\"){\n\t\t\t\t\tgraficoGlobalI.push(dados[j].stringResposta[congruentes+incongruentes]);\n\t\t\t\t\tincongruentes++;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif(congruentes)\n\t plotaGraficoMedia(graficoGlobalC, congruentes,\"Media Congruente do grupo \"+(grupos[m]), \"graficoCMedia\");\n\tif(incongruentes)\n\t\tplotaGraficoMedia(graficoGlobalI, incongruentes,\"Media Incongruente do grupo \"+(grupos[m]), \"graficoIMedia\");\n\n\t\tcongruentes = 0;\n\t\tincongruentes = 0;\n\t\tgraficoGlobalC=[];\n\t\tgraficoGlobalI=[];\n}\n\n\n\n\n\tfor( var i = 0; i< dados[0].ordemBateria.length; i++){\n\t\tif(dados[0].ordemBateria[i] == \"C\"){\n\t\t\tplotaGraficoX(congruentes+incongruentes,\"Congruente \"+(congruentes+1), \"graficoC\");\n\t\t\tcongruentes++;\n\t\t}\n\n\t\tif(dados[0].ordemBateria[i] == \"I\"){\n\t\t\tplotaGraficoX(congruentes+incongruentes,\"Incongruente \"+(incongruentes+1), \"graficoI\");\n\t\t\tincongruentes++;\n\t\t}\n\t}\n\n}", "function progetti(key) {\n // Aggiorno il path\n path_progetto = path_mese + key + '/';\n //// Inizio il progetto\n codice += \"<li class='progetto'><ul class=\\\"files\\\">\";\n /// Inserisco il nome del progetto\n codice += \"<span onclick=\\\"animazione(this)\\\">\" + key.split('_')[1] + \"</span>\";\n // Itero dentro i vari file\n data[mese_ricordo][key].forEach(file);\n //// Finisco il progetto\n codice += \"</ul></li>\"\n }", "function ver() { //funcion que recorrera las imagenes y las mostrara\n let contenido=\"\";\n\n for(let i=0;i<fileVal.length;i++){\n let imgtemporal=fileVal[i].name;\n insetar(imgtemporal);\n \n }\n\n}", "function createGJFile() {\n return DocsList.createFile(\n (cleanCamel(ss.getName()) || 'unsaved') + '-' + Date.now() + '.geojson',\n Utilities.jsonStringify({\n type: 'FeatureCollection',\n features: getRowsData(sheet, activeRange, 1)\n })\n );\n}", "function ggr2Settings()\n{ \n this.save = saveSettingToDisk;\n this.load = loadSettingFromDisk;\n this.car_model = '';\n this.car_color = '';\n}", "function afterFireProcessing() {\r\n var praefix = Fire.id;\r\n // save the form of the fire in ascii format, txt extension\r\n // save a file for each fire\r\n Fire.gridToFile('spread', 'output/fire/spread' + praefix + '.txt');\r\n // Fire.gridToFile('basalarea', 'output/fire/basalarea' + praefix + '.txt');\r\n // Fire.gridToFile('crownkill', 'output/fire/ck' + praefix + '.txt');\r\n // Fire.grid('KBDI').save('output/fire/kbdi' + praefix + '.txt');\r\n Fire.grid('fuel').save('output/fire/fuel' + praefix + '.txt');\r\n Fire.grid('combustibleFuel').save('output/fire/combustibleFuel' + praefix + '.txt');\r\n Fire.grid('nFire').save('output/fire/nfire.txt')\r\n\r\n}", "function CreateGist(g) {\n var nextGist = {};\n\n nextGist.id = g.id;\n nextGist.gisthtml = g.html_url;\n\n if (g.description) {\n nextGist.description = g.description;\n } else {\n nextGist.description = 'No Description Provided';\n }\n\n if (g.hasOwnProperty('owner')) {\n nextGist.username = g.owner.login;\n nextGist.userhtml = g.owner.html_url;\n nextGist.useravtimg = g.owner.avatar_url;\n } else {\n nextGist.username = 'anonymous';\n nextGist.userhtml = null;\n nextGist.useravtimg = 'avatar.png';\n }\n\n //get languages and other file properties\n nextGist.languages = [];\n for (var f in g.files) {\n var lang = g.files[f].language;\n if (!lang) {\n lang = 'None';\n }\n if (nextGist.languages.indexOf(lang) == -1) {\n nextGist.languages.push(lang);\n }\n }\n\n return nextGist;\n}", "function figureBedGen() {\n hexo.extend.filter.register(\"after_generate\", function () {\n log.info(\"---- START GENERATING PICTURE FILES ----\");\n try {\n var arr = [];\n const LinkFilePath = figureBedLinkFilePath;\n const output = targetPhotoListDir;\n (function toJson(path) {\n let linklistfile = fs.readFileSync(path);\n var cache = linklistfile.toString().split('\\n');\n if (!cache) {\n log.info(\"LinkList file is empty!\");\n return;\n }\n var content = JSON.stringify(cache, null, \"\\t\");\n fs.writeFile(output, content);\n })(LinkFilePath);\n } catch (err) {\n log.info(err);\n }\n var photojslibPath = pathFn.join(__dirname, \"lib/figureBed.js\");\n var photoJsContent = fs.readFileSync(photojslibPath);\n fs.writeFile(photoPubPath, photoJsContent);\n log.info(\"---- END GENERATING PICTURE FILES ----\");\n });\n\n}", "_writingGulp() {\n this.fs.copy(this.templatePath('Gulpfile.js'), this.destinationPath('Gulpfile.js'));\n this.fs.copy(\n this.templatePath('felab_gulp_template.js'),\n this.destinationPath('felab/gulp/template.js')\n );\n }", "function FilePath() {\n\n}", "function makePathG(fileName) {\n return [new Graphic(`path/${fileName}`, [\"floor\"], \".png\", 0.5, 1, 0, [-128, -128])]\n }", "async function fake_main() {\n\n const configGdt = __dirname + '/import-ghd.cfg'\n console.log('\\n*******************')\n if(!fs.existsSync(configGdt)) {\n console.log(`Konfigurationsdatei ${configGdt} nicht gefunden.`)\n process.exit(1)\n }\n console.log(`Verwende Konfigurationsdatei ${configGdt}.`)\n\n const configRecs = await csv.fromFile(configGdt)\n let configNum = 0\n for (configRec of configRecs) {\n configNum++\n console.log(`Verarbeite Konfigurationseintrag ${configNum} für Datei ${configRec.file_name}.`)\n\n if (!configRec.handle.trim()) {\n console.log(` Verarbeitung ist deaktiviert. Datensatz wird übersprungen.`)\n continue\n }\n\n if(!fs.existsSync(configRec.file_name) || !configRec.file_name.trim()) {\n console.log(`Datendatei ${configRec.file_name} nicht gefunden oder leer.`)\n continue\n }\n\n console.log(`Lese ${configRec.file_name}.`)\n\n configRec.va_ra = configRec.va_ra.toUpperCase()\n if(configRec.va_ra !== 'VA' && configRec.va_ra !== 'RA') {\n console.log(`Fehlerhafte va_ra Angabe: ${configRec.va_ra}.`)\n continue\n }\n\n\n let fileType = configRec.file_name.split('.').pop().toUpperCase()\n console.log(`Verwende Dateityp ${fileType}.`)\n if (fileType == 'XML') {\n const xmlContent = fs.readFileSync(configRec.file_name).toString()\n const ghdObj = await xmlParser.parseStringPromise(xmlContent)\n await importXml(configRec, ghdObj)\n }\n else if (fileType == 'TXT') {\n const txtContent = fs.readFileSync(configRec.file_name, { encoding: 'latin1' }).toString()\n await importTxt(configRec, txtContent)\n } else {\n console.log(`Unbekannter Dateityp: ${fileType}`)\n }\n }\n}", "export(filename) {\n const entities = Gltf2Exporter.__entityRepository._getEntities();\n const json = {\n \"asset\": {\n \"version\": \"2.0\",\n \"generator\": `Rhodonite (${_VERSION.version})`\n }\n };\n const fileName = filename ? filename : 'Rhodonite_' + (new Date()).getTime();\n json.buffers = [{\n 'uri': fileName + '.bin'\n }];\n json.bufferViews = [];\n json.accessors = [];\n json.materials = [{\n \"pbrMetallicRoughness\": {\n \"baseColorFactor\": [\n 1.0,\n 1.0,\n 1.0,\n 1.0\n ]\n }\n }];\n this.countMeshes(json, entities);\n this.createNodes(json, entities);\n this.createMeshBinaryMetaData(json, entities);\n this.createMeshes(json, entities);\n this.createMaterials(json, entities);\n const arraybuffer = this.createWriteBinary(json, entities);\n this.download(json, fileName, arraybuffer);\n }", "function atualizaTodosGraficos() {\n\tvar diasMonitorados = diasMonitoradosPaciente();\n\tatualizaComBoxGrafico(diasMonitorados);\n\tvar diaAtual = dadosDiaAtual(diasMonitorados);\n\n\tgraficoPressaoArterial(diaAtual.dadosHoras);\n\tgraficoSaturacaoOxigenio(diaAtual.dadosHoras);\n\tgraficoFrequenciaCardiaca(diaAtual.dadosHoras);\n\tgraficoTemperaturaCorporea(diaAtual.dadosHoras);\n\tgraficoFrequenciaRespiratoria(diaAtual.dadosHoras);\n}", "function afficherGraphe() {\n\t\n\t\n\t\t// Création du graphe\n\t\tvar chart = new AmCharts.AmSerialChart();\n\t\tchart.dataProvider = chartData;\n\t\tchart.categoryField = \"country\";\n\t\tvar graph = new AmCharts.AmGraph();\n\t\tgraph.valueField = \"visits\";\n\t\tgraph.type = \"column\";\n\t\tchart.addGraph(graph);\n\t\tchart.write('statistiques');\n\n\n}", "function convertDiagrammGoupe() {\r\n var groups = []\r\n for (var idx = 0 ; idx < FMSName.length; idx++) {\r\n groups.push({\r\n id: FMSName[idx],\r\n content: FMSName[idx],\r\n className: FMSName[idx] + \"-style\",\r\n options: {\r\n drawPoints: false,\r\n interpolation: false,\r\n },\r\n });\r\n }\r\n return groups;\r\n}", "function writePRGToFile() {\n\tconst fs = require(\"fs\");\n\tfs.open(\"../mario_prg.txt\", \"w+\", (err,fd) => {\n\t\tif(err) throw err;\n\t\tfs.writeSync(fd, data.prg.buffer, 0, data.prg.buffer.length);\n\t\tfs.close(fd);\n\t});\n}", "function exportPuzzle(){\n \n }", "function _GeraFeiticos() {\n for (var i = 0; i < gPersonagem.classes.length; ++i) {\n var classe_personagem = gPersonagem.classes[i];\n var chave_classe = gPersonagem.classes[i].classe;\n // Tabela de geracao da classe.\n if (!(chave_classe in tabelas_geracao)) {\n continue;\n }\n // Tabela de feiticos da classe.\n if (!(chave_classe in tabelas_feiticos)) {\n continue;\n }\n if (!(chave_classe in gPersonagem.feiticos)) {\n continue;\n }\n _GeraFeiticosClasse(\n classe_personagem, gPersonagem.feiticos[chave_classe], tabelas_geracao[chave_classe], tabelas_lista_feiticos[chave_classe]);\n }\n}", "function generateGemini() {\n\tprint(\"\\x1b[90m->\\x1b[0m generating gemini site...\");\n\t// sanity\n\tlet files = {};\n\n\t// generate index\n\tlet _books = [\"📕\", \"📗\", \"📘\", \"📙\", \"📓\"].sort(() => Math.random() - .5); // random book emojis\n\tlet _wikiRecent = pages\n\t\t// remove stubs\n\t\t.filter(page => !page.category.includes(\"stub\"))\n\t\t// first five\n\t\t.slice(0, 5)\n\t\t// render\n\t\t.map((p, i) => {\n\t\t\tlet book = _books[i]; // get random book emoji\n\t\t\tlet category = prependRelevantEmoji(p.category[0]);\n\t\t\treturn `=> /wiki/${p.page}.xyz ${book} wiki/${p.title}`\n\t\t\t\t+ \"\\n```\\n \" + `[${p.modified}] [${category}]` + \"\\n```\";\n\t\t})\n\t\t// stringify\n\t\t.join(\"\\n\");\n\tfiles[\"index\"] = templates[\"index.gmi\"].replace(\"{wiki_recent}\", _wikiRecent);\n\n\t// generate wiki index\n\tlet _wikiAll = pages\n\t\t// remove stubs\n\t\t.filter(page => !page.category.includes(\"stub\"))\n\t\t// render\n\t\t.map(p => {\n\t\t\tlet category = p.category.map(prependRelevantEmoji).join(\", \");\n\t\t\treturn `=> /wiki/${p.page}.xyz ${p.title}` +\n\t\t\t\t\"\\n```\\n \" + `[${p.modified}] [${category}]` + \"\\n```\";\n\t\t})\n\t\t// stringify\n\t\t.join(\"\\n\");\n\tfiles[\"wiki/index\"] = templates[\"wiki-index.gmi\"].replace(\"{wiki_all}\", _wikiAll);\n\n\tfiles[\"stats\"] = templates[\"stats.gmi\"];\n\n\t// generate wiki pages\n\tpages.forEach(p => {\n\t\tfiles[\"wiki/\" + p.page] = templates[\"wiki-page.gmi\"].replace(\"{content}\", p.content);\n\t});\n\n\t// write pages\n\tlet x = 0;\n\tlet _files = Object.keys(files);\n\t_files.forEach((f) => new Promise((resolve, reject) => {\n\t\tlet content = files[f]\n\t\t\t// remove html-only templates\n\t\t\t.replace(/{html[a-z_]*}\\n/g, \"\")\n\t\t\t// add filenames to thumbnails\n\t\t\t.replace(/(\\w*)\\.(png|jpg) (thumbnail|cover|image)/gi, \"$1.$2 $3 ($1.$2)\")\n\t\t\t// replace ambiguous links\n\t\t\t.replace(/\\.xyz/g, \".gmi\");\n\n\t\tlet _f = std.open(\"out/gemini/\" + f + \".gmi\", \"w\");\n\t\tif (_f.error()) return reject(_f.error());\n\t\t_f.puts(content);\n\n\t\t// update terminal readout\n\t\tstd.printf(`\\r\\x1b[32m-->\\x1b[0m wrote gemini page ${x + 1}/${_files.length}`);\n\t\t// if all pages have been written\n\t\tif (++x == _files.length) {\n\t\t\tstd.printf(\"\\n\");\n\t\t\tgenerateHTML(files);\n\t\t}\n\t\tresolve();\n\t}).catch(print));\n}", "function exportGULP() {\n\t\n\tvar stringCellparamgulp;\n\tvar coordinateAddgulp = \"\";\n\tvar cellHeadergulp = \"cell\";\n\tvar flagsymmetryGulp = false;\n\n\twarningMsg(\"Make sure you have selected the model you would like to export.\");\n\tsaveStateAndOrientation_a();\n\tif (_file.cell.typeSystem != \"crystal\")\n\t\tsetUnitCell();\n\t\n\tvar titleGulpinput = prompt(\"Type here the job title:\", \"\");\n\t(titleGulpinput == \"\") ? (titleGulpinput = 'Input prepared with J-ICE ')\n\t\t\t: (titleGulpinput = '#Input prepared with J-ICE \\n'\n\t\t\t\t\t+ titleGulpinput);\n\tvar titleGulp = 'var optiongulp = \\\"opti conp propr #GULP options\\\";'\n\t\t\t+ 'var titleheader = \\\"title \\\"; ' + 'var title = \\\"'\n\t\t\t+ titleGulpinput + '\\\"; ' + 'var titleend = \\\"end \\\";'\n\t\t\t+ 'titlegulp = [optiongulp, titleheader, title, titleend];';\n\trunJmolScriptWait(titleGulp);\n\n\tswitch (_file.cell.typeSystem) {\n\tcase \"crystal\":\n\t\tsetUnitCell();\n\t\tflagsymmetryGulp = confirm(\"Do you want to introduce symmetry ?\");\n\n\t\tif (flagsymmetryGulp) {\n\t\t\twarningMsg(\"This procedure is not fully tested.\");\n\t\t\tfigureOutSpaceGroup(false, false);\n\t\t} else {\n\t\t\tstringCellparamgulp = roundNumber(_file.cell.a) + ' ' + roundNumber(_file.cell.b)\n\t\t\t\t\t+ ' ' + roundNumber(_file.cell.c) + ' ' + roundNumber(_file.cell.alpha) + ' '\n\t\t\t\t\t+ roundNumber(_file.cell.beta) + ' ' + roundNumber(_file.cell.gamma);\n\t\t}\n\t\tbreak;\n\n\tcase \"surface\":\n\t\tcellHeadergulp = \"scell\";\n\t\tcoordinateAddgulp = \"s\";\n\t\tstringCellparamgulp = roundNumber(_file.cell.a) + \", \" + roundNumber(_file.cell.b)\n\t\t\t\t+ \", \" + roundNumber(_file.cell.gamma);\n\t\tbreak;\n\n\tcase \"polymer\":\n\t\tcellHeadergulp = \"pcell\";\n\t\tcoordinateAddgulp = \"\";\n\t\tstringCellparamgulp = roundNumber(_file.cell.a);\n\t\tbreak;\n\n\tcase \"molecule\":\n\t\t// TODO\n\n\t\tbreak;\n\t}\n\n\n\tvar cellGulp = 'var cellheader = \\\"' + cellHeadergulp + '\\\";'\n\t\t+ 'var cellparameter = \\\"' + stringCellparamgulp + '\\\";'\n\t\t+ 'cellgulp = [cellheader, cellparameter];';\n\trunJmolScriptWait(cellGulp);\n\n\tvar coordinateString;\n\tvar coordinateShel;\n\tvar sortofCoordinateGulp;\n\tif (_file.cell.typeSystem == 'crystal') {\n\t\tvar sortofCoordinate = confirm(\"Do you want the coordinates in Cartesian or fractional? \\n OK for Cartesian, Cancel for fractional.\")\n\t\tsortofCoordinateGulp = (sortofCoordinate == true) ? (coordinateAddgulp + \"cartesian\")\n\t\t\t\t: (coordinateAddgulp + \"fractional\");\n\t} else {\n\t\tmessageMsg(\"Coordinate will be exported in Cartesian\");\n\t}\n\tvar flagShelgulp = confirm(\"Is the inter-atomic potential a core/shel one? \\n Cancel stands for NO core/shel potential.\");\n\tif (sortofCoordinateGulp && _file.cell.typeSystem == 'crystal') {\n\t\tcoordinateString = _file.frameSelection + '.label(\"%e core %16.9[fxyz]\")';\n\t\tcoordinateShel = _file.frameSelection + '.label(\"%e shel %16.9[fxyz]\")';\n\t} else {\n\t\tcoordinateString = _file.frameSelection + '.label(\"%e core %16.9[xyz]\")';\n\t\tcoordinateShel = _file.frameSelection + '.label(\"%e shel %16.9[xyz]\")';\n\t}\n\tvar coordinateGulp;\n\tif (flagShelgulp) {\n\t\tcoordinateGulp = 'var coordtype = \\\"' + sortofCoordinateGulp + '\\\";'\n\t\t\t\t+ 'var coordcore = ' + coordinateString + ';'\n\t\t\t\t+ 'var coordshel = ' + coordinateShel + ';'\n\t\t\t\t+ 'coordgulp = [coordtype, coordcore, coordshel];';\n\t} else {\n\t\tcoordinateGulp = 'var coordtype = \\\"' + sortofCoordinateGulp + '\\\";'\n\t\t\t\t+ 'var coordcore = ' + coordinateString + ';'\n\t\t\t\t+ 'coordgulp = [coordtype, coordcore];';\n\t}\n\trunJmolScriptWait(coordinateGulp);\n\n\tif (_file.cell.typeSystem == \"crystal\") {\n\t\t// interNumber from crystalfunction .. BH??? interNumber is only defined locally in figureOutSpaceGroup\n\t\tif (!flagsymmetryGulp)\n\t\t\tinterNumber = \"P 1\"\n\t\tvar spacegroupGulp = 'var spaceheader = \\\"spacegroup\\\";'\n\t\t\t\t+ 'var spacegroup = \\\"' + interNumber + '\\\";'// TBC\n\t\t\t\t+ 'spacegulp = [spaceheader, spacegroup];';\n\t\trunJmolScriptWait(spacegroupGulp);\n\t}\n\n\tvar restGulp;\n\tif (flagShelgulp) {\n\t\trestGulp = 'var species= \\\"species \\\" \\n\\n;'\n\t\t\t\t+ 'var restpot = \\\"#here the user should enter the inter-atomic potential setting\\\";'\n\t\t\t\t+ 'var spring = \\\"spring \\\" \\n\\n;'\n\t\t\t\t+ 'restgulp = [species, restpot, spring];';\n\t} else {\n\t\trestGulp = 'var species= \\\"species \\\" \\n\\n;'\n\t\t\t\t+ 'var restpot = \\\"#here the user should enter the inter-atomic potential setting\\\";'\n\t\t\t\t+ 'restgulp = [species, restpot];';\n\t}\n\trunJmolScriptWait(restGulp);\n\n\tvar finalInputGulp;\n\tif (_file.cell.typeSystem == \"crystal\") {\n\t\tfinalInputGulp = \"var final = [titlegulp,cellgulp,coordgulp,spacegulp,restgulp];\"\n\t\t\t\t+ 'final = final.replace(\"\\n\\n\",\"\\n\");'\n\t\t\t\t+ 'WRITE VAR final \"?.gin\" ';\n\t} else {\n\t\tfinalInputGulp = \"var final = [titlegulp,cellgulp,coordgulp,restgulp];\"\n\t\t\t\t+ 'final = final.replace(\"\\n\\n\",\"\\n\");'\n\t\t\t\t+ 'WRITE VAR final \"?.gin\" ';\n\t}\n\trun(finalInputGulp);\n\trestoreStateAndOrientation_a();\n\n}", "function getGeneralData(){\n\t\t// Idioma\n//\t\tfind(\"//script[@type='text/javascript']\", XPFirst).src.search(/\\/([^\\/]+)?3.js$/);\n\t\tfind(\"//img[contains(@src, 'plus.gif')]\", XPFirst).src.search(/\\/img\\/([^\\/]+)\\//);\n\t\tidioma = RegExp.$1;\n\n\t\t// Ruta al pack grafico\n\t\tfind(\"//link[@rel='stylesheet']\", XPFirst).href.search(/^(.*\\/)(.*)3.css$/);\n\t\tpack_grafico = RegExp.$1;\n\n\t\t// Identificador de aldea actual\n\t\tid_aldea = getIdAldea();\n\n\t\t// Identificador de usuario\n\t\tfind(\"//td[@class='menu']\", XPFirst).innerHTML.search(/spieler.php\\?uid=(\\d+)\"/);\n\t\tuid = RegExp.$1;\n\n\t\t// Nombre del servidor\n\t\tlocation.href.search(/http:\\/\\/(.*)\\//);\n\t\tserver = RegExp.$1;\n\n\t\t// Por cada tipo de recurso: cantidad actual almacenada, capacidad total del almacen / granero y produccion por segundo\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tactual[i] = get('l'+(i+1)).innerHTML.split(\"/\")[0];\n\t\t\ttotal[i] = get('l'+(i+1)).innerHTML.split(\"/\")[1];\n\t\t\tproduccion[i] = get('l'+(i+1)).title/3600;\n\t\t}\n\n\t\t// Plus\n\t\tif (find(\"//img[contains(@src, 'travian1.gif')]\", XPFirst)) plus = true; else plus = false;\n\t}", "function repositoryGen() {\n hexo.extend.filter.register(\"after_generate\", function (picture) {\n log.info(\"---- START GENERATING PICTURE FILES ----\");\n try {\n var arr = [];\n const originPath = pictureDirPath;\n const output = targetPhotoListDir;\n (function test(path) {\n const files = fs.readdirSync(path);\n if (!files.length) return;\n files.forEach(v => {\n const vPath = path + \"/\" + v;\n const stats = fs.statSync(vPath);\n if (stats.isFile()) {\n const imgSize = sizeOf(vPath);\n arr.push(imgSize.width + \".\" +\n imgSize.height + \" \" +\n vPath.replace(originPath + \"/\", \"\"));\n } else {\n test(vPath);\n }\n });\n })(originPath);\n var content = JSON.stringify(arr, null, \"\\t\");\n fs.writeFile(output, content);\n } catch (err) {\n log.info(err);\n }\n var photojslibPath = pathFn.join(__dirname, \"lib/repos.js\");\n var photoJsContent = fs.readFileSync(photojslibPath);\n photoJsContent = photoJsContent.replace(\"${thumbnailUrl}\", pictureUrl);\n photoJsContent = photoJsContent.replace(\"${pictureUrl}\", pictureUrl);\n fs.writeFile(photoPubPath, photoJsContent);\n log.info(\"---- END GENERATING PICTURE FILES ----\");\n });\n}", "function makeConfigFile(auth) {\n\n let sheets = google.sheets('v4');\n \n sheets.spreadsheets.values.get({\n auth: auth,\n spreadsheetId: '1LP0IHXaxNHo5Yns5e9C70UycAAENCJItoZUuhHuVE6g',\n range: 'Sheet1'\n }, (err, response) => {\n if(err) {\n console.log('The API returned an error: ' + err);\n return;\n }\n let rows = response.values;\n if(rows.length == 0) {\n console.log('No data found.');\n } else {\n // Find column of interest (the one for the selected language)\n let targetIndex = rows[0].findIndex(cell => cell === chosenLanguage );\n let pageTitle = rows[1][targetIndex];\n // File with structure of the object to be translated\n let skeleton = JSON.parse(fs.readFileSync('bariatric.de.json'));\n let translated = translate(skeleton, targetIndex, rows);\n fs.writeFileSync(funnelPath, 'export const bariatric: any = ', 'utf8');\n fs.appendFileSync(funnelPath, translated, 'utf8');\n console.log('Translated file saved to ' + funnelPath);\n /* for(let i = 0; i < rows.length; i++) {\n let row = rows[i];\n\n } */\n\n }\n })\n }", "function genConfig(PATH_UIKITS){\n console.log(\"genUikitsConfig\")\n let file_global_components = PATH_UIKITS +'/components.js'\n let file_global_annotations = PATH_UIKITS + '/annotations.js'\n let global_components_import = '//auto create components.js\\n'\n let global_annotations_improt = '//auto create annotations.js\\n'\n let global_text = 'export default {\\n'\n let files = fs.readdirSync(PATH_UIKITS)\n for (let i = 0; i < files.length; i++) {\n let name = files[i]\n let abPath = path.join(PATH_UIKITS, name)\n let stat = fs.lstatSync(abPath)\n if (!stat.isDirectory()) continue\n abPath = path.join(PATH_UIKITS, name, 'packages')\n if (!fs.existsSync(abPath)) continue\n stat = fs.lstatSync(abPath)\n if (stat.isDirectory()) {\n scan_kit(path.join(PATH_UIKITS, name))\n global_components_import += `import _${name.replace(/-/g,'_')} from './${name}/packages/components';\\n`\n global_annotations_improt += `import _${name.replace(/-/g,'_')} from './${name}/packages/annotations';\\n`\n global_text += ` ${name}: _${name.replace(/-/g,'_')},\\n`\n }\n }\n global_text += '}\\n'\n writeJavascript(file_global_components,global_components_import+global_text)\n writeJavascript(file_global_annotations,global_annotations_improt+global_text)\n}", "function G(){}", "function recordStep3( gifoId ){ \n\n if(gifoId){\n // armo la url del gifo nuevo\n let gifoURL = `${GIPHY_DIRECT_URL}${gifoId}/giphy.gif`;\n // se hara el almacenamiento en local storage del nuevo gifo\n let myGif;\n myLocalStorage = window.localStorage;\n creations = JSON.parse(myLocalStorage.getItem(\"myOwnGifos\"));\n if(creations === null){\n creations = [];\n myGif = new Gif( gifoId, gifoURL, \"my-gifo-1\", \"own gifo\");\n }\n else{\n let id = creations.length + 1;\n myGif = new Gif( gifoId, gifoURL, `my-gifo-${id}`, \"own gifo\" ); \n }\n creations.push(myGif)\n myLocalStorage.setItem(\"myOwnGifos\", JSON.stringify(creations));\n\n let finalOptions = document.getElementById(\"final-options\");\n finalOptions.style.display = \"block\"; \n }\n // finalizo la utilizacion de la camara\n stream.getTracks().forEach(track => track.stop());\n}", "function browse() {\r\n\r\n}", "function main(){\n galleries = getGalleries();\n // localStorage.setItem('g', JSON.stringify(galleries) )\n // addNavItems(galleries);\n // handleView(galleries);\n }", "function generals() {\n doubleBarGraph('tablita.csv', 'Deaths in various corridors across the border.');\n}", "function InFile() {\r\n}", "function iterator(){\r\n\r\n if(this.type == \"Weight\"){\r\n\r\n\r\n\r\n //The application will read in this generated .txt file to know which weights the user is expected to meaure\r\n //this file generation utilizes the Iterator Pattern in order to only retrieve the weight element\r\n fs.appendFile(`data/${filename}.txt`, this.name, (err) => { \r\n\r\n if (err) throw err; \r\n\r\n })\r\n\r\n }\r\n\r\n\r\n\r\n \r\n\r\n \r\n }", "function loadData() {\n // STAND\n loadStandData();\n // PIT\n loadPitData();\n // IMAGES\n loadImageData();\n // NOTES\n loadNotesData();\n // PRESCOUTING\n loadPrescouting(\"./resources/prescout.csv\");\n\n}", "function pruebas(){\n let image1 = new Image(\"Imagen1\",\"muy bonita\",\"gsgsdg\",\"sdfs\");\n let image2 = new Image(\"Imagen2\",\"preciosa\",\"gsgsdg\",\"sdfs\");\n let retrato = new Portrait(\"Retrato\",\"muy bonita\",\"gsgsdg\",\"sdfs\");\n let escapetierraXD = new Landscape(\"Escapetierraoloquesea\",\"preciosa\",\"gsgsdg\",\"sdfs\");\n let autor = new Author(\"Paco\",\"correo\",\"avatar\");\n let autor2 = new Author(\"Pepo\",\"correo\",\"avatar\");\n let autor3 = new Author(\"Jimmy\",\"correo\",\"avatar\");\n let categoria = new Category(\"cat\",\"descripcion\");\n let categoria2 = new Category(\"cat2\",\"descripcion2\");\n let categoria3 = new Category(\"cat3\",\"descripcion2\");\n let galeria = Gallery.getInstance();\n let iteradorCat = galeria.iteratorCategories;\n let iteradorImg = galeria.iteratorImages;\n let iteradorAut = galeria.iteratorAuthors;\n //let obj=iteradorCat;\n\n\n console.log(\"Añadir categoria: \",galeria.addCategory(categoria));\n //console.log(\" categoria: \",categoria.title);\n console.log(\"iterator categoria: \", iteradorCat.next().value.category.title);\n // console.log(\"iterator categoria: \",iteradorCat.next().done);\n //console.log(\"Categorias:\",galeria.categories);\n console.log(\"Eliminar categoria: \",galeria.removeCategory(categoria));\n console.log(\"iterator categoria: \", iteradorCat.next());\n //console.log(\"Categorias:\",galeria.categories);\n console.log(\"Añadir una imagen: \",galeria.addImage(image1,categoria,autor));\n console.log(\"iterator imagen: \", iteradorImg.next().value.image.title);\n //console.log(\"Imagenes: \" , galeria.images);\n console.log(\"Eliminar una imagen: \",galeria.removeImage(image1));\n console.log(\"iterator imagen: \", iteradorImg.next());\n //console.log(\"Imagenes: \" ,galeria.images);\n \n console.log(\"Añadir una imagen: \",galeria.addImage(image2,categoria,autor2));\n console.log(\"Imagenes de la misma categoria: \",galeria.getCategoryImages(categoria));\n console.log(\"Añadir un autor: \",galeria.addAuthor(autor3));\n console.log(\"iterator autor: \", iteradorAut.next().value.nickname);\n console.log(\"iterator autor: \", iteradorAut.next().value.nickname);\n console.log(\"iterator autor: \", iteradorAut.next().value.nickname);\n // console.log(\"Autores: \",galeria.authors);\n console.log(\"Eliminar un autor: \",galeria.removeAuthor(autor3));\n console.log(\"iterator autor: \", iteradorAut.next());\n // console.log(\"Autores: \",galeria.authors);\n\n\n console.log(\"Añadir una imagen: \",galeria.addImage(image1,categoria,autor2));\n console.log(\"Añadir una imagen: \",galeria.addImage(image2,categoria,autor2));\n console.log(\"Ver imagenes de un autor: \",galeria.getAuthorImages(autor2));\n\n console.log(\"Añadir un retrato: \",galeria.addImage(retrato,categoria,autor2));\n console.log(\"Añadir un landscape: \",galeria.addImage(escapetierraXD,categoria,autor2));\n console.log(\"Retratos: \",galeria.getPortraits());\n console.log(\"LandScapes: \",galeria.getLandscapes());\n\n //probando excepciones\n \n\n try{\n galeria.addCategory(null);\n } catch(error){\n console.log(error.message);\n\n }\n \n try{\n galeria.addCategory(categoria);\n \n } catch(error){\n console.log(error.message);\n\n }\n\n try{\n galeria.removeCategory(categoria3);\n \n } catch(error){\n console.log(error.message);\n\n }\n \n try{\n galeria.addImage(null);\n \n } catch(error){\n console.log(error.message);\n\n }\n\n try{\n galeria.removeImage();\n \n } catch(error){\n console.log(error.message);\n\n }\n}", "get EAC_RG() {}", "function toRG()\r\n{\r\n\tvar inpuFolder = new Folder(INPUT_FOLDER);\r\n\tfiles = inpuFolder.getFiles(\"*.\" + INPUT_FILE_FORMAT).sort()\r\n\t\t\r\n\tfor(i = 0; i < files.length; i++)\r\n\t{\r\n\t\tvar document = open(files[i]);\r\n\r\n\t\tfor (j = 0; j < document.layers.length; j++)\r\n\t\t\tdocument.layers[j].visible = false;\r\n\t\tfor (j = 0; j < document.layerSets.length; j++)\r\n\t\t\tdocument.layerSets[j].visible = false;\r\n\t\t\r\n\t\tgetNeutralGrayBackgroundLayer();\r\n\r\n\t\tfor (j = document.layerSets.length - 1; j >= 0; j--)\r\n\t\t{\r\n\t\t\tif (document.layerSets[j].name == \"DISP\" || document.layerSets[j].name == \"DISP3\")\r\n\t\t\t{\r\n\t\t\t\tdocument.layerSets[j].visible = true;\r\n\t\t\t\t\r\n\t\t\t\tif (document.layerSets[j].name == \"DISP\")\r\n\t\t\t\t\tvar affixe = \"Lines\";\r\n\t\t\t\telse\r\n\t\t\t\t\tvar affixe = \"Panels\";\r\n\t\t\t\tvar name = files[i].name.split(\".\")[0];\r\n\t\t\t\tvar outputPath = OUTPUT_FOLDER + \"/\" + name + \"_\" + affixe + \".\" + OUTPUT_FILE_FORMAT;\r\n\t\t\t\tfile = new File(outputPath);\r\n \t\t\t\tdocument.saveAs(file, getExportOptions(OUTPUT_FILE_FORMAT)[0], true, Extension.LOWERCASE);\r\n\t\t\t\t\r\n\t\t\t\tdocument.layerSets[j].visible = false;\r\n\t\t\t}\t\r\n\t\t}\r\n\t\tdocument.close(SaveOptions.DONOTSAVECHANGES);\r\n\t}\r\n}", "constructor() {\n this.cW = 0;\n this.cH = 0;\n this.fileHeadline = [];\n this.orders = [];\n this.algorithm = \"SuperFlo\";\n }", "function load() {\r\n\r\n //Display the file currently being loaded\r\n console.log(`loading: ${g.loadingFile}`);\r\n\r\n //Display the percentage of files currently loaded\r\n console.log(`progress: ${g.loadingProgress}`);\r\n\r\n //Add an optional loading bar.\r\n g.loadingBar();\r\n\r\n //This built-in loading bar is fine for prototyping, but I\r\n //encourage to to create your own custom loading bar using Hexi's\r\n //`loadingFile` and `loadingProgress` values. See the `loadingBar`\r\n //and `makeProgressBar` methods in Hexi's `core.js` file for ideas\r\n}", "saveData(gstr){\n\n \n\n }", "getFiles() {\n this.divFiles.innerHTML = \"\";\n this._fileList = this.fs.readdir(this.path).filter(fileName => fileName !== \".\" && fileName !== \"..\" && this.fs.isFile(this.fs.stat(this.path + fileName).mode));\n\n this._fileList.forEach(fileName => {\n var divFile = this.createFileDiv(fileName, false);\n this.divFiles.appendChild(divFile);\n });\n\n if (this._fileList.length === 0) {\n var fileName = this.newFile(\"untitled.dsp\", \"import(\\\"stdfaust.lib\\\");\\nprocess = ba.pulsen(1, 10000) : pm.djembe(60, 0.3, 0.4, 1) <: dm.freeverb_demo;\");\n this.select(fileName);\n } else {\n this.select(this._fileList[0]);\n }\n\n if (this.$mainFile >= this._fileList.length) this.setMain(this._fileList.length - 1);else this.setMain(this.$mainFile);\n }", "function getGlobDataAPI(){\n\n}", "function load() {\n\n //Display the file currently being loaded\n console.log(`loading: ${g.loadingFile}`);\n\n //Display the percentage of files currently loaded\n console.log(`progress: ${g.loadingProgress}`);\n\n //Add an optional loading bar.\n g.loadingBar();\n\n //This built-in loading bar is fine for prototyping, but I\n //encourage to to create your own custom loading bar using Hexi's\n //`loadingFile` and `loadingProgress` values. See the `loadingBar`\n //and `makeProgressBar` methods in Hexi's `core.js` file for ideas\n}", "get format(){return this._format||defP(this,'_format',IOFile.getFormatFromExt(this.path))}", "function GeneratePath()\n{\n\n\n\n}", "function getGabaritoByName(name){\n var find = false;\n var idGabarito = null;\n var files = DriveApp.getFilesByName(name);\n while(files.hasNext() && find == false){\n var planilha = files.next();\n if(planilha.getName().localeCompare(name) == 0){\n find = true;\n idGabarito = planilha.getId();\n break;\n }\n }\n \n var gabarito = null;\n if(idGabarito != null){\n gabarito = SpreadsheetApp.openById(idGabarito);\n }\n return idGabarito != null ? gabarito : null;\n}", "function creaGeneri(){\r\n var i,j;\r\n for (i=0; i<filmografia.length; i++){\r\n var gens = filmografia[i].genere;\r\n for (j=0; j<gens.length; j++){\r\n if (!(gens[j] in generi))\r\n generi[gens[j]]=[];\r\n generi[gens[j]].push(filmografia[i]);\r\n }\r\n }\r\n window.generi=generi;\r\n console.log(generi);\r\n console.log(\"end\");\r\n}", "function files2group(files) {\n var group = []\n var hash = {}\n\n gutil.forEach(files, function(file) {\n var ext = getExt(file)\n if (ext) {\n (hash[ext] || (hash[ext] = [])).push(file)\n }\n })\n\n for (var ext in hash) {\n if (hash.hasOwnProperty(ext)) {\n group.push(hash[ext])\n }\n }\n //console.log('group',group)\n return group\n }", "function ImportData() {\n //in this method we can connect to database or read our necessery info from file\n //Currently we read registered users from file and History matches from file(maybe) and save to lists\n ReadFromFile();\n}", "function init(){\n\n\t\t// Check to see if sourceFolder has any folders in it\n\t\tif(sourceFolder != null){\n\n\t\t\t// Create new array for files to be stored;\n\t\t\tfiles = new Array();\n\n\t\t\t// Only use file types that are illustrator files\n\t\t\tfileType = \"*.ai\";\n\n\t\t\t// Files get saved with all of the files in the sourcefolder\n\t\t\tfiles = sourceFolder.getFiles( fileType );\n\n\t\t\t// Check to see if there are any files in the folder\n\t\t\tif(files.length > 0){\n\n\t\t\t\t// Ask for destination folder.\n\t\t\t\tdestFolder = Folder.selectDialog('Select the folder you want to export files to', '~');\n\t\t\t\taskForDimensions();\n\t\t\t\t// Loop through files\n\t\t\t\tfor(var i = 0; i<files.length; i++){\n\t\t\t\t\t// Saves the open file and properties to sourceDoc\n\t\t\t\t\tsourceDoc = app.open(files[i]);\n\n\t\t\t\t\tdoc = app.activeDocument;\n\n\t\t\t\t\t// Get Bounds to the artboards\n\t\t\t\t\t// Bounds work as such, left[0], top[1], right[2], bottom[3]\n\t\t\t\t\tvar bounds = doc.artboards[0].artboardRect;\n\n\t\t\t\t\tvar left = bounds[0];\n\t\t\t\t\tvar top = bounds[1];\n\n\t\t\t\t\t// Subtract the right bounds from the left bounds to get width\n\t\t\t\t\t width = bounds[2] - left;\n\n\t\t\t\t\t// Subtract the top bounds from the bottom bounds to get height;\n\t\t\t\t\theight = top - bounds[3];\n\n\t\t\t\t\t// Prompts user for width and height values in pxs\n\t\t\t\t\t\n\t\t\t\t\t// Hides all Layers\n\t\t\t\t\thideAllLayers();\n\n\t\t\t\t\t// Exports all layers\n\t\t\t\t\texportLayers();\n\t\t\t\t\t\n\t\t\t\t\t// Use DONOTSAVECHANGES to keep PNG from adding other names to the file name\n\t\t\t\t\tsourceDoc.close(SaveOptions.DONOTSAVECHANGES);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\talert('There are no files here')\n\t\t\t}\n\t\t} else {\n\t\t\talert('There is no folder here')\n\t\t}\n}", "function loadGraphs() {\n\t\tloaddone = 0;\n loadDataFile(\"1\",\"v\");\t\t// voltage\n loadDataFile(\"2\",\"i\");\t\t// impedance\n\t\tloadDataFile(\"3\",\"t\");\t\t// temp\n\t}", "function generaImagen() {\n //Obtenemos la metadata de la imagen original para trabajar sobre sus regiones\n let metadata = ctx.getImageData(0,0, img.naturalWidth, img.naturalHeight);\n let data = metadata.data;\n //Por cada region de la imagen original\n for (let y = 0; y < ntiley; y += 1) {\n for (let x = 0; x < ntilex; x += 1) {\n //Obtenemos el gris promedio de cada region\n let color = colorPromedio(x * regWidth, y * regHeight, regWidth, regHeight,\n img.naturalWidth, img.naturalHeight, data);\n let gris = (color[0] + color[1] + color[2])/3;\n // Seleccionamos el gris que mas se parezca a nuestros tonos\n let bibdata = tipo.getSemitono(gris);\n // Escribimos la info en la imagen final\n finCtx.putImageData(bibdata, x*tipo.swidth, y*tipo.sheight);\n }\n }\n}", "function MASH_FileManager() {\n\n\n}", "writeToFile () {\n let data = this.ghostToJson();\n\n fs.writeFileSync(this.ghostFileOutput, data, 'utf8');\n console.log( logSuccess('Ghost JSON generated successfully!') );\n }", "function getAndProcessData() { \n\t\tchooseFileSource();\n\t}", "function GeneticAlgorithm()\n{\n\tlet decks = [];\n\t\n\tfor(let i = 0; i < _config.features.genetic.population; i++)\n\t{\n\t\tdecks[i] = new Gene(ShuffledDeck());\n\t}\n\t\n\tSortPopulation(decks);\n\t\n\tconsole.log(\"[Initial] \"+ decks[0].placeCount);\n\t\n\tfor(let i = 1; i <= _config.features.genetic.iterations; i++)\n\t{\n\t\tdecks = EvolvePopulation(decks);\n\t\t\n\t\tif(_config.features.genetic.output != \"\")\n\t\t{\n\t\t\tWriteFile(_config.features.genetic.output, JSON.stringify(decks[0]));\n\t\t}\n\t\t\n\t\tif((i % _config.features.genetic.log) == 0)\n\t\t{\n\t\t\tconsole.log(\"[Generation \"+ i +\"] \"+ decks[0].placeCount);\n\t\t}\n\t}\n}", "function gotData(giphy){\n\n//We define X as a random number between 0 and 25.\n//We use floor to make sure it returns an even number,\n//in order for it to work with the JSON file.\n var x = floor (random (0, 25));\n\n//Lastly we make the GIFs appear. Variable x is\n//being used to fetch a random index in the JSON file.\n//The entire strings refors to the place in the JSON where\n//we can find the data we are looking for.\n createImg(giphy.data[x].images.original.url);\n\n}", "function exportGJ(e) {\n settings = {\n id: e.parameter.idBox,\n lon: e.parameter.lonBox,\n lat: e.parameter.latBox\n };\n \n // Update ui to show status\n updateUi();\n \n // Create GeoJSON file and pass back it's filepath\n var file = createGJFile();\n \n // Update ui to deliver file\n displayFile(file);\n}", "function Stickman(){\n //GRADING: COMMAND\n //note the 5 params are file names not paths\n this.head = document.getElementById('stk_head').src;\n this.body = document.getElementById('stk_body').src;\n this.legs = document.getElementById('stk_legs').src;\n this.larm = document.getElementById('stk_larm').src;\n this.rarm = document.getElementById('stk_rarm').src;\n}", "function createGallary(db, showname) {\n var div = $('<div>').addClass(\"freewall\");\n //setColumnWidth(div, 240);\n \n db.forEach(function(item) {\n let gfs = getGallaryFiles(item.name);\n let usedfiles = {};\n if (item.gallary) {\n item.gallary.forEach(function(g) {\n let f = gfs.find(p => p.path.indexOf(g.name) >= 0);\n if (f) {\n usedfiles[f.path] = true;\n } else {\n f = {path:\"\"};\n }\n div.append(createGallaryFigure(item.name, f.path, g, showname));\n });\n }\n\n for (let f of gfs) {\n if (f.path in usedfiles) continue;\n let gallaryName = ext(f.name, \"_\");\n if (gallaryName.match(/^[0-9]+$/)) gallaryName = null;\n div.append(createGallaryFigure(item.name, f.path, {name: gallaryName}, showname));\n }\n });\n\n return div;\n}", "function agregar() {\n let color = menu.color;\n let fig = menu.figuras;\n if(fig == \"ESFERA\"){\n geometria = new THREE.SphereGeometry(1.5,32,32);\n }\n if(fig == \"TOROIDE\"){\n geometria =new THREE.TorusGeometry(1.5,0.5,32,100 );\n }\n if(fig == \"PIRAMIDE\"){\n geometria = new THREE.CylinderBufferGeometry(0,2,3,4);\n }\n if(fig == \"CILINDRO\"){\n geometria = new THREE.CylinderGeometry(1,1,3,8);\n }\n\n nombre =figuras.agregar(fig,geometria,color);\n renderer.render( scene, camera );\n }", "function comportement (){\n\t }", "function gcb_manifest(){\n\tvar fs = require(\"fs\");\n\tvar y = document.getElementById(\"fileImportDialog\");\n\tvar file = y.files[0];\n\tvar new_file_name = file.name.replace(/ELO/, \"\");\n\tvar gcb_path = file.path.replace(file.name, \"\") + \"GCB\" + new_file_name.replace(/ /g, \"_\");\n\tvar count = 0;\n\n\tfs.open(gcb_path + \"/manifest.json\", \"w\", function(err,fd){\n\t\tif(err) throw err;\n\n\t\telse{\n\t\t\tvar buf = new Buffer(\"{\\n \\\"entities\\\": [\");\n\n\t\t\tfs.write(fd, buf, 0, buf.length, 0, function(err, written, buffer){\n\t\t\t\tif(err) throw err;\n \t\t\tconsole.log(err, written, buffer);\n\t\t\t})\n\n\t\t\tfs.readdir(gcb_path + \"/files/assets/css/\", function(err, files){\n\t\t\t\tfor(var i = 0 in files){\n\n\t\t\t\t\tvar n = files[i].lastIndexOf(\".\");\n \t\t\t\t\tif(files[i].substr(n+1, files[i].length) == \"css\"){\n\t\t\t\t\t\tgcb_manifest_content(\"\\\"files/assets/css/\" + files[i] + \"\\\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tfs.readdir(gcb_path + \"/files/assets/html/\", function(err, files){\n\t\t\t\tfor(var i = 0 in files){\n\t\t\t\t\tgcb_manifest_content(\"\\\"files/assets/html/\" + files[i] + \"\\\"\");\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tfs.readdir(gcb_path + \"/files/assets/img/\", function(err, files){\n\t\t\t\tfor(var i = 0 in files){\n\t\t\t\t\tgcb_manifest_content(\"\\\"files/assets/img/\" + files[i] + \"\\\"\");\n\t\t\t\t}\n\n\t\t\t\tfs.appendFile(gcb_path + \"/manifest.json\", \n\t\t\t\t\"\\n\\t{\\n\\t \\\"is_draft\\\": false,\\n\\t \\\"path\\\": \\\"files/course.yaml\\\"\\n\\t},\", function(err){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tif(err) throw err;\n \t\t\t\tconsole.log(\"record course.yaml was complete!\");\n\t\t\t\t})\n\n\t\t\t\tconsole.log(\"image\");\n\t\t\t})\n\n\t\t\tfs.readdir(gcb_path + \"/files/data/\", function(err, files){\n\t\t\t\tfor(var i = 0 in files){\n\t\t\t\t\tgcb_manifest_content(\"\\\"files/data/\" + files[i] + \"\\\"\");\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tfs.readdir(gcb_path + \"/models/\", function(err, files){\n\t\t\t\tfor(var i = 0 in files){\n\t\t\t\t\tcount += 1;\n\t\t\t\t\tconsole.log(count);\n\t\t\t\t\tif( files.length == count){\n\t\t\t\t\t\tfs.appendFile(gcb_path + \"/manifest.json\",\n\t\t\t\t\t\t\"\\n\\t{\\n\\t \\\"is_draft\\\": false,\\n\\t \\\"path\\\": \\\"models/\" + files[i] + \"\\\"\\n\\t}\", function(err){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tif(err) throw err;\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\tgcb_manifest_content(\"\\\"models/\" + files[i] + \"\\\"\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tsetTimeout(function(){\n\t\t\t\tfs.appendFile(gcb_path + \"/manifest.json\",\n\t\t\t\t\"\\n ],\\n \\\"raw\\\": \\\"course:/new_course::ns_new_course\\\",\\n \\\"version\\\": \\\"1.3\\\"\\n}\", function(err){\n\t\t\t\t\n\t\t\t\tif(err) throw err;\n\t\t\t\tconsole.log(\"raw was added\");\n\t\t\t\t})\n\t\t\t}, 20)\n\n\t\t\tfs.close(fd, function(err){\t\t\t\t\t\t\t\t\t\t//close course.yaml file\n\t\t\t\tif(err) throw err;\n\t\t\t\tconsole.log(\"manifest.json closed successfully !\");\n\t\t\t})\n\n\t\t}\n\t})\n\n}", "function onLoad() {\n //Activate accordion\n accordion();\n //Get configuration\n getFiles('motion');\n}", "static listGfx(){\n let assets = new Array();\n assets.push(\"gfx/sign_danger.png\");\n assets.push(\"gfx/turtle.png\");\n assets.push(\"gfx/turtle_in_shell_r0.png\");\n assets.push(\"gfx/squished.png\");\n assets.push(\"gfx/spring_jump_up.png\");\n assets.push(\"gfx/bomb.png\");\n assets.push(\"gfx/block_fall_on_touch_damaged_02.png\");\n assets.push(\"gfx/block_pushable.png\");\n assets.push(\"gfx/cloud.png\");\n assets.push(\"gfx/button_floor.png\");\n assets.push(\"gfx/bg-forest.png\");\n assets.push(\"gfx/vampire_wannabe.png\");\n assets.push(\"gfx/stompy.png\");\n assets.push(\"gfx/platform_left_right.png\");\n assets.push(\"gfx/gorilla_projectile.png\");\n assets.push(\"gfx/tombstone.png\");\n assets.push(\"gfx/flying_fire.png\");\n assets.push(\"gfx/jumpee.png\");\n assets.push(\"gfx/l0_splash.png\");\n assets.push(\"gfx/bomb_started.png\");\n assets.push(\"gfx/lava.png\");\n assets.push(\"gfx/block_fall_on_touch.png\");\n assets.push(\"gfx/canon_horizontal.png\");\n assets.push(\"gfx/sphere_within_sphere.png\");\n assets.push(\"gfx/explosion_big.png\");\n assets.push(\"gfx/bush_branch.png\");\n assets.push(\"gfx/elephanko_mad.png\");\n assets.push(\"gfx/button_floor_pressed.png\");\n assets.push(\"gfx/stars_black_sky.png\");\n assets.push(\"gfx/spring_jump_up_extended.png\");\n assets.push(\"gfx/elephanko.png\");\n assets.push(\"gfx/doggy.png\");\n assets.push(\"gfx/pants_gorilla_l0.png\");\n assets.push(\"gfx/explosion_small.png\");\n assets.push(\"gfx/ground_lr.png\");\n assets.push(\"gfx/fancy_city_dweller.png\");\n assets.push(\"gfx/canon_horizontal_shoot_soon.png\");\n assets.push(\"gfx/hero_r0.png\");\n assets.push(\"gfx/wood_texture.png\");\n assets.push(\"gfx/mr_spore.png\");\n assets.push(\"gfx/bomb_ignited.png\");\n assets.push(\"gfx/block_level_transition.png\");\n assets.push(\"gfx/brick_gray_bg.png\");\n assets.push(\"gfx/turtle_in_shell_l0.png\");\n assets.push(\"gfx/door_next_level_wide.png\");\n assets.push(\"gfx/turtle_in_shell.png\");\n assets.push(\"gfx/unknown.png\");\n assets.push(\"gfx/fancy_city_dweller_hat.png\");\n assets.push(\"gfx/canon_bullet_left.png\");\n assets.push(\"gfx/spikes.png\");\n assets.push(\"gfx/ground_lr2.png\");\n assets.push(\"gfx/spike_ceiling.png\");\n assets.push(\"gfx/block_fall_on_touch_damaged.png\");\n assets.push(\"gfx/fountain.png\");\n assets.push(\"gfx/turtle_r0.png\");\n assets.push(\"gfx/sign_its_safe.png\");\n assets.push(\"gfx/door_next_level.png\");\n assets.push(\"gfx/spike_ceiling_falling.png\");\n assets.push(\"gfx/smoke_dust.png\");\n assets.push(\"gfx/bush_stackable.png\");\n assets.push(\"gfx/magic_potion.png\");\n assets.push(\"gfx/pants_gorilla_r0.png\");\n assets.push(\"gfx/rabbit_house.png\");\n assets.push(\"gfx/augustus_of_prima_rabitta.png\");\n assets.push(\"gfx/hero_l0.png\");\n assets.push(\"gfx/turtle_l0.png\");\n assets.push(\"levels/l_00_rabbit_in_house.json\");\n assets.push(\"levels/l_01.json\");\n assets.push(\"levels/l_02_vampire_weekend.json\");\n assets.push(\"levels/l_exp.json\");\n assets.push(\"levels/l_05.json\");\n assets.push(\"levels/l_02.json\");\n assets.push(\"levels/l_04.json\");\n assets.push(\"levels/l_03.json\");\n assets.push(\"levels/l_99_rabbit_in_safe_house.json\");\n assets.push(\"levels/gorilla.json\");\n assets.push(\"levels/l_bug_stomp.json\");\n return assets;\n }", "constructor(size){\n\n // seteo el tamaño de la grilla\n this.size = size;\n\n //creo la grafica del juego\n this.grafica = new GraficaActiva(size,[2,4,8,16,32,64,128,256,512,1024,2048]);\n\n //crea la clase para guardar movimientos\n this.save = new Save(size,this.grafica);\n this.grilla = this.save.load();\n\n //crea clase puntaje (la setea el usuario)\n this.puntaje = null;\n }", "function getGen(sede){\n\t\tconsole.log(data[sede]);\n\t}", "function generateIdeaData()\n{\n createGraph();\n \n}", "function frog(name, sciName, imgId, pic, sound, info) {\n this.name = name;\n this.sciName = sciName;\n this.imgId= imgId\n this.pic = pic;\n this.info = info;\n this.sound = sound;\n\t}", "function cargaImagenes() {\n for (var i = 0; i < 12; i++) {\n fuentesNotas[i] = p.loadImage(\"fuentes/\" + i + \".png\");\n }\n }", "function receiveGD(value){\n \n // number of suitable gazedatafiles \n var idx = $('#fileSelection').find('option:selected').attr('count');\n\n for(var i = 0; i < idx; i++){\n \n var j = (i < 10 ? '0' : '');\n var s = value + \"_\" + j + parseInt(i+1);\n \n // get respective gazedatafile\n $.ajax({\n type: 'GET',\n url: 'temp/' + s + '_gazedata.json',\n datatype: 'application/json',\n // make async call to save data in the right array slot\n async: false,\n success: function(data){\n \n // save filecontent\n ctnt[i] = data; \n // save copy\n unsorted_ctnt[i] = JSON.parse(JSON.stringify(data));\n \n },\n error: function(jqXHR, textStatus, errorThrown) {\n console.log(\"jq: \" + JSON.stringify(jqXHR));\n console.log(\"textStatus: \" + textStatus);\n console.log(\"errorThrown:\" + errorThrown);\n console.log('failed to load gaze data');\t\t\t\n }\n });\n }\n}", "function pasarFoto() {\n if(posicionActual >= IMAGENES.length - 1) {\n posicionActual = 0; \n } else {\n posicionActual++;\n }\n renderizarImagen();\n }", "function getImplementationGuide() {\n return require(`${BASE_DIR}/ig-new.json`);\n}", "function gifNoMvmPg()\n {\n this.ruleID = 'gifNoMvmPg';\n }", "function showMyGifos() {\r\n console.log (\"##f()## showMyGifos function execution\");\r\n sandwich.checked= false;\r\n if(!queryDarkMode()) {\r\n sandwichIcon.src = \"images/burger.svg\";\r\n if (!bp1.matches) { // If media query matches\r\n document.getElementsByClassName('section-link')[0].getElementsByClassName('section-a')[0].classList.add('underline-deco'); \r\n document.getElementsByClassName('section-link')[0].getElementsByClassName('section-a')[0].style.color = '#572EE5';\r\n document.getElementsByClassName('section-link')[1].getElementsByClassName('section-a')[0].classList.add('underline-deco');\r\n document.getElementsByClassName('section-link')[1].getElementsByClassName('section-a')[0].style.color = '#572EE5';\r\n document.getElementsByClassName('section-link')[2].getElementsByClassName('section-a')[0].classList.remove('underline-deco');\r\n document.getElementsByClassName('section-link')[2].getElementsByClassName('section-a')[0].style.color = '#9CAFC3';\r\n }\r\n } else {\r\n sandwichIcon.src = \"images/burger-modo-noc.svg\";\r\n if (!bp1.matches) { // If media query matches\r\n document.getElementsByClassName('section-link')[0].getElementsByClassName('section-a')[0].classList.add('underline-deco'); \r\n document.getElementsByClassName('section-link')[0].getElementsByClassName('section-a')[0].style.color = '#FFFFFF';\r\n document.getElementsByClassName('section-link')[1].getElementsByClassName('section-a')[0].classList.add('underline-deco');\r\n document.getElementsByClassName('section-link')[1].getElementsByClassName('section-a')[0].style.color = '#FFFFFF';\r\n document.getElementsByClassName('section-link')[2].getElementsByClassName('section-a')[0].classList.remove('underline-deco');\r\n document.getElementsByClassName('section-link')[2].getElementsByClassName('section-a')[0].style.color = '#9CAFC3';\r\n }\r\n }\r\n favoritesFlag=false;\r\n myGifosFlag=true;\r\n myGifosPagination=0;\r\n clearNoGifosAlert();\r\n clearPreviousMyGifos();\r\n hideContentForMyGifos();\r\n let myGifosObject= new Array();\r\n myGifosObject = JSON.parse(localStorage.getItem('mygifos'));\r\n /*try {\r\n if(JSON.parse(localStorage.getItem('mygifos')).length == undefined) {\r\n myGifosObject= new Array (JSON.parse(localStorage.getItem('mygifos')));\r\n } else {\r\n myGifosObject= JSON.parse(localStorage.getItem('mygifos'));\r\n }\r\n } catch (err) {\r\n console.log(\"JSON.parse(localStorage.getItem('mygifos')).length failed\", err);\r\n }\r\n try {\r\n console.log(\"Longitud de mygifos: \"+myGifosObject.length);\r\n } catch (err) {\r\n console.log('myGifosObject.length failed', err);\r\n }*/\r\n if(myGifosObject!=null && myGifosObject.length!=0) {\r\n myGifosObject.forEach(element => {\r\n console.log(\"Id: \"+element.Id); \r\n });\r\n drawGifos(myGifosObject,\"mygifos\");\r\n drawMoreMyGifosButton(myGifosObject,myGifosPagination);\r\n } else {\r\n drawNoGifosAlert();\r\n }\r\n}", "constructor(filePath) {\n \n this.graphList = new Map();\n this.graphObject = JSON.parse(fs.readFileSync(filePath,{encoding : 'utf8'}));\n this.visitedArray = new Array(); \n \n }", "export() {\n // const log = this.entities.map(m => m.export()).join(\"\\n---------------------------\\n\");\n // let date = new Date().toDateString().replace(/\\s/g, \"-\");\n // const filename = `fvtt-log-${date}.txt`;\n // saveDataToFile(log, \"text/plain\", filename);\n }", "function MostrarmisGifs() {\n if (localStorage.getItem(\"gifs\"))\n {\n let imagengif = document.getElementById(\"misgifs\");\n GifosGuardados = JSON.parse(localStorage.getItem(\"gifs\"));\n GifosGuardados.forEach(gifss => {\n if (gifss) {\n let contenedorgif = document.createElement(\"img\");\n contenedorgif.src = gifss;\n imagengif.appendChild(contenedorgif);\n }\n });\n }\n}//Cierro la funcion Mostrarmisgifos", "function checkgenus(){\r\n\r\n}", "function getIO() {\n\tfor (var i = 0; i < g_plcs.length; ++i) {\n\t\tgetInputs(i);\n\t\tgetOutputs(i);\n\t\tgetNames(i);\n\t}\n}", "function Gb(){}", "function gm() {\n var a = getMainNamespace();\n a.re = '';\n a.Qc = A();\n a.kh = A();\n a.Dc = A();\n a.pe = A()\n }", "function populatePanoValues(){\n // console.log('populatePanoValues')\n // console.log('gPanos', gPanos)\n gPanos.forEach(pano => {\n // File\n pano.values.inputFile = file = removeFakePath(pano.elements.inputFile.value)\n // Name\n if (pano.elements.viewNameEnabled.value){\n pano.values.viewName = pano.elements.viewName.value\n } else {\n pano.values.viewName = pano.elements.main.id\n } \n // Camera Position\n if (pano.elements.camPosEnabled.value){\n pano.values.posx = pano.elements.posx.value\n pano.values.posy = pano.elements.posy.value\n pano.values.posz = pano.elements.posz.value\n } else {\n pano.values.posx = Number(pano.elements.main.id)\n pano.values.posy = 0\n pano.values.posz = 0\n } \n })\n }", "static get listaGeneros() {\n return [\"Action\", \"Adult\", \"Adventure\", \"Animation\", \"Biography\", \"Comedy\", \"Crime\",\n \"Documentary\", \"Drama\", \"Family\", \"Fantasy\", \"Film Noir\", \"Game-Show\", \"History\", \"Horror\",\n \"Musical\", \"Mistery\", \"News\", \"Reality-TV\", \"Romance\", \"Sci-Fi\", \"Short\", \"Sport\",\n \"Talk-Show\", \"Thriller\", \"War\", \"Western\"\n ];\n }", "dumpBiomes () {\n\n }", "async genAccomodations(){\n //Not yet implemented\n }", "function ioOTF_exportOTFfont() {\n\t\t// debug('\\n ioOTF_exportOTFfont - START');\n\t\t// debug('\\t combineshapesonexport = ' + _GP.projectsettings.combineshapesonexport);\n\t\t\n\t\tfunction firstExportStep() {\n\t\t\t// debug('\\n firstExportStep - START');\n\n\t\t\t// Add metadata\n\t\t\tvar md = _GP.metadata;\n\t\t\tvar ps = _GP.projectsettings;\n\n\t\t\toptions.unitsPerEm = ps.upm || 1000;\n\t\t\toptions.ascender = ps.ascent || 0.00001;\n\t\t\toptions.descender = (-1 * Math.abs(ps.descent)) || -0.00001;\n\t\t\toptions.familyName = (md.font_family) || ' ';\n\t\t\toptions.styleName = (md.font_style) || ' ';\n\t\t\toptions.designer = (md.designer) || ' ';\n\t\t\toptions.designerURL = (md.designerURL) || ' ';\n\t\t\toptions.manufacturer = (md.manufacturer) || ' ';\n\t\t\toptions.manufacturerURL = (md.manufacturerURL) || ' ';\n\t\t\toptions.license = (md.license) || ' ';\n\t\t\toptions.licenseURL = (md.licenseURL) || ' ';\n\t\t\toptions.version = (md.version) || 'Version 0.001';\n\t\t\toptions.description = (md.description) || ' ';\n\t\t\toptions.copyright = (md.copyright) || ' ';\n\t\t\toptions.trademark = (md.trademark) || ' ';\n\t\t\toptions.glyphs = [];\n\n\t\t\t// debug('\\t NEW options ARG BEFORE GLYPHS');\n\t\t\t// debug(options);\n\t\t\t// debug('\\t options.version ' + options.version);\n\n\t\t\t// Add Notdef\n\t\t\tvar notdef = new Glyph({'name': 'notdef', 'shapes':JSON.parse(_UI.notdefglyphshapes)});\n\t\t\tif(_GP.upm !== 1000){\n\t\t\t\tvar delta = _GP.upm / 1000;\n\t\t\t\tnotdef.updateGlyphSize(delta, delta, true);\n\t\t\t}\n\n\t\t\tvar ndpath = notdef.makeOpenTypeJSpath();\n\n\t\t\toptions.glyphs.push(new opentype.Glyph({\n\t\t\t\tname: '.notdef',\n\t\t\t\tunicode: 0,\n\t\t\t\tindex: getNextGlyphIndex(),\n\t\t\t\tadvanceWidth: round(notdef.getAdvanceWidth()),\n\t\t\t\txMin: round(notdef.maxes.xmin),\n\t\t\t\txMax: round(notdef.maxes.xmax),\n\t\t\t\tyMin: round(notdef.maxes.ymin),\n\t\t\t\tyMax: round(notdef.maxes.ymax),\n\t\t\t\tpath: ndpath\n\t\t\t}));\n\n\t\t\t// debug(' firstExportStep - END\\n');\n\t\t}\n\n\t\tfunction getNextGlyphIndex() { return glyphIndex++; }\n\n\t\tvar privateUseArea = [];\n\n\t\tfunction getNextLigatureCodePoint() {\n\t\t\twhile(ligatureCodePoint < 0xF8FF){\n\t\t\t\tif(privateUseArea.includes(ligatureCodePoint)){\n\t\t\t\t\tligatureCodePoint++;\n\t\t\t\t} else {\n\t\t\t\t\tprivateUseArea.push(ligatureCodePoint);\n\t\t\t\t\treturn ligatureCodePoint;\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Fallback. This really shouldn't happen... but if somebody\n\t\t\t// has used the entire Private Use area, I guess we'll just\n\t\t\t// start throwing Ligatures into the Korean block?\n\n\t\t\tconsole.warn('The entire Unicode Private Use Area (U+E000 to U+F8FF) seems to be taken. Ligatures will now be added to the block starting at U+AC00.');\n\t\t\tligatureCodePoint = 0xAC00;\n\t\t\treturn getNextLigatureCodePoint();\n\t\t}\n\n\t\tfunction populateExportLists() {\n\t\t\t// debug('\\n populateExportLists - START');\n\n\t\t\t// Add Glyphs\n\t\t\tvar ranges = assembleActiveRanges();\n\n\t\t\tfor(var c in _GP.glyphs){ if(_GP.glyphs.hasOwnProperty(c) && isGlyphInActiveRange(c, ranges)){\n\t\t\t\tif(parseInt(c)){\n\t\t\t\t\ttg = new Glyph(clone(_GP.glyphs[c]));\n\t\t\t\t\tdebug(`\\t adding glyph ${c} \"${tg.name}\"`);\n\t\t\t\t\texportGlyphs.push({xg:tg, xc: c});\n\t\t\t\t\tif(parseInt(c) >= 0xE000) privateUseArea.push(parseInt(c));\n\n\t\t\t\t} else {\n\t\t\t\t\tconsole.warn('Skipped exporting Glyph ' + c + ' - non-numeric key value.');\n\t\t\t\t}\n\t\t\t}}\n\t\t\t\n\t\t\texportGlyphs.sort(function(a,b){ return a.xc - b.xc; });\n\t\t\t\n\t\t\t// Add Ligatures\n\t\t\tvar ligWithCodePoint;\n\t\t\tfor(var l in _GP.ligatures){ if(_GP.ligatures.hasOwnProperty(l)){\n\t\t\t\ttg = new Glyph(clone(_GP.ligatures[l]));\n\t\t\t\t// debug(`\\t adding ligature \"${tg.name}\"`);\n\t\t\t\texportLigatures.push({xg:tg, xc: l});\n\n\t\t\t\tligWithCodePoint = doesLigatureHaveCodePoint(l);\n\t\t\t\tif(ligWithCodePoint) exportGlyphs.push({xg:tg, xc:ligWithCodePoint.point});\t\t\t\t\n\t\t\t}}\n\n\t\t\t// debug(' populateExportLists - END\\n');\n\t\t}\n\n\t\tfunction generateOneGlyph() {\n\t\t\t// debug('\\n generateOneGlyph - START');\n\t\t\t// export this glyph\n\t\t\tvar glyph = currentExportItem.xg;\n\t\t\tvar num = currentExportItem.xc;\n\t\t\tvar comb = _GP.projectsettings.combineshapesonexport;\n\t\t\tvar name = getUnicodeShortName(''+decToHex(num));\n\n\t\t\tshowToast('Exporting<br>'+glyph.name, 999999);\n\n\t\t\tif(comb && glyph.shapes.length <= _GP.projectsettings.maxcombineshapesonexport) glyph.combineAllShapes(true);\n\n\t\t\tif(glyph.isautowide) {\n\t\t\t\tglyph.updateGlyphPosition(glyph.getLSB(), 0, true);\n\t\t\t\tglyph.leftsidebearing = 0;\n\t\t\t}\n\n\t\t\tvar tgpath = glyph.makeOpenTypeJSpath(new opentype.Path());\n\n\t\t\tvar index = getNextGlyphIndex();\n\n\t\t\tvar glyphInfo = {\n\t\t\t\tname: name,\n\t\t\t\tunicode: parseInt(num),\n\t\t\t\tindex: index,\n\t\t\t\tadvanceWidth: round(glyph.getAdvanceWidth() || 1),\t// has to be non-zero\n\t\t\t\tpath: tgpath\n\t\t\t};\n\t\t\t\n\t\t\tcodePointGlyphIndexTable[''+decToHex(num)] = index;\n\n\t\t\t// debug(glyphInfo);\n\t\t\t// debug(glyphInfo.path);\n\n\t\t\t// Add this finshed glyph\n\t\t\toptions.glyphs.push(new opentype.Glyph(glyphInfo));\n\n\n\t\t\t// start the next one\n\t\t\tcurrentExportNumber++;\n\n\t\t\tif(currentExportNumber < exportGlyphs.length){\n\t\t\t\tcurrentExportItem = exportGlyphs[currentExportNumber];\n\t\t\t\tsetTimeout(generateOneGlyph, 10);\n\n\t\t\t} else {\n\n\t\t\t\tif(exportLigatures.length){\n\t\t\t\t\t// debug('\\t codePointGlyphIndexTable');\n\t\t\t\t\t// debug(codePointGlyphIndexTable);\n\n\t\t\t\t\tcurrentExportNumber = 0;\n\t\t\t\t\tcurrentExportItem = exportLigatures[0];\n\t\t\t\t\tsetTimeout(generateOneLigature, 10);\n\t\t\t\t} else {\n\t\t\t\t\tshowToast('Finalizing...', 10);\n\t\t\t\t\tsetTimeout(lastExportStep, 10);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// debug(' generateOneGlyph - END\\n');\n\t\t}\n\t\t\n\t\tfunction generateOneLigature(){\n\t\t\t// debug('\\n generateOneLigature - START');\n\t\t\t// export this glyph\n\t\t\tvar liga = currentExportItem.xg;\n\t\t\tvar ligaID = currentExportItem.xc;\n\t\t\tvar comb = _GP.projectsettings.combineshapesonexport;\n\t\t\t\n\t\t\t// debug('\\t doing ' + ligaID + ' ' + liga.name);\n\n\t\t\tshowToast('Exporting<br>'+liga.name, 999999);\n\n\t\t\tif(comb && liga.shapes.length <= _GP.projectsettings.maxcombineshapesonexport) liga.combineAllShapes(true);\n\n\t\t\tif(liga.isautowide) {\n\t\t\t\tliga.updateGlyphPosition(liga.getLSB(), 0, true);\n\t\t\t\tliga.leftsidebearing = 0;\n\t\t\t}\n\n\t\t\tvar tgpath = liga.makeOpenTypeJSpath(new opentype.Path());\n\t\t\t\n\t\t\tvar ligaCodePoint = getNextLigatureCodePoint();\n\t\t\tvar index = getNextGlyphIndex();\n\n\t\t\tvar glyphInfo = {\n\t\t\t\tname: liga.name,\n\t\t\t\tunicode: ligaCodePoint,\n\t\t\t\tindex: index,\n\t\t\t\tadvanceWidth: round(liga.getAdvanceWidth() || 1),\t// has to be non-zero\n\t\t\t\tpath: tgpath\n\t\t\t};\n\t\t\t\n\t\t\t// Add ligature glyph to the font\n\t\t\toptions.glyphs.push(new opentype.Glyph(glyphInfo));\n\n\t\t\t// Add substitution info to font\n\t\t\tvar subList = hexToChars(ligaID).split('');\n\t\t\tvar indexList = subList.map(function(v){ return codePointGlyphIndexTable[charToHex(v)]; });\n\t\t\t// debug('\\t INDEX sub: [' + indexList + '] by: ' + index + ' which is ' + ligaCodePoint);\n\t\t\tligatureSubstitutions.push({sub: indexList, by: index});\n\n\t\t\t// debug(glyphInfo);\n\n\t\t\t// start the next one\n\t\t\tcurrentExportNumber++;\n\n\t\t\tif(currentExportNumber < exportLigatures.length){\n\t\t\t\tcurrentExportItem = exportLigatures[currentExportNumber];\n\t\t\t\tsetTimeout(generateOneLigature, 10);\n\t\t\t} else {\n\t\t\t\tshowToast('Finalizing...', 10);\n\t\t\t\tsetTimeout(lastExportStep, 10);\n\t\t\t}\n\t\t}\n\t\t\n\t\tfunction lastExportStep() {\t\n\t\t\t// Export\n\t\t\t_UI.stoppagenavigation = false;\n\t\t\t\n\t\t\toptions.glyphs.sort(function(a,b){ return a.unicode - b.unicode; });\n\t\t\tvar font = new opentype.Font(options);\n\n\t\t\tfor(var s=0; s<ligatureSubstitutions.length; s++) {\n\t\t\t\tfont.substitution.addLigature('liga', ligatureSubstitutions[s]);\n\t\t\t}\n\n\t\t\t// debug('\\t Font object:');\n\t\t\t// debug(font.glyphs);\n\t\t\t// debug(font.toTables());\n\n\t\t\tfont.download();\n\t\t\tsetTimeout(function(){_UI.stoppagenavigation = true;}, 2000);\n\t\t\t// debug(' lastExportStep - END\\n');\n\t\t}\n\n\n\n\t\t/*\n\t\t\tMAIN EXPORT LOOP\n\t\t*/\n\t\tvar options = {};\n\t\tvar codePointGlyphIndexTable = {};\n\t\tvar glyphIndex = 0;\n\t\tvar ligatureCodePoint = 0xE000;\n\t\tvar ligatureSubstitutions = [];\n\t\tvar exportGlyphs = [];\n\t\tvar exportLigatures = [];\n\t\tvar currentExportNumber = 0;\n\t\tvar currentExportItem ={};\n\n\t\tfirstExportStep();\n\t\tpopulateExportLists();\n\t\tcurrentExportItem = exportGlyphs[0];\n\t\tgenerateOneGlyph();\n\n\n\t\t// debug(' ioOTF_exportOTFfont - END\\n');\n\t}", "location() {\n return `File: ${this._fileName}, Line: ${this._lineNum}`;\n }", "getFeatures() {\n let filesGlob = 'e2e/features/**/*.feature';\n let files = glob.sync(filesGlob);\n return _.sortedUniq(files);\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 }", "precargar(){\r\n this.gif = this.app.createImg('./Recursos/Balon.gif');\r\n this.gif.size(95, 95);\r\n }", "function i(e){return g[e]}" ]
[ "0.6001151", "0.59604645", "0.5841547", "0.5629736", "0.5512383", "0.55115086", "0.545925", "0.545925", "0.54518276", "0.54190916", "0.54000306", "0.53849006", "0.5359195", "0.53281635", "0.53125703", "0.5287873", "0.5277028", "0.52446914", "0.5232487", "0.523168", "0.5220214", "0.5205883", "0.5201081", "0.5197763", "0.5182264", "0.5178729", "0.5168639", "0.5167263", "0.51644254", "0.51615244", "0.51536405", "0.5153304", "0.5152702", "0.51517594", "0.51490194", "0.5139092", "0.5136018", "0.51323533", "0.51280177", "0.5093216", "0.5089099", "0.50549656", "0.5049439", "0.50471896", "0.5045771", "0.50449914", "0.50395036", "0.50339067", "0.5024076", "0.5023292", "0.50220406", "0.5016142", "0.500726", "0.5001251", "0.49947733", "0.4985075", "0.4982071", "0.49764475", "0.49690092", "0.4961751", "0.49613205", "0.49506244", "0.49495074", "0.49432713", "0.49414036", "0.49372852", "0.4935572", "0.4934947", "0.49337596", "0.49257386", "0.491366", "0.49055067", "0.4899979", "0.48944908", "0.48877165", "0.48818615", "0.48757002", "0.4872518", "0.48649213", "0.4863745", "0.4861529", "0.48614153", "0.48612764", "0.48580486", "0.4854884", "0.48493585", "0.48464507", "0.4841407", "0.4839726", "0.48339528", "0.48314288", "0.48244858", "0.48192516", "0.4817861", "0.4817814", "0.48165905", "0.48163778", "0.48151994", "0.48137483", "0.4806181", "0.48021042" ]
0.0
-1